What's new

XDevkit.IXboxConsole' does not contain a definition for 'OnStdNotify'

  • Thread starter Fire30
  • Start date
  • Views 2,528
Fire30

Fire30

Seasoned Member
Messages
7,222
Reaction score
2,364
Points
635
Sin$
0
I am creating trying to debug an application, but I can not seem to compile this code even though I am trying to use it the same way that the documentation does.

The error I am getting is
Error 1 'XDevkit.IXboxConsole' does not contain a definition for 'OnStdNotify' and no extension method 'OnStdNotify' accepting a first argument of type 'XDevkit.IXboxConsole' could be found (are you missing a using directive or an assembly reference?)

Here is the code I am using:
Code:
using XDevkit;
//stuff
// ...

//now we are in main
IXboxManager xboxMgr = new XboxManager();
IXboxConsole xbCon = xboxMgr.OpenConsole(xboxMgr.DefaultConsole);
var Address = 0x8906F378;
xbCon.DebugTarget.SetBreakpoint(Address);
xbCon.OnStdNotify += (EventType, EventInfo) =>
{
          if (EventType != XboxDebugEventType.ExecutionBreak ||  eventInfo.Info.Address != Address) return;
          // stuff that does not matter
}

Could it be that I am using a fairly old sdk? All I could find was the 2011 August sdk.
 
Last edited:
S

Sketch

Enthusiast
Messages
531
Reaction score
278
Points
170
Sin$
7
Code:
IXboxManager xboxMgr = new XboxManager();
Should be
Code:
IXboxManager xboxMgr = new IXboxManager();
 
Never mind. Scrap that.
You don't need to do that.
Code:
private IXboxManager xboxMgr;
 
Xeren

Xeren

♦♦♦ God Complex ♦♦♦
Legendary Veteran Programmer Modder
Messages
5,668
Reaction score
2,107
Points
795
Sin$
0
I am creating trying to debug an application, but I can not seem to compile this code even though I am trying to use it the same way that the documentation does.

The error I am getting is
Error 1 'XDevkit.IXboxConsole' does not contain a definition for 'OnStdNotify' and no extension method 'OnStdNotify' accepting a first argument of type 'XDevkit.IXboxConsole' could be found (are you missing a using directive or an assembly reference?)

Here is the code I am using:
Code:
using XDevkit;
//stuff
// ...

//now we are in main
IXboxManager xboxMgr = new XboxManager();
IXboxConsole xbCon = xboxMgr.OpenConsole(xboxMgr.DefaultConsole);
var Address = 0x8906F378;
xbCon.DebugTarget.SetBreakpoint(Address);
xbCon.OnStdNotify += (EventType, EventInfo) =>
{
          if (EventType != XboxDebugEventType.ExecutionBreak ||  eventInfo.Info.Address != Address) return;
          // stuff that does not matter
}

Could it be that I am using a fairly old sdk? All I could find was the 2011 August sdk.
It doesn't appear in my library neither. Might want to try another way to determine when the breakpoint is hit. All I know is that it is in the paused state when that happens.
 
Fire30

Fire30

Seasoned Member
Messages
7,222
Reaction score
2,364
Points
635
Sin$
0
It doesn't appear in my library neither. Might want to try another way to determine when the breakpoint is hit. All I know is that it is in the paused state when that happens.
i dont think any of that will help .
Code:
IXboxManager xboxMgr = new XboxManager();
Should be
Code:
IXboxManager xboxMgr = new IXboxManager();
 
Never mind. Scrap that.
You don't need to do that.
Code:
private IXboxManager xboxMgr;

ok so I got it to compile, and it runs, but it exits as soon as it starts. Should I just use a sleep function so that it exectutes for longer? Or is there something else I should do?
 
Xeren

Xeren

♦♦♦ God Complex ♦♦♦
Legendary Veteran Programmer Modder
Messages
5,668
Reaction score
2,107
Points
795
Sin$
0
ok so I got it to compile, and it runs, but it exits as soon as it starts. Should I just use a sleep function so that it exectutes for longer? Or is there something else I should do?
You could simply use sleep and a while loop, if you want the form to be responsive though, try something like this:
Code:
while (true)
            {
                await Task.Delay(1); //Wait for 1 millisecond
               while (true)
                    Task a = Task.Factory.StartNew(DoSomething); //Do whatever in loop
                    Task.WaitAll(a);
                    break;
                }
            }
