Jump to content
Tuts 4 You

C++ loader source code


Recommended Posts

Posted

Hi,

I'm looking for C++ loader source code that works on x64 applications with ASLR

If someone can help I would really appreciate it

  • Like 1
HostageOfCode
Posted

Just use GetModuleHandle().
 

Quote

 

    HMODULE hModule = GetModuleHandle(ModuleName);

    uintptr_t base_of_code = (uintptr_t)hModule;

    uintptr_t patch_va = base_of_code + rva;

 

 

 

  • Like 4
  • 7 months later...
Posted

Due to the differences in memory addressing and architecture between 32& 64bit systems you need a few adjustments to inject code into a 64bit process with ASLR  

Pointers: are wide , so you need to make sure you're using appropriate types like uintptr_t for addresses, and LPVOID for memory allocations.
Memory Allocation: Functions work similarly to 32bit systems, but you need to make sure you're handling 64bit addresses correctly.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...