File tree 8 files changed +116
-19
lines changed
8 files changed +116
-19
lines changed Original file line number Diff line number Diff line change 3
3
4
4
// only works on 32bit applications. Will add 64bit support later. See https://anti-reversing.com/Downloads/Anti-Reversing/The_Ultimate_Anti-Reversing_Reference.pdf page 5
5
5
bool MethodNtGlobalFlag () {
6
- int tmp = NULL ;
7
- __asm
8
- {
9
- mov eax , fs :[0x30 ]
10
- mov eax , [eax + 0x68 ]
11
- and al , 0x70
12
- mov tmp , eax
13
- }
14
-
15
- return tmp == 0x70 ;
6
+ auto peb = (char * ) __readfsdword (0x30 );
7
+ auto ntGlobalFlag = * (peb + 0x68 );
8
+ return ( (ntGlobalFlag & 0x70 ) == 0x70 );
16
9
}
Original file line number Diff line number Diff line change 6
6
PPEB getPeb (void );
7
7
8
8
bool MethodPEBBeingDebugged () {
9
- // define our vars
10
- PPEB pPeb = NULL ;
11
- bool dBug;
12
-
13
- pPeb = getPeb ();
14
- std::cout << " ALALOELE PEB->>> " << pPeb << std::endl;
15
-
16
- dBug = pPeb->BeingDebugged ;
17
- return dBug;
9
+ auto peb = (char *) __readfsdword (0x30 );
10
+ return *(peb+0x2 );
18
11
}
19
12
20
13
PPEB getPeb () {
Original file line number Diff line number Diff line change
1
+ // Microsoft Visual C++ generated resource script.
2
+ //
3
+ #include "resource.h"
4
+
5
+ #define APSTUDIO_READONLY_SYMBOLS
6
+ /////////////////////////////////////////////////////////////////////////////
7
+ //
8
+ // Generated from the TEXTINCLUDE 2 resource.
9
+ //
10
+ #include "winres.h"
11
+
12
+ /////////////////////////////////////////////////////////////////////////////
13
+ #undef APSTUDIO_READONLY_SYMBOLS
14
+
15
+ /////////////////////////////////////////////////////////////////////////////
16
+ // English (United States) resources
17
+
18
+ #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
19
+ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
20
+ #pragma code_page(1252)
21
+
22
+ #ifdef APSTUDIO_INVOKED
23
+ /////////////////////////////////////////////////////////////////////////////
24
+ //
25
+ // TEXTINCLUDE
26
+ //
27
+
28
+ 1 TEXTINCLUDE
29
+ BEGIN
30
+ "resource.h\0"
31
+ END
32
+
33
+ 2 TEXTINCLUDE
34
+ BEGIN
35
+ "#include ""winres.h""\r\n"
36
+ "\0"
37
+ END
38
+
39
+ 3 TEXTINCLUDE
40
+ BEGIN
41
+ "\r\n"
42
+ "\0"
43
+ END
44
+
45
+ #endif // APSTUDIO_INVOKED
46
+
47
+
48
+ /////////////////////////////////////////////////////////////////////////////
49
+ //
50
+ // Icon
51
+ //
52
+
53
+ // Icon with lowest ID value placed first to ensure application icon
54
+ // remains consistent on all systems.
55
+ IDI_ICON1 ICON "gh.ico"
56
+
57
+ #endif // English (United States) resources
58
+ /////////////////////////////////////////////////////////////////////////////
59
+
60
+
61
+
62
+ #ifndef APSTUDIO_INVOKED
63
+ /////////////////////////////////////////////////////////////////////////////
64
+ //
65
+ // Generated from the TEXTINCLUDE 3 resource.
66
+ //
67
+
68
+
69
+ /////////////////////////////////////////////////////////////////////////////
70
+ #endif // not APSTUDIO_INVOKED
71
+
Original file line number Diff line number Diff line change 153
153
<ItemGroup >
154
154
<ClInclude Include =" AntiDebugMethod.h" />
155
155
<ClInclude Include =" MethodFunctions.h" />
156
+ <ClInclude Include =" resource.h" />
157
+ </ItemGroup >
158
+ <ItemGroup >
159
+ <ResourceCompile Include =" anti-debugging.rc" />
160
+ </ItemGroup >
161
+ <ItemGroup >
162
+ <Image Include =" gh.ico" />
163
+ <Image Include =" icon1.ico" />
156
164
</ItemGroup >
157
165
<Import Project =" $(VCTargetsPath)\Microsoft.Cpp.targets" />
158
166
<ImportGroup Label =" ExtensionTargets" >
Original file line number Diff line number Diff line change 29
29
<ClInclude Include =" MethodFunctions.h" >
30
30
<Filter >Header Files</Filter >
31
31
</ClInclude >
32
+ <ClInclude Include =" resource.h" >
33
+ <Filter >Header Files</Filter >
34
+ </ClInclude >
35
+ </ItemGroup >
36
+ <ItemGroup >
37
+ <ResourceCompile Include =" anti-debugging.rc" >
38
+ <Filter >Resource Files</Filter >
39
+ </ResourceCompile >
40
+ </ItemGroup >
41
+ <ItemGroup >
42
+ <Image Include =" icon1.ico" >
43
+ <Filter >Resource Files</Filter >
44
+ </Image >
45
+ <Image Include =" gh.ico" >
46
+ <Filter >Resource Files</Filter >
47
+ </Image >
32
48
</ItemGroup >
33
49
</Project >
Original file line number Diff line number Diff line change
1
+ //{{NO_DEPENDENCIES}}
2
+ // Microsoft Visual C++ generated include file.
3
+ // Used by anti-debugging.rc
4
+ //
5
+ #define IDI_ICON1 102
6
+
7
+ // Next default values for new objects
8
+ //
9
+ #ifdef APSTUDIO_INVOKED
10
+ #ifndef APSTUDIO_READONLY_SYMBOLS
11
+ #define _APS_NEXT_RESOURCE_VALUE 103
12
+ #define _APS_NEXT_COMMAND_VALUE 40001
13
+ #define _APS_NEXT_CONTROL_VALUE 1001
14
+ #define _APS_NEXT_SYMED_VALUE 101
15
+ #endif
16
+ #endif
You can’t perform that action at this time.
0 commit comments