1. lis r3, 0xfirstHalfOfAddress
2. li r4, 0xonValue
3. stb r4, 0xsecondHalfOfAddress(r3)
1. Loading the first 2 bytes of the address into the register 3 (r3)
2. Loading the value that you are using to turn on the mod into register 4 (r4)
3. Storing that byte at the address that you loaded
lis r3, 0x00F4 #First half of the address for primary ammo
li r4, 0x64 #100 In Hex.
stb r4, 0x4DE8(r3) #Storing r4 at primary ammo address
Line 1: 3C 60 00 F4
Line 2: 38 80 00 64
Line 3: 98 83 4D E8
_main:
li r3, 0 #Local client number
li r4, 0x14 #DPAD_UP
bl 0x0018EEF8 #Key_IsDown Address
cmpwi r3, 0
beq 0x84 (end to fps)
bl 0x4C55DC #Address where the no clip function is stored
b 0x84 (end to fps)
//now put this at the address
_main:
lis r3, 0xF4
li r4, 0x01
stb r4, 0x779F(r3)
b end
end:
blr
using System.IO;
using System.Diagnostics;
public OpenFileDialog OFD = new OpenFileDialog();//this is basically just renaming the OpenFileDialog to 'OFD' and you will have access the the extensions of the class
OFD.Filter = ".ELF Files|*.elf";//this makes it so when you are choosing a file, it only lets you choose a .ELF file
if (OFD.ShowDialog() == DialogResult.OK)
{
if (OFD.SafeFileName != "default_mp.elf")//if the SafeFileName does not equal default_mp.elf it will do the following
{
MessageBox.Show("make sure you have not rename the .elf file", "Not Found (ERROR)", MessageBoxButtons.OK);
}
else//otherwise (if it does) then it will do this
{
textBox1.Text = OFD.FileName;//this makes it so that the textbox in the designer will show the path of the file
MessageBox.Show(OFD.SafeFileName + " .ELF file is now ready to modify", "Found", MessageBoxButtons.OK);
}
}
if (chromePlayers.Checked == true)
{
BigEndianWriter bew = new BigEndianWriter(new MemoryStream(File.ReadAllBytes(OFD.FileName)));//sets BigEndianWriter
int myMod = 0x01;//this is the value to turn the mod on (the bytes)
bew.BaseStream.Position = 0x4783CB;//this is the address of the mod
bew.Write(myMod);//this will write the value at the address
bew.Close();//closes
}
if (File.Exists("Debug.bat"))//if Debug.bat exists (you will also need scetool, make_fself, batch file, etc) but you can find it in one of my builders or someone elses
{
System.Threading.Thread loading = new System.Threading.Thread(new System.Threading.ThreadStart(ThreadProc));//we will get to this later
Process pro = new Process();
pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
pro.StartInfo.FileName = "Debug.bat";
pro.Start();
MessageBox.Show("Your Modified .SELF has been built", "Build Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
}//all of this is pretty self explanatory (its just using System.Diagnostics to execute the process of the .bat file
else
{
MessageBox.Show("You need to make sure you have zlib.dll !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
public static void ThreadProc()
{
}//this is just blank lol but you need this (it is the Thread Target)
Copyright © 2024, NextGenUpdate.
All Rights Reserved.