summarylogtreecommitdiffstats
path: root/unlocker.py
diff options
context:
space:
mode:
authorJean-Marc Lenoir2018-09-29 13:13:31 +0200
committerJean-Marc Lenoir2018-09-29 13:13:31 +0200
commit565903262bc5c51100df480eeeb9aba789e2662b (patch)
treec19d389d6a973ad290eec57433464831fed8244f /unlocker.py
parente0ab07cab11177199c84b8df87786993ff5fbc32 (diff)
downloadaur-565903262bc5c51100df480eeeb9aba789e2662b.tar.gz
Add vmAutoStart.xml in the package
Diffstat (limited to 'unlocker.py')
-rw-r--r--unlocker.py42
1 files changed, 6 insertions, 36 deletions
diff --git a/unlocker.py b/unlocker.py
index 94d29e0964d3..2787e65d689e 100644
--- a/unlocker.py
+++ b/unlocker.py
@@ -44,9 +44,7 @@ Offset Length Struct Type Description
from __future__ import print_function
import codecs
import os
-import six
import struct
-import subprocess
import sys
if sys.version_info < (2, 7):
@@ -56,6 +54,7 @@ if sys.version_info < (2, 7):
# Setup imports depending on whether IronPython or CPython
if sys.platform == 'win32' \
or sys.platform == 'cli':
+ # noinspection PyUnresolvedReferences
from _winreg import *
@@ -231,7 +230,7 @@ def patchsmc(name, sharedobj):
# Read file into string variable
vmx = f.read()
- print('File: ' + name)
+ print('File: ' + name + '\n')
# Setup hex string for vSMC headers
# These are the private and public key counts
@@ -349,6 +348,7 @@ def patchvmkctl(name):
print('smcPresent Patched: ' + name)
+# noinspection PyUnresolvedReferences
def main():
# Work around absent Platform module on VMkernel
if os.name == 'nt' or os.name == 'cli':
@@ -356,19 +356,11 @@ def main():
else:
osname = os.uname()[0].lower()
- vmwarebase = ''
- libvmkctl32 = ''
- libvmkctl64 = ''
+ # vmwarebase = ''
vmx_so = False
# Setup default paths
- if osname == 'darwin':
- vmx_path = '/Applications/VMware Fusion.app/Contents/Library/'
- vmx = joinpath(vmx_path, 'vmware-vmx')
- vmx_debug = joinpath(vmx_path, 'vmware-vmx-debug')
- vmx_stats = joinpath(vmx_path, 'vmware-vmx-stats')
-
- elif osname == 'linux':
+ if osname == 'linux':
vmx_path = '/usr/lib/vmware/bin/'
vmx = joinpath(vmx_path, 'vmware-vmx')
vmx_debug = joinpath(vmx_path, 'vmware-vmx-debug')
@@ -379,15 +371,6 @@ def main():
else:
vmwarebase = '/usr/lib/vmware/lib/libvmwarebase.so.0/libvmwarebase.so.0'
- elif osname == 'vmkernel':
- vmx_path = os.path.dirname(os.path.abspath(__file__))
- vmx = joinpath(vmx_path, '/unlocker/bin/vmx')
- vmx_debug = joinpath(vmx_path, '/unlocker/bin/vmx-debug')
- vmx_stats = joinpath(vmx_path, '/unlocker/bin/vmx-stats')
- vmx_so = True
- libvmkctl32 = joinpath(vmx_path, '/unlocker/lib/libvmkctl.so')
- libvmkctl64 = joinpath(vmx_path, '/unlocker/lib64/libvmkctl.so')
-
elif osname == 'windows':
reg = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
key = OpenKey(reg, r'SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation')
@@ -409,20 +392,7 @@ def main():
patchsmc(vmx_stats, vmx_so)
# Patch vmwarebase for Workstation and Player
- # Not required on Fusion or ESXi as table already has correct flags
- if vmwarebase != '':
- patchbase(vmwarebase)
- else:
- pass
-
- # Patch libvmkctl to return Apple SMC present
- if osname == 'vmkernel':
- # Patch ESXi 6.0 and 6.5 32 bit .so
- patchvmkctl(libvmkctl32)
-
- # Patch ESXi 6.5 64 bit .so
- if os.path.isfile(libvmkctl64):
- patchvmkctl(libvmkctl64)
+ patchbase(vmwarebase)
if __name__ == '__main__':