argv



This should be easy, but it is not. I am writing an assembly language program
involving GTK+. I want to parse the command line for options but am unable to
do so. The code to find argv and argc is simple:

main:
   push ebp
   mov ebp, esp
   lea eax, [ebp + 12]
   lea ecx, [ebp + 8]

The problem is that [ebp + 12] and [ebp + 8] point to nonsense. I ran a
debugger and looked at the stack, and there is nothing else on the stack
except for ebp, rtn addr, and these two parameters. I even tried
daisy-chaining the addresses to see where they would lead, and they are not
even close to pointing to the actual command line. I can easily find the
command line using a memory search, so I know what address it should be. What
am I doing wrong here? I have:

Gtk3+
Win32
v3.18.3.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]