Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confusing function

So, while using IDA to disassemble a dll, I came across this class function:

mov eax, [ecx+4]
mov eax, [eax]
retn

I know ecx means this and eax is the return value, but I fail to understand what it returns. Any help?

like image 952
小太郎 Avatar asked Sep 23 '26 05:09

小太郎


1 Answers

That function loads a pointer (into eax) at offset 4 from whatever ecx points to. Then it follows that pointer to load a 32-bit value into eax, which is returned from the function.

That's what the function does, but it's impossible to say what that means without a lot more context.

like image 136
Greg Hewgill Avatar answered Sep 25 '26 19:09

Greg Hewgill