Results 1 to 8 of 8

Thread: arguments

Hybrid View

  1. #1
    Anonymous
    Guest

    arguments

    hello,

    when setting the program argunts, i set something like "test123" when i run the program, and use GetCommandLine to check its arguments, it does return "c:\myprogram.exe test123" while it should return just test123, am i wrong ?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    Anonymous
    Guest

    arguments

    GetCommandLine returns executable with path and parameters. you should extract the parameters yourself. or use CommandLineToArgvW (UNICODE only)
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  3. #3
    Anonymous
    Guest

    arguments

    the first command line arg is always the executable filename, the programs args start from the second.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  4. #4
    Anonymous
    Guest

    arguments

    Hello, as far as i've seen its not like that or im doing something wrong, i've written a program to illustrate what i said:

    -- launch.asm --
    cmdline db "this is the command line",0
    arquivo db "host.exe",0

    invoke CreateProcess,addr exefile,addr cmdline,NULL,NULL,NULL,NULL,NULL, NULL,ADDR st_info,ADDR pr_info
    -- launch.asm --

    -- host.asm --

    invoke GetCommandLineA
    invoke MessageBox,0,eax,eax,0

    -- host.asm --

    after running launch.exe, host.exe will give the command line which is "this is the command line" and NOT "host.exe this is the command line"

    can u clarify this to me ? am i doing something wrong ?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  5. #5
    Anonymous
    Guest

    arguments

    arquivo = exefile in the thread above
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  6. #6
    Anonymous
    Guest

    arguments

    If your using CreateProcess, you'll get exactly what you are passing to that as your command line. So by passing "this is the command line" in your CreateProcess call, you'll get "this is the command line" from GetCommandLineA.

    However, when the OS loads your process, you'll get "host.exe this is the command line" as it prepends the exe name first before calling CreateProcess.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  7. #7
    Anonymous
    Guest

    arguments

    ah ok, thanks a lot,
    is there any way to get "this is the command line" in ollydbg ? maybe olly can create the process with the CreateProcess api ?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  8. #8
    Anonymous
    Guest

    arguments

    Ollydbg does create the process with the CreateProcess API, but always prepends the executable filename onto it, just like Windows does. It would therefore be easier if you did the same.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

Similar Threads

  1. Opaque arguments
    By jackall in forum The Newbie Forum
    Replies: 30
    Last Post: July 8th, 2008, 14:39
  2. Dumping function arguments
    By xml in forum OllyDbg Support Forums
    Replies: 6
    Last Post: December 22nd, 2005, 08:57
  3. Log function arguments on __vbaStrCmp
    By Teerayoot in forum OllyDbg Support Forums
    Replies: 9
    Last Post: July 23rd, 2003, 14:04
  4. [Tip] Log all API calls and arguments
    By Wayne in forum OllyDbg Support Forums
    Replies: 1
    Last Post: November 15th, 2002, 04:20
  5. ida function arguments
    By noone in forum Tools of Our Trade (TOT) Messageboard
    Replies: 0
    Last Post: May 5th, 2001, 18:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •