Skip to content

Commit 1f5ebf9

Browse files
# refacor naming scheme
# added new 0.9.0 MOUSE hash to mcpx.c # modified print output.
1 parent 50df340 commit 1f5ebf9

27 files changed

+1843
-2101
lines changed

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
################################################################################
2-
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3-
################################################################################
4-
5-
/.vs/XboxBiosTools
1+
2+
.vs
63
*.exe
74
*.pdb
85
*.bin

DecodeSettings.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,37 @@ Specify the xcode format
1616
| `{data}` | The data string |
1717
| `{comment}` | The xcode comment |
1818

19-
`format_str={offset} {op} {addr} {data} {comment}`
20-
- `0080:` `xc_mem_write` `0x0` `0xF4` `; write hlt instr to addr 0x0`
19+
```
20+
format_str={offset}: {op} {addr} {data} {comment}
21+
```
22+
23+
`> 0080: xc_mem_write, 0x0, 0xF4 ; <comment>`
24+
25+
```
26+
format_str=xcode<{op}, {addr}, {data}> {comment}
27+
```
2128

22-
`format_str=xcode<{op}, {addr}, {data}> {comment}`
23-
- `xcode<` `xc_mem_write` `,` `0x0` `,` `0xF4` `>` `; write hlt instr to addr 0x0`
29+
`> xcode<xc_mem_write, 0x0, 0xF4> ; <comment>`
2430

2531
---
2632

2733
Specify the address format in a jump instruction.
2834

29-
| `jmp_str=` | Desc |
30-
| --------- | ------------- |
31-
| `{label}` | The label |
35+
| `jmp_str=<expression>` | Desc |
36+
| --------- | ------------- |
37+
| `{label}` | The label |
38+
39+
```
40+
jmp_str={label}
41+
```
3242

33-
- `xcode<xc_jmp, lb1, 0x0>`
34-
- `xcode<xc_jmp, lb1-$-4, 0x0>`
43+
`xcode<xc_jmp, label_1, 0x0>`
44+
45+
```
46+
jmp_str={label}-$-4
47+
```
48+
49+
`xcode<xc_jmp, labe1-$-4, 0x0>`
3550

3651
---
3752

@@ -44,10 +59,13 @@ Specify the number format.
4459
| `{HEX}` | HEX |
4560
| `{HEX8}` | HEX8 |
4661

47-
- `xcode<xc_mem_write, 0x0, 0xf4>`
48-
- `xcode<xc_mem_write, 0x00000000, 0x000000f4>`
49-
- `xcode<xc_mem_write, 0x0, 0xF4>`
50-
- `xcode<xc_mem_write, 0x00000000, 0x000000F4>`
62+
`xcode<xc_mem_write, 0x0, 0xf4>`
63+
64+
`xcode<xc_mem_write, 0x00000000, 0x000000f4>`
65+
66+
`xcode<xc_mem_write, 0x0, 0xF4>`
67+
68+
`xcode<xc_mem_write, 0x00000000, 0x000000F4>`
5169

5270
---
5371

README.md

Lines changed: 55 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A command-line tool for extracting and decrypting components of An Original Xbox
99
- [Encryption / Decryption](#encryption-decryption)
1010
- [What MCPX ROM do i use?](#what-mcpx-rom-do-i-use)
1111
- [Examples](#example-commands)
12+
- [Building](#building)
1213
- [Credits / Resources](#credits-resources)
1314

1415
## Commands
@@ -20,18 +21,16 @@ A command-line tool for extracting and decrypting components of An Original Xbox
2021
| [`/bld`](#build-bios-command) | Build a BIOS |
2122
| [`/split`](#split-bios-command) | Split a BIOS into banks |
2223
| [`/combine`](#combine-bios-command) | Combine multiple banks into a single BIOS |
23-
| `/replicate` | replicate a BIOS |
24+
| [`/replicate`](#replicate-bios-command) | replicate a single BIOS |
2425
| [`/xcode-sim`](#xcode-visor-sim-command) | Simulate xcodes and Decode x86 |
2526
| [`/xcode-decode`](#xcode-decode-command) | Decode Xcodes from a BIOS or init table |
2627
| [`/x86-encode`](#x86-encode-command) | Encode x86 as xcodes |
2728
| [`/compress`](#compress-file-command) | Compress a file using lzx |
2829
| [`/decompress`](#decompress-file-command)| Decompress a file using lzx |
2930

30-
3131
## Switches
3232
| Switch | Description |
3333
| ----------------- | ----------------------------------------------------------------- |
34-
| [`/?`](#help-command) | Get help about a specific command |
3534
| `/enc-bldr` | Assume the 2BL is unencrypted (Decryption will be skipped) |
3635
| `/enc-krnl` | Assume the kernel is unencrypted (Decryption will be skipped) |
3736
| `/key-bldr <path>`| 16-byte 2BL RC4 file |
@@ -70,20 +69,22 @@ If the kernel has been decrypted, you will see a message like `decrypting kernel
7069

7170
## What MCPX ROM do i use?
7271
It depends on the BIOS version. The different revisions of the MCPX have
73-
different keys and different hashing algorithms
72+
different keys and different hashing algorithms.
7473

75-
| Rev. 0 | MD5 Hash |
76-
| ---------------- |----------------------------------- |
77-
| MCPX v1.0 | `d49c52a4102f6df7bcf8d0617ac475ed` |
78-
| M.O.U.S.E rev. 0 | `58f414016093f289c46d21639435701e` |
74+
| `Rev. 0 ` | MD5 Hash |
75+
| ---------------- |----------------------------------- |
76+
| MCPX v1.0 | `d49c52a4102f6df7bcf8d0617ac475ed` |
77+
| M.O.U.S.E rev. 0 v0.9.0 | `da9e9f527c5cb716f7a2143e976f6091` |
7978

80-
| Rev. 1 | MD5 Hash |
81-
| ---------------- | ---------------------------- |
82-
| MCPX v1.1 | `2870d58a459c745d7cc4c6122ceb3dcb` |
83-
| M.O.U.S.E rev. 1 | `06b227adbefc4dd55fb127c33590b735` |
79+
| `Rev. 1` | MD5 Hash |
80+
| ---------------- | ---------------------------- |
81+
| MCPX v1.1 | `2870d58a459c745d7cc4c6122ceb3dcb` |
82+
| M.O.U.S.E rev. 1 v0.9.0 | `06b227adbefc4dd55fb127c33590b735` |
8483

84+
- Use MCPX `Rev. 0` for BIOSes `< 4817`
85+
- Use MCPX `Rev. 1` for BIOSes `4817+`
8586

86-
Typically, if the BIOS contains a Preldr (FBL), Use a ` Rev. 1 MCPX` .
87+
Typically, if the BIOS contains a Preldr (FBL), Use a `Rev. 1 MCPX` .
8788
This is only true if the FBL TEA Attack hasn't been applied. in that instance
8889
it's likely that the BIOS is not encrypted at all, and the startup format maybe different.
8990

@@ -117,13 +118,13 @@ The list command has some flags to display specific infomation.
117118
| Switch | Desc |
118119
| ------------- | ------------------------------------------------ |
119120
| `/in <path> ` | BIOS file (req) |
120-
| `/img` | Display kernel image header info |
121-
| `/nv2a` | Display init table magic values |
122121
| `/datatbl` | Display ROM drive / slew calibration table data |
122+
| `/nv2a` | Display init table magic values |
123+
| `/img` | Display kernel image header info |
123124
| `/keys` | Display rc4, rsa keys |
124125

125126
```
126-
xbios.exe /ls <bios_file> /mcpx <mcpx_file> <extra_flags>
127+
xbios.exe /ls <bios_file> <extra_flags>
127128
```
128129

129130
## Extract BIOS command
@@ -138,9 +139,9 @@ Extract components from a BIOS file
138139
| Switch | Desc |
139140
| ------------------- | --------------------- |
140141
| `/in <path> ` | BIOS file (req) |
141-
| `/dir <path>` | Set output directory |
142142
| `/keys` | Extract keys |
143143
| `/nobootparams` | Dont restore 2BL boot params (FBL BIOSes) |
144+
| `/dir <path>` | Set output directory |
144145

145146
| Output file | Desc |
146147
| ------------------- | --------------------- |
@@ -153,7 +154,7 @@ Extract components from a BIOS file
153154
| `/certkey <path>` | Output cert key file |
154155

155156
```
156-
xbios.exe /extr <bios_file> /mcpx <mcpx_file> <extra_flags>
157+
xbios.exe /extr <bios_file> <extra_flags>
157158
```
158159

159160
## Build BIOS command
@@ -220,6 +221,14 @@ The `-bank[1-4]` switches are inferred with this command.
220221
xbios.exe /combine <bank1_file> <bank2_file> <bank3_file> <bank4_file>
221222
```
222223

224+
## Replicate BIOS command
225+
Replicate a single BIOS file.
226+
227+
| Switch | Desc |
228+
| ------------- | ---------------------------------- |
229+
| `/in <path> ` | BIOS file (req) |
230+
| `/out <path> ` | BIOS file; defaults to bios.bin |
231+
| `/binsize` | BIOS size (req) (256, 512, 1024) |
223232

224233
## X86 encode command
225234
Encode x86 *machine code* as xcode *byte code* that writes to RAM.
@@ -236,20 +245,16 @@ Encode x86 *machine code* as xcode *byte code* that writes to RAM.
236245
xbios.exe /x86-encode <code_file> /out <output_xcodes>
237246
```
238247

239-
<details><summary>Example</summary>
248+
<details><summary>x2.25 Example</summary>
240249

241250
```
242-
X86: ---> Xcodes:
243-
mov eax, 0xfff00bed xc_mem_write 0x00, 0xf00bedb8
244-
jmp eax xc_mem_write 0x04, 0x90e0ffff
245-
nop
246-
247-
Machine code: ---> Byte code:
248-
0000: B8 ED 0B F0 0000: 03 00 00 00
249-
0004: FF FF E0 90 0004: 00 F0 0B ED
250-
0008: B8 03 00 00
251-
000C: 00 04 90 E0
252-
0010: FF FF
251+
Machine code: ---> Byte code:
252+
0000: B8 ED 0B F0 mov eax, 0xfff00bed 0000: 03 00 00 00 xc_mem_write 0x00, 0xf00bedb8
253+
0004: FF FF E0 jmp eax 0004: 00 F0 0B ED
254+
0007: 90 nop 0008: B8
255+
0009: 03 00 00 00 xc_mem_write 0x04, 0x90e0ffff
256+
000D: 04 90 E0 FF
257+
0011: FF
253258
```
254259

255260
</details>
@@ -370,21 +375,10 @@ xbios.exe /decompress <in_file> /out <out_file>
370375

371376
## Example Commands
372377

373-
Extract BIOS
374-
```
375-
xbios.exe /extr /mcpx <mcpx_file> <bios_file>
376-
```
377-
378378
Extract BIOS + Keys
379379
```
380380
xbios.exe /extr /keys /mcpx <mcpx_file> <bios_file>
381381
```
382-
Extracts:
383-
- 2BL
384-
- FBL (if applicable)
385-
- Init table (magic numbers, xcodes)
386-
- Compressed Kernel (.bin)
387-
- Decompressed Kernel (.img)
388382

389383
List BIOS infomation
390384
```
@@ -396,10 +390,26 @@ List BIOS Keys
396390
xbios.exe /ls /keys /mcpx <mcpx_file> <bios_file>
397391
```
398392

399-
## Credits / Resources
393+
Replicate BIOS (256 kb) to 512 kb
394+
```
395+
xbios.exe /replicate <bios_file> /binsize 512
396+
```
400397

401-
- https://github.com/XboxDev/xbedump - XboxDev sha1.c implementation
402-
- https://github.com/WulfyStylez/XBOverclock - WulfyStylez GPU clock calculations
403-
- https://xboxdevwiki.net/Boot_Process - Boot process
398+
## Building
404399

400+
The project is built in Visual Studio 2022
401+
402+
1. Clone the repo
403+
404+
```
405+
git clone https://github.com/tommojphillips/XboxBiosTool.git
406+
```
407+
408+
2. Open vc\XboxBiosTools.sln in visual studio and build and run
409+
410+
## Credits / Resources
405411

412+
- [Xbox Dev Wiki](https://xboxdevwiki.net/Main_Page)
413+
- [Deconstructing the Xbox Boot Rom](https://web.archive.org/web/20201108132438/https://mborgerson.com/deconstructing-the-xbox-boot-rom/) by [mborgerson](https://github.com/mborgerson)
414+
- [xbedump](https://github.com/XboxDev/xbedump) by [XboxDev](https://github.com/XboxDev) - sha1.c implementation
415+
- [XBOverclock](https://github.com/WulfyStylez/XBOverclock) by [WulfyStylez](https://github.com/WulfyStylez) - GPU clock calculations

bin/clean.bat

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)