GetAcdByAcdId menu

Shout-Out

User Tag List

Results 1 to 13 of 13
  1. #1
    Dakoon's Avatar Member
    Reputation
    1
    Join Date
    Apr 2013
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GetAcdByAcdId

    I dont get the "GetAcdByAcdId"-function for 2.0.3.22427 to work -.-

    i tried to write the function at 0x00954AD0 in assembler in my c# Programm.
    What i think is the GetAcdByAcdId:

    Code:
    .text:00954AD0 arg_0           = dword ptr  8
    .text:00954AD0
    .text:00954AD0                 push    ebp
    .text:00954AD1                 mov     ebp, esp
    .text:00954AD3                 push    edi
    .text:00954AD4                 mov     edi, [ebp+arg_0]
    .text:00954AD7                 mov     edx, ecx
    .text:00954AD9                 cmp     edi, 0FFFFFFFFh
    .text:00954ADC                 jnz     short loc_954AE5
    .text:00954ADE                 xor     eax, eax
    .text:00954AE0                 pop     edi
    .text:00954AE1                 pop     ebp
    .text:00954AE2                 retn    4
    .text:00954AE5 ; ---------------------------------------------------------------------------
    .text:00954AE5
    .text:00954AE5 loc_954AE5:                             ; CODE XREF: D3_GetAcdById+Cj
    .text:00954AE5                 push    esi
    .text:00954AE6                 movzx   esi, di
    .text:00954AE9                 cmp     esi, [edx+100h]
    .text:00954AEF                 jb      short loc_954AF9
    .text:00954AF1                 pop     esi
    .text:00954AF2                 xor     eax, eax
    .text:00954AF4                 pop     edi
    .text:00954AF5                 pop     ebp
    .text:00954AF6                 retn    4
    .text:00954AF9 ; ---------------------------------------------------------------------------
    .text:00954AF9
    .text:00954AF9 loc_954AF9:                             ; CODE XREF: D3_GetAcdById+1Fj
    .text:00954AF9                 mov     cl, [edx+164h]
    .text:00954AFF                 push    ebx
    .text:00954B00                 mov     ebx, esi
    .text:00954B02                 shr     ebx, cl
    .text:00954B04                 mov     ecx, [edx+164h]
    .text:00954B0A                 mov     eax, 1
    .text:00954B0F                 shl     eax, cl
    .text:00954B11                 mov     ecx, [edx+120h]
    .text:00954B17                 dec     eax
    .text:00954B18                 and     eax, esi
    .text:00954B1A                 imul    eax, 2F8h
    .text:00954B20                 add     eax, [ecx+ebx*4]
    .text:00954B23                 xor     ecx, ecx
    .text:00954B25                 cmp     [eax], edi
    .text:00954B27                 pop     ebx
    .text:00954B28                 setnz   cl
    .text:00954B2B                 pop     esi
    .text:00954B2C                 pop     edi
    .text:00954B2D                 dec     ecx
    .text:00954B2E                 and     eax, ecx
    .text:00954B30                 pop     ebp
    .text:00954B31                 retn    4
    my C# code i put together was then:
    Code:
    			byte bits_cl = (byte)ReadInt(acdContainer + 0x164);
    			UInt16 actorAcdId_lWord = (UInt16)actorAcdId;
    			int ebx2 = (int)actorAcdId_lWord >> bits_cl;
    			int addr = ((((1 << bits_cl) - 1) & (int)actorAcdId_lWord) * 0x2F8) + ReadInt(ReadInt(acdContainer + 0x120) + ebx2 * 4);
    but for some reason it doesnt work. i always get an different ACD then i wanted.

    Is this the wrong function i'm using to get the ACD or is my code wrong?
    Last edited by Dakoon; 03-20-2014 at 10:19 AM.

    GetAcdByAcdId
  2. #2
    enigma32's Avatar Legendary
    Reputation
    912
    Join Date
    Jan 2013
    Posts
    551
    Thanks G/R
    4/738
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This works:
    Code:
    public T this[short index]
    {
        get
        {
            var blockSize = 1 << x164_Bits;
            var blockNumber = index / blockSize;
            var blockOffset = index % blockSize;
            var blockBase = base.Memory.Read<int>(base.x120_Allocation + 4 * blockNumber);
            var itemPtr = blockBase + blockOffset * x104_ItemSize;
            var item =  base.Memory.Read<T>(itemPtr);
            return item;
        }
    }

  3. #3
    Dakoon's Avatar Member
    Reputation
    1
    Join Date
    Apr 2013
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx for your help. now it works

    always good to have a working code...
    the funny thing is my code works too but i had the wrong actorAcdId or index in your code.
    anyway it helped me alot. was going crazy yesterday ^^

    as a sidenote for everyone who wants to copy your code: index = 0xFFFF & actorAcdId

  4. #4
    enigma32's Avatar Legendary
    Reputation
    912
    Join Date
    Jan 2013
    Posts
    551
    Thanks G/R
    4/738
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Dakoon View Post
    index = 0xFFFF & actorAcdId
    Or "(short)actorAcdId" I've seen people do casting and masking... silly people ^^

  5. #5
    Dolphe's Avatar Contributor
    Reputation
    97
    Join Date
    Oct 2012
    Posts
    614
    Thanks G/R
    0/26
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by enigma32 View Post
    Or "(short)actorAcdId" I've seen people do casting and masking... silly people ^^
    Guilty as charged

  6. #6
    virgil123's Avatar Member
    Reputation
    1
    Join Date
    Dec 2012
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks promising. what's the base address of acd, anyone get it yet ?

  7. #7
    enigma32's Avatar Legendary
    Reputation
    912
    Join Date
    Jan 2013
    Posts
    551
    Thanks G/R
    4/738
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by virgil123 View Post
    Looks promising. what's the base address of acd, anyone get it yet ?
    [[[0x01CD841C]+0x7A8+0x110]+0x00] that would be this/base in my code snippet.

  8. #8
    virgil123's Avatar Member
    Reputation
    1
    Join Date
    Dec 2012
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by enigma32 View Post
    [[[0x01CD841C]+0x7A8+0x110]+0x00] that would be this/base in my code snippet.
    Oh thanks, this work beautifully, have you figured out the actors offset as well ?

  9. #9
    enigma32's Avatar Legendary
    Reputation
    912
    Join Date
    Jan 2013
    Posts
    551
    Thanks G/R
    4/738
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by virgil123 View Post
    Oh thanks, this work beautifully, have you figured out the actors offset as well ?
    You're welcome, and here's for actors: [[0x01CD841C]+0x920]

  10. #10
    virgil123's Avatar Member
    Reputation
    1
    Join Date
    Dec 2012
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh btw, do you by any chance find out the level area offset too ?

  11. #11
    Dolphe's Avatar Contributor
    Reputation
    97
    Join Date
    Oct 2012
    Posts
    614
    Thanks G/R
    0/26
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by virgil123 View Post
    oh btw, do you by any chance find out the level area offset too ?
    Levelarea:
    [[0x01C36260], 0x44]

  12. #12
    CrEEzz's Avatar Active Member
    Reputation
    66
    Join Date
    Jan 2014
    Posts
    153
    Thanks G/R
    10/40
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by enigma32 View Post
    You're welcome, and here's for actors: [[0x01CD841C]+0x920]
    I can read all actors from "level", however inventory/stash items are no longer on that list, have you figured out offset for inventory/stash?

  13. #13
    enigma32's Avatar Legendary
    Reputation
    912
    Join Date
    Jan 2013
    Posts
    551
    Thanks G/R
    4/738
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by CrEEzz View Post
    I can read all actors from "level", however inventory/stash items are no longer on that list, have you figured out offset for inventory/stash?
    Those would be as ACDs only as there are no "world objects" representing them.

All times are GMT -5. The time now is 11:16 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search