Skip to content
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

merge from coolrepo99 #1

Open
wants to merge 68 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
24e7e4d
Updated installer scripts
Sep 14, 2015
6c8b757
Fixes for Workstation 12 on Linux
DrDonk Sep 14, 2015
3c80ee7
Unlocker 2.0.7
Sep 16, 2015
2d86d71
ELF Patching code
DrDonk Sep 16, 2015
153f0a5
Fusion 8.0.0 Tools
DrDonk Sep 16, 2015
258b81c
Work on a dynamic darwin.iso fetcher
Oct 10, 2015
8d31821
Delete iso files
Oct 10, 2015
3cc4516
Update .gitignore for tools folder
Oct 10, 2015
d59b8ab
Completed tools downloader
Oct 10, 2015
08c944b
Remove EFI firmware tools
Oct 10, 2015
984ccbc
Gettools spec file
Oct 13, 2015
490cb90
Fix broken winreg imports
DrDonk Oct 14, 2015
c59b11a
Unlocker 2.0.8
DrDonk Nov 29, 2015
0aa719f
New tool to generate spoof Apple data for VMX file
DrDonk Jun 4, 2016
a2cf164
Merge remote-tracking branch 'origin/master'
DrDonk Jun 4, 2016
7b0536d
Fixed error with MLB generatio & changed pyinstaller folders
DrDonk Jun 4, 2016
bed79f8
Misc changes
DrDonk Jul 17, 2016
bd2ba6e
Misc changes
DrDonk Aug 29, 2016
1fa1207
Misc changes
DrDonk Aug 29, 2016
e6d9d04
Changes for new products
DrDonk Sep 2, 2016
1ee4d6e
Work in progress for ESXi 6.5
DrDonk Nov 20, 2016
a95a751
Work in progress for ESXi 6.5
DrDonk Nov 20, 2016
f1c216c
Release candidate for 2.0.9
DrDonk Dec 15, 2016
da91cfa
Release candidate for 2.0.9
DrDonk Dec 15, 2016
20dc120
Release candidate for 2.0.9
DrDonk Dec 15, 2016
fdb8414
Release candidate for 2.0.9
DrDonk Dec 17, 2016
b13e0dd
Allow unlocker to be disabled on ESXi via boot option
DrDonk Dec 19, 2016
22003b1
Re-worked based on discovery of VMX sandbox
DrDonk Dec 28, 2016
7524b41
Re-worked based on discovery of VMX sandbox
DrDonk Dec 28, 2016
dba3097
Re-worked based on discovery of VMX sandbox
DrDonk Dec 29, 2016
aa5e301
Re-worked based on discovery of VMX sandbox
DrDonk Dec 29, 2016
409f9a9
Updated readme for 2.0.9 RC2
DrDonk Dec 29, 2016
fcc21ab
Updates for 2.0.9 RC3
Sep 27, 2017
e16c05c
New files used in tests for 2.0.9 RC3
Sep 27, 2017
949c13d
Another set of changes 2.0.9.
Oct 5, 2017
e2b1fe2
Fixed gettools.py for Fus10 2.0.9.
Oct 5, 2017
d1eec2a
Executables created and update scripts 2.0.9.
Oct 5, 2017
621de92
Fix vmwarebase patch offsets and Linux issues 2.0.9.
DrDonk Oct 9, 2017
91b6901
Final ESXi fixes 2.0.9
DrDonk Oct 9, 2017
7455ac7
Final changes for 2.0.9!
DrDonk Oct 9, 2017
a55b00e
Final changes for 2.0.9!
DrDonk Oct 9, 2017
761d3f3
Renamed to version 2.1.0.
DrDonk Oct 10, 2017
c6ff390
Fix incorrect docstring quote 2.1.0.
DrDonk Oct 10, 2017
e11d6f4
Removing support for ESXi 6.x as unreliable - 2.1.1
DrDonk Oct 11, 2017
af5102b
Removing support for ESXi 6.x as unreliable - 2.1.1
DrDonk Oct 11, 2017
fd216eb
Removing support for ESXi 6.x as unreliable - 2.1.1
DrDonk Oct 11, 2017
b036c40
Miscellaneous changes to tidy up code.
DrDonk Dec 7, 2017
212f309
Miscellaneous changes to tidy up code.
DrDonk Aug 19, 2018
29485bb
Add a newline to message.
DrDonk Aug 19, 2018
1073f82
New ESXi Unlocker first commit
DrDonk Aug 19, 2018
3f88c75
Update win-install.cmd
Bleizingard Sep 17, 2018
9ed1c79
Moved ESXi code to new repository.
DrDonk Sep 24, 2018
786fb35
Pre-release updates for 3.0.0.
DrDonk Sep 29, 2018
4266222
Update readme with version number.
DrDonk Sep 30, 2018
c457c84
Version 3.0.0
DrDonk Oct 1, 2018
1b8c256
Fixed copyright string in scripts.
DrDonk Oct 1, 2018
2027f52
Merge pull request #16 from Bleizingard/patch-1
DrDonk Oct 2, 2018
38be72e
Fix typo in readme.
DrDonk Oct 2, 2018
886655d
Get tools failed on Python 3 and did not correctly retreive darwinPre…
DrDonk Oct 2, 2018
79d5301
Updated gettools.exe with fixed Python 3 code.
DrDonk Oct 2, 2018
b10d3db
Updated readme.txt for 3.0.1
DrDonk Oct 2, 2018
dcb1b41
Fixed AV false positive using reecompiled run.exe from PyInstaller.
DrDonk Oct 8, 2018
c8b0d65
Updated version in printed messages to 3.0.2
DrDonk Oct 10, 2018
0d24796
Remove exe from .gitignore
DrDonk Oct 10, 2018
3c990b0
Allow Python 2 and 3 to run Python files
DrDonk Oct 10, 2018
b218a2f
Updated readme for 3.0.2
DrDonk Oct 10, 2018
5aa7936
Windows commands fixed to work with Player plus cosmetic changes to o…
DrDonk Oct 20, 2018
99325b9
Fixed CR/LF for .txt file
DrDonk Oct 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

# Declare files that will always have CRLF line endings on checkout.
*.cmd text eol=crlf
*.txt text eol=crlf

# Declare files that will always have CRLF line endings on checkout.
*.sh text eol=lf
# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf
*.py text eol=lf

# Declare files that are binary on checkout.
*.exe binary
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
backup/
tools/
.idea/
unlocker/build
unlocker/dist
dumpsmc/build
dumpsmc/dist
samples/
tests/
build/
dist/
*.spec
*.pyc
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014-2016 Dave Parsons & Sam Bingner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
13 changes: 0 additions & 13 deletions argtest.py

This file was deleted.

81 changes: 81 additions & 0 deletions darwin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#Tech Preview SMC
##Darwin

0ee83c0: 5945 4b23 0432 3369 7580 0000 0000 0000 YEK#.23iu.......
0eec7f0: 5945 4b23 0432 3369 7580 0000 0000 0000 YEK#.23iu.......

015f380: d401 0000 c745 a030 4b53 4f48 8d1d 9405 .....E.0KSOH....
015f410: 4848 83c0 4881 fb30 4b53 4f75 e348 89f9 HH..H..0KSOu.H..
015f440: 488d 4db0 4889 dfbe 304b 534f 4c89 e2e8 H.M.H...0KSOL...

0eec740: 304b 534f 202a 3868 6380 0000 0000 0000 0KSO *8hc.......
0ef4200: 304b 534f 202a 3868 6390 0000 0000 0000 0KSO *8hc......

015f4c0: c048 81fb 314b 534f 75e7 4889 f948 01c1 .H..1KSOu.H..H..
015f500: 004c 8d75 acbf 314b 534f e952 ffff ff31 .L.u..1KSO.R...1

0eec780: 0000 0000 0000 0000 314b 534f 202a 3868 ........1KSO *8h
0ef4240: 0000 0000 0000 0000 314b 534f 202a 3868 ........1KSO *8h

##Linux

0f82800: 5945 4b23 0432 3369 7580 0000 0000 0000 YEK#.23iu.......
0f8a2c0: 5945 4b23 0432 3369 7580 0000 0000 0000 YEK#.23iu.......

03bbde0: 3b48 8b00 8138 304b 534f 0f84 a002 0000 ;H...80KSO......
03bbe00: 8b32 4889 d048 83c2 4881 fe30 4b53 4f0f .2H..H..H..0KSO.
03bc050: efc7 4424 1430 4b53 4f49 89d8 e8af 1ece ..D$.0KSOI......

0f8a210: 304b 534f 202a 3868 6390 0000 0000 0000 0KSO *8hc.......
0f8e640: 304b 534f 202a 3868 6380 0000 0000 0000 0KSO *8hc.......

03bc070: ba01 0000 0048 89ef c744 2414 314b 534f .....H...D$.1KSO
03bc0c0: 0f84 56fd ffff 488b 0081 3831 4b53 4f74 ..V...H...81KSOt
03bc0e0: 8b1a 4889 d048 83c2 4881 fb31 4b53 4f74 ..H..H..H..1KSOt

0f8a250: 0000 0000 0000 0000 314b 534f 202a 3868 ........1KSO *8h
0f8e680: 0000 0000 0000 0000 314b 534f 202a 3868 ........1KSO *8h


