R5AC: Apex Legends anti-cheat Analysis (S25)

An analysis of respawn entertainment's R5AC for Apex Legends Season 25.

Introduction

Learn about how respawn improved client-side cheat detection in Apex Legends.

Introduction

Specification


R5AC is the name of an in-house cheat detection software. It seems to be made by a team at respawn entertainment, although there is no public information about it anywhere on the internet.

Where is it?

It is located in the main game executable, r5apex_dx12.exe. Sometimes you will encounter entire functions that will be related to it, other times it'll be some inlined code in some important game/engine functions. It uses a basic xor transform on it's c-strings, which makes it so that it will only be decrypted on the stack. However, it's quite easy to statically analyze a runtime dump of Apex Legends, and figure out a way to:

  1. Find all instances of encrypted R5AC C-String's, preferably automated.

  2. Figure out the following parameters for this transformation:

    • Location of the encrypted data.

    • Location of the encryption key.

    • Length of the encrypted data.

  3. In case of this cheat detection software, the length of an encrypted C-String's encoded data equals it's encryption key's size. This might be done to prevent repeating keys during the XOR transform, which can weaken the overall effectiveness of encryption.

 

What are it's capabilities?

Generally speaking, this specific solution seems to focus on the game process and it's local process context. It mostly features detections for internal cheats. These detections range from heurstics all the way down to very specific, concrete signals.

Introduction

Obfuscation: Constant (C-String)

R5AC uses a simple XOR algorithm where the decryption key length and encrypted content length are identical.

Referenced & encoded C-Strings Analysis

0x20ea35 KERNEL32.dll
0x3a3e51 ntdll.dll
0x54ee61 ADVAPI32.dll
0x542551 steamnetworkingsockets.dll
0x542691 steam_api64.dll
0x2f1cc2 EOSSDK-Win64-Shipping.dll
0x54ee31 EasyAntiCheat_EOS
0x3a3e81 wine_get_version

0x20ea60 K32GetMappedFileNameA
0x20ee00 VirtualQuery
0x20f160 GetLastError
0x7df831 VirtualProtect
0x54ee91 OpenSCManagerA
0x54eec1 OpenServiceA
0x54eef1 QueryServiceStatusEx
0x54ef21 CloseServiceHandle
0x543471 WideCharToMultiByte
0x541fc0 RtlCaptureStackBackTrace

Control Flow Analysis / Game Functions

0x20e9f0 CS_CEngineClient::Engine_SetViewAngles
0x26c540 CS_CNetChan::SetTimeout
0x26dfe0 CS_CNetChan::SendReliableMessages
0x270511 CS_CNetChan::SendDatagram
0x2744c1 CS_CNetChan::SendNetMsg
0x275210 CS_CNetChan::SendData
0x3ae540 CS_Playlist_GetPlaylistVar
0x7cf601 CS_C_BaseEntity::CalcAbsoluteVelocity
0x878620 CS_CViewRender::GetMostRecentClipTransform
0x951be1 CS_CInput::Input_CreateMove
0x952811 VTP_CInput::Input_CreateMove
0x59ebd0 CS_CCommandBuffer::AddText
0x69b830 CS_UTIL_TraceRay_Client
0xa58200 CS_C_BaseEntity::GetEntityNameAsCStr
0xabe800 CS_C_MoveData::MoveData_Init
0xcc4e10 CS_Pak_RequireSignedPaks
0xcc8c51 CS_Pak_ValidateSignatureForCurrentReadingFile
0xcd89a1 CS_WrappedFileSystem_Open

Virtual Method Table Analysis

0x22ee01 VTP_GetEngineTraceClient
0x22f271 VTP_GetEngineTraceClientDecals
0x479351 VTP_GetFilesystemInterface
0x817371 VTP_C_Player::Spawn
0x865491 VTP_GetEntityList
0x9f13b1 VTP_GetViewRenderInstance

 

Miscellaneous

