Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
Fixed issues #6, #7
Browse files Browse the repository at this point in the history
Moved another few bytes to heap
  • Loading branch information
nefarius committed Oct 3, 2018
1 parent ca03977 commit c34afa9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@
/Debug
/sys/Debug
/sys/ARM/Debug
/lib/Debug (dynamic)/*.log
/sys/RCa25584
3 changes: 2 additions & 1 deletion sys/Xusb.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_XUSB_UNKNOWN_2,
#define XUSB_LEDSET_SIZE 0x03
#define XUSB_LEDNUM_SIZE 0x01
#define XUSB_INIT_STAGE_SIZE 0x03
#define XUSB_BLOB_STORAGE_SIZE 0x26
#define XUSB_BLOB_STORAGE_SIZE 0x2A

#define XUSB_BLOB_00_OFFSET 0x00
#define XUSB_BLOB_01_OFFSET 0x03
Expand All @@ -58,6 +58,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_XUSB_UNKNOWN_2,
#define XUSB_BLOB_04_OFFSET 0x0C
#define XUSB_BLOB_05_OFFSET 0x20
#define XUSB_BLOB_06_OFFSET 0x23
#define XUSB_BLOB_07_OFFSET 0x26

#define XUSB_IS_DATA_PIPE(_x_) ((BOOLEAN)(_x_->PipeHandle == (USBD_PIPE_HANDLE)0xFFFF0081))
#define XUSB_IS_CONTROL_PIPE(_x_) ((BOOLEAN)(_x_->PipeHandle == (USBD_PIPE_HANDLE)0xFFFF0083))
Expand Down
23 changes: 16 additions & 7 deletions sys/buspdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ VOID Pdo_EvtIoInternalDeviceControl(
PURB urb;
PPDO_DEVICE_DATA pdoData;
PIO_STACK_LOCATION irpStack;
PXUSB_DEVICE_DATA pXusbData;
PUCHAR blobBuffer;


TraceEvents(TRACE_LEVEL_VERBOSE, TRACE_BUSPDO, "%!FUNC! Entry");
Expand Down Expand Up @@ -629,13 +631,20 @@ VOID Pdo_EvtIoInternalDeviceControl(
switch (urb->UrbControlTransfer.SetupPacket[6])
{
case 0x04:
//
// Xenon magic
//
COPY_BYTE_ARRAY(urb->UrbControlTransfer.TransferBuffer, P99_PROTECT({
0x31, 0x3F, 0xCF, 0xDC
}));
status = STATUS_SUCCESS;
if (pdoData->TargetType == Xbox360Wired)
{
pXusbData = XusbGetData(hDevice);
blobBuffer = WdfMemoryGetBuffer(pXusbData->InterruptBlobStorage, NULL);
//
// Xenon magic
//
RtlCopyMemory(
urb->UrbControlTransfer.TransferBuffer,
&blobBuffer[XUSB_BLOB_07_OFFSET],
0x04
);
status = STATUS_SUCCESS;
}
break;
case 0x14:
//
Expand Down
4 changes: 3 additions & 1 deletion sys/xusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ NTSTATUS Xusb_AssignPdoContext(WDFDEVICE Device)
// 5
0x01, 0x03, 0x03,
// 6
0x05, 0x03, 0x00
0x05, 0x03, 0x00,
// 7
0x31, 0x3F, 0xCF, 0xDC
}));

// I/O Queue for pending IRPs
Expand Down

0 comments on commit c34afa9

Please sign in to comment.