Jump to content

Help with Code Inject


Go to solution Solved by Guest,

5 posts in this topic

Recommended Posts

Posted

This is my first time attempting to code inject so can someone help me and tell me what to write in the Tweak.xm file and explain why.

 

I am hacking a SUB R0, R0, #1 Here is a pic from IDA

 

ida.png

 

 

 

 

Here is the HEX value :

 

hex.png

  • Solution
Posted (edited)

You first need the writeData header. Get it here: https://www.dropbox.com/s/ffr9t3w25noyxn3/writeData.h?dl=0

 

You put the file in your hack folder. Your Tweak.xm will be like this:

 

#include <substrate.h>
#include "writeData.h"

%ctor{
writeData(0x11E468, 0x0000A0E1);
}
This is if you want to NOP it.

 

In general, your Tweak.xm will be like this:

 

#include <substrate.h>
#include "writeData.h"

%ctor{
writeData(0xOFFSET, 0xINSTRUCTION);
}
Updated by Guest
Posted

You first need the writeData header. Get it here: https://www.dropbox.com/s/ffr9t3w25noyxn3/writeData.h?dl=0

 

You put the file in your hack folder. Your Tweak.xm will be like this:

 

#include <substrate.h>
#include "writeData.h"

%ctor{
writeData(0x11E468, 0x0000A0E1);
}
This is if you want to NOP it.

 

In general, your Tweak.xm will be like this:

 

#include <substrate.h>
#include "writeData.h"

%ctor{
writeData(0xOFFSET, 0xINSTRUCTION);
}

Thanks man. Also how would you know whether to use 2byte code or 4byte?

Posted

Thanks man. Also how would you know whether to use 2byte code or 4byte?

When the hex is like 00 00 00 00 you use 4 byte.

When the hex is like 00 00 you use 2 byte.

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