0x20f0f0 BA:0x%llX AB:0x%llX RS:0x%llX AP:0x%lX PR:0x%lX TY:0x%lX
0x5427e0 Callstack Init Failed
0x543821 os_version
0x543a12 gpu_vendor
0x543c91 render_device_driver_version
0x543e81 cpu_brand
0x544042 windows_install_date
0x544205 is_wine
0x544231 0
0x544260 1
0x544780 language
0x544a40 HWID_%02X-%02X
0x544ab0 %02X
0x544db1 HWID_%02X-FAILURE
0x54a0b1 %u:%u:%X:%llX:%llX:%llX
0x54fa91 Startup
0x7dfb91 remove permissions

Anti-Cheat Networking

Understanding how an anti-cheat communicates will help you navigate around it more efficiently.

Anti-Cheat Networking

Client>Server Communication

There is no singular function that is responsible for this task. In Apex, we rather have multiple of those working together. 

It is very unlikely that respawn is using just one function for their telemetry exchange. I have encountered at least 1 different function that also submits telemetry in a similar way to PushViolation. If you're watching their violation queues, you need to be aware that in certain scenarios they will send a NetMessage directly. In such a case, your logging would be incomplete.

Let's get started with the most common function, R5AC::PushViolation:

void __fastcall R5AC::PushViolation(
        const __m128i *pszIdentifierStr,
        char Severity,
        __int64 ExtraDataPtr,
        __int64 ExtraDataLen);

In case of client-side anomalies being detected, it will be invoked like this:

LBL_ON_ABNORMALITY_FOUND:
              v119 = v116();
              v120 = 0;
              v121 = 0i64;
              do
              {
                v122 = *(_BYTE *)(v121 + 41489128); // these are just data and key, and the RVA can be computed with analysis of a runtime dump.
                ++v120;
                v123 = *(_BYTE *)(v121 + 27928337);
                v188[++v121 + 15] = v123 ^ v122;
              }
              while ( v120 < 0xC ); // C-String encryption using simple xor
              sprintf_s_2(Buffer, 0x104ui64, Format, v119);
            }
          }
          R5AC::PushViolation(v200, 1, v177, (__int64)Buffer);

It's purpose is to enqueue a new violation record into a list that is fetched and emptied by numerous callers, all originating from r5apex_dx12.exe. These are to be considered slaves because they simply check if there is any messages pending, use CLC_AntiCheat virtual method table to setup a new netmessage in source engine, and then puts the data of the anti-cheat violation/message into the netmsg and sends it to the game server.

if ( gpNetChan )
  {
    v14 = vft::CLC_AntiCheatMsg;
    v15 = 0;
    v17 = 0i64;
    v5 = 5;
    v16 = 1;
    // send all of them in bulk
    for ( i = 0; (unsigned __int8)R5AC::PopAnticheatMsg(v20, &i); --v5 )
    {
      if ( !v5 )
        break;
      v18 = v20;
      v19 = i;
      C_NetChan::SendNetMsg(v4, &v14, 0, 0);
      C_NetChan::SendDatagram(v4, 0i64);
    }
  }

Additionally, there is a couple more ways for the anti-cheat to phone back home. Let me introduce you R5AC::TrySendViolationOrQueue. It behaves almost identically to it's predecessor, with the twist that if your game client has an active network channel instance (or in other words: an active connection to a game server is present), it will bypass it's usual queue-based system and directly send it to the game server.

It should be noted that they no longer use any readable strings for the violation/message identifier. Instead, they will use a numeric, hexadecimal value (64-bit). Example: 0xA7F3C91D5B82E46F. This might be unfortunate because you could use these strings to automatically resolve certain game functions and also interface pointers. Sure, you could leverage old dumps and still find most stuff through manual reversing, but I would say grabbing them automatically like this did have an appeal.  

