Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
bfixer117

C#
Need Some Help

5 posts in this topic

So I've been wondering how to make a program connect to the Xbox and poke changes so lets say i want to make a xex poker for example or what if i just wanted it to connect to the xbox how would i go about doing this.

Share this post


Link to post
Share on other sites

Here's a quick rundown.

 


Setting things up


First, you'll want to add xdevkit.dll to your project. Right-click on "References" in your project's tree in the Solution Explorer and select "Add Reference." In the dialog that pops up, click "Browse" and find your xdevkit.dll. Close it.

 

0E3jZ8K.png

 

UfnTF6e.png

 

Now open up the source code file for your main form (or whatever form you want to do poking with). Add this line at the top:

using XDevkit;

Next, add these private members to your form's class. These will hold the objects we'll be using to access XDevkit functions.

private XboxManagerClass xboxManager = null;private XboxConsole xboxConsole = null;private IXboxDebugTarget debugTarget = null;


Connecting


Now we need to connect to your Xbox. Put this code in the event handler that you want to use to connect (it can be Load, or a button click, for example):

try{    // Try connecting to the console    xboxManager = new XboxManagerClass();    xboxConsole = xboxManager.OpenConsole("CONSOLE IP GOES HERE"); // You might want to grab the IP from a textbox or something    debugTarget = xboxConsole.DebugTarget;    debugTarget.ConnectAsDebugger("PROGRAM NAME GOES HERE", XboxDebugConnectFlags.Force);}catch (Exception ex){    // Something went wrong - display an error message    // This is just an example, you can do whatever you want here    MessageBox.Show("Unable to connect to your console.\nPlease check the connection and then try again:\n\n" + ex.ToString(), Text, MessageBoxButtons.OK, MessageBoxIcon.Error);}


Poking


Once you've connected to an Xbox and have a valid IXboxDebugTarget, you can start poking away!

Here's an example of how to poke four bytes to address 0x12345678:

byte[] bytesToPoke = new byte[] { 1, 2, 3, 4 };uint numBytesWritten;debugTarget.SetMemory(0x12345678, (uint)bytesToPoke.Length, bytesToPoke, out numBytesWritten);


Reading


If you want to read four bytes from address 0x12345678:

byte[] bytesRead = new byte[4];uint numBytesRead;debugTarget.GetMemory(0x12345678, (uint)bytesRead.Length, bytesRead, out numBytesRead);


Freezing/Unfreezing


If you poke/read a large amount of data, it might be a good idea to freeze the console first. To freeze the console, you do:

bool stopped;debugTarget.Stop(out stopped);// stopped will be set to true if the console was already frozen

And to unfreeze:

bool running;debugTarget.Go(out running);// running will be set to true if the console was already running


Disconnecting


Finally, if you want to disconnect from the console:

if (debugTarget != null){    debugTarget.DisconnectAsDebugger();    debugTarget = null;}xboxConsole = null;


So yeah, those are the basics. There's a lot more you can do (breakpoints, getting debug messages, reading the processor state, etc.), but it's more complicated. Ask if you have any specific questions.

bfixer117, OrangeMohawk and WaeV like this

Share this post


Link to post
Share on other sites

Thanks so much couldn't find it anywhere. where it explained it as easy as that thx.
And also thx for taking the time to make that mini tutorial

Edited by bfixer117

Share this post


Link to post
Share on other sites

so i know that the xdevkit uses the XboxManager. This is where i got stuck everytime i tried making a program like this  is it would say:

Interop type 'XDevkit.XboxManagerClass' cannot be embedded. Use the applicable interface instead.
How would i fix this issue and what would the applicable interface be?

Share this post


Link to post
Share on other sites

ok i fixed it i changed: 

private XboxManagerClass xboxManager = null;

to:

private IXboxManager xboxManager;

i used this because i looked at assembly's XBDM code to see how Assembly connects to a xbox

what i dont get is if i look in the  IXboxManager part of the dll i dont see XboxManager

1mq4zc20fwffvss6g.jpg
Edited by bfixer117

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0