That would run every millisecond, or at least close to it. I just noticed the second while loop as well, which I don't know if it's neccesary, but I added it in before, so it works. If you need to update the form while in the function called in StartNew, update it like this, or it will not work. This all can only be done in a 4.5 framework project by the way.
Code:
private void DoSomething()
        {
            Dispatcher.BeginInvoke(new Action(() =>
                {
                    mediaTime.Content = String.Format("{0}:{1}", CurrentAudioSettings.CurrentTime.Minutes, CurrentAudioSettings.CurrentTime.Seconds.ToString("00"));
                    mediaLength.Value = CurrentAudioSettings.CurrentTime.Ticks;
                    if (replayMedia)
                    {
                        if (CurrentAudioSettings.CurrentTime == CurrentAudioSettings.TotalTime)
                        {
                            CurrentAudioSettings.CurrentTime = new TimeSpan(0);
                        }
                    }
                }));
        }
 
Last edited:
Fire30

Fire30

Seasoned Member
Messages
7,222
Reaction score
2,364
Points
635
Sin$
0
You could simply use sleep and a while loop, if you want the form to be responsive though, try something like this:
Code:
while (true)
            {
                await Task.Delay(1); //Wait for 1 millisecond
               while (true)
                    Task a = Task.Factory.StartNew(DoSomething); //Do whatever in loop
                    Task.WaitAll(a);
                    break;
                }
            }
That would run every millisecond, or atleast close to it. I just noticed the second while loop as well, which I don't know if it's neccesary, but I added it in before, so it works. If you need to update the form while in the function called in StartNew, update it like this, or it will not work. This all can only be done is a 4.5 framework project by the way.
Code:
private void DoSomething()
        {
            Dispatcher.BeginInvoke(new Action(() =>
                {
                    mediaTime.Content = String.Format("{0}:{1}", CurrentAudioSettings.CurrentTime.Minutes, CurrentAudioSettings.CurrentTime.Seconds.ToString("00"));
                    mediaLength.Value = CurrentAudioSettings.CurrentTime.Ticks;
                    if (replayMedia)
                    {
                        if (CurrentAudioSettings.CurrentTime == CurrentAudioSettings.TotalTime)
                        {
                            CurrentAudioSettings.CurrentTime = new TimeSpan(0);
                        }
                    }
                }));
        }
Ok I got that part sorted out and am now wondering about a certain exception I am getting?

The exception I am getting is:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in WindowsFormsApplication1.exe

It occurs when I try to get the top of the stack. All the research I have done on makes it seems like it is 32/64 bit issue but that doesn't make sense..

Code:
long r4;
IXboxStackFrame functionStack = eventInfo.Info.Thread.TopOfStack; // Exception here.
functionStack.GetRegister64(XboxRegisters64.r4, out r4);
byte[] buffer = new byte[128];
uint outInfo;
uint len = 128;
xboxConsole.DebugTarget.GetMemory((uint)r4, len, buffer, out outInfo);
Debug.WriteLine(buffer);
 
Xeren

Xeren

♦♦♦ God Complex ♦♦♦
Legendary Veteran Programmer Modder
Messages
5,668
Reaction score
2,107
Points
795
Sin$
0
Ok I got that part sorted out and am now wondering about a certain exception I am getting?

The exception I am getting is:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in WindowsFormsApplication1.exe

It occurs when I try to get the top of the stack. All the research I have done on makes it seems like it is 32/64 bit issue but that doesn't make sense..

Code:
long r4;
IXboxStackFrame functionStack = eventInfo.Info.Thread.TopOfStack; // Exception here.
functionStack.GetRegister64(XboxRegisters64.r4, out r4);
byte[] buffer = new byte[128];
uint outInfo;
uint len = 128;
xboxConsole.DebugTarget.GetMemory((uint)r4, len, buffer, out outInfo);
Debug.WriteLine(buffer);
Can I see all the code? I'm not sure yet whether it is a problem with the form itself or the console.
 
Fire30

Fire30

Seasoned Member
Messages
7,222
Reaction score
2,364
Points
635
Sin$
0
Ok I looked a bit further and it seems that the exception means:

The exception that is thrown when an unrecognized HRESULT is returned from a COM method call.

hmm.. could it be that my that my sdk version and the dash version I am using are like three years apart? That is a reason why the HRESULT could be unrecognized.

get_NextStackFrame is supposed to return S_OK though on success...so it would still mean that what I am doing is not working right?

