Assembly Language for Beginners
3.17. OBFUSCATION Always executed/never executed code If the developer is sure that ESI at always 0 at that point: mov esi, 1 .. ...
3.18 C++ IDAwill show references only todummy_data1anddummy_data2, but not to the text strings. Global variables and even functi ...
3.18. C++ int main() { class c c1; class c c2(5,6); c1.dump(); c2.dump(); return 0; }; MSVC: x86 Here is how themain()function l ...
3.18. C++ ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov DWORD ...
3.18. C++ Listing 3.84: MSVC ??0c@@QAE@XZ PROC ; c::c, COMDAT ; _this$ = ecx mov eax, ecx mov DWORD PTR [eax], 667 mov DWORD PTR ...
3.18. C++ mov DWORD PTR [rcx+4], r8d ; 2nd argument: b mov rax, rcx ret 0 ??0c@@QEAA@HH@Z ENDP ; c::c ; default ctor ??0c@@QEAA@ ...
3.18. C++ arg_0 = dword ptr 8 push ebp mov ebp, esp mov eax, [ebp+arg_0] mov dword ptr [eax], 667 mov eax, [ebp+arg_0] mov dword ...
3.18. C++ This function in itsinternal representationhas only one argument, used as pointer to the object (this). This function ...
3.18. C++ class box : public object { private: int width, height, depth; public: box(int color, int width, int height, int depth ...
3.18. C++ Listing 3.89: Optimizing MSVC 2008 /Ob0 ?dump@box@@QAEXXZ PROC ; box::dump, COMDAT ; _this$ = ecx mov eax, DWORD PTR [ ...
3.18. C++ lea ecx, DWORD PTR _b$[esp+40] call ??0box@@QAE@HHHH@Z ; box::box push 40 push 2 lea ecx, DWORD PTR _s$[esp+32] call ? ...
3.18. C++ Let’s compile it again in MSVC 2008 with/Oxand/Ob0options and see thebox::dump()method code: ?dump@box@@QAEXXZ PROC ; ...
3.18. C++ return 0; }; Let’s run: this is box. color=1, width=10, height=20, depth=30 this is box. color=1, width=123, height=20 ...
3.18. C++ this->density=density; }; void dump() { printf ("this is solid_box. width=%d, height=%d, depth=%d, density=%d\n", w ...
3.18. C++ push OFFSET ??_C@_0DO@HNCNIHNN@this?5is?5solid_box?4?5width?$DN?$CFd?0?5hei@ call _printf add esp, 20 ret 0 ?dump@soli ...
3.18. C++ Thus,thesolid_object::get_density()methodwillbelievelikeitisdealingwiththeusualsolid_object class, and thebox::get_vol ...
3.18. C++ o1->dump(); o2->dump(); return 0; }; Classobjecthas a virtual methoddump()that is being replaced in the inheriti ...
3.18. C++ DD FLAT:??_R0?AVbox@@@8 DD FLAT:??_R3box@@8 ??_7box@@6B@ DD FLAT:??_R4box@@6B@ ; box::`vftable' DD FLAT:?dump@box@@UAE ...
3.18. C++ _main PROC push OFFSET $SG37112 push OFFSET ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A ; std::cout call ...
3.18. C++ ...then we can see that the compiled code is just the same as in the pointers example (3.21 on page 611): Listing 3.10 ...
«
24
25
26
27
28
29
30
31
32
33
»
Free download pdf