void __fastcall R5AC::TrySendViolationOrQueue(
        const __m128i *id_str,
        __int64 a2,
        __int64 extraData,
        const __m128i *extraDataLen)
{
  --*(_DWORD *)(v4 + 68);
  v5 = gpNetChan;
  if ( gpNetChan && (unsigned int)MEMORY[0x7FFE8D2B5550](id_str, 0i64) == dword_594427C )
  {
    v28 = 0;
    v9 = id_str;

    do
    {
      v10 = v9->m128i_i8[0];
      v9->m128i_i8[pszBuffer - (char *)id_str] = v9->m128i_i8[0];
      v9 = (const __m128i *)((char *)v9 + 1);
    }
    while ( v10 );

    idStrLength = -1i64;
    do
      ++idStrLength;
    while ( id_str->m128i_i8[idStrLength] );
    v12 = &pszBuffer[idStrLength + 1];
    if ( extraDataLen )
    {
      idx = -1i64;
      do
        ++idx;
      while ( extraDataLen->m128i_i8[idx] );
      R5::AllocAndCopyStruWithHdr(
        &mem,
        extraDataLen,
        idx,
        (__int64 (__fastcall **)(_QWORD, unsigned __int64, __int64))off_1AA6728);
      extraDataPtr = mem;
    }
    else
    {
      extraDataPtr = 0i64;
      mem = 0i64;
    }
    *(_DWORD *)v12 = 1;
    v12[4] = 0;
    *(_QWORD *)(v12 + 5) = extraData;
    sse_memcpy((__m128i *)(v12 + 13), extraDataPtr, (unsigned int)(extraDataPtr[-1].m128i_i32[3] + 1));
    v15 = (_DWORD)v12 - ((unsigned int)&v27 + 880) + 14 + extraDataPtr[-1].m128i_i32[3];
    someKey = 0x42A1110F96B5E116i64;
    v16 = 0;
    if ( v15 != 2 )
    {
      v17 = pszBuffer;
      do
      {
        ++v17;
        v18 = v16++ & 7;
        *(v17 - 1) ^= *((_BYTE *)&someKey + v18);
      }
      while ( v16 < v15 - 2 );
    }
    v26 = v15;
    *(_QWORD *)&v21 = vft::CLC_AntiCheatMsg;
    v22 = 0;
    v25 = &v28;
    v24 = 0i64;
    v23 = 1;
    C_NetChan::SendNetMsg(v5, &v21, 0, 0);
    C_NetChan::SendDatagram(v5, 0i64);
    sse_memset((__int64)&v28, 0, 0x400ui64);
    *(_QWORD *)&v21 = &off_173A878;
    if ( _InterlockedExchangeAdd(&extraDataPtr[-1].m128i_i32[2], 0xFFFFFFFF) == 1 )
      (*(void (__fastcall **)(__int64))(extraDataPtr[-1].m128i_i64[0] + 8))(extraDataPtr[-1].m128i_i64[0]);
  }
  else
  {
    R5AC::PushViolation(id_str, 0, extraData, (__int64)extraDataLen);
  }

I have tried sending random stuff through this function before their switch to numeric ID's. I don't know if it ever arrived, probably not if they realistically filter for garbage. I can say that it was successfully pushed to the telemetry queue, but whether it was sent: no idea. The idea seems to be funny that you could send messages of your choice through it. What i also found interesting was the question how they process these anti-cheat messages on the server side. I obviously can't know it but i'd imagine its saved somewhere, so they have evidence and can read the raw telemetry or feed it to automation.

image.png

Anti-Cheat Detections

I focused on detections that generate significant evidence of cheating. If you look at it yourself, you might encounter many additional detections much simpler in structure. Checking R5AC encoded strings might help you get an idea for some of them.

Anti-Cheat Detections

Virtual Method Tables

R5AC is ensuring that VMTP's are pointing within expected bounds, and that read-only VMT related data has not been tampered with.


Pointer Verification

Every time the script calls sub_1DCDD1, the virtual method table pointer (VMTP) for the filesystem interface is verified by VTP_GetFilesystemInterface. This function performs an integrity check to ensure the interface has not been tampered with or injected. There are numerous other variants of this VMTP related detection, all on different interfaces and virtual method tables, or object instances.

How the detection works

  1. VMTP location check

    • The function calculates the address of FilesystemInterfaceVMTP and checks whether it lies within a valid PE section of the main game module.

    • If the pointer is outside expected sections, this indicates possible tampering or injection.

  2. Module and export verification

    • It scans the loaded modules for KERNEL32.DLL and finds the export K32GetMappedFileName.

    • This function is used to retrieve the file path of the module where the VMTP resides.

  3. Violation reporting

    • If the VMTP is outside a legitimate module section, R5AC::PushViolation is called.

    • This flags a potential anti-cheat violation.

In more recent builds, R5AC has started verifying that the backing segment of the VMTP's linear address are having a plausible characteristics. it must contain IMAGE_SCN_CNT_INITIALIZED_DATA/IMAGE_SCN_MEM_READ


Conclusion:
VTP_GetFilesystemInterface is an anti-tamper routine that validates the location of the filesystem VMTP and ensures it points to legitimate code within the game’s module. Any deviation triggers a violation report, preventing injected or modified interfaces from being used.

Here is an example of how this detection might look like.

// Everytime sub_1DCDD1 is called, the check (VTP_GetFilesystemInterface) is executed.

char __fastcall sub_1DCDD1()
{ 
  FilesystemInterface = (__int64 *)R5::VTP_GetFilesystemInterface(); 
  *((_QWORD *)v2 + 16) = FilesystemInterface;
  gpFileSystemInterface[0] = FilesystemInterface;
  return 1;
}

void **R5::VTP_GetFilesystemInterface()
{
    _LIST_ENTRY* lpK32GetMappedFileName = nullptr;
    void* VmtTablePtr = R5::FilesystemInterfaceVMTP;
    void* VmtTablePtr2 = R5::FilesystemInterfaceVMTP;
    __int64 ImageBaseAddress = (__int64)NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;

    // Plaintext strings (replacing encrypted runtime decoding)
    const char ModuleNameStr[] = "KERNEL32.DLL";
    const char ExportFuncStr[] = "K32GetMappedFileName";
    const char InterfaceStr[] = "VTP_GetFilesystemInterface";

    if (*(WORD*)ImageBaseAddress == 0x5A4D) // Check for 'MZ' PE signature
    {
        _IMAGE_NT_HEADERS64* lpNTH = (_IMAGE_NT_HEADERS64*)(ImageBaseAddress + *(int*)(ImageBaseAddress + 0x3C));
        if (lpNTH->OptionalHeader.Magic == 0x20B) // PE32+
        {
            unsigned int NumberOfSections = lpNTH->FileHeader.NumberOfSections;
            char* lpFirstSectionContentStart = (char*)&lpNTH->OptionalHeader + lpNTH->FileHeader.SizeOfOptionalHeader;

            if (NumberOfSections && lpFirstSectionContentStart)
            {
                _IMAGE_SECTION_HEADER* dwTableRVA = (_IMAGE_SECTION_HEADER*)((char*)R5::FilesystemInterfaceVMTP - ImageBaseAddress);
                _DWORD* sectionHeaders = (_DWORD*)(lpFirstSectionContentStart + 8);
                unsigned int nSectionIdx = 0;

                while (true)
                {
                    _IMAGE_SECTION_HEADER* dwSegmentRVA = (_IMAGE_SECTION_HEADER*)(unsigned int)sectionHeaders[1];
                    if (dwSegmentRVA <= dwTableRVA &&
                        (unsigned int)((_DWORD)dwSegmentRVA + *sectionHeaders) > (unsigned __int64)dwTableRVA)
                    {
                        break; // Found containing section
                    }

                    ++nSectionIdx;
                    sectionHeaders += 10;

                    if (nSectionIdx >= NumberOfSections)
                    {
                        // Outside module section — use default
                        VmtTablePtr = VmtTablePtr2;
                        goto ON_DETECTED_OUTSIDE_INGAME_SECTION;
                    }
                }
            }
        }
    }

ON_DETECTED_OUTSIDE_INGAME_SECTION:

    char lpMappedFileName[272] = {0};
    wchar_t NeedleForSomeModule[264] = {0};
    mbstowcs_s(nullptr, NeedleForSomeModule, ModuleNameStr, sizeof(ModuleNameStr));

    // Search loaded modules
    _LIST_ENTRY* p_InMemoryOrderModuleList = &NtCurrentTeb()->ProcessEnvironmentBlock->Ldr->InMemoryOrderModuleList;
    _LIST_ENTRY* Flink = p_InMemoryOrderModuleList->Flink;

    if (Flink != p_InMemoryOrderModuleList)
    {
        while (_wcsicmp(NeedleForSomeModule, (_WCHAR*)Flink[5].Flink) != 0)
        {
            Flink = Flink->Flink;
            if (Flink == p_InMemoryOrderModuleList)
                goto ON_DETECTED;
        }

        _LIST_ENTRY* lpModuleBase = Flink[2].Flink;
        if (lpModuleBase)
        {
LABEL_22:
            if (LOWORD(lpModuleBase->Flink) == 0x5A4D) // 'MZ'
            {
                __int64 lpExportDirectory = (__int64)lpModuleBase + SHIDWORD(lpModuleBase[3].Blink);
                if (*(WORD*)(lpExportDirectory + 24) == 0x20B) // PE32+
                {
                    unsigned int* v27 = (unsigned int*)(lpExportDirectory + 0x88);
                    if (!v27)
                        v27 = nullptr;

                    if (v27)
                    {
                        unsigned int nExportEnumIdx = 0;
                        _DWORD* v29 = (_DWORD*)((char*)lpModuleBase + *v27);
                        __int64 AddressOfFunctions = (__int64)lpModuleBase + (unsigned int)v29[7];
                        __int64 AddressOfNames = (__int64)lpModuleBase + (unsigned int)v29[8];
                        unsigned int NumberOfExports = v29[6];
                        __int64 AddressOfNameOrdinals = (__int64)lpModuleBase + (unsigned int)v29[9];

                        while (nExportEnumIdx < NumberOfExports)
                        {
                            char* lpExportRecordMaybe = (char*)lpModuleBase + *(unsigned int*)(AddressOfNames + 4i64 * nExportEnumIdx);
                            if (strcmp(lpExportRecordMaybe, ExportFuncStr) == 0)
                            {
                                unsigned int dwFunctionRVA = *(_DWORD*)(AddressOfFunctions
                                    + 4i64 * *(unsigned __int16*)(AddressOfNameOrdinals + 2i64 * nExportEnumIdx));

                                lpK32GetMappedFileName = (_LIST_ENTRY*)((char*)lpModuleBase + dwFunctionRVA);
                                break;
                            }
                            ++nExportEnumIdx;
                        }
                    }
                }
            }
        }
    }

ON_DETECTED:

    // Get the module file name of where this VMTP is residing in.
    if (lpK32GetMappedFileName)
        ((void(__fastcall*)(__int64, void*, char*, __int64))lpK32GetMappedFileName)(
            -1,
            VmtTablePtr2,
            lpMappedFileName,
            sizeof(lpMappedFileName)
        );

    // Report violation if needed
    R5AC::PushViolation(nullptr, 2, (__int64)VmtTablePtr2, (__int64)lpMappedFileName);

    return &R5::FilesystemInterfaceVMTP;
}

 

Anti-Cheat Detections

Control Flow Analysis

R5AC is planting control flow enumeration helpers into important game mode.

Just because a module is signed, doesn't mean that R5AC will give it a pass. 

It follows a strict whitelist which at the time of this writing, consisted of the following ranges.

r5apex_dx12.exe (+1000 → +13d2000) ; '.text'
KERNEL32.DLL  (+1000 → +7f4bb) ; '.text'
ntdll.dll (+1000 → +119f1e) ; '.text'
ntdll.dll +11a000 → +11a592) ; 'PAGE'
ntdll.dll (+11b000 → +11b1f9) ; 'RT'
steamnetworkingsockets.dll (+1000 → +2f63a8) ; '.text
steam_api64.dll (+1000 → +243de) ; '.text'
EOSSDK-Win64-Shipping.dll (+1000 → +d8117c) ; '.text

