Skip to content

Instantly share code, notes, and snippets.

@blair1922
Last active February 7, 2024 17:36
Show Gist options
  • Save blair1922/904dcd750efc1b51d09d3b1a5e2903f5 to your computer and use it in GitHub Desktop.
Save blair1922/904dcd750efc1b51d09d3b1a5e2903f5 to your computer and use it in GitHub Desktop.
EAC Thread Bypass in 1line 💀
const std::uint64_t current_thread = reinterpret_cast<std::uint64_t>(current_thread);
*reinterpret_cast<ULONG*>(current_thread + 0x560) = FALSE; // this offset is for my OS version which is windows 11 23h2, you can get offsets at https://www.vergiliusproject.com/
dbg("thread dbg status %i\n", PsIsThreadTerminating(current_thread));
//now the 1line version (meme):
*reinterpret_cast<ULONG*>(reinterpret_cast<std::uint64_t>(KeGetCurrentThread()) + 0x560) = FALSE;

Skip EAC thread detection PoC

If you look at what EAC does in IDA on their thread detection once you've devirtualized their driver You'll see the detection function will bugcheck/get out if

if ( !(unsigned __int8)PsIsThreadTerminating(threadObject)

Now, how does this actually work? PsIsThreadTerminating returns the byte

ULONG _ETHREAD::Terminated

https://doxygen.reactos.org/dc/d4d/ntoskrnl_2ps_2thread_8c_source.html#l00868

The function itself is just a bytecheck, and this byte doesnt actually initialize the thread termination function but more like the thread termination function initializes the byte.

What is the PoC?

Look at the following file, of course its just code scrambled as i didnt use an ide to write that part but it has been tested on my hypervisor that i use for debugging and indeed works. (i tested numerous calls etc without writing any code just plain debugging)

EDIT:

there is absolutely no else condition on the terminating check execution

nothing will be debugged or sent to server about that

glhf cant wait for eac fix ^^

@im-tesla
Copy link

im-tesla commented Feb 7, 2024

thank you for this bro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment