Jump to content

Creating Tweak Help


Go to solution Solved by Amuyea,

20 posts in this topic

Recommended Posts

Posted

I used the online MS Hook tool and this is how it came out and it doesn't work. What am i missing?

 

#include <substrate.h>
#include <Foundation/Foundation.h>
 
int __ZN10GlobalData8addMoneyEi() {
return 99999;
}
 
%ctor {
MSHookFunction(MSFindSymbol(NULL, "__"),(int*)__ZN10GlobalData8addMoneyEi, NULL);
}
Posted (edited)

If we don't know the errors you get we can't help you.

 

Well, I didn't get an error this time, but when i start the game i see that nothing has changed. Basically i wanted to know if this how the tweak file is supposed to look? 

Updated by beantownfan73
Posted

Lol. What happened to %hook and %end

Hahahaha...I'm glad you think it's funny that an old guy like me doesn't understand this stuff. Ask the people who created that online MS Hook generator because that's how it came out on there. 

 

This is where I am at now - 

 

I searched the headers with grep command and nothing in there about money, add money or add coins. There is a bunch of functions in IDA related to adding money, get money, set money, but nothing in the dump file to hook it to. 

Posted (edited)

#include <substrate.h>
#include <Foundation/Foundation.h> 

static int __ZN10GlobalData8addMoneyEi() 
{
return 99999;
} 

%ctor{
MSHookFunction(MSFindSymbol(NULL, "__ZN10GlobalData8addMoneyEi"),(int*)__ZN10GlobalData8addMoneyEi, NULL);
}
Your whalecum.

 

If changes don't take effect you must've hacked something useless or something wrong.

Updated by Chrizk0
Posted

Try this mate.

 

int (*old__ZN10GlobalData8addMoneyEi)();

int $__ZN10GlobalData8addMoneyEi() { 

 return 9999; 

 }

%ctor { 

MSHookFunction(((int*)MSFindSymbol(NULL, "__ZN10GlobalData8addMoneyEi")),(int*)$__ZN10GlobalData8addMoneyEi,(int**)&old__ZN10GlobalData8addMoneyEi);

}

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines