Part 12 - Load Effective Address
For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the topics it will cover. https://github.com/mytechnotalent/Reverse-Engineering-Tutorial
When a binary executes in RAM the OS will unmap the code into a data segment where it finds free space in memory.
Load Effective Address loads a given memory address as a pointer to any given variable. For example:
lea rbx, my_var
This will load the address of my_var into rbx.
In C++, a pointer actually adds what the user would see as one if something was incremented however it is actually moving it 2 bytes forward under the hood assuming it is a word in length or 16 bits or 2 bytes. Same thing.
In Assembly every single byte is addressable. For example:
lea rax, my_var
inc rax
mov word ptr [rax], rbx
Let’s say the value of 0x20 is in rbx. This above instruction will place the value of 0x20 into a non-word boundary which will result in an error. You would have to increment rax by 2 to ensure that does not happen.
Next week we will dive into the data segment! Stay tuned!