Skip to content

Instantly share code, notes, and snippets.

@landaire
Last active November 23, 2020 22:12
Show Gist options
  • Save landaire/f0ed787c5ca9beb1c06d to your computer and use it in GitHub Desktop.
Save landaire/f0ed787c5ca9beb1c06d to your computer and use it in GitHub Desktop.
Xbox 360 Dev Kit Controller Disconnect

Why controllers get disconnected, and why am I making this note?

Controllers get disconnected because they fail an authentication check that Microsoft broke at some point in time. Some people are unable to obtain newer recoveries because they simply do not have contacts or access to a GDN account, and are stuck on one of these broken recoveries

What do to fix making

Patch RgcSecAuthenticateDeviceAsyncStateMachine + 0x704 (should be a bge instruction, where if cr6 -- the result of r11 >= r10 -- then the authentication succeeds) so that this always branches to the "successful" block of code leaving the auth fail code as simply dead, unreachable code.

RgcSecAuthenticateDeviceAsyncStateMachine target

The address of this method of course changes from build to build, so you'll have to use a static address. I'm not sure what recovery/kernel revision I originally wrote this code for (I think 15574.0 kernel?) and I'm too lazy to find out for sure, but it should be enough to get you going:

void PatchControllerDisconnect()
{
    int branch = 0x4800008C;
    // some macro function that calls XbdmSetMem or whatever
    SetMemory((LPVOID)0x80127D04, (LPCVOID)&branch, 4);
}

The above code was originally a part of LaunchCode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment