L L4D2node

std::__insertion_sort<unsigned_char*>

0x00143730 · 151 bytes · unknown

_ZSt16__insertion_sortIPhEvT_S1_

Decompiled

void (2 params)

/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* void std::__insertion_sort<unsigned char*>(unsigned char*, unsigned char*) */

void std::__insertion_sort<unsigned_char*>(uchar *param_1,uchar *param_2)

{
  byte bVar1;
  byte bVar2;
  byte *pbVar3;
  size_t __n;
  byte *pbVar4;
  bool bVar5;
  uchar *local_20;
  
  if ((param_1 != param_2) && (pbVar4 = param_1 + 1, param_2 != pbVar4)) {
    local_20 = param_1 + 2;
    do {
      bVar1 = *pbVar4;
      if (bVar1 < *param_1) {
        __n = (int)pbVar4 - (int)param_1;
        if (__n != 0) {
          memmove(local_20 + -__n,param_1,__n);
        }
        *param_1 = bVar1;
      }
      else {
        bVar2 = pbVar4[-1];
        pbVar3 = pbVar4;
        while (bVar1 < bVar2) {
          *pbVar3 = bVar2;
          bVar2 = pbVar3[-2];
          pbVar3 = pbVar3 + -1;
        }
        *pbVar3 = bVar1;
      }
      pbVar4 = pbVar4 + 1;
      bVar5 = local_20 != param_2;
      local_20 = local_20 + 1;
    } while (bVar5);
  }
  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)