ZSR Forums
October 13, 2024, 03:47:10 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: ZSR Forums are back - read only!
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: MHS Thread  (Read 18493 times)
512: loadMemberContext(): member id 1 not previously loaded by loadMemberData()
File: /var/www/html/smf1.1/Sources/Load.php
Line: 969
mzxrules
Admin
Ultimate Mega Guay

Posts: 901


Wrong warp expert


« on: June 03, 2012, 04:49:28 AM »

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;
}
}
« Last Edit: August 20, 2014, 09:57:54 AM by mzxrules » Logged

Quote from:  Leigh Rogers
Braid
This is art because the music is classical music, and the graphics are done with a pen. The story is something about a woman. I could not understand much of this to be honest, which makes it even more likely to be an art.
ING-X
Site Editor
Mega Guay

Posts: 613


fuck you and the horse you rode in on

562243965 marikthechao@hotmail.com ingx24
« Reply #1 on: June 03, 2012, 11:38:08 PM »

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.
Logged

<complex> byan you're doing that thing again
<complex> the thing where everything you say is fucking retarded


<ethandude> http://en.wikipedia.org/wiki/Homosexual cheak this out luxury it might come in helpful when u wright your resime
mzxrules
Admin
Ultimate Mega Guay

Posts: 901


Wrong warp expert


« Reply #2 on: August 20, 2014, 09:43:00 AM »

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
Logged

Quote from:  Leigh Rogers
Braid
This is art because the music is classical music, and the graphics are done with a pen. The story is something about a woman. I could not understand much of this to be honest, which makes it even more likely to be an art.