Their whitelist is using a relatively primitive structure for describing what they deem a whitelisted memory range:

struct WHITELISTED_REGION

{

    u64 Begin;

    u64 End;

};

In more recent builds of Apex Legends, this list is now more complex to interpret and seems to have switched to using the LDR directly, with some middle steps that i haven't figured out yet..  EDIT: actually, they still build a list of whitelisted regions. I was just too focused on other things and the hash calculation memes had initially confused me. Check S30 r5apex_dx12.exe+0x1D83E40 for the initializer, which is responsible for looking up the used API's and construct the initial list.

In 2026, R5AC has switched to manual stack tracing via RtlCaptureContext  + RtlLookupFunctionEntry + RtlVirtualUnwind. 

Additionally, respawn seems to have added some old code back, which was basically a broad check for return address spoofing. It first checks if the current retaddr entry that it previously captured using their manual stack unwind. It only proceeds with the actual heuristic if the memory interpreted as uint8 at retaddr-5 is not evaluated to 0xE8.  In x64, this is a direct near CALL instruction using a signed, 32-bit displacement for affecting the program counter. So if it reads something that isn't 0xE8, it will proceed to run the following heuristic. It starts by doing a backwards scan, beginning at retaddr - 2. It then continuously keeps interating until a maximum of 6. It checks whether any code bytes during the backwards scan evaluate to 0xFF. If that is positive, it will try to filter out the REG field of the current instruction's MODRM byte, and if it doesn't find patterns resembling a FF/2 or FF/3 type of CALL instruction, it will fall through to the telemetry submission label,  

