Results 1 to 8 of 8
  1. #1
    marco60's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    0

    Base Address + offset

    So, im doing something here using Python but the address i got uses the base address + an offset, which is CoDWaWmp.exe+591938(float).
    I cant get it working, i read i need to use GetModuleHandle but the way im doing to create that function seems wrong.
    "
    HMODULE WINAPI GetModuleHandle(
    _In_opt_ LPCTSTR lpModuleName
    );" lpModuleName being the .exe or .dll, which in this case is the CoDWaWmp.exe.

    What do i need to do to be able to modify the value of that address?
    Last edited by marco60; 06-27-2018 at 10:52 PM.

  2. #2
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    797
    Reputation
    593
    Thanks
    26,314
    You can't get the Base Address of a Module Handle with GetModuleHandle of another Process.
    You can only use it to get the own ModuleHandle or from Modules which are inbound in the Module, like DLL's
    You need to do it with CreateToolhelp32Snapshot or EnumProcessModules.

  3. #3
    marco60's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    0
    and after that, does it return the actual address?

  4. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by marco60 View Post
    and after that, does it return the actual address?
    Toolhelp32Snapshot will give you the base address and module size of each module, then you simple add the offset to get to where you need to go.
    Ah we-a blaze the fyah, make it bun dem!

  5. #5
    marco60's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    0
    will try that man, thanks. Any problem i might post here again

    - - - Updated - - -

    Quote Originally Posted by marco60 View Post
    will try that man, thanks. Any problem i might post here again
    seems like the base address is 0x0000015224020B48 (i got a bunch of similars using another function earlier, i didnt know which one to pick cause it was spamming), but i cant get the thing to work, im honestly stuck. By the way, i used a code made by someone to get the base addres(yeah it uses createtoolhelp32snapshot).
    print me32.dwSize
    print me32.th32ModuleID
    print me32.th32ProcessID
    print me32.GlblcntUsage
    print me32.ProccntUsage
    print me32.modBaseAddr
    print me32.modBaseSize
    print me32.hModule
    print me32.szModule
    print me32.szExePath
    Last edited by marco60; 06-28-2018 at 02:13 AM.

  6. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Use me32.szModule to check for "codwew.exe", and log the base address for that. You only need to do this once, the module won't shift around during operation.
    Ah we-a blaze the fyah, make it bun dem!

  7. #7
    marco60's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    0
    Yeah during the operation it wont change, but how do i use the base address + the offset together? its giving me an error "expected str, got int instead" when i try to add the offset to it. For example: self.xpMultiplier1 = (me32.modBaseAddr)+0x591938



    print(me32.szModule)
    print(me32.modBaseAddr)
    print(me32.th32ModuleID)


    b'CoDWaWmp.exe'
    <ctypes.wintypes.LP_c_byte object at 0x0000022743F10BC8>
    1
    b'ntdll.dll'
    <ctypes.wintypes.LP_c_byte object at 0x0000022743F10BC8>
    1
    b'wow64.dll'
    <ctypes.wintypes.LP_c_byte object at 0x0000022743F10BC8>
    1
    b'wow64win.dll'
    <ctypes.wintypes.LP_c_byte object at 0x0000022743F10BC8>
    1
    b'wow64cpu.dll'
    <ctypes.wintypes.LP_c_byte object at 0x0000022743F10BC8>
    1



    got told that the BaseAddress for any CoD is static and i couldve just used the address that is displayed on CE

    thanks anyway, indeed learned stuff from here
    Last edited by marco60; 06-28-2018 at 06:46 PM.

Similar Threads

  1. [Help] Base Address with Offset
    By LWJ in forum C++/C Programming
    Replies: 2
    Last Post: 08-13-2014, 06:26 AM
  2. [Help Request] Garry's Mod sv_cheats base address + offset?
    By NotAFed in forum Garry's Mod Discussions & Help
    Replies: 3
    Last Post: 02-24-2014, 06:23 AM
  3. [Release] Assault Cube CT Base Address and OffSets
    By brassh in forum Other First Person Shooter Hacks
    Replies: 2
    Last Post: 06-27-2013, 07:05 AM
  4. [Tutorial] Find base address + offset
    By GEHhgerhgerhgerhrhr in forum Battlefield 3 (BF3) Hacks & Cheats
    Replies: 9
    Last Post: 03-06-2013, 06:53 AM
  5. Writing to address based on offset?
    By Muu in forum C++/C Programming
    Replies: 21
    Last Post: 12-06-2010, 07:16 PM