aight guys so this is my first post on dis account.
wanted to start off with something useful.
here are a bunch of templates for different function types plus a slider template.
float:
int:
bool:
Slider Switch Hook:
Field:
Field With Multiple Switches:
UNITY FRAMEWORK HOOK
Use this under your void setup() {, the mshookfunction will cause the game to crash, this method wont
how to use:
you can copy and paste the template above your setup function (below the import lines)
and fill in the info. What you do next is add your switches. Here are the Ted2 Switches available
hope this helps
wanted to start off with something useful.
here are a bunch of templates for different function types plus a slider template.
float:
C++:
float(*old_@Function@)(void *_this);
float @Function@(void *_this){
if([switches isSwitchOn:@"@SwitchName@"]) {
//float must return a decimal so add a .0f after any number you wish to return
return 999999999.0f;
}
return old_@Function@(_this);
}
%ctor {
MSHookFunction((void *)getRealOffset(@FunctionOffset@), (void *)@Function@, (void **)&old_@Function@);
}
C++:
int(*old_@Function@)(void *_this);
int @Function@(void *_this){
if([switches isSwitchOn:@"@SwitchName@"]) {
return 999999999;
}
return old_@Function@(_this);
}
%ctor {
MSHookFunction((void *)getRealOffset(@FunctionOffset@), (void *)@Function@, (void **)&old_@Function@);
}
C++:
bool(*old_@Function@)(void *_this);
bool @Function@(void *_this){
if([switches isSwitchOn:@"@SwitchName@"]) {
//make this true or false based on what you want it to do
return true;
}
return old_@Function@(_this);
}
%ctor {
MSHookFunction((void *)getRealOffset(@FunctionOffset@), (void *)@Function@, (void **)&old_@Function@);
}
C++:
@FunctionType@(*old_@Function@)(void *_this);
@FunctionType@ @Function@(void *_this){
if([switches isSwitchOn:@"@SwitchName@"]) {
return old_@Function@(_this) * [[switches getValueFromSwitch:@"@SwitchName@"] floatValue];
}
return old_@Function@(_this);
}
%ctor {
MSHookFunction((void *)getRealOffset(@FunctionOffset@), (void *)@Function@, (void **)&old_@Function@);
}
C++:
/*use instance to prevent crashing, idk if you have that problem too
hook to the update, start or awake function, if you use start or awake it wont update instantly, so turn those on before joining a game
*/
void(*old_Update)(void *instance);
void Update(void *instance){
if([switches isSwitchOn:@"@SWITCHNAME@"]) {
//type is the function type, float,int ect
*(TYPE *) ((uint64_t)instance + @FIELDOFFSET@) = @VALUE@;
}
return old_Update(instance);
}
%ctor {
MSHookFunction((void *)getRealOffset(@UPDATE OFFSET@), (void *)Update, (void **)&old_Update);
}
C++:
/*use instance to prevent crashing, idk if you have that problem too
hook to the update, start or awake function, if you use start or awake it wont update instantly, so turn those on before joining a game
*/
void(*old_Update)(void *instance);
void Update(void *instance){
if([switches isSwitchOn:@"@SWITCHNAME@"]) {
//type is the function type, float,int ect
*(TYPE *) ((uint64_t)instance + @FIELDOFFSET@) = @VALUE@;
}
if([switches isSwitchOn:@"@SWITCHNAME@"]) {
//type is the function type, float,int ect
*(TYPE *) ((uint64_t)instance + @FIELDOFFSET@) = @VALUE@;
}
if([switches isSwitchOn:@"@SWITCHNAME@"]) {
//type is the function type, float,int ect
*(TYPE *) ((uint64_t)instance + @FIELDOFFSET@) = @VALUE@;
}
return old_Update(instance);
}
%ctor {
MSHookFunction((void *)getRealOffset(@UPDATE OFFSET@), (void *)Update, (void **)&old_Update);
}
UNITY FRAMEWORK HOOK
Use this under your void setup() {, the mshookfunction will cause the game to crash, this method wont
Code:
HOOK(@OFFSET@, @FUNCTION@, old_@FUNCTION);
how to use:
you can copy and paste the template above your setup function (below the import lines)
and fill in the info. What you do next is add your switches. Here are the Ted2 Switches available
C++:
//patching offsets directly, without switch
patchOffset(0x1002DB3C8, "0xC0035FD6");
patchOffset(0x10020D2D4, "0x00008052C0035FD6");
// You can write as many bytes as you want to an offset
patchOffset(0x10020D3A8, "0x00F0271E0008201EC0035FD6");
// or
patchOffset(0x10020D3A8, "00F0271E0008201EC0035FD6");
// spaces are fine too
patchOffset(0x10020D3A8, "00 F0 27 1E 00 08 20 1E C0 03 5F D6");
// Empty switch - usefull with hooking
[switches addSwitch:@"Masskill"
description:@"Teleport all enemies to you without them knowing"];
// Offset Switch with one patch
[switches addOffsetSwitch:@"God Mode"
description:@"You can't die"
offsets:{0x1005AB148}
bytes:{"0x00E0BF12C0035FD6"}];
// Offset switch with multiple patches
[switches addOffsetSwitch:@"One Hit Kill"
description:@"Enemy will die instantly"
offsets:{0x1001BB2C0, 0x1002CB3B0, 0x1002CB3B8}
bytes:{"0x00E0BF12C0035FD6", "0xC0035FD6", "0x00F0271E0008201EC0035FD6"}];
// Textfield Switch - used in hooking
[switches addTextfieldSwitch:@"Custom Gold"
description:@"Here you can enter your own gold amount"
inputBorderColor:UIColorFromHex(0xBD0000)];
// Slider Switch - used in hooking
[switches addSliderSwitch:@"Custom Move Speed"
description:@"Set your custom move speed"
minimumValue:0
maximumValue:10
sliderColor:UIColorFromHex(0xBD0000)];
}
Last edited: