Found a nice code snippet (https://github.com/invictus1306/Anti-debugging-techniques/blob/master/anti-debugging.asm) for anti-debugging mechanism in asm. My question is about following snippet:
;IsDebuggerPresent first - kernel32!IsDebuggerPresent
call IsDebuggerPresent
call @eip_manipulate ; change eip (point to next instruction)
mov eax, 010h
cmp eax, 1
je @Detected
[...]
@eip_manipulate:
add dword ptr [esp], 5
ret
I don't get why I have to change this. Because if i call isDebuggerPresent, it will return 1 for debuggerIsPresent or a 0 for debuggerIsNotPresent. Tried this and it only works with the eip_manipulate call.