-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c84a432
commit a968978
Showing
24 changed files
with
529 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
IFNDEF rax | ||
.model flat | ||
ENDIF | ||
|
||
IFDEF rax | ||
|
||
.data | ||
|
||
extern SyscallGadget:QWORD | ||
extern NtCreateFileSyscallNumber:DWORD | ||
extern NtQueryInformationFileSyscallNumber:DWORD | ||
extern NtReadFileSyscallNumber:DWORD | ||
extern NtProtectVirtualMemorySyscallNumber:DWORD | ||
|
||
.code | ||
|
||
SyscallNtCreateFile proc | ||
mov r10, rcx | ||
mov eax, NtCreateFileSyscallNumber | ||
jmp SyscallGadget | ||
SyscallNtCreateFile endp | ||
|
||
SyscallNtQueryInformationFile proc | ||
mov r10, rcx | ||
mov eax, NtQueryInformationFileSyscallNumber | ||
jmp SyscallGadget | ||
SyscallNtQueryInformationFile endp | ||
|
||
SyscallNtReadFile proc | ||
mov r10, rcx | ||
mov eax, NtReadFileSyscallNumber | ||
jmp SyscallGadget | ||
SyscallNtReadFile endp | ||
|
||
SyscallNtProtectVirtualMemory proc | ||
mov r10, rcx | ||
mov eax, NtProtectVirtualMemorySyscallNumber | ||
jmp SyscallGadget | ||
SyscallNtProtectVirtualMemory endp | ||
|
||
ELSE | ||
|
||
; For now, unhooking works on 64-bit Windows only. | ||
|
||
.code | ||
|
||
_SyscallNtCreateFile proc | ||
mov eax, -1 | ||
ret | ||
_SyscallNtCreateFile endp | ||
|
||
_SyscallNtQueryInformationFile proc | ||
mov eax, -1 | ||
ret | ||
_SyscallNtQueryInformationFile endp | ||
|
||
_SyscallNtReadFile proc | ||
mov eax, -1 | ||
ret | ||
_SyscallNtReadFile endp | ||
|
||
_SyscallNtProtectVirtualMemory proc | ||
mov eax, -1 | ||
ret | ||
_SyscallNtProtectVirtualMemory endp | ||
|
||
ENDIF | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "r77mindef.h" | ||
#ifndef _SYSCALLS_H | ||
#define _SYSCALLS_H | ||
|
||
LPVOID SyscallGadget; | ||
DWORD NtCreateFileSyscallNumber; | ||
DWORD NtQueryInformationFileSyscallNumber; | ||
DWORD NtReadFileSyscallNumber; | ||
DWORD NtProtectVirtualMemorySyscallNumber; | ||
|
||
extern NTSTATUS SyscallNtCreateFile(LPHANDLE fileHandle, ACCESS_MASK desiredAccess, POBJECT_ATTRIBUTES objectAttributes, PIO_STATUS_BLOCK ioStatusBlock, PLARGE_INTEGER allocationSize, ULONG fileAttributes, ULONG shareAccess, ULONG createDisposition, ULONG createOptions, LPVOID eaBuffer, ULONG eaLength); | ||
extern NTSTATUS SyscallNtQueryInformationFile(HANDLE fileHandle, PIO_STATUS_BLOCK ioStatusBlock, LPVOID fileInformation, ULONG length, FILE_INFORMATION_CLASS fileInformationClass); | ||
extern NTSTATUS SyscallNtReadFile(HANDLE fileHandle, HANDLE event, PIO_APC_ROUTINE apcRoutine, LPVOID apcContext, PIO_STATUS_BLOCK ioStatusBlock, LPVOID buffer, ULONG length, PLARGE_INTEGER byteOffset, PULONG key); | ||
extern NTSTATUS SyscallNtProtectVirtualMemory(HANDLE processHandle, LPVOID *baseAddress, PSIZE_T numberOfBytesToProtect, ULONGLONG newAccessProtection, PULONGLONG oldAccessProtection); | ||
|
||
#endif |
Oops, something went wrong.