first working version of new_generate

This commit is contained in:
Clement Rouault
2016-06-16 13:31:16 +02:00
parent e42dafee7c
commit 4436be72c0
27 changed files with 2186 additions and 3927 deletions
@@ -2394,4 +2394,124 @@ typedef struct _OBJECT_DIRECTORY_INFORMATION
{
UNICODE_STRING Name;
UNICODE_STRING TypeName;
} OBJECT_DIRECTORY_INFORMATION, *POBJECT_DIRECTORY_INFORMATION;
} OBJECT_DIRECTORY_INFORMATION, *POBJECT_DIRECTORY_INFORMATION;
typedef struct _DEBUG_VALUE_TMP_SUBSTRUCT1
{
ULONG64 I64;
BOOL Nat;
} DEBUG_VALUE_TMP_SUBSTRUCT1;
typedef struct _DEBUG_VALUE_TMP_SUBSTRUCT2
{
ULONG LowPart;
ULONG HighPart;
} DEBUG_VALUE_TMP_SUBSTRUCT2;
typedef struct _DEBUG_VALUE_TMP_SUBSTRUCT3
{
ULONG64 LowPart;
LONG64 HighPart;
} DEBUG_VALUE_TMP_SUBSTRUCT3;
typedef union _DEBUG_VALUE_TMP_UNION
{
UCHAR I8;
USHORT I16;
ULONG I32;
_DEBUG_VALUE_TMP_SUBSTRUCT1 tmp_sub_struct_1;
FLOAT F32;
DOUBLE F64;
UCHAR F80Bytes[10];
UCHAR F82Bytes[11];
UCHAR F128Bytes[16];
UCHAR VI8[16];
USHORT VI16[8];
ULONG VI32[4];
ULONG64 VI64[2];
FLOAT VF32[4];
DOUBLE VF64[2];
DEBUG_VALUE_TMP_SUBSTRUCT2 I64Parts32;
DEBUG_VALUE_TMP_SUBSTRUCT3 F128Parts64;
UCHAR RawBytes[24];
} DEBUG_VALUE_TMP_UNION;
typedef struct _DEBUG_VALUE
{
_DEBUG_VALUE_TMP_UNION u;
ULONG TailOfRawBytes;
ULONG Type;
} DEBUG_VALUE, *PDEBUG_VALUE;
typedef struct _DEBUG_SYMBOL_PARAMETERS
{
ULONG64 Module;
ULONG TypeId;
ULONG ParentSymbol;
ULONG SubElements;
ULONG Flags;
ULONG64 Reserved;
} DEBUG_SYMBOL_PARAMETERS, *PDEBUG_SYMBOL_PARAMETERS;
typedef struct _DEBUG_SYMBOL_ENTRY
{
ULONG64 ModuleBase;
ULONG64 Offset;
ULONG64 Id;
ULONG64 Arg64;
ULONG Size;
ULONG Flags;
ULONG TypeId;
ULONG NameSize;
ULONG Token;
ULONG Tag;
ULONG Arg32;
ULONG Reserved;
} DEBUG_SYMBOL_ENTRY, *PDEBUG_SYMBOL_ENTRY;
typedef struct _DEBUG_MODULE_PARAMETERS
{
ULONG64 Base;
ULONG Size;
ULONG TimeDateStamp;
ULONG Checksum;
ULONG Flags;
ULONG SymbolType;
ULONG ImageNameSize;
ULONG ModuleNameSize;
ULONG LoadedImageNameSize;
ULONG SymbolFileNameSize;
ULONG MappedImageNameSize;
ULONG64 Reserved[2];
} DEBUG_MODULE_PARAMETERS, *PDEBUG_MODULE_PARAMETERS;
typedef struct _DEBUG_MODULE_AND_ID
{
ULONG64 ModuleBase;
ULONG64 Id;
} DEBUG_MODULE_AND_ID, *PDEBUG_MODULE_AND_ID;
typedef struct _DEBUG_OFFSET_REGION
{
ULONG64 Base;
ULONG64 Size;
} DEBUG_OFFSET_REGION, *PDEBUG_OFFSET_REGION;
typedef struct _DEBUG_SYMBOL_SOURCE_ENTRY
{
ULONG64 ModuleBase;
ULONG64 Offset;
ULONG64 FileNameId;
ULONG64 EngineInternal;
ULONG Size;
ULONG Flags;
ULONG FileNameSize;
ULONG StartLine;
ULONG EndLine;
ULONG StartColumn;
ULONG EndColumn;
ULONG Reserved;
} DEBUG_SYMBOL_SOURCE_ENTRY, *PDEBUG_SYMBOL_SOURCE_ENTRY;
+7 -6
View File
@@ -102,12 +102,12 @@ known_type = dummy_wintypes.names + list([x[0] for x in TYPE_EQUIVALENCE])
known_type += ["void"]
FUNC_FILE = "winfunc.txt"
STRUCT_FILE = "winstruct.txt"
DEF_FILE = "windef.txt"
NTSTATUS_FILE = "ntstatus.txt"
NAME_TO_IID_FILE = "interface_to_iid.txt"
COM_INTERFACE_DIR_GLOB = "com/*.txt"
FUNC_FILE = "definitions\\winfunc.txt"
STRUCT_FILE = "definitions\\winstruct.txt"
DEF_FILE = "definitions\\windef.txt"
NTSTATUS_FILE = "definitions\\ntstatus.txt"
NAME_TO_IID_FILE = "definitions\\interface_to_iid.txt"
COM_INTERFACE_DIR_GLOB = "definitions\\com/*.txt"
GENERATED_STRUCT_FILE = "winstructs"
GENERATED_FUNC_FILE = "winfuncs"
@@ -194,6 +194,7 @@ def validate_structs(structs, enums, defs):
all_struct_name = get_all_struct_name(structs, enums)
for struct in structs:
for field_type, field_name, nb_rep in struct.fields:
import pdb;pdb.set_trace()
if field_type.name not in known_type + all_struct_name:
raise ValueError("UNKNOW TYPE {0}".format(field_type))
try:
+33 -48
View File
@@ -166,8 +166,11 @@ class DefGenerator(CtypesGenerator):
return "{0}({1})".format(self.name, hex(self))
__str__ = __repr__
""")
IMPORT_HEADER = """{deps}"""
def analyse(self, data):
self.add_exports("Flag")
self.add_exports("NATIVE_WORD_MAX_VALUE")
@@ -176,7 +179,10 @@ class DefGenerator(CtypesGenerator):
def generate(self):
ctypes_lines = [self.common_header, self.HEADER] + [d.generate_ctypes() for d in self.parse()]
ctypes_lines = [self.common_header, self.HEADER]
deps = "\n".join(["from {0} import *".format(os.path.basename(dep.outfilename).rsplit(".")[0]) for dep in self.dependances])
ctypes_lines += [self.IMPORT_HEADER.format(deps=deps)]
ctypes_lines += [d.generate_ctypes() for d in self.parse()]
ctypes_code = "\n".join(ctypes_lines)
with open(self.outfilename, "w") as f:
f.write(ctypes_code)
@@ -192,7 +198,6 @@ class StructGenerator(CtypesGenerator):
{types_equivalences}
""")
TYPES_HEADER = dedent("""
class EnumValue(Flag):
def __new__(cls, enum_name, name, value):
@@ -278,7 +283,10 @@ class FuncGenerator(CtypesGenerator):
def generate(self):
deps = "\n".join(["from {0} import *".format(os.path.basename(dep.outfilename).rsplit(".")[0]) for dep in self.dependances])
HEADER = self.HEADER.format(deps=deps)
ctypes_lines = [self.common_header, HEADER] + [d.generate_ctypes() for d in self.parse()]
func_list = "functions = {0}\n\n".format(str([f.name for f in self.data]))
ctypes_lines = [self.common_header, HEADER, func_list] + [d.generate_ctypes() for d in self.parse()]
ctypes_code = "\n".join(ctypes_lines)
with open(self.outfilename, "w") as f:
f.write(ctypes_code)
@@ -289,8 +297,8 @@ class NtStatusGenerator(CtypesGenerator):
HEADER_IMPORT = dedent("""
import ctypes
{deps}
""")
""")
HEADER = dedent("""
class NtStatusException(WindowsError):
ALL_STATUS = {}
@@ -357,17 +365,13 @@ class NtStatusGenerator(CtypesGenerator):
class COMGenerator(CtypesGenerator):
PARSER = com_parser.WinComParser
IGNORE_INTERFACE = ["ITypeInfo"]
IMPORT_HEADER = dedent("""
import functools
import ctypes
{deps}
""")
HEADER = dedent("""
class IID(IID):
def __init__(self, Data1, Data2, Data3, Data4, name=None, strid=None):
self.name = name
@@ -440,23 +444,27 @@ class COMGenerator(CtypesGenerator):
return data
def analyse(self, data):
self.real_type = {}
for cominterface in data:
self.add_exports(cominterface.name)
for cominterface in data:
for method in cominterface.methods:
self.add_imports(method.ret_type)
for pos, arg in enumerate(method.args):
initial_arg = arg
if arg.type in self.exports or arg.type in self.IGNORE_INTERFACE:
# COM Interface ? -> PVOID !
atype = "PVOID"
byreflevel = arg.byreflevel - 1
method.args[pos] = arg = type(arg)(atype, byreflevel, arg.name)
self.real_type[arg] = initial_arg
elif arg.type == "void" and arg.byreflevel > 0:
# **void -> *PVOID
atype = "PVOID"
byreflevel = arg.byreflevel - 1
method.args[pos] = arg = type(arg)(atype, byreflevel, arg.name)
self.real_type[arg] = initial_arg
self.add_imports(arg.type)
@@ -477,9 +485,10 @@ class COMGenerator(CtypesGenerator):
methods_string = []
for method_nb, method in enumerate(cominterface.methods):
args_to_define = method.args[1:] #ctypes doesnt not need the This
args_for_comment = [self.real_type.get(arg, arg) for arg in args_to_define]
#import pdb;pdb.set_trace()
str_args = []
methods_string.append(self.com_interface_comment_template.format(method.name, ", ".join([arg.name +":"+ ("*"* arg.byreflevel) +arg.type for arg in args_to_define])))
methods_string.append(self.com_interface_comment_template.format(method.name, ", ".join([arg.name +":"+ ("*"* arg.byreflevel) +arg.type for arg in args_for_comment])))
for arg in args_to_define:
type = arg.type
for i in range(arg.byreflevel):
@@ -503,7 +512,6 @@ class COMGenerator(CtypesGenerator):
print("<{0}> generated".format(self.outfilename))
return ctypes_code
def parse_iid(self, iid_str):
part_iid = iid_str.split("-")
str_iid = []
@@ -517,45 +525,22 @@ class COMGenerator(CtypesGenerator):
class DefaultConfig(object):
DEF_DIR = "definitions"
FUNC_FILE = "winfunc.txt"
STRUCT_FILE = "winstruct.txt"
DEF_FILE = "windef.txt"
NTSTATUS_FILE = "ntstatus.txt"
NAME_TO_IID_FILE = "interface_to_iid.txt"
COM_INTERFACE_DIR_GLOB = "com/*.txt"
# A partial define without the dependance to ntstatus defintion
# BOOTSTRAP!!
non_generated_def = DefGenerator("definitions\\windef.txt", r"..\windows\generated_def\\windef.py")
GENERATED_STRUCT_FILE = "winstructs"
GENERATED_FUNC_FILE = "winfuncs"
GENERATED_DEF_FILE = "windef"
GENERATED_NTSTATUS_FILE = "ntstatus"
GENERATED_COM_FILE = "interfaces"
ntstatus = NtStatusGenerator("definitions\\ntstatus.txt", r"..\windows\generated_def\\ntstatus.py", dependances=[non_generated_def])
ntstatus.generate()
OUT_DIRS = "..\windows\generated_def"
# Not a real circular def (import not at the begin of file
defs_with_ntstatus = DefGenerator("definitions\\windef.txt", r"..\windows\generated_def\\windef.py", dependances=[ntstatus])
defs_with_ntstatus.generate()
@classmethod
def verify(cls):
for infile in cls.FUNC_FILE, cls.STRUCT_FILE, cls.DEF_FILE, cls.NTSTATUS_FILE, cls.NAME_TO_IID_FILE:
if not os.path.exists(pjoin(cls.DEF_DIR, infile)):
raise ValueError("Missing file <{0}>".format(pjoin(DEF_DIR, infile)))
structs = StructGenerator("definitions\\winstruct.txt", r"..\windows\generated_def\\winstructs.py", dependances=[defs_with_ntstatus])
structs.generate()
functions = FuncGenerator("definitions\\winfunc.txt", r"..\windows\generated_def\\winfuncs.py", dependances=[structs])
functions.generate()
x = DefGenerator("definitions\\windef.txt", "out\\yolo.py")
x.generate()
y = StructGenerator("definitions\\winstruct.txt", "out\\truc.py", dependances=[x])
y.generate()
z = FuncGenerator("definitions\\winfunc.txt", "out\\func.py", dependances=[y])
z.generate()
nt = NtStatusGenerator("definitions\\ntstatus.txt", "out\\nt.py", dependances=[x])
nt.generate()
com = COMGenerator("definitions\\com\\*.txt", "definitions\\interface_to_iid.txt" ,"out\\com.py", dependances=[y])
com.generate()
print(os.listdir(DefaultConfig.DEF_DIR))
DefaultConfig.verify()
com = COMGenerator("definitions\\com\\*.txt", "definitions\\interface_to_iid.txt" ,r"..\windows\generated_def\\interfaces.py", dependances=[structs])
com.generate()
+10 -6
View File
@@ -3,6 +3,8 @@ import functools
import ctypes
from winstructs import *
class IID(IID):
def __init__(self, Data1, Data2, Data3, Data4, name=None, strid=None):
self.name = name
@@ -32,6 +34,8 @@ class IID(IID):
generate_IID = IID.from_raw
GUID = IID
LPGUID = POINTER(GUID)
class COMInterface(ctypes.c_void_p):
_functions_ = {
@@ -55,7 +59,7 @@ class IDispatch(COMInterface):
#GetTypeInfoCount -> pctinfo:*UINT
"GetTypeInfoCount": ctypes.WINFUNCTYPE(HRESULT, POINTER(UINT))(3, "GetTypeInfoCount"),
#GetTypeInfo -> iTInfo:UINT, lcid:LCID, ppTInfo:**ITypeInfo
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(POINTER(ITypeInfo)))(4, "GetTypeInfo"),
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(PVOID))(4, "GetTypeInfo"),
#GetIDsOfNames -> riid:REFIID, rgszNames:*LPOLESTR, cNames:UINT, lcid:LCID, rgDispId:*DISPID
"GetIDsOfNames": ctypes.WINFUNCTYPE(HRESULT, REFIID, POINTER(LPOLESTR), UINT, LCID, POINTER(DISPID))(5, "GetIDsOfNames"),
#Invoke -> dispIdMember:DISPID, riid:REFIID, lcid:LCID, wFlags:WORD, pDispParams:*DISPPARAMS, pVarResult:*VARIANT, pExcepInfo:*EXCEPINFO, puArgErr:*UINT
@@ -79,7 +83,7 @@ class IEnumVARIANT(COMInterface):
"Skip": ctypes.WINFUNCTYPE(HRESULT, ULONG)(4, "Skip"),
#Reset ->
"Reset": ctypes.WINFUNCTYPE(HRESULT)(5, "Reset"),
#Clone -> ppEnum:**IEnumVARIANT
#Clone -> ppEnum:**IEnumWbemClassObject
"Clone": ctypes.WINFUNCTYPE(HRESULT, POINTER(PVOID))(6, "Clone"),
}
@@ -120,7 +124,7 @@ class INetFwPolicy2(COMInterface):
#GetTypeInfoCount -> pctinfo:*UINT
"GetTypeInfoCount": ctypes.WINFUNCTYPE(HRESULT, POINTER(UINT))(3, "GetTypeInfoCount"),
#GetTypeInfo -> iTInfo:UINT, lcid:LCID, ppTInfo:**ITypeInfo
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(POINTER(ITypeInfo)))(4, "GetTypeInfo"),
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(PVOID))(4, "GetTypeInfo"),
#GetIDsOfNames -> riid:REFIID, rgszNames:*LPOLESTR, cNames:UINT, lcid:LCID, rgDispId:*DISPID
"GetIDsOfNames": ctypes.WINFUNCTYPE(HRESULT, REFIID, POINTER(LPOLESTR), UINT, LCID, POINTER(DISPID))(5, "GetIDsOfNames"),
#Invoke -> dispIdMember:DISPID, riid:REFIID, lcid:LCID, wFlags:WORD, pDispParams:*DISPPARAMS, pVarResult:*VARIANT, pExcepInfo:*EXCEPINFO, puArgErr:*UINT
@@ -185,7 +189,7 @@ class INetFwRules(COMInterface):
#GetTypeInfoCount -> pctinfo:*UINT
"GetTypeInfoCount": ctypes.WINFUNCTYPE(HRESULT, POINTER(UINT))(3, "GetTypeInfoCount"),
#GetTypeInfo -> iTInfo:UINT, lcid:LCID, ppTInfo:**ITypeInfo
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(POINTER(ITypeInfo)))(4, "GetTypeInfo"),
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(PVOID))(4, "GetTypeInfo"),
#GetIDsOfNames -> riid:REFIID, rgszNames:*LPOLESTR, cNames:UINT, lcid:LCID, rgDispId:*DISPID
"GetIDsOfNames": ctypes.WINFUNCTYPE(HRESULT, REFIID, POINTER(LPOLESTR), UINT, LCID, POINTER(DISPID))(5, "GetIDsOfNames"),
#Invoke -> dispIdMember:DISPID, riid:REFIID, lcid:LCID, wFlags:WORD, pDispParams:*DISPPARAMS, pVarResult:*VARIANT, pExcepInfo:*EXCEPINFO, puArgErr:*UINT
@@ -216,7 +220,7 @@ class INetFwRule(COMInterface):
#GetTypeInfoCount -> pctinfo:*UINT
"GetTypeInfoCount": ctypes.WINFUNCTYPE(HRESULT, POINTER(UINT))(3, "GetTypeInfoCount"),
#GetTypeInfo -> iTInfo:UINT, lcid:LCID, ppTInfo:**ITypeInfo
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(POINTER(ITypeInfo)))(4, "GetTypeInfo"),
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(PVOID))(4, "GetTypeInfo"),
#GetIDsOfNames -> riid:REFIID, rgszNames:*LPOLESTR, cNames:UINT, lcid:LCID, rgDispId:*DISPID
"GetIDsOfNames": ctypes.WINFUNCTYPE(HRESULT, REFIID, POINTER(LPOLESTR), UINT, LCID, POINTER(DISPID))(5, "GetIDsOfNames"),
#Invoke -> dispIdMember:DISPID, riid:REFIID, lcid:LCID, wFlags:WORD, pDispParams:*DISPPARAMS, pVarResult:*VARIANT, pExcepInfo:*EXCEPINFO, puArgErr:*UINT
@@ -309,7 +313,7 @@ class INetFwServiceRestriction(COMInterface):
#GetTypeInfoCount -> pctinfo:*UINT
"GetTypeInfoCount": ctypes.WINFUNCTYPE(HRESULT, POINTER(UINT))(3, "GetTypeInfoCount"),
#GetTypeInfo -> iTInfo:UINT, lcid:LCID, ppTInfo:**ITypeInfo
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(POINTER(ITypeInfo)))(4, "GetTypeInfo"),
"GetTypeInfo": ctypes.WINFUNCTYPE(HRESULT, UINT, LCID, POINTER(PVOID))(4, "GetTypeInfo"),
#GetIDsOfNames -> riid:REFIID, rgszNames:*LPOLESTR, cNames:UINT, lcid:LCID, rgDispId:*DISPID
"GetIDsOfNames": ctypes.WINFUNCTYPE(HRESULT, REFIID, POINTER(LPOLESTR), UINT, LCID, POINTER(DISPID))(5, "GetIDsOfNames"),
#Invoke -> dispIdMember:DISPID, riid:REFIID, lcid:LCID, wFlags:WORD, pDispParams:*DISPPARAMS, pVarResult:*VARIANT, pExcepInfo:*EXCEPINFO, puArgErr:*UINT
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -1,10 +1,14 @@
#Generated file
from ctypes import *
from ctypes.wintypes import *
from .winstructs import *
from winstructs import *
functions = ['ExitProcess', 'TerminateProcess', 'GetLastError', 'GetCurrentProcess', 'CreateFileA', 'CreateFileW', 'LdrLoadDll', 'NtQuerySystemInformation', 'NtQueryInformationProcess', 'NtQueryVirtualMemory', 'NtCreateThreadEx', 'NtQueryInformationThread', 'GetExitCodeThread', 'GetExitCodeProcess', 'VirtualAlloc', 'VirtualAllocEx', 'NtProtectVirtualMemory', 'VirtualFree', 'VirtualFreeEx', 'VirtualProtect', 'VirtualProtectEx', 'VirtualQuery', 'VirtualQueryEx', 'QueryWorkingSet', 'QueryWorkingSetEx', 'GetModuleFileNameA', 'GetModuleFileNameW', 'CreateThread', 'CreateRemoteThread', 'VirtualProtect', 'CreateProcessA', 'CreateProcessW', 'GetThreadContext', 'NtGetContextThread', 'SetThreadContext', 'NtSetContextThread', 'OpenThread', 'OpenProcess', 'CloseHandle', 'ReadProcessMemory', 'NtWow64ReadVirtualMemory64', 'WriteProcessMemory', 'NtWow64WriteVirtualMemory64', 'CreateToolhelp32Snapshot', 'Thread32First', 'Thread32Next', 'Process32First', 'Process32Next', 'Process32FirstW', 'Process32NextW', 'GetProcAddress', 'LoadLibraryA', 'LoadLibraryW', 'OpenProcessToken', 'LookupPrivilegeValueA', 'LookupPrivilegeValueW', 'AdjustTokenPrivileges', 'FindResourceA', 'FindResourceW', 'SizeofResource', 'LoadResource', 'LockResource', 'GetVersionExA', 'GetVersionExW', 'GetVersion', 'GetCurrentThread', 'GetCurrentThreadId', 'GetCurrentProcessorNumber', 'AllocConsole', 'FreeConsole', 'GetStdHandle', 'SetStdHandle', 'SetThreadAffinityMask', 'WriteFile', 'GetExtendedTcpTable', 'GetExtendedUdpTable', 'SetTcpEntry', 'AddVectoredContinueHandler', 'AddVectoredExceptionHandler', 'TerminateThread', 'ExitThread', 'RemoveVectoredExceptionHandler', 'ResumeThread', 'SuspendThread', 'WaitForSingleObject', 'GetThreadId', 'LoadLibraryExA', 'LoadLibraryExW', 'SymInitialize', 'SymFromName', 'SymLoadModuleEx', 'SymSetOptions', 'SymGetTypeInfo', 'DeviceIoControl', 'GetTokenInformation', 'RegOpenKeyExA', 'RegOpenKeyExW', 'RegGetValueA', 'RegGetValueW', 'RegCloseKey', 'Wow64DisableWow64FsRedirection', 'Wow64RevertWow64FsRedirection', 'Wow64EnableWow64FsRedirection', 'Wow64GetThreadContext', 'SetConsoleCtrlHandler', 'WinVerifyTrust', 'GlobalAlloc', 'GlobalFree', 'GlobalUnlock', 'GlobalLock', 'OpenClipboard', 'EmptyClipboard', 'CloseClipboard', 'SetClipboardData', 'GetClipboardData', 'EnumClipboardFormats', 'GetClipboardFormatNameA', 'GetClipboardFormatNameW', 'WinVerifyTrust', 'OpenProcessToken', 'OpenThreadToken', 'GetTokenInformation', 'SetTokenInformation', 'GetSidIdentifierAuthority', 'GetSidSubAuthority', 'GetSidSubAuthorityCount', 'DebugBreak', 'WaitForDebugEvent', 'ContinueDebugEvent', 'DebugActiveProcess', 'DebugActiveProcessStop', 'DebugSetProcessKillOnExit', 'DebugBreakProcess', 'GetProcessId', 'Wow64SetThreadContext', 'GetMappedFileNameW', 'GetMappedFileNameA', 'RtlInitString', 'RtlInitUnicodeString', 'RtlAnsiStringToUnicodeString', 'OpenEventA', 'OpenEventW', 'NtOpenEvent', 'NtAlpcCreatePort', 'NtAlpcConnectPort', 'NtAlpcAcceptConnectPort', 'AlpcInitializeMessageAttribute', 'AlpcGetMessageAttribute', 'NtAlpcSendWaitReceivePort', 'lstrcmpA', 'lstrcmpW', 'CreateFileMappingA', 'CreateFileMappingW', 'MapViewOfFile', 'OpenSCManagerA', 'OpenSCManagerW', 'EnumServicesStatusExA', 'EnumServicesStatusExW', 'EnumWindows', 'GetWindowTextA', 'GetWindowTextW', 'GetWindowModuleFileNameA', 'GetWindowModuleFileNameW', 'CryptCATAdminCalcHashFromFileHandle', 'CryptCATAdminEnumCatalogFromHash', 'CryptCATAdminAcquireContext', 'CryptCATCatalogInfoFromContext', 'CryptCATAdminReleaseCatalogContext', 'CryptCATAdminReleaseContext', 'GetLogicalDriveStringsA', 'GetLogicalDriveStringsW', 'GetVolumeInformationA', 'GetVolumeInformationW', 'GetVolumeNameForVolumeMountPointA', 'GetVolumeNameForVolumeMountPointW', 'GetDriveTypeA', 'GetDriveTypeW', 'QueryDosDeviceA', 'QueryDosDeviceW', 'NtQueryObject', 'DuplicateHandle', 'GetModuleBaseNameA', 'GetModuleBaseNameW', 'GetProcessImageFileNameA', 'GetProcessImageFileNameW', 'GetFileVersionInfoA', 'GetFileVersionInfoW', 'GetFileVersionInfoSizeA', 'GetFileVersionInfoSizeW', 'VerQueryValueA', 'VerQueryValueW', 'GetSystemMetrics', 'GetComputerNameA', 'GetComputerNameW', 'LookupAccountSidA', 'LookupAccountSidW', 'CoInitializeEx', 'CoInitializeSecurity', 'CoCreateInstance', 'GetInterfaceInfo', 'GetIfTable', 'GetIpAddrTable', 'NtOpenDirectoryObject', 'NtQueryDirectoryObject', 'NtQuerySymbolicLinkObject', 'NtOpenSymbolicLinkObject', 'GetProcessTimes', 'GetShortPathNameA', 'GetShortPathNameW', 'GetLongPathNameA', 'GetLongPathNameW']
#def ExitProcess(uExitCode):
# return ExitProcess.ctypes_function(uExitCode)
ExitProcessPrototype = WINFUNCTYPE(VOID, UINT)
@@ -1059,4 +1063,3 @@ GetLongPathNameAParams = ((1, 'lpszShortPath'), (1, 'lpszLongPath'), (1, 'cchBuf
# return GetLongPathNameW.ctypes_function(lpszShortPath, lpszLongPath, cchBuffer)
GetLongPathNameWPrototype = WINFUNCTYPE(DWORD, LPWSTR, LPWSTR, DWORD)
GetLongPathNameWParams = ((1, 'lpszShortPath'), (1, 'lpszLongPath'), (1, 'cchBuffer'))
File diff suppressed because it is too large Load Diff