-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore/documentation code & readme #3
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
libusb1 = "*" | ||
|
||
[requires] | ||
python_version = "3.7" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,34 @@ | ||
A tool to dump the ROM of the Xbox DVD Movie Playback Kit dongle. | ||
## A tool to dump the ROM of the Xbox DVD Movie Playback Kit dongle. | ||
|
||
The ROM is prefixed with version information and the length of the contained XBE. | ||
The XBE certificate region is the allowed DVD playback region. | ||
The section of the XBE is compressed using LZX, 128kiB window size, 32kiB blocks. | ||
|
||
## Prerequisites | ||
|
||
Make sure you satisfy the following requirements: | ||
|
||
* basic python know-how | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line should be removed - it's expected when people look at github. (On a somewhat related note: We might eventually have a CI version which is bundled into a Windows executable, but that's not relevant for now) |
||
* pipenv | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have never used it. https://github.com/pypa/pipfile implies that it isn't finalized yet? |
||
* libusb1 | ||
* a way to attach the DVD Kit dongle to your computer i.e. this [[adapter]](https://www.amazon.ca/Mcbazel-Female-Controller-Adapter-Cable/dp/B000RT2868). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* the dongle itself :) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
### Setup | ||
|
||
macOS only: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be more explanatory to avoid giving the impression that this only works on macOS. |
||
```sh | ||
brew install libusb | ||
``` | ||
|
||
```sh | ||
pipenv install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this would have to be run in the cloned git repo folder? |
||
``` | ||
|
||
### Usage | ||
|
||
Connect the dongle to your computer and run: | ||
```sh | ||
pipenv shell | ||
python dump-dvd-kit.py | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,11 @@ | |
import usb1 | ||
import struct | ||
|
||
REGION_LOOKUP = ["region-free", "North-America", | ||
"Europe", "Southeast Asia", | ||
"Latin America", "Africa", | ||
"China", "MPAA", "International"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these confirmed to match the region in the dongles? The full list also implies that we have encountered all of those in the real world (which likely isn't the case). |
||
|
||
with usb1.USBContext() as context: | ||
|
||
vid = 0x045e | ||
|
@@ -13,15 +18,15 @@ | |
|
||
handle = context.openByVendorIDAndProductID(vid, pid, skip_on_error=True) | ||
if handle is None: | ||
# Device not present, or user is not allowed to access device. | ||
print("oops?!") | ||
print("Device not present, or user is not allowed to access the device") | ||
sys.exit() | ||
|
||
|
||
rom_info = 1 | ||
info = handle.controlRead(usb1.REQUEST_TYPE_VENDOR | usb1.RECIPIENT_INTERFACE, rom_info, 0, interface, 6) | ||
|
||
(version, code_length) = struct.unpack("<HI", info) | ||
print("Version: %X.%X" % (version >> 8, version & 0xFF)) | ||
print("Size: " + str(code_length) + " bytes") | ||
|
||
with open("dvd-dongle-rom.bin", 'wb') as f: | ||
|
||
|
@@ -44,6 +49,7 @@ | |
f.write(data) | ||
remaining -= chunkSize | ||
cursor += chunkSize | ||
print("Size: "+ str(code_length) + " bytes(written to dvd-dongle-rom.bin)") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add space between "bytes" and "(written". Maybe just " bytes (dvd-dongle-rom.bin)". To avoid issues in the future, we might also want to have a temporary variable for the filename (as it's used more than once, and might be changed eventually). |
||
|
||
# Do some sanity checks and print out DVD region | ||
|
||
|
@@ -58,4 +64,6 @@ | |
SizeOfRawData = struct.unpack('I', xbe[SectionHeaders+16:SectionHeaders+20])[0] | ||
assert(RawData + SizeOfRawData == SizeOfImage) | ||
GameRegion = struct.unpack('I', xbe[Certificate+160:Certificate+164])[0] | ||
print("Region: " + str(GameRegion)) | ||
print("Region(" + str(GameRegion) + "): " + REGION_LOOKUP[GameRegion]) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the first headline, so it should be
#
, not##
.Also remove trailing dot/period if it's no longer a real sentence.
I'd suggest to keep this as a sentence instead.
If we really want to have a headline, we should just use
# dump-dvd-kit