So, when using the IDA to parse the dll, I came across this class function:
mov eax, [ecx+4] mov eax, [eax] retn
I know what it ecxmeans this, and eax- the return value, but I do not understand what it returns. Any help?
ecx
this
eax
class C { int a; int *b; // ecx+4 int get_b() { return *b; } }
Of course, the actual type aand *bunknown, but both of them are 32-bit types. aIt can also be a pointer to VMT if the class has any virtual methods or destructors.
a
*b
( eax) 4 ecx. , 32- eax, .
, , , , .
, - EAX... , ECX... (4 ) . () EAX , EAX.
( , "" MOV (load), , .
, . ECX , , ++ "this", . , , . , , , ( ). , .
(, x86 - , DOS .. ... errno stdlib C EAX).
. ecx "this", , . instr, dword, ; ? . eax, , - . eax, func.
ecx -------> dword dataA offset 0 dword dataB offset 4 mov eax, [ecx + 4] eax = dataB ----> dword dataC offset 0 mov eax, [eax] eax = dataC
dataC , , .
, . , , MSVC 32- eax. @Gregs , , , , .
If you want to understand disassembly, try looking at the results yourself (C / C ++). This is really the only way to get an idea of what is going on in others' dlls.
Source: https://habr.com/ru/post/1752233/More articles:Best Visual Studio solution / project structure for a client / server project with a common model - visual-studioMinimize glDrawArray calls in OpenGls - iphoneC # linq order depending on language - c #Use Scala as if it were Java - eclipseCustomers complaining about the slow speed of my osCommerce site - performanceWhat is the best module in perl that can implement Paros proxy functions - securityКак перевести RPC_STATUS в HRESULT? - windowsIs it possible with GIT to delete a file only from the index? - gitрегулярное выражение, которое извлекает слова из строки - javaFiles in gitignore - gitAll Articles