Using my previous "KiFastSystemCall" wrapper, I found it quite easily possible to rewrite portions of the Windows API, removing dependencies on core-system files.
For example:
The idea is fairly easy to grasp; if you obfuscate the above calls before the system call is handed off, then you're forcing reversers/attackers to dump every syscall being used for their specific OS build, then in the context they're being used under, etc.Code:BOOL WINAPI CloseHandle( HANDLE Object ) { return( _NtClose( Object ) ); } VOID WINAPI ExitProcess( UINT ExitCode ) { _NtTerminateProcess( 0xFFFFFFFF, ExitCode ); } HANDLE WINAPI OpenThread( DWORD DesiredAccess, BOOL InheritHandle, DWORD ThreadId ) { HANDLE ThreadHandle; _NtOpenThread( &ThreadHandle, DesiredAccess, InheritHandle, ThreadId ); return( ThreadHandle ); } BOOL WINAPI TerminateThread( HANDLE Thread, DWORD ExitCode ) { return( _NtTerminateThread( Thread, ExitCode ) ); } BOOL WINAPI VirtualProtect( LPVOID Address, SIZE_T Size, DWORD NewProtect, PDWORD OldProtect ) { return( _NtProtectVirtualMemory( 0xFFFFFFFF, Address, Size, NewProtect, OldProtect ) ); } BOOL WINAPI VirtualProtectEx( HANDLE Process, LPVOID Address, SIZE_T Size, DWORD NewProtect, PDWORD OldProtect ) { return( _NtProtectVirtualMemory( Process, Address, Size, NewProtect, OldProtect ) ); } DWORD WINAPI ResumeThread( HANDLE Thread ) { return( _NtResumeThread( Thread, 0 ) ); } DWORD WINAPI SuspendThread( HANDLE Thread ) { return( _NtSuspendThread( Thread, 0 ) ); }
Feedback?



Reply With Quote


