September 2017
Beginner to intermediate
290 pages
6h 58m
English
The code we are about to write will look a tiny bit different from the code we are used to as we are not expecting an executable file to be generated out of it; instead, we will generate a binary file containing a 32-bit procedure assumed to be loaded at a specific address, and that is what we are going to tell the compiler in the first two lines of our patch.asm source file:
; Tell the assembler we are writing 32-bit codeuse32; Then specify the address where the procedure; is expected to be loaded atorg 0x414d98
Then we will define two labels pointing at addresses outside our procedure. Fortunately, Flat Assembler allows us to define a label at an arbitrary address, like this:
; Assign label to the code where jump ; to fgets is ...
Read now
Unlock full access