nxdk icon indicating copy to clipboard operation
nxdk copied to clipboard

`DbgPrompt` functions as expected

Open GXTX opened this issue 3 years ago • 2 comments

char resp[255];
char *prp = "hello world: ";

DbgPrompt(prp, &resp, 255);
DbgPrint("%s\n", resp);

funcs

Not sure why this function has a description as if it were broken. Please update. The prototype is also wrong.

https://github.com/XboxDev/nxdk/blob/c081dd5880188e95ead46e464005900fac436570/lib/xboxkrnl/xboxkrnl.h#L4257

Btw the response length isn't taken into account, you can overflow easily (or could be from my types, idk)

GXTX avatar Feb 18 '22 08:02 GXTX

Not sure why this function has a description as if it were broken.

I assume this function crashes because the export is only present in debug kernels, so if the user ran it on another kernel they likely called into NULL. cxbe could probably warn about used symbols which aren't present in all kernels.

The comment also says "XBox" which is a spelling we don't use either (as we always use "Xbox"), so the comment is likely from a bad source.

Btw the response length isn't taken into account, you can overflow easily (or could be from my types, idk)

Could be a bug / lack of features in the kernel. The API is likely from Windows and the Xbox does not necessarily implement all features. Should probably be double-checked and documented.

JayFoxRox avatar Feb 19 '22 12:02 JayFoxRox

The comment was added by me because that was what seemed to happen when I had the opportunity to try my code on a debug kit (back when this was written, which predates my involvement in the development of nxdk).

Unfortunately, this issue (again) lacks almost all useful/required info (what software is that? How is it attached, xbdm, serial? What is allegedly wrong about the function prototype?) so I don't see myself taking away time from other stuff to invest it into reproducing this in the near future.

thrimbor avatar Feb 20 '22 11:02 thrimbor