Is it also possible that get_NextStackFrame is not implemented in the xbdm plugin?

Ok it can not be the xbdm plugin not supporting it. I am getting this even if I use rgloader.

I think it is looking more likely that it is me using an old sdk. Anyone have one newer than August 2011 so I can test :wink:?

I also printed the message from the exeption. It says:

Error HRESULT E_FAIL has been returned from a call to a COM component.
 
Last edited by a moderator:
S7 Pro

S7 Pro

Seasoned Member
Modder Programmer
Messages
2,511
Reaction score
1,599
Points
560
Sin$
7
The problem is that the OnStdNotify function isn't within the IXboxConsole class. It's actually in the 'XboxConsole' class, which is entirely different.

Use this:
Code:
private XboxManager manager;
private XboxConsole console;
private bool activeConnection;
private uint connection;

public void ConnectToDev()
{
manager= new XboxManager();
console= manager.OpenConsole(manager.DefaultConsole);
connection = console.OpenConnection(null);
console.DebugTarget.ConnectAsDebugger("devmgr", XboxDebugConnectFlags.Force);
activeConnection = true;
}

From there you can invoke the function you're requesting.
 
Fire30

Fire30

Seasoned Member
Messages
7,222
Reaction score
2,364
Points
635
Sin$
0
The problem is that the OnStdNotify function isn't within the IXboxConsole class. It's actually in the 'XboxConsole' class, which is entirely different.

Use this:
Code:
private XboxManager manager;
private XboxConsole console;
private bool activeConnection;
private uint connection;

public void ConnectToDev()
{
manager= new XboxManager();
console= manager.OpenConsole(manager.DefaultConsole);
connection = console.OpenConnection(null);
console.DebugTarget.ConnectAsDebugger("devmgr", XboxDebugConnectFlags.Force);
activeConnection = true;
}

From there you can invoke the function you're requesting.
Thanks yeah I figured that out. I am having a new problem though if you look a few posts above. When I call the function
IXboxStackFrame functionStack = eventInfo.Info.Thread.TopOfStack;

I get an exception titled System.Runtime.InteropServices.COMException and the message saying Error HRESULT E_FAIL has been returned from a call to a COM component.

I also posted the code above in the pastebin link so you can see what my whole program is doing if that helps.
 
S7 Pro

S7 Pro

Seasoned Member
Modder Programmer
Messages
2,511
Reaction score
1,599
Points
560
Sin$
7
Thanks yeah I figured that out. I am having a new problem though if you look a few posts above. When I call the function
IXboxStackFrame functionStack = eventInfo.Info.Thread.TopOfStack;

I get an exception titled System.Runtime.InteropServices.COMException and the message saying Error HRESULT E_FAIL has been returned from a call to a COM component.

I also posted the code above in the pastebin link so you can see what my whole program is doing if that helps.
Code:
            uint send = 0x823B6A44;
            long r5;
            xbCon.DebugTarget.SetBreakpoint(send);
            xbCon.OnStdNotify += (EventType, EventInfo) =>
            {
                if (EventType == XboxDebugEventType.ExecutionBreak && EventInfo.Info.Address == send)
                {
                    var functionStack = EventInfo.Info.Thread.TopOfStack;
                    functionStack.GetRegister64(XboxRegisters64.r5, out r5);
                    richTextBox1.Text += Convert.ToString(r5) + "\n";
                    if (Convert.ToBoolean(EventInfo.Info.IsThreadStopped))
                    {
                        bool flag2;
                        EventInfo.Info.Thread.Continue(true);
                        xbCon.DebugTarget.Go(out flag2);
                        xbCon.DebugTarget.FreeEventInfo(EventInfo.Info);
                        xbCon.DebugTarget.RemoveAllBreakpoints();
                    }
                }
            };

This was a small hook I had to print some integers on a function I was reversing.

Edit:: Just put that in a button click handler or something, and let me know if it works. If it doesn't, you're going to probably need a newer SDK.
 
Last edited by a moderator:
Fire30

Fire30

