c# - Pointer address of intptr -
Sorry to ask this silly question, but I am trying to get a GB address (indicator) running in a remote process. .
The address is saved in type type intptr, but when I print the value I get a huge int.
How can I convert it to 0x00000 etc?
Example Code:
Public UIT GetModuleBase (string _modelum) {MODULEENTRY32 me32 = new MODULEENTRY32 (); IntPtr hSnapshot = IntPtr.Zero; Me32.dwSize = (UIT) system.rintime.interop services. Mrishal Size off (May 32); HSnapshot = CreateToolhelp32 snapshot (0x00000008, this.processId); // can we start looking? If (! Module32First (hSnapshot, ref me32)) {CloseHandle (hSnapshot); Return 0; } // Tell all the modules till we find what we are searching for, or until each one of them is checked (string.compare (May 32.szModule, _moduleName)! = 0 & Amp; Module32Next (hSnapshot, ref me32)) {Modules.Add (me32.szModule, me32.modBaseAddr); } // close the handle (hsnapshot); // Check whether the module handle has been found and will return it if (string 32. szModule, _moduleName) == 0) {return (UIT) me32.modBaseAddr; } Return 0; } The process hacker shows that Lib is loaded at the address (0x6f300000), but I get an int value (1865416704) when I try to print the intptr value.
You can convert your integer number to 0x00000000 format (which is only Is a representation) ToString () and 0x prefixing part of this type:
int yourNumber = 1234567890; String hexonumber = string Format ("0x {0: X}", yourNumber); However, there is no real need to do this because it is essentially just a display format.
Comments
Post a Comment