Additional heads up: If the currently scanned retaddr happens to be of value zero, it will jump directly to the telemetry submission label. I can't say if the telemetry is actually sent because in that label it does a couple further checks first before finally sending it. 

An example of this instance of detection can be found in C_ViewRender::GetMostRecentClipTransform.

__int64 C_ViewRender::GetMostRecentClipTransform(__int64 a1, char frameIndex)
{
    v152 = frameIndex;    // Prime RNG (seems unrelated to stack walker)
    R5AC::Prime = 214013 * R5AC::Prime + 2531011;    // Early exit: check stack walker enablement
    if (!R5AC::IsStackWalkerEnabled)
        return *(_QWORD *)(a1 + 8i64 * v152 + 1155920);    __int64 stackFrames[2] = { 0 };
    __int128 stackData[2] = { 0 };    unsigned short numFrames = R5AC::Imp::RtlCaptureSBT(1, 5, stackData);
    if (!numFrames)
        return *(_QWORD *)(a1 + 8i64 * v152 + 1155920);    // Compute simple hash of the captured stack
    int hashA = 5381, hashB = 0;
    char* p = reinterpret_cast<char*>(stackData);
    for (size_t i = 0; i < 8 * numFrames; ++i)
    {
        unsigned char val = *p++;
        hashA = val + 33 * hashA;
        hashB = val + 65599 * hashB;
    }
    int stackHash = hashA ^ hashB;    // Lock to check hash
    MEMORY[0x7FFE8D571760](&R5AC::SoemLock, 0);
    char hasChanged = R5AC::HashmapHasChangedData((__int64)&R5::HashedCodeExecutionFrames, &stackHash);
    MEMORY[0x7FFE8D571920](&R5AC::SoemLock);    if (hasChanged != -1)
    {
        // If hash is known, return cached transform
        return *(_QWORD *)(a1 + 8i64 * v152 + 1155920);
    }    // Iterate captured frames
    for (unsigned int i = 0; i < numFrames; ++i)
    {
        __int64 frameAddr = *reinterpret_cast<__int64*>(stackData + i);
        if (!frameAddr)
            break;        // Check if frame is in whitelisted regions
        bool inWhitelist = false;
        for (int j = 0; j < R5AC::WhitelistedSectionCount; ++j)
        {
            _WHITELISTED_SEGMENT_* region = &R5AC::WhitelistedSections[j];
            if (frameAddr >= region->Begin && frameAddr <= region->End)
            {
                inWhitelist = true;
                break;
            }
        }        if (inWhitelist)
            continue;        // If not whitelisted, fetch mapped module and push violation
        char moduleName[272] = { 0 };
        ((void(__fastcall*)(__int64, __int64*, char*, __int64))0)(-1, frameAddr, moduleName, 260);        if (moduleName[0])
        {
            R5AC::PushViolation(nullptr, 1, frameAddr, reinterpret_cast<__int64>(moduleName));
            return *(_QWORD *)(a1 + 8i64 * v152 + 1155920);
        }
    }    // If no violations, store new hash
    MEMORY[0x7FFE8D5790A0](&R5AC::SoemLock, R5AC::WhitelistedSectionCount, numFrames, R5AC::WhitelistedSections);
    sub_2345E0(&R5::HashedCodeExecutionFrames, &stackHash);
    MEMORY[0x7FFE8D562C70](&R5AC::SoemLock);    return *(_QWORD *)(a1 + 8i64 * v152 + 1155920);
}