###Exports

appleSMCKeyTableV0 - 158A2A0
appleSMCKeyTableV1 - 15827E0

###Header

0x00 08 ptr Offset of #KEY
0x08 04 int Count of all keys
0x0C 04 int Count of keys - OSK0/1

###Key

0x00 04 int Key name (byte reversed e.g. #KEY is #YEK)
0x04 01 byte Length of returned data
0x05 04 int Data type of returned data (byte reversed e.g. ui32 is 23iu)
0x09 01 byte Flag R/W
0x0a 06 byte Padding
0x10 08 ptr Internal VMware routine
0x18 48 byte Data

##Windows

0c9a910: 5945 4b23 0432 3369 7580 0000 0000 0000 YEK#.23iu.......
0ca23d0: 5945 4b23 0432 3369 7580 0000 0000 0000 YEK#.23iu.......

04c1630: 304b 534f 4889 4424 20e8 e232 b7ff 4183 0KSOH.D$ ..2..A.
04c16a0: 8138 304b 534f 745b ffc1 4883 c048 3bca .80KSOt[..H..H;.

0ca2320: 304b 534f 202a 3868 6390 0000 0000 0000 0KSO *8hc.......
0ca6750: 304b 534f 202a 3868 6380 0000 0000 0000 0KSO *8hc.......

04c1650: 4102 488b cfc7 4424 3431 4b53 4f48 8944 A.H...D$41KSOH.D
04c17a0: ffff ff48 8b00 8138 314b 534f 740f ffc3 ...H...81KSOt...

0ca2360: 0000 0000 0000 0000 314b 534f 202a 3868 ........1KSO *8h
0ca6790: 0000 0000 0000 0000 314b 534f 202a 3868 ........1KSO *8h

OSK0/1 keys return 32 bytes:

ourhardworkbythesewordsguardedpl
easedontsteal(c)AppleComputerInc
Binary file added dumpsmc.exe
Binary file not shown.
87 changes: 48 additions & 39 deletions dumpsmc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
"""
The MIT License (MIT)

Copyright (c) 2014-2015 Dave Parsons
Copyright (c) 2014-2016 Dave Parsons

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
Expand All @@ -22,14 +23,14 @@
THE SOFTWARE.

vSMC Header Structure
Offset Length struct Type Description
Offset Length Struct Type Description
----------------------------------------
0x00/00 0x08/08 Q ptr Offset to key table
0x08/08 0x04/4 I int Number of private keys
0x0C/12 0x04/4 I int Number of public keys

vSMC Key Data Structure
Offset Length struct Type Description
Offset Length Struct Type Description
----------------------------------------
0x00/00 0x04/04 4s int Key name (byte reversed e.g. #KEY is YEK#)
0x04/04 0x01/01 B byte Length of returned data
Expand All @@ -40,25 +41,33 @@
0x18/24 0x30/48 48B byte Data
"""

from __future__ import print_function
import struct
import sys

if sys.version_info < (2, 7):
sys.stderr.write('You need Python 2.7 or later\n')
sys.exit(1)

def bytetohex(bytestr):
return ''.join(['%02X ' % ord(x) for x in bytestr]).strip()

def bytetohex(data):
if sys.version_info > (3, 0):
# Python 3 code in this block
return "".join("{:02X} ".format(c) for c in data)
else:
# Python 2 code in this block
return "".join("{:02X} ".format(ord(c)) for c in data)


def printkey(i, smc_key, smc_data):
print str(i+1).zfill(3) \
+ ' ' + smc_key[0][::-1] \
+ ' ' + str(smc_key[1]).zfill(2) \
+ ' ' + smc_key[2][::-1].replace('\x00', ' ') \
+ ' ' + '{0:#0{1}x}'.format(smc_key[3], 4) \
+ ' ' + hex(smc_key[4]) \
+ ' ' + bytetohex(smc_data)
def printkey(i, offset, smc_key, smc_data):
print(str(i + 1).zfill(3)
+ ' ' + hex(offset)
+ ' ' + smc_key[0][::-1].decode('UTF-8')
+ ' ' + str(smc_key[1]).zfill(2)
+ ' ' + smc_key[2][::-1].replace(b'\x00', b' ').decode('UTF-8')
+ ' ' + '{0:#0{1}x}'.format(smc_key[3], 4)
+ ' ' + hex(smc_key[4])
+ ' ' + bytetohex(smc_data))


def dumpkeys(f, key):
Expand All @@ -76,34 +85,34 @@ def dumpkeys(f, key):
smc_data = f.read(smc_key[1])

# Dump entry
printkey(i, smc_key, smc_data)
printkey(i, offset, smc_key, smc_data)

# Exit when OSK1 has been read
if smc_key[0] == '1KSO':
if smc_key[0] == b'1KSO':
break
else:
i += 1


def dumpsmc(name):

with open(name, 'r+b') as f:
with open(name, 'rb') as f:

# Read file into string variable
# Read file into variable
vmx = f.read()

print 'File: ' + name
print('File: ' + name)

# Setup hex string for vSMC headers
# These are the private and public key counts
smc_header_v0 = '\xF2\x00\x00\x00\xF0\x00\x00\x00'
smc_header_v1 = '\xB4\x01\x00\x00\xB0\x01\x00\x00'
smc_header_v0 = b'\xF2\x00\x00\x00\xF0\x00\x00\x00'
smc_header_v1 = b'\xB4\x01\x00\x00\xB0\x01\x00\x00'

# Setup hex string for #KEY key
key_key = '\x59\x45\x4B\x23\x04\x32\x33\x69\x75'
key_key = b'\x59\x45\x4B\x23\x04\x32\x33\x69\x75'

# Setup hex string for $Adr key
adr_key = '\x72\x64\x41\x24\x04\x32\x33\x69\x75'
adr_key = b'\x72\x64\x41\x24\x04\x32\x33\x69\x75'

# Find the vSMC headers
smc_header_v0_offset = vmx.find(smc_header_v0) - 8
Expand All @@ -117,51 +126,51 @@ def dumpsmc(name):
smc_adr = vmx.find(adr_key)

# Print vSMC0 tables and keys
print 'appleSMCTableV0 (smc.version = "0")'
print 'appleSMCTableV0 Address : ' + hex(smc_header_v0_offset)
print 'appleSMCTableV0 Private Key #: 0xF2/242'
print 'appleSMCTableV0 Public Key #: 0xF0/240'
print('appleSMCTableV0 (smc.version = "0")')
print('appleSMCTableV0 Address : ' + hex(smc_header_v0_offset))
print('appleSMCTableV0 Private Key #: 0xF2/242')
print('appleSMCTableV0 Public Key #: 0xF0/240')

if (smc_adr - smc_key0) != 72:
print 'appleSMCTableV0 Table : ' + hex(smc_key0)
print('appleSMCTableV0 Table : ' + hex(smc_key0))
dumpkeys(f, smc_key0)
elif (smc_adr - smc_key1) != 72:
print 'appleSMCTableV0 Table : ' + hex(smc_key1)
print('appleSMCTableV0 Table : ' + hex(smc_key1))
dumpkeys(f, smc_key1)

print
print()

# Print vSMC1 tables and keys
print 'appleSMCTableV1 (smc.version = "1")'
print 'appleSMCTableV1 Address : ' + hex(smc_header_v1_offset)
print 'appleSMCTableV1 Private Key #: 0x01B4/436'
print 'appleSMCTableV1 Public Key #: 0x01B0/432'
print('appleSMCTableV1 (smc.version = "1")')
print('appleSMCTableV1 Address : ' + hex(smc_header_v1_offset))
print('appleSMCTableV1 Private Key #: 0x01B4/436')
print('appleSMCTableV1 Public Key #: 0x01B0/432')

if (smc_adr - smc_key0) == 72:
print 'appleSMCTableV1 Table : ' + hex(smc_key0)
print('appleSMCTableV1 Table : ' + hex(smc_key0))
dumpkeys(f, smc_key0)
elif (smc_adr - smc_key1) == 72:
print 'appleSMCTableV1 Table : ' + hex(smc_key1)
print('appleSMCTableV1 Table : ' + hex(smc_key1))
dumpkeys(f, smc_key1)

# Tidy up
f.close()


def main():
print 'dumpsmc'
print '-------'
print('dumpsmc')
print('-------')

if len(sys.argv) >= 2:
vmx_path = sys.argv[1]
else:
print 'Please pass file name!'
print('Please pass file name!')
return

try:
dumpsmc(vmx_path)
except IOError:
print 'Cannot find file ' + vmx_path
print('Cannot find file ' + vmx_path)


if __name__ == '__main__':
Expand Down
17 changes: 0 additions & 17 deletions dumpsmc/dumpsmc.spec

This file was deleted.

19 changes: 0 additions & 19 deletions esxi-install.sh

This file was deleted.

13 changes: 0 additions & 13 deletions esxi-uninstall.sh

This file was deleted.

Binary file removed firmware/efi32-srvr.rom
Binary file not shown.
Binary file removed firmware/efi64-srvr.rom
Binary file not shown.
Binary file added gettools.exe
Binary file not shown.
Loading