Author Topic: MHS Thread  (Read 17948 times)

0 Members and 1 Guest are viewing this topic.

mzxrules

  • Admin
  • Mega Guay
  • Offline Offline
  • Posts: 921
  • Wrong warp expert
MHS Thread
« on: June 02, 2012, 08:49:28 PM »

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: [Select]
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, 01: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
  • Offline Offline
  • Posts: 613
  • fuck you and the horse you rode in on
Re: Obligatory MHS Thread
« Reply #1 on: June 03, 2012, 03: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
  • Mega Guay
  • Offline Offline
  • Posts: 921
  • Wrong warp expert
Re: MHS Thread
« Reply #2 on: August 20, 2014, 01: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.

Cosmo

  • Admin
  • Mega Guay
  • Offline Offline
  • Posts: 659
Re: MHS Thread
« Reply #3 on: August 20, 2014, 06:56:22 AM »

Here are sockfolder's OoT memory addresses for mupen 0.5 rerecording
http://www.mediafire.com/?q4083u9w365eo
« Last Edit: January 15, 2015, 01:54:54 PM by mzxrules »
Logged

Jbop

  • Moderator
  • Special Guay
  • Offline Offline
  • Posts: 233
  • Potatoes are useful.
Re: MHS Thread
« Reply #4 on: August 21, 2014, 05:40:04 PM »

Cheat Engine forever!
Logged
Quote from:  ZFG on March 24, 2008, 8:27:24 AM
Quote from:  Prognosis_4 on March 24, 2008, 8:25:50 AM
Why are you guys so certain it's possible?
Because its OoT.

mzxrules

  • Admin
  • Mega Guay
  • Offline Offline
  • Posts: 921
  • Wrong warp expert
Re: MHS Thread
« Reply #5 on: November 16, 2014, 12:28:01 PM »

Set specific stones/medallions (0 to not have, 1 to have). For this to work, the value must be locked, and the value being locked must be set to the start address of the stones/medallions stuff. (8011A674 in 1.0)
Code: [Select]
VOID Lock(MHS_ADDRESS aAddress, INT iItemSize){

bool Emerald = 0;
bool Ruby = 0;
bool Sapphire = 0;

bool M_Light = 0;
bool M_Forest = 0;
bool M_Fire = 0;
bool M_Water = 0;
bool M_Shadow = 0;
bool M_Spirit = 0;

bool S_Lullaby = 0;
bool S_Epona = 0;
bool S_Saria = 0;
bool S_Sun = 0;
bool S_Time = 0;
bool S_Storm = 0;

bool S_Minuet = 0;
bool S_Bolero = 0;
bool S_Serenade = 0;
bool S_Requiem = 0;
bool S_Nocturne = 0;
bool S_Prelude = 0;

bool O_Stone = 0;
bool O_GerudoCard = 0;
bool O_GoldSkull = 0;

char HeartPieces = 0;

//Code
extern unsigned int r = { "", aAddress };
unsigned int result = 0;

result += (int)HeartPieces <<28;
result += (int)Test(
O_GoldSkull, O_GerudoCard, O_Stone, Sapphire,
Ruby, Emerald, S_Storm, S_Time) << 16;
result += (int)Test(
S_Sun, S_Saria, S_Epona, S_Lullaby,
S_Prelude, S_Nocturne, S_Requiem, S_Serenade) << 8;
result += Test(
S_Bolero, S_Minuet, M_Light, M_Shadow,
M_Spirit, M_Water, M_Fire, M_Forest);
r = result;
}

char Test(bool a, bool b, bool c, bool d,
bool e, bool f, bool g, bool h)
{
char result = 0;
result += a<<7;
result += b<<6;
result += c<<5;
result += d<<4;
result += e<<3;
result += f<<2;
result += g<<1;
result += h;

return result;
}
« Last Edit: November 16, 2014, 12:31:14 PM 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.

mzxrules

  • Admin
  • Mega Guay
  • Offline Offline
  • Posts: 921
  • Wrong warp expert
Re: MHS Thread
« Reply #6 on: November 21, 2014, 04:50:02 PM »

Code: [Select]
bool d_right[2] = {0, 0};
bool d_left[2] = {0, 0};
bool d_down[2] = {0, 0};
bool d_up[2] = {0, 0};

short locked = 0; //change to char for byte,

VOID Lock(MHS_ADDRESS aAddress, INT iItemSize)
{
    extern char b2 = { "", aAddress+0x1C84B7}; // 0x1C84B4
    extern short var = { "", aAddress+0x1DAAE4}; // 0x1DAB6C  (tunic)

if (runOnce == 1)
{
locked = var;
runOnce = 0;
}

d_right[0] = b2 & 0x01;
d_left[0]  = b2 & 0x02;
d_down[0]  = b2 & 0x04;
d_up[0]    = b2 & 0x08;

if (CheckInput(d_right))
locked++;

if (CheckInput(d_left))
locked--;

if(CheckInput(d_up))
locked += 10;

if(CheckInput(d_down))
locked -= 10;

var = locked;

d_right[1] = d_right[0];
d_left[1] = d_left[0];
d_down[1] = d_down[0];
d_up[1] = d_up[0];
}

bool CheckInput(bool* b)
{
return (b[0] && b[0] != b[1]);
}
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.

Lovingood2799

  • Deku Scrub
  • Offline Offline
  • Posts: 10
Re: MHS Thread
« Reply #7 on: March 08, 2016, 07:34:50 AM »

anyone have English MM MHS addresses for PJ64? they'd be really appreciated
Logged