A look at the Callers of RtlCaptureSBT

Some cheat developers have actually been using the aforementioned functionality against apex. See, because the API respawn uses for stack walking is resolved into an unchecked pointer in .data, anyone can just swap it out and fake the back trace buffer, or even cheaper: pretend like nothing on the stack was unwindable. As if that wasn't enough, respawn also have decided to making calls by referencing it's value across the game's entire code base.

What makes this much worse is the fact that this vulnerable pointer is referenced by numerous critical game functions. It's literally a backdoor so handy that you don't even need to hook CreateMove anymore, for example. You can just swap this pointer, check if caller (return address) is C_Input::CreateMove, and and that's it! Well, you'd also have to reconstruct the arguments passed down to it if your hook cares about that. It definitely will if you are planning to use the sequence number argument to retrieve an usercmd pointer.

Actually, you could detect this quite trivially by checking where these manually resolved API's point to. You might also be detected indirectly if they actually keep track of writable regions and diff them or something like that. I know that approach might be very effective for catching changes on read-only stuff. Maybe they're doing these or something else already.

Above code was tested on retail apex legends, on both windows and linux. Since the flaw is in R5AC itself, platform mostly does not matter.

Anti-Cheat Detections

Badware Forwarding

I'm not entirely sure on who is doing the actual badware checking, i suspect it might be either Theia or R5AC. 

