📄 softice.h
字号:
#ifdef __SOFTICE_C__ // Preinitialized patterns. For internal use only :)
//////////////////////////////////////////////////////////////////////////////
// GetChar
//////////////////////////////////////////////////////////////////////////////
// function prototype
#define TYPE_GetChar (UCHAR (__stdcall*)(VOID))
#define OFS_GetChar 0 // offset of code pattern in function
UCHAR PAT_GetChar[] =
{
0x57, // push edi
0x56, // push esi
0xE8, _XX_, _XX_, _XX_, _XX_, // call ReadOneKey
0x0F, 0xB6, 0xC0, // movzx eax, al
0x5E, // pop esi
0x5F, // pop edi
0xC3 // ret
};
//////////////////////////////////////////////////////////////////////////////
// KbHit
//////////////////////////////////////////////////////////////////////////////
#define TYPE_KbHit (UCHAR (__stdcall*)(VOID))
#define OFS_KbHit 0 // offset of code pattern in function
UCHAR PAT_KbHit[] =
{
0x53, // push ebx
0x33, 0xC0, // xor eax, eax
0x80, 0x3D, _XX_, _XX_, _XX_, _XX_, 0x00, // cmp fExecuteMoreCommands, 0
0x74, _XX_, // jz short jReadOneKey_ret
0x8B, 0x1D, _XX_, _XX_, _XX_, _XX_, // mov ebx, dword_B3E69
0x3B, 0x1D, _XX_, _XX_, _XX_, _XX_, // cmp ebx, dword_B3E6D
0x74, _XX_ // jz short jReadOneKey_ret
};
//////////////////////////////////////////////////////////////////////////////
// UpdateScreen
// CallVideoDriver_1
//////////////////////////////////////////////////////////////////////////////
#define TYPE_CallVideoDriver_1 (VOID (__stdcall *)(VOID))
#define TYPE_UpdateScreen (VOID (__stdcall *)(VOID))
#define OFS_UpdateScreen 30 // offset of code pattern in function
UCHAR PAT_CallVideoDriver_1[] =
{
0x60, // pushad
0x80, 0x3D, _XX_, _XX_, _XX_, _XX_, 0x01, // cmp VidDrv_1_flag, 1
0x75, 0x13, // jnz short loc_376AC
0xE8, _XX_, _XX_, _XX_, _XX_, // call sub_36536
0xB0, 0x01, // mov al, 1
0xE8, _XX_, _XX_, _XX_, _XX_, // call pCallVideoDriver
0xC6, 0x05, _XX_, _XX_, _XX_, _XX_, 0x01, // mov fVidDrv_0B, 1
// loc_376AC:
0xE8, _XX_, _XX_, _XX_, _XX_, // call pUpdateScreen
0x61, // popad
0xC3 // retn
};
//////////////////////////////////////////////////////////////////////////////
// MoveCursor
//////////////////////////////////////////////////////////////////////////////
#define TYPE_MoveCursor (VOID (__stdcall *)(LONG,LONG))
#define OFS_MoveCursor 0 // offset of code pattern in function
UCHAR PAT_MoveCursor[] =
{
0x55, // push ebp
0x8B, 0xEC, // mov ebp, esp
0x53, // push ebx
0x56, // push esi
0x57, // push edi
0x8A, 0x75, 0x08, // mov dh, [ebp+arg_0]
0x8A, 0x55, 0x0C, // mov dl, [ebp+arg_4]
0xE8, _XX_, _XX_, _XX_, _XX_, // call asm_MoveCursor
0x5F, // pop edi
0x5E, // pop esi
0x5B, // pop ebx
0x5D, // pop ebp
0xC2, 0x08, 0x00, // retn 8
// asm_MoveCursor:
0x50, // push eax
0x51, // push ecx
0x52, // push edx
0x80, 0x3D // cmp byte_C28BD, 0
};
//////////////////////////////////////////////////////////////////////////////
// Expression2Integer
//////////////////////////////////////////////////////////////////////////////
#define TYPE_Expression2Integer (LONG(__stdcall*)(PCHAR))
#define OFS_Expression2Integer 13 // offset of code pattern in function
UCHAR PAT_Expression2Integer[] =
{
0xBE, _XX_, _XX_, _XX_, _XX_, // mov esi, offset si_CommandLine
0xE8, _XX_, _XX_, _XX_, _XX_, // call pSkipWord
0x72, 0x12, // jb short loc_44037
0xE8, _XX_, _XX_, _XX_, _XX_, // call pExpression2Integer
0x72, 0x10, // jb short loc_4403C
0xBE, _XX_, _XX_, _XX_, _XX_, // mov esi, offset loc_44044
0xE8, _XX_, _XX_, _XX_, _XX_, // call c_PHYS_
0xC3, // retn
//loc_44037:
0xB8, _XX_, _XX_, _XX_, _XX_, // mov eax, offset aParametersRequ ; "Parameters required"
//
//loc_4403C:
0x8B, 0xF0, // mov esi, eax
0xE8, _XX_, _XX_, _XX_, _XX_, // call pSayESI
0xC3 // retn
};
//////////////////////////////////////////////////////////////////////////////
// ExecuteMacro
//////////////////////////////////////////////////////////////////////////////
#define TYPE_ExecuteMacro (LONG(__stdcall*)(PCHAR))
#define OFS_ExecuteMacro 0 // offset of code pattern in function
UCHAR PAT_ExecuteMacro[] =
{
0x55, // push ebp
0x8B, 0xEC, // mov ebp, esp
0x83, 0xEC, _XX_, // sub esp, 0Ch
0xB8, _XX_, _XX_, _XX_, _XX_, // mov eax, offset unk_106D78
0x56, // push esi
0x89, 0x45, 0xF4, // mov [ebp+var_C], eax
0xC7, 0x45 // mov [ebp+var_4], offset unk_106AE0
};
UCHAR PAT_ExecuteMacro_DS30[] =
{
0x55, // push ebp
0x8B, 0xEC, // mov ebp, esp
0x83, 0xEC, _XX_, // sub esp, 0Ch
0x56, // push esi
0xBE, _XX_, _XX_, _XX_, _XX_, // mov esi, offset unk_106D78
0x89, 0x75, 0xF4, // mov [ebp+var_C], esi
0xC7, 0x45 // mov [ebp+var_4], offset unk_106AE0
};
//////////////////////////////////////////////////////////////////////////////
// pNTIce
//////////////////////////////////////////////////////////////////////////////
#define TYPE_NTIce (VOID(__stdcall*)(VOID))
#define TYPE_NTIceMain (VOID(__stdcall*)(ULONG))
#define OFS_NTIce 0 // offset of code pattern in function
#define OFS_NTIceMain 9 // offset of pNTIceMain call
UCHAR PAT_NTIce[] =
{
0x9C, // pushf
0x0E, // push cs
0x68, _XX_, _XX_, _XX_, _XX_, // push offset nullsub_2
0xFA, // cli
0xE8, _XX_, _XX_, _XX_, _XX_, // call pNTICEMain
0xCF // iret
};
//////////////////////////////////////////////////////////////////////////////
// pPrintChar
//////////////////////////////////////////////////////////////////////////////
#define TYPE_PrintChar (VOID(__stdcall*)(VOID))
#define OFS_PrintChar 0
#define OFS_ExecuteMoreCommands 18
UCHAR PAT_PrintChar[] =
{
0x57, // push edi
0x51, // push ecx
0x50, // push eax
0xE8, _XX_, _XX_, _XX_, _XX_, // call pCallVideoDriver_2x
0x80, 0x3D, _XX_, _XX_, _XX_, _XX_, 0x01, // cmp byte_B0A5C, 1
0x74, _XX_, // jz short loc_33CA9
0xA0 // mov al, fExecuteMoreCommands
// ^^ ^^ ^^ ^^ - fExecuteMoreCommands
};
//////////////////////////////////////////////////////////////////////////////
// pDelayMilliSec
//////////////////////////////////////////////////////////////////////////////
#define TYPE_DelayMilliSec (VOID(__stdcall*)(VOID))
#define OFS_DelayMilliSec 0
UCHAR PAT_DelayMilliSec[] =
{
0x2E, 0xF6, 0x05, _XX_, _XX_, _XX_, _XX_, 0x01, // test cs:dw_RDTSC_present,1
0x75, _XX_, // jnz short loc_505DD
0x51, // push ecx
0xB9, 0x00, 0x00, 0x0F, 0x00, // mov ecx, 0F0000h
//loc_505D9:
0xE2, 0xFE // loop loc_505D9
};
//////////////////////////////////////////////////////////////////////////////
// pReadFromKbdBuffer_char
//////////////////////////////////////////////////////////////////////////////
#define TYPE_ReadFromKbdBuffer_char (LONG(__stdcall*)(VOID))
#define OFS_ReadFromKbdBuffer_char 0
UCHAR PAT_ReadFromKbdBuffer_char[] =
{
0x53, // push ebx
0x33, 0xC0, // xor eax, eax
0x8B, 0x1D, _XX_, _XX_, _XX_, _XX_, // mov ebx, dw_KbdBufPos
0x3B, 0x1D, _XX_, _XX_, _XX_, _XX_, // cmp ebx, dw_KbdBufMax
0x74, _XX_, // jz short loc_39592
0x8A, 0x83, _XX_, _XX_, _XX_, _XX_, // mov al, bKeybBuffer[ebx]
0x43, // inc ebx
0x81, 0xE3, _XX_, _XX_, _XX_, _XX_, // and ebx, 1FFh
0x89 // mov dw_KbdBufPos, ebx
};
//////////////////////////////////////////////////////////////////////////////
// pWriteToKbdBuffer_char
//////////////////////////////////////////////////////////////////////////////
#define TYPE_WriteToKbdBuffer_char (VOID(__stdcall *)(VOID))
#define OFS_WriteToKbdBuffer_char 0
UCHAR PAT_WriteToKbdBuffer_char[] =
{
0x53, // push ebx
0x51, // push ecx
0x3C, 0x1B, // cmp al, 1Bh
0x75, _XX_, // jnz short loc_39950
0x83, 0x3D, _XX_, _XX_, _XX_, _XX_, 0x01, // cmp trace_dwd+1, 1
0x76, _XX_, // jbe short loc_39950
0xC7, 0x05 // mov trace_dwd+1, 1
};
//////////////////////////////////////////////////////////////////////////////
// pEmptyKbdBuffer
//////////////////////////////////////////////////////////////////////////////
#define TYPE_EmptyKbdBuffer (VOID(__stdcall*)(VOID))
#define OFS_EmptyKbdBuffer 0
UCHAR PAT_EmptyKbdBuffer[] =
{
0x9C, // pushf
0xFA, // cli
0xC7, 0x05, _XX_, _XX_, _XX_, _XX_, 0x00, 0x00, 0x00, 0x00, // mov dw_KbdBufPos, 0
0xC7, 0x05, _XX_, _XX_, _XX_, _XX_, 0x00, 0x00, 0x00, 0x00, // mov dw_KbdBufMax, 0
0x9D, // popf
0xC3 // retn
};
//////////////////////////////////////////////////////////////////////////////
// pActivateBPs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -