/////EnableAC.bat file ;@GOTO -) .CODE EnableAC PROC C SMSW EAX TEST EAX, 40000h JE NotEnabled PUSHFQ OR BYTE PTR [RSP+2], 4 POPFQ MOV AL, 1 RET NotEnabled: MOV AL, 0 RET EnableAC ENDP DisableAC PROC C PUSHFQ AND BYTE PTR [RSP+2], NOT 4 POPFQ RET DisableAC ENDP END :-) @ECHO OFF ML64.EXE /nologo /c EnableAC.bat PAUSE CLS /////Test.c file #include <stdio.h> char EnableAC(void); void DisableAC(void); int main(void) { char c[16]; printf(EnableAC() ? "AC enabled.\n" : "AC not enabled.\n"); __try { *(short int *)(c+1) = 0x1234; } __except(1) { printf("Exception.\n"); } DisableAC(); return(printf("End.\n")); }
There are 31,320 total registered users.
[+] expand