command line arguments - Assembly (MASM) running program with byte value parameters? -


I am writing an assembly program that requires an array of strings and bytes as arguments while running . (Byte characters are not set for values ​​and all unsigned values ​​are between 0 and 255)

Example execution command:

  Program.exe "A 32-byte array ( Fixed size) "" A byte array of arbitrary length, (more than 0) " 

How do I get logic in the assembly? Even slightly irrelevant to the question, the array of bytes can be any length, will there be any problem if the length of the array is more than the fixed size? Logic will be loaded in memory while running and the program will be replaced after implementation, then it will return the array to its new state. (I am using the assembly to speed up the processing time)

Arguments of argv Like in order to get it in the list, you need Shell 32.Lib which does not send with Irwin's book (as far as I can see in free samples). You can get a suitable shell 32 here. Lib: When you have installed Masm32 you can play with my example:

  include Irvine32.inc IncludeLib C: \ masm32 \ lib \ Shell32.lib GetCommandLineW Primetime STDCALL CommandLineToArgvW Audio STDCALL ,: DWORD ,: DWORD WideCharToMultiByte PROTO STDCALL: DWORD ,: DWORD ,: DWORD ,: DWORD ,: DWORD ,: DWORD .DATA szArglist DD? NRG DD? RGD DB 8192 Dup (?); Http://blogs.msdn.com/b/oldnewthing/archive/2003/12/10/56028.aspx .CODE Main PROC invoke GetCommandLineW invoke CommandLineToArgvW, eax, nArgs OFFSET test eax, eax JZ @@ exit MOV [szArglist ], Ex; Store the result of CommandLineToArgvW for LocalFree mov esi; [EX]; ESI: * szArglist @@: call WasteCharToMultiByte, 0,0, ESI, -1, OFFSET arg, sizeof arg, 0,0 mov EDX, OFFSET arg call callString; To call the console (Irvine), type the string CRLF; New line on console (Irvine) ShellX, 1; Unicode AD, the result of EX, the result of multi-multiplying multi-charitamultibite; * SzArglist + = eax sub dword ptr [nrgs], 1; Next argument in the list? Jnz @B; Yes - & gt; Once again local free, Dvord PTR [SAGRUST]; CommandLineToArgvW @@ exits: exit; Irwin's main ENDP end of exit:  

I suggest separating the elements of the array from the spaces:

program.exe "A 32 byte array (fixed size) "1 2 3 4 5


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -