目前想在64位的程序里注入代码,并实现SEH,但是有些结构体没有搞明白,不知道有没有人能指点下。 网上看了相关的资料但是讲的和IDA有点对不上。 https://www.pediy.com/kssd/pediy12/142371.html 以下IDA显示出来的 结构参数,和说明的结构体,看了好久没看明白,对应不上。 中间多出来的字节又是什么意思呢 windbg 输出信息 .fnent 0xFFFFF880032BA240 BeginAddress = 00000000`00001240 EndAddress = 00000000`000012af UnwindInfoAddress = 00000000`00002350 Unwind info at fffff880`032c6350, 14 bytes version 2, flags 1, prolog 4, codes 3 handler routine: DemoDriver!_C_specific_handler (fffff880`032c52f6), data 1 00: offs 1, unwind op 6, op info 1 UWOP_EPILOG Length: 1. Flags: 1 01: offs 0, unwind op 6, op info 0 UWOP_EPILOG (padding) 02: offs 4, unwind op 2, op info 8 UWOP_ALLOC_SMALL. 该函数含有 __except filter 我发现替换了UnwindInfoAddress 另个函数的异常 结构信息,以上的输出信息 不会变,难道还加载到其他其它地方了吗
typedef struct _RUNTIME_FUNCTION { ULONG BeginAddress; ULONG EndAddress; ULONG UnwindData; } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; typedef enum _UNWIND_OP_CODES { UWOP_PUSH_NONVOL = 0, UWOP_ALLOC_LARGE, // 1 UWOP_ALLOC_SMALL, // 2 UWOP_SET_FPREG, // 3 UWOP_SAVE_NONVOL, // 4 UWOP_SAVE_NONVOL_FAR, // 5 UWOP_SPARE_CODE1, // 6 UWOP_SPARE_CODE2, // 7 UWOP_SAVE_XMM128, // 8 UWOP_SAVE_XMM128_FAR, // 9 UWOP_PUSH_MACHFRAME // 10 } UNWIND_OP_CODES, *PUNWIND_OP_CODES; typedef union _UNWIND_CODE { struct { UCHAR CodeOffset; UCHAR UnwindOp : 4; UCHAR OpInfo : 4; }; USHORT FrameOffset; } UNWIND_CODE, *PUNWIND_CODE; #define UNW_FLAG_NHANDLER 0x0 #define UNW_FLAG_EHANDLER 0x1 #define UNW_FLAG_UHANDLER 0x2 #define UNW_FLAG_CHAININFO 0x4 typedef struct _UNWIND_INFO { UCHAR Version : 3; UCHAR Flags : 5; UCHAR SizeOfProlog; UCHAR CountOfCodes; UCHAR FrameRegister : 4; UCHAR FrameOffset : 4; UNWIND_CODE UnwindCode[1]; // // The unwind codes are followed by an optional DWORD aligned field that // contains the exception handler address or a function table entry if // chained unwind information is specified. If an exception handler address // is specified, then it is followed by the language specified exception // handler data. // // union { // struct { // ULONG ExceptionHandler; // ULONG ExceptionData[]; // }; // // RUNTIME_FUNCTION FunctionEntry; // }; // } UNWIND_INFO, *PUNWIND_INFO; typedef struct _SCOPE_TABLE { ULONG Count; struct { ULONG BeginAddress; ULONG EndAddress; ULONG HandlerAddress; ULONG JumpTarget; } ScopeRecord[1]; } SCOPE_TABLE, *PSCOPE_TABLE;
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!