Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

How do I change structures in IDA?

Newbie Spellweaver
Joined
Sep 24, 2006
Messages
54
Reaction score
13
I'm not looking for a direct answer but more of a good place to start learning, however direct answers are always nice :)

I am trying to change a structure in IDA, I'm very newbie when it comes to C & assembly but I'm learning. I know you're not supposed to start this way but I'm a bit forced.

I have this structure.
struct ADDON_GROUP_ESSENCE {
unsigned int id;
wchar_t name[32];
wchar_t prefix[16];
wchar_t suffix[16];
int desc_text;
int desc_text_col;
int type;
int addon_ids[8];
}
the new version has addon_ids[16] instead of 8 & the size from 176 to 208. What exactly should I be looking for?

Code:
.text:081FD4A8 ; abase::vector<ADDON_GROUP_ESSENCE, abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)
.text:081FD4A8                 public _ZN5abase6vectorI19ADDON_GROUP_ESSENCENS_13default_allocEE9push_backERKS1_ ; weak
.text:081FD4A8 _ZN5abase6vectorI19ADDON_GROUP_ESSENCENS_13default_allocEE9push_backERKS1_ proc near
.text:081FD4A8                                         ; CODE XREF: elementdataman::array<ADDON_GROUP_ESSENCE>::load(_IO_FILE *)+D4p
.text:081FD4A8                                         ; elementdataman::array<ADDON_GROUP_ESSENCE>::push_back(ADDON_GROUP_ESSENCE const&)+Fp
.text:081FD4A8
.text:081FD4A8 var_28          = dword ptr -28h
.text:081FD4A8 var_24          = dword ptr -24h
.text:081FD4A8 var_20          = dword ptr -20h
.text:081FD4A8 var_1C          = dword ptr -1Ch
.text:081FD4A8 var_18          = dword ptr -18h
.text:081FD4A8 var_14          = dword ptr -14h
.text:081FD4A8 var_10          = dword ptr -10h
.text:081FD4A8 arg_0           = dword ptr  8
.text:081FD4A8 arg_4           = dword ptr  0Ch
.text:081FD4A8
.text:081FD4A8                 push    ebp
.text:081FD4A9                 mov     ebp, esp
.text:081FD4AB                 push    edi
.text:081FD4AC                 push    esi
.text:081FD4AD                 push    ebx
.text:081FD4AE                 sub     esp, 1Ch
.text:081FD4B1                 mov     eax, [ebp+arg_0]
.text:081FD4B4                 mov     edx, [ebp+arg_0]
.text:081FD4B7                 mov     eax, [eax+0Ch]
.text:081FD4BA                 cmp     eax, [edx+8]
.text:081FD4BD                 jnz     loc_81FD5E7
.text:081FD4C3                 sub     esp, 4
.text:081FD4C6                 lea     eax, [ebp+var_20]
.text:081FD4C9                 push    eax
.text:081FD4CA                 mov     eax, [ebp+arg_0]
.text:081FD4CD                 mov     eax, [eax+0Ch]
.text:081FD4D0                 inc     eax
.text:081FD4D1                 push    eax
.text:081FD4D2                 push    [ebp+arg_0]
.text:081FD4D5                 call    _ZN5abase6vectorI19ADDON_GROUP_ESSENCENS_13default_allocEE15_M_allocate_newEjRj ; abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::_M_allocate_new(uint,uint &)
.text:081FD4DA                 add     esp, 10h
.text:081FD4DD                 mov     [ebp+var_14], eax
.text:081FD4E0                 cmp     [ebp+var_14], 0
.text:081FD4E4                 jnz     short loc_81FD506
.text:081FD4E6                 sub     esp, 4
.text:081FD4E9                 push    0C6h
.text:081FD4EE                 push    offset aExportZhang_59 ; "/export/zhanglidong/chibi/sgame/include"...
.text:081FD4F3                 push    offset aNewdata_26 ; "newdata"
.text:081FD4F8                 call    ASSERT_FAIL
.text:081FD4FD                 add     esp, 10h
.text:081FD500                 mov     dword ptr [eax], 0
.text:081FD506
.text:081FD506 loc_81FD506:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+3Cj
.text:081FD506                 mov     eax, [ebp+var_14]
.text:081FD509                 mov     [ebp+var_18], eax
.text:081FD50C                 mov     eax, [ebp+arg_0]
.text:081FD50F                 mov     eax, [eax]
.text:081FD511                 mov     [ebp+var_1C], eax
.text:081FD514                 mov     [ebp+var_10], 0
.text:081FD51B
.text:081FD51B loc_81FD51B:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+C8j
.text:081FD51B                 mov     edx, [ebp+arg_0]
.text:081FD51E                 mov     eax, [ebp+var_10]
.text:081FD521                 cmp     eax, [edx+0Ch]
.text:081FD524                 jb      short loc_81FD528
.text:081FD526                 jmp     short loc_81FD572
.text:081FD528 ; ---------------------------------------------------------------------------
.text:081FD528
.text:081FD528 loc_81FD528:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+7Cj
.text:081FD528                 sub     esp, 8
.text:081FD52B                 mov     eax, [ebp+var_18]
.text:081FD52E                 push    eax
.text:081FD52F                 lea     eax, [ebp+var_18]
.text:081FD532                 add     dword ptr [eax], 0B0h
.text:081FD538                 push    0B0h
.text:081FD53D                 call    _ZnwjPv         ; operator new(uint,void *)
.text:081FD542                 add     esp, 10h
.text:081FD545                 mov     [ebp+var_24], eax
.text:081FD548                 cmp     [ebp+var_24], 0
.text:081FD54C                 jz      short loc_81FD56B
.text:081FD54E                 mov     eax, [ebp+var_1C]
.text:081FD551                 mov     edx, eax
.text:081FD553                 lea     eax, [ebp+var_1C]
.text:081FD556                 add     dword ptr [eax], 0B0h
.text:081FD55C                 mov     edi, [ebp+var_24]
.text:081FD55F                 mov     esi, edx
.text:081FD561                 cld
.text:081FD562                 mov     eax, 2Ch
.text:081FD567                 mov     ecx, eax
.text:081FD569                 rep movsd
.text:081FD56B
.text:081FD56B loc_81FD56B:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+A4j
.text:081FD56B                 lea     eax, [ebp+var_10]
.text:081FD56E                 inc     dword ptr [eax]
.text:081FD570                 jmp     short loc_81FD51B
.text:081FD572 ; ---------------------------------------------------------------------------
.text:081FD572
.text:081FD572 loc_81FD572:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+7Ej
.text:081FD572                 mov     eax, [ebp+arg_0]
.text:081FD575                 mov     eax, [eax]
.text:081FD577                 mov     [ebp+var_1C], eax
.text:081FD57A                 mov     [ebp+var_10], 0
.text:081FD581
.text:081FD581 loc_81FD581:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+F4j
.text:081FD581                 mov     edx, [ebp+arg_0]
.text:081FD584                 mov     eax, [ebp+var_10]
.text:081FD587                 cmp     eax, [edx+0Ch]
.text:081FD58A                 jb      short loc_81FD58E
.text:081FD58C                 jmp     short loc_81FD59E
.text:081FD58E ; ---------------------------------------------------------------------------
.text:081FD58E
.text:081FD58E loc_81FD58E:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+E2j
.text:081FD58E                 lea     eax, [ebp+var_1C]
.text:081FD591                 add     dword ptr [eax], 0B0h
.text:081FD597                 lea     eax, [ebp+var_10]
.text:081FD59A                 inc     dword ptr [eax]
.text:081FD59C                 jmp     short loc_81FD581
.text:081FD59E ; ---------------------------------------------------------------------------
.text:081FD59E
.text:081FD59E loc_81FD59E:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+E4j
.text:081FD59E                 sub     esp, 4
.text:081FD5A1                 mov     eax, [ebp+arg_0]
.text:081FD5A4                 push    dword ptr [eax+8] ; int
.text:081FD5A7                 mov     eax, [ebp+arg_0]
.text:081FD5AA                 push    dword ptr [eax] ; void *
.text:081FD5AC                 push    [ebp+arg_0]     ; int
.text:081FD5AF                 call    _ZN5abase6vectorI19ADDON_GROUP_ESSENCENS_13default_allocEE13_M_deallocateEPS1_j ; abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::_M_deallocate(ADDON_GROUP_ESSENCE*,uint)
.text:081FD5B4                 add     esp, 10h
.text:081FD5B7                 mov     edx, [ebp+arg_0]
.text:081FD5BA                 mov     eax, [ebp+var_20]
.text:081FD5BD                 mov     [edx+8], eax
.text:081FD5C0                 mov     edx, [ebp+arg_0]
.text:081FD5C3                 mov     eax, [ebp+var_14]
.text:081FD5C6                 mov     [edx], eax
.text:081FD5C8                 mov     ebx, [ebp+arg_0]
.text:081FD5CB                 mov     ecx, [ebp+arg_0]
.text:081FD5CE                 mov     eax, [ebp+arg_0]
.text:081FD5D1                 mov     edx, [eax+0Ch]
.text:081FD5D4                 mov     eax, edx
.text:081FD5D6                 shl     eax, 2
.text:081FD5D9                 add     eax, edx
.text:081FD5DB                 shl     eax, 1
.text:081FD5DD                 add     eax, edx
.text:081FD5DF                 shl     eax, 4
.text:081FD5E2                 add     eax, [ecx]
.text:081FD5E4                 mov     [ebx+4], eax
.text:081FD5E7
.text:081FD5E7 loc_81FD5E7:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+15j
.text:081FD5E7                 sub     esp, 8
.text:081FD5EA                 mov     eax, [ebp+arg_0]
.text:081FD5ED                 push    dword ptr [eax+4]
.text:081FD5F0                 push    0B0h
.text:081FD5F5                 call    _ZnwjPv         ; operator new(uint,void *)
.text:081FD5FA                 add     esp, 10h
.text:081FD5FD                 mov     [ebp+var_28], eax
.text:081FD600                 cmp     [ebp+var_28], 0
.text:081FD604                 jz      short loc_81FD618
.text:081FD606                 mov     eax, [ebp+arg_4]
.text:081FD609                 mov     edi, [ebp+var_28]
.text:081FD60C                 mov     esi, eax
.text:081FD60E                 cld
.text:081FD60F                 mov     eax, 2Ch
.text:081FD614                 mov     ecx, eax
.text:081FD616                 rep movsd
.text:081FD618
.text:081FD618 loc_81FD618:                            ; CODE XREF: abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::push_back(ADDON_GROUP_ESSENCE const&)+15Cj
.text:081FD618                 mov     eax, [ebp+arg_0]
.text:081FD61B                 inc     dword ptr [eax+0Ch]
.text:081FD61E                 mov     eax, [ebp+arg_0]
.text:081FD621                 add     dword ptr [eax+4], 0B0h
.text:081FD628                 lea     esp, [ebp-0Ch]
.text:081FD62B                 pop     ebx
.text:081FD62C                 pop     esi
.text:081FD62D                 pop     edi
.text:081FD62E                 leave
.text:081FD62F                 retn
.text:081FD62F _ZN5abase6vectorI19ADDON_GROUP_ESSENCENS_13default_allocEE9push_backERKS1_ endp

