Solved Semantics of function 0x463600

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

St. Ansen

Newbie
Full Member
Aug 4, 2017
8
52
0
Hello experts,

I am trying to find AssaultCube's traceline routine on my own and I got stuck right away. May I kindly ask you to take a look at a routine IDA has decompiled (it's at 0x463600). I struggle with its semantics.
The routine is repeatedly called whenever a gun is drawn and stays out (not for knife or grenades). It is related to decrementing the clip ammo.

C++:
char __thiscall SthSthDecrementAmmo(_DWORD *this, int a2)
{
    _DWORD *v1;
    int v2;
    _DWORD *v4;
    // ... some more declarations

    v1 = this; // local player 
    // ... sth unrelated
    v4 = (_DWORD *)v1[6]; // line in question
    v5 = time_us - *(_DWORD *)(v1[2] + 0x210) - *v4;

    //... rest of the routine
}
It looks to me as:
  • v1 stores the local player's base address
  • v1[6] accesses the 6th element in the player struct; v1[6] = *(v1 + 6*sizeof(DWORD))
  • v4 interprets whatever is at v1 + 0x6 as a pointer
  • *v4 dereferences the pointer

Problem is that the sixth DWORD in the player struct (offset 0x18) seems to be some kind of counter, triggered by shooting or jumping and dependent on your view angles. It certainly does not look like an address to me. The values vary between 0 and sth. in the order of 10[SUP]9[/SUP] ( ~2[SUP]32[/SUP]ish) so it makes no sense to dereference it.

Here's a snapshot from cheat engine when the routine gets called with the memory location in question.


Where did I go wrong? It all looks as if the function is simply comparing some counters against each other and/or the game time, but I would like to get behind my mistake.

Thank you
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
That is another position, almost sure of it.
Change them to floats so they make sense.
What I do when I see some stupid numbers like that that just don't make sense, I'll change the view to hex.
If it doesn't look like a valid address, I'll change it to float.

iirc that function is fed the result of traceline... my memory isn't the greatest ever though :p
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods