Square Brackets - Square brackets signify "address pointed to". For example, [var] is the address pointed to by var. In other words, when using [var] we want to access the memory address that var is holding.
LEA - Ignore literally everything about square brackets when working with LEA.
LEA is short for Load Effective Address and it's used for calculating and loading addresses.
LEA is used to load and calculate addresses, NOT data.
Here is a simple example of dereferencing and a pointer in Assembly:
If that Assembly was executed, var would be 12.
lea RAX, [var]
mov [RAX], 12
Earlier I said that LEA can be used to calculate addresses, and it often is
lea RAX, [RCX+8] ;This will set RAX to the address of RCX+8.
mov RAX, [RCX+8] ;This will set RAX to the value inside of RCX+8.
'강의정리 > Z0FCourse_Re' 카테고리의 다른 글
[x64] DLL(import/export), Function Overriding, Mangling, and Decoration (0) | 2020.01.23 |
---|---|
[x64dbg] 셋팅 정리필요함 (0) | 2020.01.22 |
[x86-64] 루프 (반복문), 디컴파일러의 do-while 루프 (0) | 2020.01.22 |
[x64] C++ 코드 리버싱할 때, printf와 stdout의 차이 (0) | 2020.01.22 |
[x64] fastcall과 호출 규약 (0) | 2020.01.21 |