Jump to content
kvk1989

write console code

Recommended Posts

hi can someone help me to write this  code thanks !

Usage : odin4 [args...]
Odin4 downloader. odin4 version 1.2.13
 -v        SHOW VERSION
 -w        Show License
 -b        Add Bootloader file
 -a        Add AP image file
 -c        Add CP image file
 -s        Add CSC file
 -u        Add UMS file
 -e        Set Nand erase option
 -V        Home binary validation check with pit file
 --reboot  Reboot into normal mode
 --noreboot  Don't reboot after flashing binaries
 --redownload  Reboot into download mode if it possible (not working in normal case)
 --ignore-md5  Ignore MD5SUM. odin don't verify the integrity of files
 --md5sum-only Verify the integrity of files(xxx.tar.MD5). odin don't flash binary
 -d        Set a device path (detect automatically without this option)
 -l        Show downloadable devices path
 --list    Show downloadable devices path and usb location (linux/win)
 --verbose     Verbose. (Single download only)

IMPORTANT : You must set up your system to detect your device on LINUX host.
 create this file: /etc/udev/rules.d/51-android.rules
 to add a line to the file:
 SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
   (http://developer.android.com/tools/device.html)
 And you maybe need to unload a module cdc_acm before downloading. (This is only needed for older kernels.)
   $sudo rmmod cdc_acm
 OR
   echo "blacklist cdc_acm" > /etc/modprobe.d/cdc_acm-blacklist.conf

Example :
$odin4 -b BL_XXXX.tar.md5 -a AP_XXXX.tar.md5 -c CP_XXXX.tar.md5 -s CSC_XXXX.tar.md5
Example (Select One Device):
$odin4 -l
PATH_OF_DEVICE_A
PATH_OF_DEVICE_B
$odin4 -b BL_XXXX.tar.md5 -a AP_XXXX.tar.md5 -c CP_XXXX.tar.md5 -s CSC_XXXX.tar.md5 -d PATH_OF_DEVICE_A

Odin Community : http://mobilerndhub.sec.samsung.net/hub/site/odin/

i write like this but not working 

var
  Strm: TMemoAppendStream;

  

  begin
   Strm := TMemoAppendStream.Create(Memo1);
  try
    GetDosOutput(Strm, 'd.exe -b '+e1.Text+'d.exe -a '+e2.Text+'d.exe -c'+e3.Text+'d.exe -s'+e4.Text+'-d PATH_OF_DEVICE_A', ExtractFilePath(application.ExeName)
      + 'bin\');
  finally
    Strm.Free;
  end;
end;

end;

Edited by kvk1989

Share this post


Link to post
2 hours ago, kvk1989 said:

i write like this but not working

This is a very poor diagnostic which can't be used to help you.

Share this post


Link to post

First of all, do a WriteLn('d.exe -b '+e1.Text+'d.exe -a '+e2.Text+'d.exe -c'+e3.Text+'d.exe -s'+e4.Text+'-d PATH_OF_DEVICE_A') and ensure that the command executes successfully.

Next, make sure ExtractFilePath(application.ExeName) + 'bin\' folder exists (I suppose this is the "working directory".

Finally, make sure that all the external files you reference in the command line are using ABSOLUTE paths, otherwise they must be present in the working directory.

 

As @FPiette mentioned, neither GetDosOutput or TMemoAppendStream exists in Delphi by default. While we can guess what they do, we cannot guess their implementation. It's possible that your call is correct, only these implementations are buggy.

Share this post


Link to post
3 hours ago, aehimself said:

First of all, do a WriteLn('d.exe -b '+e1.Text+'d.exe -a '+e2.Text+'d.exe -c'+e3.Text+'d.exe -s'+e4.Text+'-d PATH_OF_DEVICE_A') and ensure that the command executes successfully.

Next, make sure ExtractFilePath(application.ExeName) + 'bin\' folder exists (I suppose this is the "working directory".

Finally, make sure that all the external files you reference in the command line are using ABSOLUTE paths, otherwise they must be present in the working directory.

 

As @FPiette mentioned, neither GetDosOutput or TMemoAppendStream exists in Delphi by default. While we can guess what they do, we cannot guess their implementation. It's possible that your call is correct, only these implementations are buggy.

When I execute codes it's showing " d.exe failed parse" 

See this video how cmd console works

 

Edited by kvk1989

Share this post


Link to post

Do as @aehimself said: capture the command line you generate with your program and execute it manually by copy/paste in the cmd window.

Then check that what seems to be the output of GetDosOutput is writeable. To check, write code in your program.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×