From ad77fd7a296c3072f1fd8872b3079a21fa0ed0ef Mon Sep 17 00:00:00 2001 From: sacx Date: Wed, 14 Dec 2022 15:33:32 +0200 Subject: [PATCH] Added dummy functions for RemoveDirectory SetEndOfFile --- speakeasy/winenv/api/usermode/kernel32.py | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/speakeasy/winenv/api/usermode/kernel32.py b/speakeasy/winenv/api/usermode/kernel32.py index 01ea6ec..56baca0 100644 --- a/speakeasy/winenv/api/usermode/kernel32.py +++ b/speakeasy/winenv/api/usermode/kernel32.py @@ -3378,6 +3378,22 @@ def CreateDirectory(self, emu, argv, ctx={}): argv[0] = target return True + @apihook('RemoveDirectory', argc=1) + def RemoveDirectory(self, emu, argv, ctx={}): + ''' + BOOL RemoveDirectoryA( + [in] LPCSTR lpPathName + ); + ''' + pn, = argv + cw = self.get_char_width(ctx) + + if pn: + target = self.read_mem_string(pn, cw) + argv[0] = target + + return True + @apihook('CopyFile', argc=3) def CopyFile(self, emu, argv, ctx={}): ''' @@ -3691,6 +3707,15 @@ def CloseHandle(self, emu, argv, ctx={}): emu.dec_ref(obj) return True return False + + @apihook('SetEndOfFile', argc=1) + def SetEndOfFile(self, emu, argv, ctx={}): + ''' + BOOL SetEndOfFile( + HANDLE hFile + ); + ''' + return True @apihook('IsDebuggerPresent', argc=0) def IsDebuggerPresent(self, emu, argv, ctx={}):