L L4D2node

CVEngineServer::DrawMapToScratchPad

0x0022d560 · 414 bytes · __cdecl

_ZN14CVEngineServer19DrawMapToScratchPadEP13IScratchPad3Dm

Decompiled

undefined (2 params)

/* CVEngineServer::DrawMapToScratchPad(IScratchPad3D*, unsigned long) */

void CVEngineServer::DrawMapToScratchPad(IScratchPad3D *param_1,ulong param_2)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined4 *puVar7;
  int local_50;
  byte *local_40;
  int local_30 [8];
  
  iVar4 = *(int *)(host_state + 0x134);
  if ((iVar4 != 0) &&
     (local_40 = (byte *)(*(int *)(host_state + 0x138) * 0x20 + *(int *)(iVar4 + 0x78)),
     0 < *(int *)(host_state + 0x13c))) {
    local_50 = 0;
    iVar6 = host_state;
    do {
      if ((*local_40 & 0x10) == 0) {
        local_30[0] = 0;
        iVar6 = 0;
        local_30[1] = 0;
        local_30[2] = 0;
        local_30[3] = 0;
        local_30[4] = 0;
        if (local_40[3] != 0) {
          do {
            iVar5 = local_30[3];
            puVar7 = (undefined4 *)
                     (*(int *)(iVar4 + 0x20) +
                     (uint)*(ushort *)
                            (*(int *)(iVar4 + 0x88) + (*(int *)(local_40 + 8) + iVar6) * 2) * 0xc);
            uVar1 = *puVar7;
            uVar2 = puVar7[1];
            uVar3 = puVar7[2];
            CUtlVector<CSPVert,CUtlMemory<CSPVert,int>>::GrowVector
                      ((CUtlVector<CSPVert,CUtlMemory<CSPVert,int>> *)local_30,1);
                    /* try { // try from 0022d668 to 0022d6d9 has its CatchHandler @ 0022d70f */
            CUtlVector<CSPVert,CUtlMemory<CSPVert,int>>::ShiftElementsRight
                      ((CUtlVector<CSPVert,CUtlMemory<CSPVert,int>> *)local_30,iVar5,1);
            puVar7 = (undefined4 *)(iVar5 * 0x1c + local_30[0]);
            if (puVar7 != (undefined4 *)0x0) {
              puVar7[3] = 0x3f800000;
              puVar7[4] = 0x3f800000;
              *puVar7 = uVar1;
              puVar7[1] = uVar2;
              puVar7[2] = uVar3;
              puVar7[5] = 0x3f800000;
              puVar7[6] = 0x3f800000;
            }
            iVar6 = iVar6 + 1;
          } while (iVar6 < (int)(uint)local_40[3]);
        }
        (**(code **)(*(int *)param_2 + 0x20))(param_2,local_30);
        local_30[3] = 0;
        CUtlMemory<CSPVert,int>::Purge((CUtlMemory<CSPVert,int> *)local_30);
        local_30[4] = local_30[0];
        CUtlMemory<CSPVert,int>::Purge((CUtlMemory<CSPVert,int> *)local_30);
        iVar6 = host_state;
      }
      local_50 = local_50 + 1;
      local_40 = local_40 + 0x20;
    } while (local_50 < *(int *)(iVar6 + 0x13c));
  }
  return;
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)