2016-12-01から1ヶ月間の記事一覧

HARDCODED msvc++ 関数のサイズを調べる

#include "stdafx.h" #define FUNC_GARBAGE \ __asm _emit 0xEB \ __asm _emit 0xEC \ __asm _emit 0xED \ __asm _emit 0xEF \ __declspec(naked) int __cdecl print_char() { __asm { push ebp mov ebp,esp sub esp, __LOCAL_SIZE push ebx push edi push e…

簡易 x86で関数のサイズを調べる

#include "stdafx.h" #include <map> #include <vector> #include <detours.h> #pragma comment(lib, "detours.lib") BOOL is_jcc_instruction(PBYTE pb) { if (!pb) return FALSE; if (0x70 <= pb[0] && pb[0] <= 0x7F) { // jo, jno, jb, jnb, jz, jnz, jbe, ja, js, jns, jp, jnp,</detours.h></vector></map>…