File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ FN_INSTRUCTION(VOID);
1515
1616#if defined(_M_X64 )
1717
18- EXTERN_C FN_INSTRUCTION * SimpleInstructionFunc1X64Ptr ;
18+ EXTERN_C FN_INSTRUCTION SimpleInstructionFunc1X64 ;
1919
2020#elif defined(_M_IX86 )
2121
22- EXTERN_C FN_INSTRUCTION * SimpleInstructionFunc1X86Ptr ;
22+ EXTERN_C FN_INSTRUCTION SimpleInstructionFunc1X86 ;
2323
2424#endif
2525
@@ -32,11 +32,11 @@ Hooked_InstructionFunc(VOID)
3232 return (ULONG_PTR )PRESET_RETURN_VALUE * 2 ;
3333}
3434
35- static FN_INSTRUCTION * * g_apfnInstructionFunctions [] = {
35+ static FN_INSTRUCTION * g_apfnInstructionFunctions [] = {
3636#if defined(_M_X64 )
37- & SimpleInstructionFunc1X64Ptr ,
37+ & SimpleInstructionFunc1X64 ,
3838#elif defined(_M_IX86 )
39- & SimpleInstructionFunc1X86Ptr ,
39+ & SimpleInstructionFunc1X86 ,
4040#endif
4141 NULL
4242};
@@ -48,7 +48,7 @@ TEST_FUNC(Instruction)
4848
4949 for (ULONG i = 0 ; i < ARRAYSIZE (g_apfnInstructionFunctions ) && g_apfnInstructionFunctions [i ] != NULL ; i ++ )
5050 {
51- pfn2 = pfn1 = * g_apfnInstructionFunctions [i ];
51+ pfn2 = pfn1 = g_apfnInstructionFunctions [i ];
5252 if (pfn1 () != (ULONG_PTR )PRESET_RETURN_VALUE )
5353 {
5454 TEST_SKIP ("Instruction Function #%lu did not return the preset value\n" , i );
Original file line number Diff line number Diff line change 1- IFDEF _M_IX86
1+ INCLUDE KNSoft \NDK \Assembly \Header . inc
2+ INCLUDE KNSoft \NDK \Assembly \NDK . inc
23
3- SIZE_T equ <DWORD>
4- PRESET_RETURN_VALUE equ 012345678h
5-
6- ELSE
7-
8- SIZE_T equ <QWORD>
4+ IFDEF _WIN64
95PRESET_RETURN_VALUE equ 01234567890 ABCDEFh
10-
6+ ELSE
7+ PRESET_RETURN_VALUE equ 012345678 h
118ENDIF
12-
13- $ PublicFuncAddr MACRO Func
14- align 4
15- @CatStr(Func , <Ptr SIZE_T offset > , Func)
16- PUBLIC @CatStr(Func , <Ptr>)
17- ENDM
Original file line number Diff line number Diff line change 1- include Instruction.inc
1+ INCLUDE Instruction.inc
22
3- .code
3+ .CODE
44
55SimpleInstructionFunc1X64 PROC
66
@@ -10,8 +10,4 @@ SimpleInstructionFunc1X64 PROC
1010
1111SimpleInstructionFunc1X64 ENDP
1212
13- .const
14-
15- $ PublicFuncAddr SimpleInstructionFunc1X64
16-
1713END
Original file line number Diff line number Diff line change 1- .686P
2- .XMM
3- .model fl at , stdcall
1+ INCLUDE Instruction. inc
42
5- include Instruction. inc
3+ .CODE
64
7- .code
8-
9- SimpleInstructionFunc1X86 PROC
5+ SimpleInstructionFunc1X86 PROC C
106
117 xor eax , eax
128 mov eax , PRESET_RETURN_VALUE
139 ret
1410
1511SimpleInstructionFunc1X86 ENDP
1612
17- .const
18-
19- $ PublicFuncAddr SimpleInstructionFunc1X86
20-
2113END
You can’t perform that action at this time.
0 commit comments