September 2017
Beginner to intermediate
290 pages
6h 58m
English
Let's begin by taking a quick look at the original code of the procedure we planted into the executable as part of our patch. The code is quite straightforward and, knowing what we already know, is easy to read:
; First of all we tell the assembler; that this is a 32-bit codeuse32; Tell the assembler that we are expecting; this code to appear at 0x41e000org 0x41e000; Define labels for "external" procedures; we are about to uselabel fgets at 0x414bd8label __acrt_iob_func at 0x41b180; Implement the procedurefgets_patch: ; We begin the procedure with the standard ; prolog for cdecl calling convention push ebp mov ebp, esp ; As we need the pointer to the stdin stream ; we call the __acrt_iob_func procedure push 0 ; This is the ...
Read now
Unlock full access