Skip to content

Instantly share code, notes, and snippets.

@H0neyCake
Last active May 5, 2019 21:15
Show Gist options
  • Save H0neyCake/131dc2285f6f569775b0a0cc8860cfd2 to your computer and use it in GitHub Desktop.
Save H0neyCake/131dc2285f6f569775b0a0cc8860cfd2 to your computer and use it in GitHub Desktop.
pbo_hider_x64
/*
pbo is the pbo pointer from the pbo list (eg. 'Mem.ReadPtr(pboList + 0 * 0x8);' gets the first pbo)
*/
public string GetPboName(ulong pbo)
{
int aStrPtr = Mem.ReadPtr(pbo + 0x20); // not sure if changed, find on reclass
string path = Mem.ReadArmaString(aStrPtr);
return Path.GetFileName(path);
}
/*
The id is the number of the pbo, you can get it by iterating through all the pbos
and printing the name and the number and just take the one you want
*/
public void HidePbo(int id)
{
// get these yourself
ulong pboManager = 0x000000;
ulong baseAddr = 0x000000;
// read the necessary pointers
ulong pboPtr = Mem.ReadPtr(baseAddr + pboManager);
ulong pboList = Mem.ReadPtr(pboPtr);
ulong pboCount = Mem.ReadInt(pboPtr + 0x8);
// increase the id by one so the id gets overridden
id++;
// for all of the pbos after the one we want to hide
for (int i = id; i < pboCount; i++)
{
int tmp = i;
// read the pointer of the pbo
ulong pbo = Mem.ReadPtr(pboList + (ulong)tmp * 0x8);
// take one from the id
tmp--;
// write the pointer to the place of the previous pbo
Mem.WritePtr(pboList + (ulong)tmp * 0x8, pbo);
}
// make the list a bit smaller
pboCount--;
Mem.WriteInt(pboPtr + 0x8, pboCount);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment