Where are there areas in a program full of jmp instructions?

156 Views Asked by At

I am learning about debugging programs and stumpled upon an area I don't understand. Why is this area, as seen in the picture below, full of jump instructions to different addresses?

enter image description here

I'm learning about hooks and wanted to see my hooking function (hookingFunction) through x32dbg. It has the prototype of LoadLibraryA as that's the function I want to hook.

enter image description here

Here is the LoadLibrary prototype:

typedef HMODULE(__stdcall* LoadLibraryType) (LPCSTR filename);

static LoadLibraryType loadlib;

HMODULE __stdcall hookingFunction(LPCSTR filename) {

    std::cout << "hello from hookingFunction" << std::endl;

    return loadlib(filename);
}

When printing the base address of the hookingFunction I get the following address:

std::cout << std::hex << "hookingFunction, base address: " << hookingFunction << std::endl; 
// Output: "hookingFunction, base address: 7C061410"

Following the address in x32dbg I land here:

enter image description here

When following "jmp 713B" relative to 7C061410, I land at the actual function I wanted to land at in the first place

enter image description here

But why do we first need to visit the address 7C061410? And why is this area full of jmp instructions?

I hope it makes sense, and thank you for reading.

0

There are 0 best solutions below