Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

How to find a patterns?


Anderholm
 Share

Recommended Posts

Hi all! Who can help me with patterns searching? How it works? For example - i need to "convert" (or find) this:

static void SET_ENTITY_COLLISION(Entity entity, BOOL toggle, BOOL keepPhysics) { invoke<Void>(0x1A9205C1B9EE827F, entity, toggle, keepPhysics); } // 0x1A9205C1B9EE827F 0x139FD37D

 

to this:

 

"\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x41\x8A\xF1\x41\x8A\xE8\x40\x8A\xFA",
"xxxx?xxxx?xxxx?xxxxxxxxxxxxxx"
Edited by Antrix
Link to comment
Share on other sites

I think this question deserves an answer from people who have enough knowledge to explain it.

It would be quite useful in many situations.

Link to comment
Share on other sites

Scriptkiddy1337

This isn't an Question with an easy answer.

First of all, you can't do it with ScriptHookV, because it takes the Part to translating the Initial Identifier Hash to current Hash which you will need for it.

If you have access to the Native VTable directly it will work like this:

You search for the current Hash in there and prints out the jmp Address behind it.

In an Disassembler you will go to this jmp and will find something like this:

 

.text:0000000142496750 loc_142496750:                          ; CODE XREF: .text:000000013FD1C22Cj.text:0000000142496750                 mov     rax, [rcx+10h].text:0000000142496754                 mov     r9b, 1.text:0000000142496757                 cmp     dword ptr [rax+8], 0.text:000000014249675B                 mov     ecx, [rax].text:000000014249675D                 setnz   dl.text:0000000142496760                 cmp     dword ptr [rax+10h], 0.text:0000000142496764                 setnz   r8b.text:0000000142496768                 lea     rsp, [rsp-8].text:000000014249676D                 mov     [rsp], rbp.text:0000000142496771                 lea     rbp, sub_13FD49778.text:0000000142496778                 xchg    rbp, [rsp].text:000000014249677C                 lea     rsp, [rsp+8].text:0000000142496781                 jmp     qword ptr [rsp-8].text:0000000142496785 ; ---------------------------------------------------------------------------.text:0000000142496785 ; START OF FUNCTION CHUNK FOR sub_143A0B6E7
The Natives looks most like this and most referce to a piece of Codeblock, which is only part of a way bigger function, however:

Int this Function we can see 1 sub routine

 

Now you disassemble this Function and see something like this:

 

int __fastcall sub_13FD49778(__int64 a1, char a2, char a3, char a4){  char v4; // [email protected]  char v5; // [email protected]  char v6; // [email protected]  __int64 v7; // [email protected]  __int64 v8; // [email protected]  __int64 v9; // [email protected]  __int64 v10; // [email protected]  __int64 v11; // [email protected]  __int64 v12; // [email protected]  Concurrency::details::HardwareAffinity *v13; // [email protected]  __int64 v14; // [email protected]  char v15; // [email protected]  __int64 v16; // [email protected]  v4 = a4;  v5 = a3;  v6 = a2;  LODWORD(v7) = sub_13FD0BBD8();  v9 = v7;  if ( v7 )  {    if ( !byte_141A2294C      || *(_BYTE *)(v7 + 40) != 4      || !v6      || *(_QWORD *)(qword_141641090 + 8) != v7      || (LODWORD(v7) = sub_1402AFBD0(), !(_BYTE)v7) )    {      if ( *(_BYTE *)(v9 + 40) != 4 || (LODWORD(v7) = *(_DWORD *)(v9 + 5112) >> 30, !(v7 & 1)) )      {        v10 = *(_QWORD *)v9;        if ( v6 )        {          (*(void (__fastcall **)(__int64, _QWORD, _QWORD))(v10 + 640))(v9, 0i64, 0i64);        }        else        {          LOBYTE(v8) = v4;          (*(void (__fastcall **)(__int64, _QWORD, __int64))(v10 + 648))(v9, 0i64, v8);        }        if ( *(_BYTE *)(v9 + 40) == 5 )        {          v12 = *(_QWORD *)(v9 + 48);          if ( v12 )          {            if ( v6 )            {              (*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 608i64))(v9);            }            else if ( !v5 && *(_WORD *)(v12 + 24) != -1 )            {              (*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 616i64))(v9);            }            if ( byte_141A2294C )            {              v13 = *(Concurrency::details::HardwareAffinity **)(v9 + 208);              if ( v13 )              {                if ( Concurrency::details::HardwareAffinity::GetGroup(v13) == 5 )                {                  v14 = *(_QWORD *)(v9 + 208);                  v15 = qword_141EC0AC4;                  *(_BYTE *)(v14 + 437) |= 0x20u;                  *(_BYTE *)(v14 + 439) = v15;                }              }            }          }        }        v16 = *(_QWORD *)v9;        if ( v6 )        {          LODWORD(v7) = (*(int (__fastcall **)(__int64, _QWORD, _QWORD))(v16 + 640))(v9, 0i64, 0i64);        }        else        {          LOBYTE(v11) = v4;          LODWORD(v7) = (*(int (__fastcall **)(__int64, _QWORD, __int64))(v16 + 648))(v9, 0i64, v11);        }        if ( *(_BYTE *)(v9 + 40) == 4 )        {          LODWORD(v7) = (*(_DWORD *)(v9 + 5132) ^ -(v6 == 0)) & 0x40000000;          *(_DWORD *)(v9 + 5132) ^= v7;          if ( v4 || v6 )            *(_DWORD *)(v9 + 5148) ^= (*(_DWORD *)(v9 + 5148) ^ -(v6 == 0)) & 0x80000000;        }      }    }  }  return v7;}
and thats it already, now you click on the Address and creates a Signatur with Sigmaker.

The Sideeffect of this is, we found out the Native is wrong documentated, because this Function have 3 bools and not only 2, like in natives.h declared.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.