Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 1.57 KB

File metadata and controls

30 lines (24 loc) · 1.57 KB

x64 Cheat Sheet

  • https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf

  • DCL(DoubleCheckedLocking) 的例子

    • singletons[i].reference = new Singleton();
      # note that the Symantec JIT using a handle-based object allocation system
      0206106A   mov         eax,0F97E78h
      0206106F   call        01F6B210                  ; allocate space for
                                                       ; Singleton, return result in eax
      02061074   mov         dword ptr [ebp],eax       ; EBP is &singletons[i].reference 
                                                      ; store the unconstructed object here.
      02061077   mov         ecx,dword ptr [eax]       ; dereference the handle to
                                                       ; get the raw pointer
      02061079   mov         dword ptr [ecx],100h      ; Next 4 lines are
      0206107F   mov         dword ptr [ecx+4],200h    ; Singleton's inlined constructor
      02061086   mov         dword ptr [ecx+8],400h
      0206108D   mov         dword ptr [ecx+0Ch],0F84030h