SI
Size: a a a
SI
DM
T
DM
T
T
typedef struct _PEB {
BYTE Reserved1[2];
BYTE BeingDebugged;
T
T
#Стартует приложение!
RunTo(BeginEA());
GetDebuggerEvent(WFNE_SUSP, -1);
# На старте, EBX содержит адрес структуры PEB.
ebx_addr = idc.GetRegValue('EBX')
PatchByte(ebx_addr + 2, 0);
print "BeingDebugged field in PEB patched!"
T
T
PEB!NtGlobalFlags
When a process is created, the system sets some flags that will define how various APIs will behave for this program. Those flags can be read in the PEB, in the DWORD located at offset 0x68 (see the reference).
By default, different flags are set depending if the process is created under a debugger or not. If the process is debugged, some flags controlling the heap manipulation routines in ntdll will be set: FLG_HEAP_ENABLE_TAIL_CHECK, FLG_HEAP_ENABLE_FREE_CHECK and FLG_HEAP_VALIDATE_PARAMETERS.
This anti-debug can be bypassed by resetting the NtGlobalFlags field.
T
T
T
T
T
T
Z
R