MHS Thread

(1/2) > >>

mzxrules:
L. Spyro's Memory Hacking Software (or MHS for short) is a rather nifty program that allows you to look into a program and do all kinds of fun stuff with it.

One rather neat thing you can do with it is read memory values and perform calculations based off those values.

Since I'm terrible at starting threads, here's a script that calculates the distance traveled during during the last frame. It's not 100% accurate because the time value isn't always updated when Link can move I think (when just entering a scene I think).

Code:

VOID Lock(MHS_ADDRESS aAddress, INT iItemSize){
extern int off = { "project64.exe", 0xD6A1C }; //Grabs pointer value to the start of the 64's RAM for PJ64

extern short t = { "", (0x1EF6AC + off)}; //Grabs the current time frame
extern short tO = { "", (0x3FFF50 + off)}; //Grabs the previous time frame

//grab the current x,y,z coordinates
extern float xN = { "", (0x3FFDD4 + off) };
extern float yN = { "", (0x3FFDD8 + off) };
extern float zN = { "", (0x3FFDDC + off) };

//grab the previous frame's x,y,z coordinates
extern float xO = { "", (0x3FFF44 + off) };
extern float yO = { "", (0x3FFF48 + off) };
extern float zO = { "", (0x3FFF4C + off) };

//result is where we'll return our final value
extern float result = { "", aAddress };

//stores delta x, y, z
float x;
float y;
float z;

//temp values for calculating the speed
float u;
float v;
int i;

//if we're on the next frame
if (t != tO)
{
//get delta x, y, z
x = xN-xO;
y = yN-yO;
z = zN-zO;

//update our previous position/frame number
xO = xN;
yO = yN;
zO = zN;
tO = t;

//Begin calculating sqrt(x^2+y^2+z^2)

//u = x^2+y^2+z^2
u = ((x*x)+(y*y)+(z*z));

//some square root magic I don't quite understand.
i = * (int *) &u;
i = 0x1FBC5524 + i/2;
v = * (float *) &i;

//The more times this is repeated, the more accurate the result is
v = (v + u/v)*0.5f;
v = (v + u/v)*0.5f;

result = v;
}
}

ING-X:
lmao

Anyways, Petrie gave me this list of MM addresses for MHS a while back. May as well attach it to this post so other people can access it more easily.

mzxrules:
Came up with a dynamic address for the Blue Warp timer, so that several values become one:

[project64.exe+D6A1C]+([[project64.exe+D6A1C]+1CA10C]&FFFFFF)+180h

The way it works is it captures the pointer at 1CA10C, which appears to be the last actor spawned with a particular... "actor typing" I guess. Blue warps are type 7 which seem to be shared with just navi, and some decor.

Haven't done extensive testing of it though

512: loadMemberContext(): member id 1 not previously loaded by loadMemberData()
File: /var/www/html/smf1.1/Sources/Load.php
Line: 969