Log in

View Full Version : ASM dword ptr


galda
January 18th, 2010, 22:23
Hi,

I'm not sure about it...if I have for example:
Code:

var_1 = dword prt 20h
arg_33 = dword 30h

push [ecx+var_1]
cmp edx,[eax+arg_33]


So what is the different of creating var or arg ?
and in the push command we push the ecx address and the var_1 address together to the stack? or what?

tnx!

EB00
January 18th, 2010, 23:23
Hi galda,

I'm not sure where you got the terms "arg" and "var" here, but if they're coming from an assembler deadlisting as IDA produces then "arg" is an argument for a call and "var" is a variable inside the call. The difference is the variable is only local to the call the argument comes from outside and is basically the same thing like a parameter for a function in any programming language.

For the push: Usually this is used if var_1 points to an array.

push [ecx+var_1] would then push the ecxth value on the stack, but this really depends on what the code you are looking at is all about

galda
January 19th, 2010, 07:35
Thanks,
did you mean the the push [ecx+var_1] would then push the ecx20th
or did I get you wrong?

EB00
January 19th, 2010, 10:03
Yep, but basically it just means that the 32bit value at memory location

ecx+20h

is pushed on the stack. This can be any type of data, a pointer, an integer...

galda
January 19th, 2010, 14:11
Quote:
[Originally Posted by EB00;84808]Yep, but basically it just means that the 32bit value at memory location

ecx+20h

is pushed on the stack. This can be any type of data, a pointer, an integer...


I would be the value of ecx+20h or the address of ecx+20h?

Thanks

EB00
January 19th, 2010, 16:54
push [ecx+20h]

pushes the value that's saved at adress ecx+20h on the stack.