Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arguments passed to a function in IDA Pro

Tags:

arguments

ida

When I analyzed a binary with IDA, I saw the following function:

Function::Function(void *, unsigned int, void *, unsigned int)

So, as you can see, IDA displays that we have 4 arguments. But below that, in the summary view, IDA shows that we have 5 arguments. In the following you can see the summary view of IDA where usually the arguments and local variables are shown (in that case we have no local var.):

arg_0 = dword ptr 8
arg_4 = dword ptr 0Ch
arg_8 = dword ptr 10h
arg_C = dword ptr 14h
arg_10 = dword ptr 18h

So, I am asking: Why is that happen? Is that a mistake of IDA? Or, is arg_10 a global variable rather than a argument passed to that function?

My assumption is that IDA can not resolve the type of the 5th argument, so it leaves it out in the function declaration.

like image 379
user3097712 Avatar asked May 07 '26 17:05

user3097712


1 Answers

When calling methods of an object, a pointer to the object is implicitly passed as a parameter to the function. (This is what the this keyword represents)

It is very likely that arg_0 is the this pointer.

like image 129
user1354557 Avatar answered May 11 '26 14:05

user1354557