Code:
.text:081D22FA ; elementdataman::add_structure(unsigned int, ADDON_GROUP_ESSENCE &).text:081D22FA                 public _ZN14elementdataman13add_structureEjR19ADDON_GROUP_ESSENCE
.text:081D22FA _ZN14elementdataman13add_structureEjR19ADDON_GROUP_ESSENCE proc near
.text:081D22FA
.text:081D22FA var_4           = dword ptr -4
.text:081D22FA arg_0           = dword ptr  8
.text:081D22FA arg_4           = dword ptr  0Ch
.text:081D22FA arg_8           = dword ptr  10h
.text:081D22FA
.text:081D22FA                 push    ebp
.text:081D22FB                 mov     ebp, esp
.text:081D22FD                 sub     esp, 8
.text:081D2300                 sub     esp, 8
.text:081D2303                 push    [ebp+arg_8]
.text:081D2306                 mov     eax, [ebp+arg_0]
.text:081D2309                 add     eax, 4E0h
.text:081D230E                 push    eax
.text:081D230F                 call    _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEE9push_backERKS1_ ; elementdataman::array<ADDON_GROUP_ESSENCE>::push_back(ADDON_GROUP_ESSENCE const&)
.text:081D2314                 add     esp, 10h
.text:081D2317                 sub     esp, 0Ch
.text:081D231A                 mov     eax, [ebp+arg_0]
.text:081D231D                 add     eax, 4E0h
.text:081D2322                 push    eax
.text:081D2323                 call    _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEE4sizeEv ; elementdataman::array<ADDON_GROUP_ESSENCE>::size(void)
.text:081D2328                 add     esp, 10h
.text:081D232B                 dec     eax
.text:081D232C                 mov     [ebp+var_4], eax
.text:081D232F                 sub     esp, 8
.text:081D2332                 push    0
.text:081D2334                 mov     eax, [ebp+arg_0]
.text:081D2337                 add     eax, 4E0h
.text:081D233C                 push    eax
.text:081D233D                 call    _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEEixEj ; elementdataman::array<ADDON_GROUP_ESSENCE>::operator[](uint)
.text:081D2342                 add     esp, 8
.text:081D2345                 push    eax
.text:081D2346                 push    [ebp+var_4]
.text:081D2349                 push    4Fh
.text:081D234B                 push    [ebp+arg_4]
.text:081D234E                 push    0
.text:081D2350                 push    [ebp+arg_0]
.text:081D2353                 call    _ZN14elementdataman12add_id_indexE8ID_SPACEj9DATA_TYPEjPv ; elementdataman::add_id_index(ID_SPACE,uint,DATA_TYPE,uint,void *)
.text:081D2358                 add     esp, 20h
.text:081D235B                 leave
.text:081D235C                 retn
.text:081D235C _ZN14elementdataman13add_structureEjR19ADDON_GROUP_ESSENCE endp

