資源簡介
c++ 透明代理(hookproxy)
代碼片段和文件信息
//////////////////////////////////////////////////////////////////////////
//#define?ENV_APPLICATION
#include?“stdafx.h“
#include?“detour.h“
#define?DBG_OUT?
enum?
{
mod_offset_dynamic? =?0x1u
mod_offset_address? =?0x2u
mod_offset_noenlarge =?0x4u
mod_offset_sib =?0x10u
mod_offset_notsib =?0x0fu
};
typedef?struct?instruction_copy_params
{
byte is_16bit_operand;
byte is_16bit_address;
pbyte* target_pptr;
long* extra_ptr;
long scratch_extra;
pbyte scratch_target;
byte scratch_dst[64];
}?icp;
struct?instruction_copy_entry;
typedef?const?struct?instruction_copy_entry?*ref_ice;
typedef?pbyte?(__stdcall?*?instruction_copy_func)(ref_ice?entry
???pbyte?dst
???pbyte?src
???icp*?cp);
typedef?struct?instruction_copy_entry?
{
ulong? op_code? :?8; //?Opcode
ulong fix_size? :?3; //?Fixed?size?of?opcode
ulong fix_size16? :?3; //?Fixed?size?when?16?bit?operand
ulong mod_offset? :?3; //?Offset?to?mod/rm?byte?(0=none)
long rel_offset? :?3; //?Offset?to?relative?target.
ulong flags :?4; //?Flags?for?mod_offset_dynamic?etc.
instruction_copy_func copy_fun; //?Function?pointer.
}?ice?;
//////////////////////////////////////////////////////////////////////////
pbyte?__stdcall?adjust_target(pbyte?dst??pbyte?src??long?op??long?target_offset??icp*?cp);
pbyte?__stdcall??copy_invalid(ref_ice?entry??pbyte?dst??pbyte?src??icp*?cp);
pbyte??__stdcall?copy_bytes(ref_ice?entry??pbyte?dst??pbyte?src??icp*?cp);
pbyte??__stdcall?copy_bytes_prefix(ref_ice?entry??pbyte?dst??pbyte?src??icp?*cp);
//////////////////////////////////////////////////////?Individual?Bytes?Codes.
pbyte??__stdcall?copy_0f(ref_ice?entry??pbyte?dst??pbyte?src??icp?*cp);
pbyte??__stdcall?copy_66(ref_ice?entry??pbyte?dst??pbyte?src??icp?*cp);
pbyte?__stdcall??copy_67(ref_ice?entry??pbyte?dst??pbyte?src??icp?*cp);
pbyte??__stdcall?copy_F6(ref_ice?entry??pbyte?dst??pbyte?src??icp?*cp);
pbyte??__stdcall?copy_F7(ref_ice?entry??pbyte?dst??pbyte?src??icp?*?cp);
pbyte??__stdcall?copy_FF(ref_ice?entry??pbyte?dst??pbyte?src??icp?*?cp);
//////////////////////////////////////////////////////////////////////////
#define?entry_copy_bytes1 1?1?0?0?0?copy_bytes
#define?entry_copy_bytes1_dynamic 1?1?0?0?mod_offset_dynamiccopy_bytes
#define?entry_copy_bytes2 2?2?0?0?0?copy_bytes
#define?entry_copy_bytes2_jump 2?2?0?1?0?copy_bytes
#define?entry_copy_bytes2_cant_jump 2?2?0?1?mod_offset_noenlarge?copy_bytes
#define?entry_copy_bytes2_dynamic 2?2?0?0?mod_offset_dynamic?copy_bytes
#define?entry_copy_bytes3 3?3?0?0?0?copy_bytes
#define?entry_copy_bytes3_dynamic 3?3?0?0?mod_offset_dynamiccopy_bytes
#define?entry_copy_bytes3_or_5 5?3?0?0?0?copy_bytes
#define?entry_copy_bytes3_or_5targ
- 上一篇:卡爾曼定位程序
- 下一篇:c++ 郵件多附件群發
評論
共有 條評論