While apex had still used EAC+Theia, there used to be a callback that inside the game that was called everytime a badware detection has fired. So the flow is you get the badware message, and in the background, Apex might send the violation possibly containing an identifier for the blacklisted tool that was detected. 

I did a quick test by first neutralizing R5AC::PushViolation, and then monitoring it while simultaneously launching IDA Pro, which apparently was on their list of applications considered as badware. The result was that PushViolation was called multiple times nearly imemdiately after the blacklisted application was launched.

image.png

I should have tried launching cheat engine or some other blacklisted program and compare the c-string it passed to PushViolation. Sadly i have not done that so i can only speculate if they actually have a way of distinguishing the blacklisted application that was detected. It would certainly make sense though, purely from a detection perspective.

https://www.youtube.com/watch?v=Tcc6eExS7hk

It should be noted that this is one of the few functions that make use of the R5AC::PushViolation variant that, under the conditions where the game client currently has an active network channel to the game server, it will attempt to transmit the violation message directly via C_NetChan::SendNetMsg and C_NetChan::SendDatagram.

Hardware ID

Hardware ID

Does R5AC have hardware fingerprinting capabilities?

Not directly, but Apex Legends itself additionally uses Theia for a second form of machine fingerprinting. It doesn't replace EAC's mechanisms for the same thing, but rather seems to work alongside it. As an additional vector, so to speak.

The game will build a string that seems to resemble a hardware ID. I haven't reconstructed it fully yet, which is why this page is to be considered work in progress.

I've seen routines in both apex legends itself, but also theia's runtime which seem to be responsible for doing stuff with hardware identification. It seems like theia's runtime is doing all the heavy lifting, as i was able to trace a lot of NtDeviceIoControlFile calls from some suspicious region in apex legends. Of course it was the theia runtime. It led me to multiple giant functions which used various IOCTL codes and addressed different devices. Name of the devices were encrypted using some inline transformation in the code. But it seems fairly trivial to decrypt. 

When i'll have some free time again, i will verify which codes are actually really queried in a live system.