Code:
.text:081DFDDA ; elementdataman::array<ADDON_GROUP_ESSENCE>::size(void).text:081DFDDA                 public _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEE4sizeEv ; weak
.text:081DFDDA _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEE4sizeEv proc near
.text:081DFDDA                                         ; CODE XREF: elementdataman::add_structure(uint,ADDON_GROUP_ESSENCE &)+29p
.text:081DFDDA                                         ; elementdataman::setup_hash_map(void)+5519p
.text:081DFDDA
.text:081DFDDA arg_0           = dword ptr  8
.text:081DFDDA
.text:081DFDDA                 push    ebp
.text:081DFDDB                 mov     ebp, esp
.text:081DFDDD                 sub     esp, 8
.text:081DFDE0                 sub     esp, 0Ch
.text:081DFDE3                 push    [ebp+arg_0]
.text:081DFDE6                 call    _ZNK5abase6vectorI19ADDON_GROUP_ESSENCENS_13default_allocEE4sizeEv ; abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::size(void)
.text:081DFDEB                 add     esp, 10h
.text:081DFDEE                 leave
.text:081DFDEF                 retn
.text:081DFDEF _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEE4sizeEv endp
.text:081DFDEF
.text:081DFDF0
.text:081DFDF0 ; =============== S U B R O U T I N E =======================================
.text:081DFDF0
.text:081DFDF0 ; Attributes: bp-based frame
.text:081DFDF0
.text:081DFDF0 ; elementdataman::array<ADDON_GROUP_ESSENCE>::operator[](unsigned int)
.text:081DFDF0                 public _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEEixEj ; weak
.text:081DFDF0 _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEEixEj proc near
.text:081DFDF0                                         ; CODE XREF: elementdataman::add_structure(uint,ADDON_GROUP_ESSENCE &)+43p
.text:081DFDF0                                         ; elementdataman::setup_hash_map(void)+5551p ...
.text:081DFDF0
.text:081DFDF0 arg_0           = dword ptr  8
.text:081DFDF0 arg_4           = dword ptr  0Ch
.text:081DFDF0
.text:081DFDF0                 push    ebp
.text:081DFDF1                 mov     ebp, esp
.text:081DFDF3                 sub     esp, 8
.text:081DFDF6                 sub     esp, 8
.text:081DFDF9                 push    [ebp+arg_4]
.text:081DFDFC                 push    [ebp+arg_0]
.text:081DFDFF                 call    _ZN5abase6vectorI19ADDON_GROUP_ESSENCENS_13default_allocEEixEj ; abase::vector<ADDON_GROUP_ESSENCE,abase::default_alloc>::operator[](uint)
.text:081DFE04                 add     esp, 10h
.text:081DFE07                 leave
.text:081DFE08                 retn
.text:081DFE08 _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEEixEj endp

