• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 8 of 8
    1. #1
      Newbie
      Building a nuclear bomb
       
      Coding
       
      Freak's Avatar
      Join Date
      Jan 2013
      Posts
      7
      Thanks (-->)
      4
      Thanks (<--)
      1

      Address to Module BaseName

      John Kittz
      Hellow guyz!

      I need some help

      i have the address 0x12345678

      And i dont know what module name from this address, so i need a function to convert it to something like
      (modulename + 0x45678) same as CE does and put it in a messagebox.


      ex.
      0x12345678 => engine.dll + 0x45678

      thanks
      Last edited by Freak; 03-20-2014 at 08:53 PM.

    2. #2
      Hacker
      shell toes yes
       
      Lagging
       
      squeenie's Avatar
      Join Date
      Mar 2013
      Posts
      717
      Thanks (-->)
      598
      Thanks (<--)
      221
      Use moduleinformation to check the base of the dll plus the size and see if your address is within its boundaries

    3. Thanks till0sch thanked for this post
    4. #3
      Newbie
      Building a nuclear bomb
       
      Coding
       
      Freak's Avatar
      Join Date
      Jan 2013
      Posts
      7
      Thanks (-->)
      4
      Thanks (<--)
      1
      Quote Originally Posted by squeenie View Post
      Use moduleinformation to check the base of the dll plus the size and see if your address is within its boundaries
      i know this one,

      I made a function to get the modulesize of all modules of process, and just check if my address is > or < of modulesize to return the module name, but i think which have some more easy way to do it.
      Can you do it?
      Last edited by Freak; 03-20-2014 at 10:38 PM.

    5. #4
      Hacker
      shell toes yes
       
      Lagging
       
      squeenie's Avatar
      Join Date
      Mar 2013
      Posts
      717
      Thanks (-->)
      598
      Thanks (<--)
      221
      Quote Originally Posted by Freak View Post
      i know this one,

      I made a function to get the modulesize of all modules of process, and just check if my address is > or < of modulesize to return the module name, but i think which have some more easy way to do it.
      Can you do it?
      That's the best I can think of right now. Why don't you just use that?

    6. Thanks Freak thanked for this post
    7. #5
      Newbie
      Building a nuclear bomb
       
      Coding
       
      Freak's Avatar
      Join Date
      Jan 2013
      Posts
      7
      Thanks (-->)
      4
      Thanks (<--)
      1
      Quote Originally Posted by squeenie View Post
      That's the best I can think of right now. Why don't you just use that?
      Thanks for help,
      Im using works not bad, i wrote the function by myself and i not sure if this is really best way to do it, maybe there would be an easier way to get it.

    8. #6
      Global Moderator
      give me my colorz back
      FeelsBadMan
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      https://stackoverflow.com/questions/...c-ptr-in-win32

      If you take a look at the response of "Arty", he uses this:

      Code:
      HMODULE hmodule = NULL;
      GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(address), &hmodule);
      To get a HMODULE having the address..


      Not too sure whether that works or not it's just that he got many ratings up so I guess it does.. If that works use

      DWORD WINAPI GetModuleFileName(
      _In_opt_ HMODULE hModule,
      _Out_ LPTSTR lpFilename,
      _In_ DWORD nSize
      );

      to get the name of the module (path)

      (https://msdn.microsoft.com/en-us/lib...v=vs.85).aspx)

    9. #7
      Jr.Coder
      @_/ miiiaaauuuu
       
      Coding
       
      x86asm's Avatar
      Join Date
      Jan 2013
      Posts
      52
      Thanks (-->)
      2
      Thanks (<--)
      2
      Hello, you take also my function.


      Code:
      unsigned GetDllBaseAddress( string DllName, int ProcessId )
      {
      HANDLE snap;
      MODULEENTRY32 lppe;
      lppe.dwSize = sizeof(MODULEENTRY32);
      
      
      		snap =  CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, ProcessId );
      
      		if ( snap == INVALID_HANDLE_VALUE )
      		{
      			cout<< "CreateToolhelp32Snapshot error: " << GetLastError()<<"\n";
      			system("PAUSE");
      			return 0;
      		}
      
      		Module32First(  snap, &lppe );
      		do
      		{
      			if ( !strcmp( lppe.szModule, DllName.c_str() ) )
      			{
      				//cout<<lppe.szModule<< "     "<<hex<<lppe.hModule<<"\n";
      				return unsigned(lppe.hModule);
      			}
      	   }
      	   while ( Module32Next ( snap , &lppe ) == 1 ) ;
      
      return 0;
      }
      
      
      
      
      int GetProcessIdByName ( string ProcessName )
      {
      HANDLE h = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS,0);
      
      PROCESSENTRY32 lppe;
      lppe.dwSize = sizeof(PROCESSENTRY32);
      
      	Process32First( h, &lppe );
      	do
      	{
      		if ( strcmp(lppe.szExeFile,ProcessName.c_str()) == false )
      		{
      			return lppe.th32ProcessID;
      		}
      	}
      	while ( Process32Next (h, &lppe) == true );
      
      return -1;
      }

    10. #8
      Global Moderator
      give me my colorz back
      FeelsBadMan
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      Cheats'n'Trainers
      Quote Originally Posted by x86asm View Post
      Hello, you take also my function.


      Code:
      unsigned GetDllBaseAddress( string DllName, int ProcessId )
      {
      HANDLE snap;
      MODULEENTRY32 lppe;
      lppe.dwSize = sizeof(MODULEENTRY32);
      
      
      		snap =  CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, ProcessId );
      
      		if ( snap == INVALID_HANDLE_VALUE )
      		{
      			cout<< "CreateToolhelp32Snapshot error: " << GetLastError()<<"\n";
      			system("PAUSE");
      			return 0;
      		}
      
      		Module32First(  snap, &lppe );
      		do
      		{
      			if ( !strcmp( lppe.szModule, DllName.c_str() ) )
      			{
      				//cout<<lppe.szModule<< "     "<<hex<<lppe.hModule<<"\n";
      				return unsigned(lppe.hModule);
      			}
      	   }
      	   while ( Module32Next ( snap , &lppe ) == 1 ) ;
      
      return 0;
      }
      
      
      
      
      int GetProcessIdByName ( string ProcessName )
      {
      HANDLE h = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS,0);
      
      PROCESSENTRY32 lppe;
      lppe.dwSize = sizeof(PROCESSENTRY32);
      
      	Process32First( h, &lppe );
      	do
      	{
      		if ( strcmp(lppe.szExeFile,ProcessName.c_str()) == false )
      		{
      			return lppe.th32ProcessID;
      		}
      	}
      	while ( Process32Next (h, &lppe) == true );
      
      return -1;
      }
      He wants to get the module handle which covers a certain address not vice-versa.

    Similar Game Hacker Threads

    1. [Tutorial] Get Module Base Address Tutorial (Spoonfed)
      By [GH]Rake in forum Tutorials and Snippets
      Replies: 7
      Last Post: 04-11-2016, 02:44 PM
    2. [Help] Memory Address - Not in a module [Screenshot Provided]
      By Aleksander in forum Hacking Help
      Replies: 8
      Last Post: 11-20-2015, 01:30 PM
    3. [Help] DLL - How to get address of module?
      By zepixx in forum Hacking Help
      Replies: 1
      Last Post: 10-29-2014, 04:56 AM
    4. Calling a function by address (function in another module)
      By c5 in forum Tutorials and Snippets
      Replies: 9
      Last Post: 11-05-2013, 09:27 AM

    Tags for this Thread