[Tutorial] RT3ME Your first XRPC tool - Part 2

begallegal1 Nov 23, 2013

  1. begallegal1

    begallegal1 Medicine Man Lifetime Gold TeamXPG
    0/47

    Joined:
    Oct 31, 2011
    Messages:
    3,694
    Likes Received:
    3,127
    Trophy Points:
    235
    Gender:
    Male
    Location:
    In a Field of Green
    Console:
    Xbox
    Hello again all ;)

    well here we are at part2 of this series on making your own XRPC-RTE tools, this section will cover a bit more ground than part 1, but im sure everyone will follow along just fine, today we will be adding Infinite Ammo , Vision Mode Selector , and Kill Feed Spammer

    If you have not read the requirements, or part 1 , please go HERE first

    http://www.youtube.com/watch?v=UNABrv0VGt8

    [​IMG]

    [​IMG]

    also I would just like to say that even though we will be touching on some of the client aspects of these tools, we will not be adding any stats or recovery options that are only for online use, these mods are all made and tested using offline local and system link play. part2 now being released during TU4 , I have commented out the TU3 code/offsets but will leave it in our source for future use


    Ok so first lets add infinite ammo for our player, this will require 4 offsets (primary/secondary/lethal/tactical)
    we will set these cheats on a 20ms timer so our values will stay constant with every tick of the timer,
    and our buttons turn the timer on and off



    private void infamPlayerOn_Click(object sender, EventArgs e)
    {
    //Inf ammo timer on
    infammoTimer.Start();
    }

    private void infamPlayerOff_Click(object sender, EventArgs e)
    {
    //Inf ammo timer off
    infammoTimer.Stop();
    }

    private void infammoTimer_Tick(object sender, EventArgs e)
    {
    //We use this timer to update our values every 20/ms

    //Primary Weapon
    x.SetMemory(0x8328AD54, new byte[] { 0x00, 0x00, 0x00, 0x63 });
    //Secondary Weapon
    x.SetMemory(0x8328AD60, new byte[] { 0x00, 0x00, 0x00, 0x63 });
    //lethal
    x.SetMemory(0x8328AD3C, new byte[] { 0x00, 0x00, 0x00, 0x05 });
    //tactical
    x.SetMemory(0x8328AD48, new byte[] { 0x00, 0x00, 0x00, 0x05 });
    }

    Next we are going to add our "Kill Feed" spammer, the way I have set this up (which can be altered to your setup prefs using other form tools) you will need to add a text box, and 3 buttons , one button for single spams, the other 2 for constant spam on/off


    private void spamKF_Click(object sender, EventArgs e)
    {
    //Here we call SV_GameSendServerCommand to spam the kill feed with what is in//our text box a single time
    x.Call(0x824B9AB0, -1,1, "e \"" + textBox1.Text);
    }

    private void supaSpam_Click(object sender, EventArgs e)
    {
    //Forever Spam On
    KFSpamTimer.Start();
    }

    private void supaSpamOff_Click(object sender, EventArgs e)
    {
    //Forever Spam Off
    KFSpamTimer.Stop();
    }

    private void KFSpamTimer_Tick(object sender, EventArgs e)
    {
    //Here we call SV_GameSendServerCommand to spam the kill feed based on the
    //above timer being on/off(set at 250ms adjust if need)
    x.Call(0x824B9AB0, -1, 1, "e \"" + textBox1.Text);
    }



    Finally we will add another use for the SV_GameSendServerCommand, Vision mode , for this we need to add a list box (add scroll property if

    needed) we will set the vision mode to change when selected in the list box

    this will require a few things this is my way of doing it anyway :p


    //We create an enumeration of the "modes" for vision
    // (prob more available, just a random list i found)

    public enum Visions
    {
    ac130,
    ac130_enhanced,
    ac130_enhanced_mp,
    ac130_inverted,
    ac130_thermal,
    aftermath,
    black_bw,
    cheat_bw,
    coup_sunblind,
    default_night,
    default_night_mp,
    end_game,
    mpnuke,
    mpnuke_aftermath,
    mpoutro,
    near_death,
    near_death_mp
    }


    Code:
    //A method to fill our list box with the items from our above enumeration,
    // which we will call when the app starts in form_load
    public void Vision()
    {
     //Add a single line for no setting (will reset after death)
      visionList.Items.Add("None ^_^");
    
     //for each item in our enumeration add it to the list box
      foreach (Visions vis in Enum.GetValues(typeof(Visions)))
      {
      visionList.Items.Add(vis);
      }
    }
    
    Code:
     //Here we call SV_GameSendServerCommand to set the vision mode if the  
    //list box is not set to "None ^_^"
    //(resets on death, could use timer to fix this if desired)
    
       private void visionList_SelectedIndexChanged(object sender, EventArgs e)        {
                if (visionList.SelectedItem.ToString() != "None ^_^")
                {
                    x.Call(0x824B9AB0, -1,1, "J \"" + visionList.SelectedItem.ToString() + "\"");
                }        
            }
    Code:
    //So because we want our list to show up on load we call the method above aft//er we have success with connection
    
    private void Form1_Load(object sender, EventArgs e)
    {
    //Try to connect , display console info if success, error message if failed
       try
       {
         x.Connect();
         MessageBox.Show("Connected To: " + x.xbCon.Name + "\n\nConsole Type: " + x.xbCon.ConsoleType + "\n\nMounted Drives: " + x.xbCon.Drives + "\n\nCurrently Running: " + x.xbCon.RunningProcessInfo.ProgramName, "Connected!");
    
      //Call method to fill our list box with vision modes*****<<<<<
       Vision();
    }
    catch (System.Exception)
      {
         MessageBox.Show("No Console To Connect", "Error!");
      }
    }

    Complete source
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    //Add reference to XRPCLib
    using XRPCLib;

    namespace RT3ME
    {
    public partial class Form1 : Form
    {
    //Make an instance of our XRPC class
    XRPC x = new XRPC();

    public Form1()
    {
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
    //Try to connect , display console info if success, error message if failed
    try
    {
    x.Connect();
    MessageBox.Show("Connected To: " + x.xbCon.Name + "\n\nConsole Type: " + x.xbCon.ConsoleType + "\n\nMounted Drives: " + x.xbCon.Drives + "\n\nCurrently Running: " + x.xbCon.RunningProcessInfo.ProgramName, "Connected!");

    //Call method to fill our list box with vision modes
    Vision();
    }
    catch (System.Exception)
    {
    MessageBox.Show("No Console To Connect", "Error!");
    }
    }

    private void dateTime_Tick(object sender, EventArgs e)
    {
    //date/time label just for fun
    dateTimeLbl.Text = System.DateTime.Now.ToString();
    }

    private void XPG_Click(object sender, EventArgs e)
    {
    //Gotta rep XPG ^_^
    System.Diagnostics.Process.Start("http://www.xpgamesaves.com");
    }

    private void setJumpHt_Click(object sender, EventArgs e)
    {
    //Fix Fall Damage First

    //TU3
    //x.SetMemory(0x8201B424, new byte[] { 0x4F, 0xFF, 0x00, 0x00 });

    //TU4
    x.SetMemory(0x8201B50C, new byte[] { 0x4F, 0xFF, 0x00, 0x00 });

    /* //TU3 Jump Options
    //Select jump height based on numerical up/down box, we are giving 3 levels of jump here plus default
    //if (jumpLvlNumBox.Value == 0)
    //{
    // x.SetMemory(0x820151F8, new byte[] { 0x42, 0x1c, 0x00, 0x00 });
    // x.Notify(XRPC.XNotiyLogo.FLASH_LOGO, "Default Jump Set");
    //}
    //if (jumpLvlNumBox.Value == 1)
    //{
    // x.SetMemory(0x820151F8, new byte[] { 0x43, 0xFF, 0x00, 0x00 });
    // x.Notify(XRPC.XNotiyLogo.FLASH_LOGO, "Level 1 Jump Set");
    //}
    //if (jumpLvlNumBox.Value == 2)
    //{
    // x.SetMemory(0x820151F8, new byte[] { 0x45, 0xFF, 0x00, 0x00 });
    // x.Notify(XRPC.XNotiyLogo.FLASH_LOGO, "Level 2 Jump Set");
    //}
    //if (jumpLvlNumBox.Value == 3)
    //{
    // x.SetMemory(0x820151F8, new byte[] { 0x48, 0xFF, 0x00, 0x00 });
    // x.Notify(XRPC.XNotiyLogo.FLASH_LOGO, "Level 3 Jump Set");
    //}

    //Alt "switch" method for jump height as suggested by starkiller, both methods work in the exact same way
    //int jVal = Convert.ToInt32(jumpLvlNumBox.Value);
    //switch (jVal)
    //{
    // case :shocked:
    // x.SetMemory(0x820151F8, new byte[] { 0x42, 0x1c, 0x00, 0x00 });
    // break;
    // case 1:
    // x.SetMemory(0x820151F8, new byte[] { 0x43, 0xFF, 0x00, 0x00 });
    // break;
    // case 2:
    // x.SetMemory(0x820151F8, new byte[] { 0x45, 0xFF, 0x00, 0x00 });
    // break;
    // case 3:
    // x.SetMemory(0x820151F8, new byte[] { 0x48, 0xFF, 0x00, 0x00 });
    // break;
    //}*/

    //TU4 Jump Options

    int jVal = Convert.ToInt32(jumpLvlNumBox.Value);
    switch (jVal)
    {
    case :shocked:
    x.SetMemory(0x820152A8, new byte[] { 0x42, 0x1c, 0x00, 0x00 });
    break;
    case 1:
    x.SetMemory(0x820152A8, new byte[] { 0x43, 0xFF, 0x00, 0x00 });
    break;
    case 2:
    x.SetMemory(0x820152A8, new byte[] { 0x45, 0xFF, 0x00, 0x00 });
    break;
    case 3:
    x.SetMemory(0x820152A8, new byte[] { 0x48, 0xFF, 0x00, 0x00 });
    break;
    }
    }

    private void infamPlayerOn_Click(object sender, EventArgs e)
    {
    //Inf ammo timer on
    infammoTimer.Start();
    }

    private void infamPlayerOff_Click(object sender, EventArgs e)
    {
    //Inf ammo timer off
    infammoTimer.Stop();
    }

    private void infammoTimer_Tick(object sender, EventArgs e)
    {
    //We use this timer to update our values every 20/ms

    //TU3
    ////Primary Weapon
    //x.SetMemory(0x8328AAD4, new byte[] { 0x00, 0x00, 0x00, 0x63 });
    ////Secondary Weapon
    //x.SetMemory(0x8328AAE0, new byte[] { 0x00, 0x00, 0x00, 0x63 });
    ////Flash
    //x.SetMemory(0x8328AAC8, new byte[] { 0x00, 0x00, 0x00, 0x05 });
    ////Nades
    //x.SetMemory(0x8328AABC, new byte[] { 0x00, 0x00, 0x00, 0x05 });

    //TU4
    //Primary Weapon
    x.SetMemory(0x8328AD54, new byte[] { 0x00, 0x00, 0x00, 0x63 });
    //Secondary Weapon
    x.SetMemory(0x8328AD60, new byte[] { 0x00, 0x00, 0x00, 0x63 });
    //lethal
    x.SetMemory(0x8328AD3C, new byte[] { 0x00, 0x00, 0x00, 0x05 });
    //tactical
    x.SetMemory(0x8328AD48, new byte[] { 0x00, 0x00, 0x00, 0x05 });
    }

    //We create an enumeration of the "modes" for vision (prob more available, just a random list i found)
    public enum Visions
    {
    ac130,
    ac130_enhanced,
    ac130_enhanced_mp,
    ac130_inverted,
    ac130_thermal,
    aftermath,
    black_bw,
    cheat_bw,
    coup_sunblind,
    default_night,
    default_night_mp,
    end_game,
    mpnuke,
    mpnuke_aftermath,
    mpoutro,
    near_death,
    near_death_mp
    }

    //A method to fill our list box with the items from our above enumeration,
    //which we will call when the app starts in form_load
    public void Vision()
    {
    //Add a single line for no setting (will reset after death)
    visionList.Items.Add("None ^_^");

    //for each item in our enumeration add it to the list box
    foreach (Visions vis in Enum.GetValues(typeof(Visions)))
    {
    visionList.Items.Add(vis);
    }
    }

    private void visionList_SelectedIndexChanged(object sender, EventArgs e)
    {
    //Here we call SV_GameSendServerCommand to set the vision mode if the list box is not set to "None ^_^"
    //(resets on death, could use timer to fix this if desired)
    if (visionList.SelectedItem.ToString() != "None ^_^")
    {
    x.Call(0x824B9AB0, -1,1, "J \"" + visionList.SelectedItem.ToString() + "\"");
    }
    }

    private void spamKF_Click(object sender, EventArgs e)
    {
    //Here we call SV_GameSendServerCommand to spam the kill feed a single time
    x.Call(0x824B9AB0, -1, 1, "e \"" + textBox1.Text);
    }

    private void supaSpam_Click(object sender, EventArgs e)
    {
    //Forever Spam On
    KFSpamTimer.Start();
    }

    private void supaSpamOff_Click(object sender, EventArgs e)
    {
    //Forever Spam Off
    KFSpamTimer.Stop();
    }

    private void KFSpamTimer_Tick(object sender, EventArgs e)
    {
    //Here we call SV_GameSendServerCommand to spam the kill feed based on the above timer on/off (set at 250ms)
    x.Call(0x824B9AB0,-1, 1, "e \"" + textBox1.Text);
    }
    }
    }

    In part 3 we will be adding some suggested alternate methods for the work we have done to help build some skills, tweak some of what we have done to get more flexibility out of our cheats, and move on to some of the biggies like client index and what it can be used for.

    happy coding and see you in part 3 :begal:
     

    Attached Files:

    • Like Like x 4
  2. Vash The Stampede

    Vash The Stampede Developer XPG Developer TeamXPG
    205/282

    Joined:
    Mar 13, 2011
    Messages:
    4,411
    Likes Received:
    2,304
    Trophy Points:
    205
    Gender:
    Male
    Console:
    Xbox
    thanks begallegal1 i will give this a go
     
    • Like Like x 1
  3. Coder123

    Coder123 Finnish Modder XPG Developer TeamXPG
    105/188

    Joined:
    Jan 21, 2012
    Messages:
    1,954
    Likes Received:
    717
    Trophy Points:
    105
    Gender:
    Male
    Location:
    Finland
    Console:
    Xbox
    Just few notes related to SV_GameSendServerCommand

    0, -1

    the first one is clientIndex and second one is type. Type can be 0 or then 1, -1 is not valid type. I suggest you change it to this

    -1, 1 = this will be for all clients with 1 as the type (the type doesent really matter, but on bo2 it did change few things)
     
    • Like Like x 1
  4. begallegal1

    begallegal1 Medicine Man Lifetime Gold TeamXPG
    235/282

    Joined:
    Oct 31, 2011
    Messages:
    3,694
    Likes Received:
    3,127
    Trophy Points:
    235
    Gender:
    Male
    Location:
    In a Field of Green
    Console:
    Xbox
    I think your just seein stuff , that's clearly what I had
    :LOL: thanks coder, you know im a noob to these tools too :p
     
    • Like Like x 1
  5. Alcatraz3222

    Alcatraz3222 Newbie
    0/47

    Joined:
    Mar 6, 2013
    Messages:
    52
    Likes Received:
    33
    Trophy Points:
    0
    Console:
    Xbox
    Begallegal the visions don't work for me
     
  6. begallegal1

    begallegal1 Medicine Man Lifetime Gold TeamXPG
    235/282

    Joined:
    Oct 31, 2011
    Messages:
    3,694
    Likes Received:
    3,127
    Trophy Points:
    235
    Gender:
    Male
    Location:
    In a Field of Green
    Console:
    Xbox
    then you must have missed something
     
  7. Alcatraz3222

    Alcatraz3222 Newbie
    0/47

    Joined:
    Mar 6, 2013
    Messages:
    52
    Likes Received:
    33
    Trophy Points:
    0
    Console:
    Xbox
    I tested your tool and same, don't work for me, the jump and others work perfect
     
  8. demondylan

    demondylan Newbie
    0/47

    Joined:
    Oct 9, 2011
    Messages:
    36
    Likes Received:
    3
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Michigan
    Console:
    Xbox
    i keep getting this error what am i doing wrong new to microsoft visual studios and c# more developed in java :p
    [​IMG]
     
  9. Designs

    Designs Newbie
    0/47

    Joined:
    Nov 15, 2013
    Messages:
    27
    Likes Received:
    5
    Trophy Points:
    0
    You are missing the Timer in form designs. Get a Timer on the form design and name it to infammoTimer. ;)
     

Share This Page

Close