Code:
.text:081CD04E loc_81CD04E:                            ; CODE XREF: elementdataman::~elementdataman()+A7Bj.text:081CD04E                 mov     ebx, [ebp+var_10]
.text:081CD051                 sub     esp, 0Ch
.text:081CD054                 mov     eax, [ebp+arg_0]
.text:081CD057                 add     eax, 4E0h
.text:081CD05C                 push    eax
.text:081CD05D                 call    _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEED1Ev ; elementdataman::array<ADDON_GROUP_ESSENCE>::~array()
.text:081CD062                 add     esp, 10h
.text:081CD065                 mov     [ebp+var_10], ebx
.text:081CD068                 jmp     short loc_81CD083
.text:081CD06A ; ---------------------------------------------------------------------------
.text:081CD06A
.text:081CD06A loc_81CD06A:                            ; CODE XREF: elementdataman::~elementdataman()+A91j
.text:081CD06A                 sub     esp, 0Ch
.text:081CD06D                 mov     eax, [ebp+arg_0]
.text:081CD070                 add     eax, 4E0h
.text:081CD075                 push    eax
.text:081CD076                 call    _ZN14elementdataman5arrayI19ADDON_GROUP_ESSENCEED1Ev ; elementdataman::array<ADDON_GROUP_ESSENCE>::~array()
.text:081CD07B                 add     esp, 10h
.text:081CD07E                 jmp     short loc_81CD09F

Thanks for any help in advance!
 
Last edited:
Newbie Spellweaver
Joined
Apr 19, 2014
Messages
16
Reaction score
1
Well, I never working in this area with C++ before, but I find something about it.

Try to see the examples on the text. If you can't find the solution to your problem, search others features on the Web.

The only commentary who I can speech to you it is about the data type wchar_t.
This data type (exclusive on C++) have the feature to include others caracters avaible to you work in your project. It's like a "long char", for example. However, maybe you have some problems in your output way. His excelent to read a variable, similar to the typical char, but in particular consoles, print the string who use wchar_t maybe can results somes problems. Be considerate and warning.
 

Dec

Experienced Elementalist
Joined
Aug 21, 2012
Messages
214
Reaction score
147
I tried this a lot, never managed to pull it off, if anybody could give a nice tutorial that would be great, I've tried everything
 
Back
Top