Add winproxy.is_implemented

This commit is contained in:
Clement Rouault
2016-05-18 10:54:58 +02:00
parent dfe8217259
commit d09cb4ca51
2 changed files with 17 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
V0.3:
* NtStatusException is now a WindowsError
* Add shr/shl RM32(64)/Imm8
* Small fix simple_x64 Imm8 encoding
* `execute_64bits_code_from_syswow` able to return ULONG64
* utils.get_short_path / utils.get_long_path
* Object returned by `windows.native_exec.create_function` has an attribute `code_addr` with the address of the executable code
* add `windows.winproxy.is_implemented` Ex: windows.winproxy.is_implemented(windows.winproxy.QueryWorkingSetEx)
+8 -1
View File
@@ -9,6 +9,13 @@ from windows.generated_def.ntstatus import NtStatusException
from windows.dbgprint import dbgprint
def is_implemented(winfunc):
try:
winfunc.force_resolution()
except ExportNotFound:
return False
return True
class Kernel32Error(WindowsError):
def __new__(cls, func_name):
win_error = ctypes.WinError()
@@ -83,7 +90,7 @@ def error_ntstatus(func_name, result, func, args):
return args
class ExportNotFound(AttributeError):
class ExportNotFound(RuntimeError):
def __init__(self, func_name, api_name):
self.func_name = func_name
self.api_name = api_name