syncon Posted February 27, 2007 Posted February 27, 2007 (edited) Hello Everyone. How can I use _MemoryRead() to read the player's Chinese names in a game? Thank for Helps. expandcollapse popup;================================================================================================= ; Function: _MemoryRead($iv_Address, $ah_Handle[, $sv_Type]) ; Description: Reads the value located in the memory address specified. ; Parameter(s): $iv_Address - The memory address you want to read from. It must be in hex ; format (0x00000000). ; $ah_Handle - An array containing the Dll handle and the handle of the open ; process as returned by _MemoryOpen(). ; $sv_Type - (optional) The "Type" of value you intend to read. This is set to ; 'dword'(32bit(4byte) signed integer) by default. See the help file ; for DllStructCreate for all types. ; An example: If you want to read a word that is 15 characters in ; length, you would use 'char[16]'. ; Requirement(s): The $ah_Handle returned from _MemoryOpen. ; Return Value(s): On Success - Returns the value located at the specified address. ; On Failure - Returns 0 ; @Error - 0 = No error. ; 1 = Invalid $ah_Handle. ; 2 = $sv_Type was not a string. ; 3 = $sv_Type is an unknown data type. ; 4 = Failed to allocate the memory needed for the DllStructure. ; 5 = Error allocating memory for $sv_Type. ; 6 = Failed to read from the specified process. ; Author(s): Nomad ; Note(s): Values returned are in Decimal format, unless specified as a 'char' type, then ; they are returned in ASCII format. Also note that size ('char[size]') for all ; 'char' types should be 1 greater than the actual size. ;================================================================================================= Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword') If Not IsArray($ah_Handle) Then SetError(1) Return 0 EndIf Local $v_Buffer = DllStructCreate($sv_Type) If @Error Then SetError(@Error + 1) Return 0 EndIf DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '') If Not @Error Then Local $v_Value = DllStructGetData($v_Buffer, 1) Return $v_Value Else SetError(6) Return 0 EndIf EndFunc Edited February 27, 2007 by syncon
xwinterx Posted February 27, 2007 Posted February 27, 2007 I'm sure you can but you have to know the memory location of the name then if the memory locations are dynamic (not sure if that is the right term) where they change each time you run the the game.
Archman Posted February 27, 2007 Posted February 27, 2007 Yeah you need to know the Memory address that stores the name you require.Once you know that address you need to find a static pointer for that address.Once you know that you need to find the base offset for the static pointer. Static Pointer = An Address that is always the same, and thats Value + Offset = Address u want. This could be multi level, one i needed recently was 6 lvls, So for examplePointer One value + 0000000B = Pointer TwoPointer Two value + 00000860 = Pointer ThreePointer Three value + 0000AC94 = Pointer FourPointer Four value + 0000CC0B = Pointer FivePointer Five value + 00000874 = Pointer SixPointer Six value + 0000A896 = Address that stores the name u require ( Name will be in Binary so u will need convert binary to text)Base Offset = The distance from the first Mem address the program uses to the First Pointer. Anyhow have a look here for some tutorials that helped me out - http://www.mpcforum.com/showthread.php?t=61072
city Posted May 11, 2007 Posted May 11, 2007 Is it C++? It cant work in my Autoit3 Editor. How can i compile and translate to .au3? How to check the name Memory?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now