|
Welcome to the GSM-Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Only registered members may post questions, contact other members or search our database of over 8 million posts. Registration is fast, simple and absolutely free so please - Click to REGISTER! If you have any problems with the registration process or your account login, please contact contact us . |
|
Register | FAQ | Donate | Forum Rules | Root any Device | ★iPhone Unlock★ | ★ Direct Codes ★ | Direct Unlock Source |
GSM Programming & Reverse Engineering Here you can post all Kind of GSM Programming and Reverse Engineering tools and Secrets. |
| LinkBack | Thread Tools | Display Modes |
01-08-2014, 04:48 | #1 (permalink) |
Insane Poster Join Date: Jul 2012
Posts: 95
Member: 1786269 Status: Offline Thanks Meter: 6 | request guidance for use adb command in my progrom i need help for execute and get output adb command in delphi or c++ For example : i want run one command from fastboot command's in my progrom and get The result in my program . i will be grateful if someone help me ... |
The Following User Says Thank You to hoseyni- For This Useful Post: |
01-08-2014, 22:54 | #3 (permalink) |
Insane Poster Join Date: May 2008 Location: Poland ;) Age: 38
Posts: 69
Member: 776944 Status: Offline Thanks Meter: 26 | Easyiest answer for your question is using pipes. Look on : Capture Console Output Realtime To Memo - Delphi Programming |
The Following User Says Thank You to McManiek For This Useful Post: |
01-08-2014, 23:31 | #4 (permalink) |
No Life Poster Join Date: Aug 2004 Location: With old & new friends Age: 49
Posts: 692
Member: 79640 Status: Offline Sonork: 1577251 Thanks Meter: 238 | Learn how to use adbwinapi.dll with your project. There are alot of good code samples on the net just google it ! Last edited by dzunlocker; 01-08-2014 at 23:40. |
01-10-2014, 04:11 | #5 (permalink) | |
Insane Poster Join Date: Jul 2012
Posts: 95
Member: 1786269 Status: Offline Thanks Meter: 6 | Quote:
| |
01-10-2014, 15:24 | #7 (permalink) |
No Life Poster Join Date: Apr 2004
Posts: 753
Member: 61389 Status: Offline Thanks Meter: 193 | really, mate? After search, first page: c# [HOW TO] Make your own Android Toolkit for Windows in C# - Make it to your liking! - xda-developers java: android - Adding ADB to my Java PC application - Stack Overflow c++ https://android.googlesource.com/pla...indows/usb/api |
The Following User Says Thank You to jodge For This Useful Post: |
01-11-2014, 18:45 | #8 (permalink) |
Banned Join Date: Nov 2009 Location: Lima, Perú
Posts: 1,477
Member: 1159099 Status: Offline Thanks Meter: 6,371 | @hoseyni- here a small example how run cmd with ADB,this code is partly a small project. Code: function IsWinNT: boolean; var OSV: OSVERSIONINFO; begin OSV.dwOSVersionInfoSize := sizeof(osv); GetVersionEx(OSV); result := OSV.dwPlatformId = VER_PLATFORM_WIN32_NT; end; function cmdxcx(Cmd: string): string; var Buffer: array[0..4096] of Char; si: STARTUPINFO; sa: SECURITY_ATTRIBUTES; sd: SECURITY_DESCRIPTOR; pi: PROCESS_INFORMATION; newstdin, newstdout, read_stdout, write_stdin: THandle; exitcod, bread, avail: Cardinal; Str: string; begin Result:= ''; if IsWinNT then begin InitializeSecurityDescriptor(@sd, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(@sd, true, nil, false); sa.lpSecurityDescriptor := @sd; end else sa.lpSecurityDescriptor := nil; sa.nLength := sizeof(SECURITY_ATTRIBUTES); sa.bInheritHandle := TRUE; if CreatePipe(newstdin, write_stdin, @sa, 0) then begin if CreatePipe(read_stdout, newstdout, @sa, 0) then begin GetStartupInfo(si); with si do begin dwFlags := STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW; wShowWindow := SW_HIDE; hStdOutput := newstdout; hStdError := newstdout; hStdInput := newstdin; end; Fillchar(Buffer, SizeOf(Buffer), 0); GetEnvironmentVariable('COMSPEC', @Buffer, SizeOf(Buffer) - 1); StrCat(@Buffer,PChar(' /c ' + Cmd)); if CreateProcess(nil, @Buffer, nil, nil, TRUE, CREATE_NEW_CONSOLE, nil, nil, si, pi) then begin Str:= #13; WriteFile(write_stdin,PChar(Str)^,Length(Str),bread,nil); repeat PeekNamedPipe(read_stdout, @Buffer, SizeOf(Buffer) - 1, @bread, @avail, nil); if bread > 0 then begin Fillchar(Buffer, SizeOf(Buffer), 0); ReadFile(read_stdout, Buffer, bread, bread, nil); Result:= Result + String(PChar(@Buffer)); end; GetExitCodeProcess(pi.hProcess, exitcod); until (exitcod <> STILL_ACTIVE) and (bread = 0); end; CloseHandle(read_stdout); CloseHandle(newstdout); end; CloseHandle(newstdin); CloseHandle(write_stdin); end; end; pic test https://imagizer.imageshack.us/v2/97...0/713/h4tr.jpg Thxz!/regards Pablo |
The Following User Says Thank You to xcachorrox For This Useful Post: |
01-15-2014, 12:32 | #9 (permalink) | |
Insane Poster Join Date: Jul 2012
Posts: 95
Member: 1786269 Status: Offline Thanks Meter: 6 | Quote:
thnx dear - XcachorroX ** can you upload your example source project ?? | |
02-13-2017, 01:22 | #11 (permalink) |
Insane Poster Join Date: Jan 2017
Posts: 95
Member: 2674769 Status: Offline Thanks Meter: 17 | it works for me good but thare is a proplem it gives achineise characters insteed of english way i send this Memo1.Lines.Add(Cmdxcx('adb devices')); i got 楌瑳漠敤楶散瑡慴档摥ഠ搊㘷搵攳ऴ敤楶散 |
02-14-2017, 13:55 | #13 (permalink) | |
No Life Poster Join Date: May 2012 Location: BHARAT
Posts: 1,571
Member: 1766148 Status: Offline Sonork: 100.1614494 Thanks Meter: 490 | Quote:
Check your PC's Regional settings and adb.exe file. | |
Bookmarks |
| |
|