Seasoned Member
Messages
7,222
Reaction score
2,364
Points
635
Sin$
0
Code:
            uint send = 0x823B6A44;
            long r5;
            xbCon.DebugTarget.SetBreakpoint(send);
            xbCon.OnStdNotify += (EventType, EventInfo) =>
            {
                if (EventType == XboxDebugEventType.ExecutionBreak && EventInfo.Info.Address == send)
                {
                    var functionStack = EventInfo.Info.Thread.TopOfStack;
                    functionStack.GetRegister64(XboxRegisters64.r5, out r5);
                    richTextBox1.Text += Convert.ToString(r5) + "\n";
                    if (Convert.ToBoolean(EventInfo.Info.IsThreadStopped))
                    {
                        bool flag2;
                        EventInfo.Info.Thread.Continue(true);
                        xbCon.DebugTarget.Go(out flag2);
                        xbCon.DebugTarget.FreeEventInfo(EventInfo.Info);
                        xbCon.DebugTarget.RemoveAllBreakpoints();
                    }
                }
            };

This was a small hook I had to print some integers on a function I was reversing.

Edit:: Just put that in a button click handler or something, and let me know if it works. If it doesn't, you're going to probably need a newer SDK.
Ok I will try it when I get home. I thought maybe the SDK had something to do with it as I am using one from August 2011 lol. I can't find any newer ones lol.
 
S

Sketch

Enthusiast
Messages
531
Reaction score
278
Points
170
Sin$
7
May I ask what you are working on? Just had me curious with the sprintfoffset.
 
Fire30

Fire30

Seasoned Member
Messages
7,222
Reaction score
2,364
Points
635
Sin$
0
Code:
            uint send = 0x823B6A44;
            long r5;
            xbCon.DebugTarget.SetBreakpoint(send);
            xbCon.OnStdNotify += (EventType, EventInfo) =>
            {
                if (EventType == XboxDebugEventType.ExecutionBreak && EventInfo.Info.Address == send)
                {
                    var functionStack = EventInfo.Info.Thread.TopOfStack;
                    functionStack.GetRegister64(XboxRegisters64.r5, out r5);
                    richTextBox1.Text += Convert.ToString(r5) + "\n";
                    if (Convert.ToBoolean(EventInfo.Info.IsThreadStopped))
                    {
                        bool flag2;
                        EventInfo.Info.Thread.Continue(true);
                        xbCon.DebugTarget.Go(out flag2);
                        xbCon.DebugTarget.FreeEventInfo(EventInfo.Info);
                        xbCon.DebugTarget.RemoveAllBreakpoints();
                    }
                }
            };

This was a small hook I had to print some integers on a function I was reversing.

Edit:: Just put that in a button click handler or something, and let me know if it works. If it doesn't, you're going to probably need a newer SDK.

Nope it didn't work for me. Still getting
Error HRESULT E_FAIL has been returned from a call to a COM component.


May I ask what you are working on? Just had me curious with the sprintfoffset.

I am trying to better understand a game so I thought seeing what was being passed in sprtinf would be the way to go. Granted right now I am just trying to get it to work with an xex I made where all it does is a sprintf in a loop.


Anyways does anybody have a link to a newer sdk.. I can't find one and it is sort of annoying me lol.
 
S

Sketch

Enthusiast
Messages
531
Reaction score
278
Points
170
Sin$
7
Nope it didn't work for me. Still getting
Error HRESULT E_FAIL has been returned from a call to a COM component.




I am trying to better understand a game so I thought seeing what was being passed in sprtinf would be the way to go. Granted right now I am just trying to get it to work with an xex I made where all it does is a sprintf in a loop.


Anyways does anybody have a link to a newer sdk.. I can't find one and it is sort of annoying me lol.
I don't think we can provide warez. http://www.xbox360iso.com/xbox360-xdk-20675-t344997.html
I got mine from there.
 
S7 Pro

S7 Pro

Seasoned Member
Modder Programmer
Messages
2,511
Reaction score
1,599
Points
560
Sin$
7
Well if what I posted didn't work, the issue is your outdated SDK.
 
D

Deleted member 847964

No sympathy for the Devil; keep that in mind
Seasoned Veteran Grizzled Veteran
Messages
1,172
Solutions
6
Reaction score
275
Points
220
Sin$
0
If there is anyone still active and familiar with how to use this I could use some tips.

Would I be able to use this to read register values, it looks like that's what it's for? For a lot of things I'm trying to do I can only find the pointers I'm looking for stored in registers and can't find them by searching memory. It would also be useful for comparison when something is shared like health/enemy health.

I'm not having much luck with it right now the way it's written above, when I try to get the top of the stack it throws a null reference error but my connection is active.

Any help would be much appreciated

*Solved
 
Last edited:
Top Bottom
Login
Register