Memory Functions

From SolarStrike wiki
Revision as of 00:41, 15 July 2008 by Elverion (talk | contribs) (memoryReadInt)
Jump to: navigation, search

Note that many of the functions here are very similar to each other. The only real difference between functions like memoryReadByte() and memoryReadInt() is the size (number of bytes) they read from the target process's memory space. You should use memory searching/editing software such as ArtMoney or Cheat Engine to figure out the size of the data type you are trying to read before you use these functions; reading the wrong number of bytes can result in erroneous information.


memoryReadByte

byte memoryReadByte(handle, address)

Reads a single byte (-128 -> +127) from the specified process handle and address. The specified address may be in either decimal or hexadecimal form.

handle should be the variable that you obtained using openProcess().


Example

-- This will read 0x0D2E0F90 on MyProcess and store it into HP
HP = memoryReadByte( myProcess, 0x0D2E0F90);
if( HP <= 100 ) then 
  printf("Hp[%d] dropping too low!",HP);
end

memoryReadShort

byte memoryReadShort(handle, address)

Reads a short (2 bytes, -32,768 -> +32,767) from the specified process handle and address. The specified address may be in either decimal or hexadecimal form.

handle should be the variable that you obtained using openProcess().

Example

-- This will read 0x0D2E0F90 on MyProcess and store it into HP
HP = memoryReadShort( myProcess, 0x0D2E0F90);
if( HP <= 100 ) then 
  printf("Hp[%d] dropping too low!",HP);
end

memoryReadInt

byte memoryReadShort(handle, address)

Reads a int (4 bytes, -2,147,483,648 -> +2,147,483,647) from the specified process handle and address. The specified address may be in either decimal or hexadecimal form.

handle should be the variable that you obtained using openProcess().

Example

-- This will read 0x0D2E0F90 on MyProcess and store it into HP
HP = memoryReadInt( myProcess, 0x0D2E0F90);
if( HP <= 100 ) then 
  printf("Hp[%d] dropping too low!",HP);
end