[Wildstar] 1.0.8.6697 x86 Info Dump Thread menu

User Tag List

Results 1 to 11 of 11
  1. #1
    temp321's Avatar Sergeant
    Reputation
    7
    Join Date
    Dec 2012
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Wildstar] 1.0.8.6697 x86 Info Dump Thread

    Binaries

    Download 6697.zip from Sendspace.com - send big files the easy way

    Code:
    Manager 0x86bec8
    
    class Manager
    {
    public:
    char _0x0000[4];
    	__int32 Lock; //0x0004 
    	float SecondsSinceLoadScreen; //0x0008 
    	__int32 TenthsOfSecondSinceChoosingCharacter; //0x000C 
    char _0x0010[44];
    	Unit* LocalPlayer; //0x003C 
    };
    
    class Unit
    {
    public:
    char _0x0000[4];
    	__int32 GUID; //0x0004 
    	UTF16* Name; //0x0008 
    char _0x000C[28];
    	__int32 Level; //0x0028 
    char _0x002C[4];
    	__int32 Health; //0x0030 
    char _0x0034[4];
    	__int32 Shield; //0x0038 
    char _0x003C[24];
    	Unit* NextUnit; //0x0054 
    	__int32 Type; //0x0058 
    };
    Can someone explain how to locate the first Unit?

    [Wildstar] 1.0.8.6697 x86 Info Dump Thread
  2. #2
    karnkore's Avatar Member
    Reputation
    7
    Join Date
    Sep 2012
    Posts
    130
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe try pointer scans with cheat engine?

  3. #3
    temp321's Avatar Sergeant
    Reputation
    7
    Join Date
    Dec 2012
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by karnkore View Post
    Maybe try pointer scans with cheat engine?
    I don't see how that will help. I know the Unit for the player is at Manager + 3C, but it is the last Unit in the linked list.

    The first Unit in the linked list changes all the time because it is a singly linked list and the only way to add to a singly linked list is to add it at the beginning.

    I tried reversing GetUnitById but it doesn't seem to touch the linked list at all.

  4. #4
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by temp321 View Post
    I don't see how that will help. I know the Unit for the player is at Manager + 3C, but it is the last Unit in the linked list.

    The first Unit in the linked list changes all the time because it is a singly linked list and the only way to add to a singly linked list is to add it at the beginning.

    I tried reversing GetUnitById but it doesn't seem to touch the linked list at all.
    GetUnitById basically takes the ID and does modulo 4091 or something like that.
    Then uses that as an index in a unit array and compares if the IDs match. If they don't it checks the next place in the array. That way you can almost gurantee O(1).

    Code:
    uint32 currIndex = unitId;
    CUnit *currUnit = nullptr;
    
    do {
        currUnit = sGameMgr->m_unitArray[currIndex++ % 4091];
        if (!currUnit)
            return nullptr; // unit not present
    } while (currUnit->unitId != unitId);
    Something like that.
    Last edited by Master674; 05-25-2014 at 04:04 AM.

  5. #5
    temp321's Avatar Sergeant
    Reputation
    7
    Join Date
    Dec 2012
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Master674 View Post
    GetUnitById basically takes the ID and does modulo 4091 or something like that.
    Then uses that as an index in a unit array and compares if the IDs match. If they don't it checks the next place in the array. That way you can almost gurantee O(1).

    Code:
    uint32 currIndex = unitId;
    CUnit *currUnit = nullptr;
    
    do {
        currUnit = sGameMgr->m_unitArray[currIndex++ % 4091];
        if (!currUnit)
            return nullptr; // unit not present
    } while (currUnit->unitId != unitId);
    Something like that.
    Ya I already reversed almost all of it. I think it is actually a hash table with linked lists at each bucket. I guess I could use this, but it would be much more efficient to find the start of the linked list.

    Code:
    signed int __cdecl GameLib_GetUnitById(int luastate)
    {
      int *UnitPointer; // eax@1
      signed int result; // eax@3
      int one; // [sp+8h] [bp-4h]@1
    
      one = luaL_CheckNumber(luastate, 1);
      UnitPointer = (int *)FindHash(manager + 23892, (int)&one);
      if ( UnitPointer && *UnitPointer )
      {
        result = Apollo::GetUnit(luastate, *UnitPointer);
      }
      else
      {
        result = 1;
        *(_DWORD *)(*(_DWORD *)(luastate + 8) + 8) = 0;
        *(_DWORD *)(luastate + 8) += 16;
      }
      return result;
    }
    Code:
    struct HashTable
    {
        int unknown1;                               // +0 is not a vtable pointer
        int bucketSize;                             // +4
        HashEntry* slots;                           // +8
        int Hasher?(int slot);                    // +12
        bool PointsToSameValue(void* a, void* b); // +16
    }
    
    struct HashEntry
    {
        int unknown1;     // +0
        HashEntry* next;  // +4
        int id?;          // +8
        void* value;      // +12
    }
    Code:
    int __thiscall FindHash(int hashtable, int id)
    {
      int hashtable2; // ebx@1
      unsigned int hashed_index; // edi@1
      int entry; // esi@1
      int result; // eax@5
    
      hashtable2 = hashtable;
      hashed_index = (*(int (__cdecl **)(int))(hashtable + 12))(id);
      entry = *(_DWORD *)(*(_DWORD *)(hashtable2 + 8) + 4 * hashed_index % *(_DWORD *)(hashtable2 + 4));
      if ( entry )
      {
        while ( hashed_index != *(_DWORD *)entry || !(*(int (__cdecl **)(int, int))(hashtable2 + 16))(id, entry + 8) )// compare arg1 and arg2 dereferenced
        {
          entry = *(_DWORD *)(entry + 4);
          if ( !entry )
            goto LABEL_5;
        }
        result = entry + 12;
      }
      else
      {
    LABEL_5:
        result = 0;
      }
      return result;
    }
    Last edited by temp321; 05-25-2014 at 04:41 PM.

  6. #6
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    #pragma pack(push, 1)
    struct SimpleHashTable
    {
      _DWORD dword0;
      _DWORD Size;
      HashEntry **Slots;
      int (__cdecl *GetKeyFunc)(int);
      int (__cdecl *EqualityComparator)(int, int *);
    };
    #pragma pack(pop)
    Code:
    #pragma pack(push, 1)
    struct __declspec(align(2)) HashEntry
    {
      DWORD Key;
      HashEntry *Next;
      int ID;
      void *Value;
    };
    #pragma pack(pop)
    Code:
    void **__thiscall SimpleHashTable::Find(SimpleHashTable *this, int a2)
    {
      unsigned int v3; // edi@1
      HashEntry *v4; // esi@1
      void **result; // eax@5
    
    
      v3 = this->GetKeyFunc(a2);
      v4 = this->Slots[v3 % this->Size];
      if ( v4 )
      {
        while ( v3 != v4->Key || !this->EqualityComparator(a2, &v4->ID) )
        {
          v4 = v4->Next;
          if ( !v4 )
            goto END_OF_LIST;
        }
        result = &v4->Value;
      }
      else
      {
    END_OF_LIST:
        result = 0;
      }
      return result;
    }

  7. #7
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And for kickers...

    Code:
    signed int __cdecl Script::GameLib::GetUnitById(lua_State *a1)
    {
      void **ppUnit; // eax@1
      signed int nArgsOnStack; // eax@3
      int inputArg; // [sp+8h] [bp-4h]@1
    
    
      inputArg = luaL_checknumber(a1, 1);
      ppUnit = SimpleHashTable::Find(&g_GameManager->Actors, &inputArg);
      if ( ppUnit && *ppUnit )
      {
        nArgsOnStack = Apollo::CreateUnitMetaTable(a1, (int)*ppUnit);
      }
      else
      {
        nArgsOnStack = 1;
        a1->top->tt = 0;
        ++a1->top;
      }
      return nArgsOnStack;
    }

  8. #8
    cute_star's Avatar Sergeant
    Reputation
    4
    Join Date
    Apr 2014
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i downloaded the 6697 version ,but i can't find Manager at 0x86bec8.
    that is code section , not data section.
    What is that ?

  9. #9
    Midi12's Avatar Contributor
    Reputation
    90
    Join Date
    Sep 2012
    Posts
    182
    Thanks G/R
    6/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by cute_star View Post
    i downloaded the 6697 version ,but i can't find Manager at 0x86bec8.
    that is code section , not data section.
    What is that ?
    You need to rebase your program to 0x00001000

  10. #10
    cute_star's Avatar Sergeant
    Reputation
    4
    Join Date
    Apr 2014
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your advice ,and then how to get all units ? thanks again

  11. #11
    cute_star's Avatar Sergeant
    Reputation
    4
    Join Date
    Apr 2014
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how can i get the postion of all units ?

Similar Threads

  1. [Wildstar] 1.0.7.6677 x86 Info Dump Thread
    By JuceMMOCrawler in forum Wildstar Memory Editing
    Replies: 3
    Last Post: 05-14-2014, 12:13 PM
  2. [Wildstar] 1.0.7.6670 x86 Info Dump Thread
    By -Ryuk- in forum Wildstar Memory Editing
    Replies: 3
    Last Post: 05-11-2014, 05:47 AM
  3. [Wildstar] 1.0.7.6658 x86 Info Dump Thread
    By -Ryuk- in forum Wildstar Memory Editing
    Replies: 24
    Last Post: 05-08-2014, 05:20 PM
  4. [Wildstar] 1.0.3.6610 x86 Info Dump Thread
    By Midi12 in forum Wildstar Memory Editing
    Replies: 0
    Last Post: 04-04-2014, 06:01 PM
  5. [Wildstar] 0.5.12.6395 x86 Info Dump Thread
    By Master674 in forum Wildstar Memory Editing
    Replies: 4
    Last Post: 03-26-2014, 02:44 PM
All times are GMT -5. The time now is 02:23 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search