-
Notifications
You must be signed in to change notification settings - Fork 29
404_functions_SetItems
; FN game.48E3DD (Game.exe+8E3DD)
; called when hovering over any item in inventory
;
; game_48E3DDD (
;
; )
mov edx,[7BCBF4] ; pUnit = getInt(GLOBAL_DATA_7BCBF4)
push edx
call game.627E70 ; quality = get_item_quality_627E70(pUnit)
mov esi,eax
mov [ebp-24],esi
call game.468830 ; tmp = get_some_global_data_468830()
cmp eax,8
je game.48ED67 ; if tmp == 8:
; // TODO (jump)
;
mov eax,[7BCBF4] ; pUnit = getInt(GLOBAL_DATA_7BCBF4)
call game.62A0A0 ; isTransmogrify = get_item_is_transmogrify_by_unit_62A0A0(pUnit)
test eax,eax
jne game.48ED67 ; if isTransmogrify:
; // TODO (jump)
cmp esi,5
jne game.48E440 ; if quality != ItemQuality.Set:
; // TODO: (jump)
;
mov ecx,[7BCBF4] ; pUnit = getInt(GLOBAL_DATA_7BCBF4)
push game.6D9BC0 ;
push F9F
push 10
push ecx
call game.6280A0
test eax,eax
je game.48E440
mov ecx,edi
call game.48D1D0
pop edi
pop esi
pop ebx
mov esp,ebp
pop ebp
ret 8
; J game.48E440 mov edx,[7BCBF4] ; pUnit = getInt(GLOBAL_DATA_7BCBF4) push edx call game.62B400 ; itemType = get_item_type_by_item_62B400(pUnit) cmp eax,12 ; jne game.48E45F ; if itemType != ItemType.Unknown_12 ; jump_to(game.48E45F)
call game.48CFF0 ; TODO (return game.48CFF0()) pop edi pop esi pop ebx mov esp,ebp pop ebp ret 8
; J game.48E45F mov eax,[7BCBF4] ; pUnit = getInt(GLOBAL_DATA_7BCBF4) push eax call game.62C0B0 ; tmp = get_some_unknown_21_by_unit_62C0B0(pUnit) mov esi,eax cmp esi,7 je game.48E4B1 ; if tmp == 7: ; jump_to(game.48E4B1)
[...]
; J game.48E4B1
mov eax,[7BCBF4] ; pUnit = getInt(GLOBAL_DATA_7BCBF4)
test eax,eax
jne game.48E4BF ; if pUnit != null
or eax,FFFFFFFF ; eClass = -1
jmp game.48E4C2 ; else
mov eax,[eax+4] ; eClass = pUnit.eClass
push eax
call game.6335F0 ; itemDesc = get_item_description_by_class_6335F0(eClass) mov esi,eax ; test esi,esi mov [ebp+8],esi jne game.48E4F0 ; if itemDesc != null ; JUMP ; else ; ... not sure :) push FC2 call game.408090 push eax push game.6CC837 call game.408A60 add esp,C push FFFFFFFF call game.681E09
; J game.48E4F0 mov ecx,[7BCBF4] ; pUnit = getInt(GLOBAL_DATA_7BCBF4) push ecx call game.62E740 ; unknown2 = get_some_unknown_0e_by_unit_62E740(pUnit) test eax,eax mov ebx,[7BCBF4] ; pUnit = getInt(GLOBAL_DATA_7BCBF4) je game.48E514 ; if unknown2 == 0 ; jump_to(game.48E514)
push esi ; // TODO lea esi,[ebp-834] ; // TODO call game.484DB0 ; // TODO jmp game.48E51F ; // TODO
; J game.48E514 lea esi,[ebp-2834] ; // ??? put an address to deep in the stack into esi ?(maybe?) call game.484E90 ; get_item_durability_string_484E90( ; esi: addr to deep inside the stack ; ebx: addr to item ; ) mov exi,[ebp-8] lea edx,[ebp+C] push edx mov edx,[7BCBF4] lea eax,[ebp-34] push eax lea ecx,[ebp-2C] push ecx push 0 push esi push edx call game.62EAF0
[...] ; END ----------------------------------------------------------------
; FN game.484E90
; maybe fn to get durability string for item
;
; get_item_durability_string_484E90 (
; esi: addr to deep inside the stack
; ebx: *D2Unit pUnit
; )
push ebp
mov ebp,esp
sub esp,28
xor eax,eax
push edi ; edi is some address (to a string maybe?)
mov ecx,F9B ; // StringConstants.SPACE
; // empty the top of the stack (clear it for writing the string maybe?)
; // not sure why it is emptying the stack elements tho
mov [ebp-28],ax
mov [ebp-26],ax
mov [ebp-24],ax
mov [ebp-22],ax
mov [ebp-20],ax
mov [ebp-1E],ax
mov [ebp-1C],ax
mov [ebp-1A],ax
mov [ebp-18],ax
mov [ebp-16],ax
call game.524A30 ; get_string_by_identifier(StringConstants.SPACE)
mov ecx,F9E ; // StringConstants.EOL
mov edi,eax ; edi = addr of string " " // ???
call game.524A30 ; get_string_by_identifier(StringConstants.EOL)
push ebx ; // ebx is ptr to some unit (item), but not ; sure where it comes from, must be set before calling the fn
mov [ebp-8],eax ; [ebp-8] = addr of string "\n" // ??? call game.629930 ; tmp = is_some_durability_related_val_game_629930(pUnit) ; // maybe determines if durability should be shown to user when hovering item test eax,eax ; je game.484FDF ; if !tmp: ; return 0; // return tmp, which is 0 in this case
push ebx call game.625E00 ; maxDurability = get_max_durability_of_item_625E00(pUnit) test eax,eax jle game.484FDF ; if <= maxDurability: ; return maxDurability; // can be 0 or negative
push ebx
call game.62BA80 ; tmp3 = get_some_unknown_10_by_unit_62BA80(pUnit)
test eax,eax
jne game.484FDF ; if tmp3:
; return tmp3
push eax ; // eax is 0 here
push 4B ; // if we are doing something with stat identifier,
; // then this is... Unknown_4B
push ebx ;
mov [ebp-4],eax ; some_check = 0 // put '0' in the stack
call game.625560 ; tmp4 = some_kind_of_check_625560(
; pUnit,
; 0x4B,
; 0
; )
test eax,eax ;
je game.484F1B
mov [ebp-4],1 ; if tmp4
; some_check = 1 // put '1' into the stack
; J game.484F1B mov ecx,D81 ; StringConstants.Durability call game.524A30 ; get_string_by_identifier(StringConstants.Durability) mov edx,eax ; pSource = addr of string "Durability:" mov ecx,esi ; pTarget = esi call game.5267E0 ; copy_string_5267E0(pSource, pTarget)
push 0 push 48 ; Durability (current Durability of item) push ebx call game.625480 ; currentDurability = getStatValue_625480()
push eax ; currentDurability push game.6D6454 ; // seems to be string template to format int => '%i' lea eax,[ebp-14] ; eax = some addr in stack push A ; push eax ; call game.413A40 ; len = format_value_to_string2_413A40 ( ; addr, ; 0x0A, ; "%i", // addr of template? ; value, // ; ) add esp,10 mov edx,edi ; // maybe still addr of " " mov ecx,esi ; // maybe still addr of "Durability:" call game.526700 ; append_string_526700( ; ecx = pBase ; edx = pSuffix ; ) ; // str is now: "Durability: " push 9 ; maxLen = 9 lea edx,[ebp-14] ; lea ecx,[ebp-28] ; call game.526F20 ; copy_string_to_multibyte_526F20 ( ; maxLen ; edx: fromAddr ; ecx: toAddr ; ) lea edx,[ebp-28] ; // "" multibyte current durability value mov ecx,esi ; // "Durability: " call game.526700 ; append_string_526700( ; ecx = pBase ; edx = pSuffix ; ) ; // "Durability: 10"
mov edx,edi ; mov ecx,esi ; call game.526700 ; append_string_526700("Durability: 10", " ") ; // "Durability: 10 "
mov ecx,D87 ; DurabilityBetween call game.524A30 ; get_string_by_identifier(StringConstants.DurabilityBetween) mov edx,eax mov ecx,esi call game.526700 ; append_string_526700("Durability: 10 ", "of") ; // "Durability: 10 of"
mov edx,edi ; mov ecx,esi call game.526700 ; append_string_526700("Durability: 10 of", " ") ; // "Durability: 10 of "
push ebx call game.625E00 ; maxDurability = get_max_durability_of_item_625E00(pUnit)
push eax ; // maxDurability push game.6D6454 ; // "%i" ; lea ecx,[ebp-14] ; // push A ; // 0x0A push ecx ; // addr call game.413A40 ; len = format_value_to_string2_413A40 ( ; addr, ; 0x0A, ; "%i", // addr of template? ; maxDurability, // ; ) add esp,10 ; push 9 ; maxLen = 9 lea edx,[ebp-14] ; // formatted string lea ecx,[ebp-28] ; // target addr call game.526F20 ; copy_string_to_multibyte_526F20( ; maxLen, ; edx: fromAddr ; ecx: toAddr ; ) cmp [ebp-4],0 ; je game.484FCB ; if some_check == 0 ; jump_to(game.484FCB)
mov edx,3 ; // some more happy string stuff? lea ecx,[ebp-28] ; // some more happy string stuff? call game.4521C0 ; // some more happy string stuff?
; J game.484FCB lea edx,[ebp-28] ; // addr of formattedVal from some lines above mov ecx,esi ; call game.526700 ; append_string_526700("Durability: 10 of ", formattedVal) ; // "Durability: 10 of 12"
mov edx,[ebp-8] ; // newline (see above) mov ecx,esi ; call game.526700 ; append_string_526700("Durability: 10 of 12", "\n") ; // "Durability: 10 of 12\n" ; J game.484FDF pop edi mov esp,ebp pop ebp ret ; END ----------------------------------------------------------------
; FN game.526F20 ; ; some string copy fn? ; ; copy_string_to_multibyte_526F20 ( ; int maxLen // seen: 0x09 hardcoded ; edx: fromAddr ; ecx: toAddr ; ) push ebp ; mov ebp,esp ; mov eax,ecx ; mov ecx,[ebp+8] ; // maxLen push esi ; xor esi,esi ; i = 0 test ecx,ecx ; jle game.526F49 ; if maxLen <= 0 ; jump_to(game.526F49)
push ebx ; push edi ;
; J game.526F31 mov bl,[esi+edx] ; char = fromAddr[i] test bl,bl ; je game.526F47 ; if char == 0 ; jump_to(game.526F47)
movzx di,bl ; mov [eax+esi2],di ; toAddr[i2] = char add esi,1 ; i++ cmp esi,ecx ; jl game.526F31 ; if i < maxLen ; jump_to(game.526F31)
; J game.526F47 pop edi ; pop ebx ;
; J game.526F49 cmp [esi+edx],0 ; // check if string end was reached je game.526F5B ; if fromAddr[i] == 0 ; toAddr[i2] = 0 ; else ; toAddr[(i-1)2] = 0 ; return toAddr mov [eax+esi2-2],0 ; pop esi ; pop ebp ; ret 4 ; mov [eax+esi2],0 ; pop esi ; pop ebp ; ret 4 ; ; END ----------------------------------------------------------------
; FN game.413A40
;
; format_value_to_string2_413A40 (
; [ebp+8] int addr, // some addr in stack (target addr?)
; [ebp+C] int maxLen, //
; [ebp+10] int tmplAddr // addr of str template
; [ebp+14] int value, // value
; )
push ebp
mov ebp,esp
mov ecx,[ebp+10] ; tmplAddr
push edi
mov edi,[ebp+8] ; // addr
mov eax,edi ; // ADDR = addr
neg eax ; // ADDR = -ADDR
sbb eax,eax ; ADDR = addr ? 0xFFFFFFFF : 0 // ??
mov edx,ecx ; // TMPL_ADDR = tmplAddr neg edx ; // TMPL_ADDR = -TMPL_ADDR sbb edx,edx ; TMPL_ADDR = tmplAddr ? 0xFFFFFFFF : 0 // ??
and eax,edx ; jne game.413A66 ; if !addr || !tmplAddr
push 57 ;
call game.41C340 ;
xor eax,eax ;
pop edi ;
pop ebp ;
ret ;
; J game.413A66 push esi ; mov esi,[ebp+C] ; maxLen lea eax,[ebp+14] ; pValue = addr(value) call game.413A00 ; format_value_to_string2_413A00 ( ; esi: maxLen ; eax: pValue ; ecx: tmplAddr ; edi: addr ; ) pop esi pop edi pop ebp ret ; END ----------------------------------------------------------------
; FN game.413A00
;
; format_value_to_string2_413A00 (
; esi: maxLen
; eax: pValue
; ecx: tmplAddr
; edi: targetAddr
; )
test esi,esi
je game.413A2E ; if !maxLen
; return 0
cmp esi,7FFFFFFF ; push eax push ecx je game.413A24 ; if maxLen == 7FFFFFFF ; jump_to(game.413A24)
push esi ; push edi ; call game.682F22 ; len = game_682F22 ( ; targetAddr, ; maxLen, ; tmplAddr, ; pValue, ; ) // seems to return the length of created string add esp,10 ; cmp eax,esi ; jb game.413A30 ; if len < maxLen ; return len
; // add 0 to cut string to maxLen, return maxLen - 1
; // (len without the final 0)
;
lea eax,[esi-1] ; // X = maxLen - 1 mov [eax+edi],0 ; // str[X] = 0 ret ; // return X
; J game.413A2E push edi call game.682DA1 ; tmp = game_682DA1( ; targetAddr, ; tmplAddr, ; pValue, ; ) ; return tmp
add esp,C ret
; J game.413A2E xor eax,eax ret ; END ----------------------------------------------------------------
; FN game.682F22 ; ; game_682F22 ( ; targetAddr, ; maxLen, ; tmplAddr, ; pValue, ; ) push [esp+10] ; // put the args to next fn push 0 ; // put 0 to next fn push [esp+14] ; // put the args to next fn push [esp+14] ; // put the args to next fn push [esp+14] ; // put the args to next fn call game.682E71 ; return game_682E71( ; targetAddr, ; maxLen, ; tmplAddr, ; 0, ; pValue, ; ) add esp,14 ; ret ; ; END ----------------------------------------------------------------
; FN game.682E71 ; ; game_682E71 ( ; targetAddr, ; maxLen, ; tmplAddr, ; 0, ; pValue, ; ) push ebp mov ebp,esp sub esp,20 push ebx xor ebx,ebx cmp [ebp+10],ebx jne game.682E9F call game.6896AD push ebx push ebx push ebx push ebx push ebx mov [eax],16 call game.689635 add esp,14 or eax,FFFFFFFF jmp game.682F1F mov ecx,[ebp+C] cmp ecx,ebx push esi mov esi,[ebp+8] je game.682ECB cmp esi,ebx jne game.682ECB call game.6896AD push ebx push ebx push ebx push ebx push ebx mov [eax],16 call game.689635 add esp,14 or eax,FFFFFFFF jmp game.682F1E mov eax,7FFFFFFF cmp ecx,eax mov [ebp-1C],eax ja game.682EDA mov [ebp-1C],ecx push edi push [ebp+18] lea eax,[ebp-20] push [ebp+14] mov [ebp-14],42 push [ebp+10] mov [ebp-18],esi push eax mov [ebp-20],esi call game.68B5A3 add esp,10 cmp esi,ebx mov edi,eax je game.682F1D dec [ebp-1C] js game.682F0F mov eax,[ebp-20] mov [eax],bl jmp game.682F1B lea eax,[ebp-20] push eax push ebx call game.68ABAC pop ecx pop ecx mov eax,edi pop edi pop esi pop ebx leave ret ; END ----------------------------------------------------------------
; FN game.625560 ; ; some_kind_of_check_625560 ( ; pUnit, ; statIdentifier ? // seen: 0x4B ; someVal // seen: 0 ; ) push ebp mov ebp,esp mov eax,[ebp+8] ; // pUnit push edi mov edi,[eax+5C] ; test edi,edi ; jne game.625575 ; if pUnit.StatListNode == null ; return 0 xor eax,eax pop edi pop ebp ret C
; J game.625575
mov ecx,[ebp+C] ; // statIdentifier
push ebx
mov ebx,[ebp+10] ; // someVal
push esi
push ebx
push ecx
push edi
call game.625420 ; tmp = statlist_func_625420(
; pUnit.StatListNode,
; statIdentifier,
; someVal,
; someStackAddr ? // probably unused (just stored away)
; )
mov edx,[ebp+C] ; // statIdentifier
push ebx
push edx
push edi
mov esi,eax
call game.625350 ; tmp2 = game_625350(
; pUnit.StatListNode,
; statIdentifier,
; someVal,
; ESI: tmp
; )
sub esi,eax ;
mov eax,esi ; return tmp - tmp2
pop esi
pop ebx
pop edi
pop ebp
ret C
; END ----------------------------------------------------------------
; FN game.625350 ; game_625350 ( ; D2StatListEx statListNode, ; statIdentifier, ; someVal, ; ESI: tmp ; ) push ebp mov ebp,esp push ebx mov ebx,[ebp+8] ; // statListNode test ebx,ebx jne game.625362 ; if statListNode == null ; return 0 xor eax,eax pop ebx pop ebp ret C
; J game.625362 push edi mov edi,[ebp+C] ; // statIdentifier test edi,edi jl game.625388 ; if statIdentifier < 0 ; return 0
mov ecx,[744304] ; globalData = GLOBAL_DATA_744304 cmp edi,[ecx+BD4] ; jge game.625388 ; if statIdentifier >= globalData.ItemStatCostCount ; return 0
mov eax,edi imul eax,eax,144 add eax,[ecx+BCC] ; stat = globalData.ItemStatCost[statIdentifier] jne game.625390 ; if stat == null ; return 0
; J game.625388 pop edi xor eax,eax pop ebx pop ebp ret C
; J game.625390 push eax movzx eax,[ebp+10] ; shl edi,10 ; add edi,eax ; tmp = (statIdentifier << 10) + someVal call game.624ED0 ; get_item_stat_flags_somehow_game_624ED0( ; stat, ; EBX: statListNode, ; EDI: tmp, ; ) pop edi pop ebx pop ebp ret C
; END ----------------------------------------------------------------
; FN game.625420 ; ; statlist_func_625420 ( ; D2StatListEx pStatListNode, ; statIdentifier, ; someVal, ; someStackAddr ? ; ) push ebp push ebp,esp push ebx mov ebx,[ebp+8] ; // pStatListNode test ebx,ebx jne game.625432 ; if pStatListNode == null xor eax,eax ; return 0 pop ebx pop ebp ret C
; J game.625432 push edi mov edi,[ebp+C] ; // statIdentifier test edi,edi ; jl game.625458 ; if statIdentifier < 0 ; return 0
mov ecx,[744304] ; globalData = GLOBAL_DATA_744304 cmp edi,[ecx+BD4] ; jge game.625458 ; if statIdentifier >= globalData.ItemStatCostCount ; return 0
mov eax,edi imul eax,eax,144 add eax,[ecx+BCC] ; stat = globalData.ItemStatCost[statIdentifier] jne game.625460 ; if stat == null ; return 0
; J game.625458 pop edi xor eax,eax pop ebx pop ebp ret C
; J game.625460 push eax ; movzx eax,[ebp+10] ; someVal shl edi,10 ; statIdentifier = statIdentifier << 0x10 ; (moving to upper part of the val) ; eg. 0000004A ; becomes 004A0000 add edi,eax ; statIdentifier = statIdentifier + someVal call game.624F60 ; return statlist_func_625F60( ; stat // D2ItemStatCost ; edi ? ; ) // it works on EBX as well (pStatListNode) pop edi pop ebx pop ebp ret C ; END ----------------------------------------------------------------
; FN game.62BA80 ; ; get_some_unknown_10_by_unit_62BA80 ( ; pUnit ; ) push ebp mov ebp,esp mov eax,[ebp+8] test eax,eax je game.62BABF ; if pUnit == null ; return 0 cmp [eax],4 jne game.62BABF ; if pUnit.eType != UnitType.Item ; return 0
push eax call game.62B400 ; itemType = get_item_type_by_item_62B400(pUnit) test eax,eax jl game.62BABF ; if itemType < 0 ; return 0
mov ecx,[744304] ; globalData = GLOBAL_DATA_744304 cmp eax,[ecx+BFC] jge game.62BABF ; if itemType >= globalData.unknownCount2 ; return 0
imul eax,eax,E4 add eax,[ecx+BF8] ; pUnknownData3 = globalData.unknownList2[itemType] test eax,eax ; je game.62BABF ; if pUnknownData3 == null: ; return 0
movzx eax,[eax+10] ; return pUnknownData3.unknown_10 pop ebp ret 4 ; J game.62BABF xor eax,eax pop ebp ret 4 ; END ----------------------------------------------------------------
; FN game.629930
;
; checks if some durability related stat is true/false
; if noDurability is set or durability <= 0 this will always return false
;
; is_some_durability_related_val_game_629930 (
; )
push ebp
mov ebp,esp
push esi
mov esi,[ebp+8] ; pUnit = ...
test esi,esi
je game.629984 ; if !pUnit:
; return 0
cmp [esi],4
jne game.629984 ; if pUnit.eType != UnitType.Item
; return 0
mov eax,[esi+4] ; push eax call game.6335F0 ; itemDesc = get_item_description_by_class_6335F0(pUnit.eClass)
test eax,eax je game.629984 ; if itemDesc == null ; return 0 cmp [eax+113],0 jne game.629984 ; if itemDesc.noDurability ; return 0
cmp [eax+112],0
jbe game.629984 ; if itemDesc.durability < 0
; return 0
push esi
call game.625E00 ; maxDurability = get_max_durability_of_item_625E00(pUnit)
test eax,eax
je game.629984 ; if maxDurability == 0 // or null
; return 0
push 0
push 98 ; StatIdentifier.Unknown_98
push esi
call game.625480 ; statValue = getStatValue_625480()
xor ecx,ecx ;
test eax,eax ;
setle cl ; if statValue <= 0
; return 1
; return 0
pop esi
mov eax,ecx
pop ebp
ret 4
; J game.629984 xor eax,eax pop esi pop ebp ret 4 ; END ----------------------------------------------------------------
; FN game.625E00 ; get_max_durability_of_item_625E00 ( ; *D2Unit pUnit ; ) push ebp mov ebp,esp mov ecx,[ebp+8] test ecx,ecx push ebx push esi push edi je game.625E3F ; if pUnit == null ; return 0 mov eax,[744304] ; globalData = GLOBAL_DATA_744304 cmp [eax+BD4],49 jle game.625E3F ; // is this different for some patch version ; // or game mode? why the hard check on 0x49 ; if globalData.ItemStatCostCount <= 0x49 ; return 0 mov esi,[eax+BCC] ; itemStatCost = globalData.ItemStatCost add esi,5C64 ; // skip exactly 49 items in the list ; // (each item has length 0x144) ; // riddle solved: because the 50ths element is DurabilityMax
je game.625E3F ; if itemStatCost == null (points to nothing?) ; return 0
mov ebx,[ecx+5C]
test ebx,ebx
je game.625E3F ; if pUnit.StatListNode == null
; return 0
push esi ; mov edi,game.490000 ; call game.624ED0 ; tmp5 = get_item_stat_flags_somehow_game_624ED0(itemStatCost) test eax,eax ; jne game.625E48 ; if tmp5 == 0 ; return 0 ; J 625E3F pop edi pop esi xor eax,eax pop ebx pop ebp ret 4
; J game.625E48
test ebx,ebx
je game.625E3F ; if EBX == null // D2StatListEx ??
; return 0
test esi,esi je game.625E3F ; if pItemStatCostList == null // not really sure ; return 0
push esi call game.624F60 ; return statlist_func_625F60(itemStatCost) pop edi pop esi pop ebx pop ebp ret 4 ; END ----------------------------------------------------------------
; FN game.624ED0 ; get_item_stat_flags_somehow_game_624ED0 ( ; ?D2ItemStatCost itemStatCost, ; EBX: D2StatListEx? ; EDI: ?? ; ) push ebp mov ebp,esp push esi lea esi,[ebx+24] ; mov eax,esi ; tmp = EBX.BaseStats // D2StatArray
call game.624890 ; tmp2 = game_624890(tmp) test eax,eax jl game.624EEB ; if tmp2 < 0 ; return 0
mov ecx,[esi] ; lea eax,[ecx+eax*8] ; tmp3 = itemStatCost.StatId * tmp2 * 8 test eax,eax jne game.624EF2 ; if tmp3 == 0 ; return 0
; J game.624EEB xor eax,eax pop esi pop ebp ret 4
; J game.624EF2 mov esi,[ebp+8] ; pUnknownData4 = ??? // pointer to some structure test esi,esi ; mov eax,[eax+4] ; eax = itemStatCost.ItemStatFlags je game.624F33 ; if pUnknownData4 == null ; return itemStatCost.ItemStatFlags
mov dl,[6CE270] ; dl = GLOBAL_DATA_6CE270 test [esi+5],dl ; je game.624F33 ; if dl == pUnknownData4.unknown_05 ; return itemStatCost.ItemStatFlags
test [ebx+10],80000000 je game.624F33 ; if EBX.ListFlags == 80000000 ; return itemStatCost.ItemStatFlags
mov ecx,[ebx+44] ; pOwner = EBX.pUnit test ecx,ecx ; je game.624F33 ; if not pOwner ; return itemStatCost.ItemStatFlags
cmp [ecx],0 je game.624F25 ; if pOwner.eType not in [UnitType.Player, UnitType.Monster] ; return itemStatCost.ItemStatFlags
test ecx,ecx
je game.625F33
cmp [ecx],1
jne game.624F33
; J game.624F25 mov edx,[esi+2C] ; edx = pUnknownData4.unknown_2c cmp eax,edx ; jge game.624F33 ; if itemStatCost.ItemStatFlags >= edx ; return itemStatCost.ItemStatFlags mov cl,[esi+18] ; cl = pUnknownData4.unknown_18 shl edx,cl ; edx = edx << cl mov eax,edx ; return edx
; J game.624F33 pop esi pop ebp ret 4 ; END ----------------------------------------------------------------
; FN game.624890 ; not sure what this is doing... ; ; game_624890 ( ; ?D2ItemStatCost itemStatCost // not sure yet ; ) push ebx mov ebx,[eax] ; statId = itemStatCost.StatId push esi movsx esi,[eax+4] ; statFlags = itemStatCost.ItemStatFlags xor ecx,ecx ; ECX = 0 test esi,esi jle game.624BBF ; if statFlags == 0 // no flags? ; return -1
mov edi,edi ;
; J game.624BA0 mov eax,esi ; eax = statFlags sub eax,ecx ; eax = eax - ECX // ???? cdq ; edx = eax >= 0 ? 0 : -1 sub eax,edx ; eax = eax - edx sar eax,1 ; eax = eax >> 1 add eax,ecx ; eax = eax + ECX mov edx,[ebx+eax*8] ; edx = .... ?? why cmp edi,edx ; // edit set to 490000 earlier jle game.624BB7 ; if edi <= edx ; jump_to(game.624BB7) lea ecx,[eax+1] ; ecx = eax+1 jmp game.624BBB ; jump_to(game.624BBB)
; J game.624BB7 jge game.624BC2 ; if edi >= edx) return eax mov esi,eax
; J game.624BBB cmp ecx,esi ; jl game.624BA0 ; if ecx < esi ; jump_to(game.624BA0) // to start of loop
or eax,FFFFFFFF pop esi pop ebx ret ; return -1 ; END ----------------------------------------------------------------
; FN game.62E740
;
; get_some_unknown_0e_by_unit_62E740 (
; pUnit unit
; )
push ebp
mov ebp,esp
mov eax,[ebp+8]
test eax,eax ;
je game.62E77F ; if unit == null:
; return 0
cmp [eax],4
jne game.62E77F ; if unit.eType != UnitType.Item
; return 0
push eax
call game.62B400 ; itemType = get_item_type_by_item_62B400(pUnit)
test eax,eax
jl game.62E77F ; if itemType < 0
; return 0
mov ecx,[744304] ; ecx = GLOBAL_DATA_744304 cmp eax,[ecx+BFC] ; jge game.62E77F ; if itemType >= globalData.unknownCount2 imul eax,eax,E4 add eax,[ecx+BF8] ; pUnknownData3 = globalData.unknownList2[itemType] test eax,eax je game.62E77F ; if pUnknownData3 == null ; return 0 movsx eax,[eax+E] ; return pUnknownData3.unknown_0E pop ebp ret 4
; J game.62E77F xor eax,eax pop ebp ret 4 ; END --------------------------
; FN game.62C0B0 ; ; ; get_some_unknown_21_by_unit_62C0B0 ( ; pUnit unit ; ) push ebp mov ebp,esp mov eax,[ebp+8] test eax,eax ; je game.62C0F1 ; if unit == null: ; return 7 push eax call game.62B400 ; itemType = get_item_type_by_item_62B400(unit) test eax,eax jl game.62C0F1 ; if itemType < 0: ; return 7 mov ecx,[744304] ; globalData = GLOBAL_DATA_744304
cmp eax,[ecx+BFC]
jge game.62C0F1 ; if itemType >= globalData.unknownCount2
; return 7
imul eax,eax,E4 ; add eax,[ecx+BF8] ; test eax,eax ; pUnknownData3 = globalData.unknownList2[itemType] je game.62C0F1 ; if pUnknownData3 == null: ; return 7
mov al,[eax+21] ; cmp al,7 ; movzx eax,al jb game.62C0F6 ; if pUnknownData3.unknown_21 < 7 ; return pUnknownData3.unknown_21 ; ; return 7 ; J 62C0F1 mov eax,7 ; J 62C0F6 pop ebp ret 4 ; END --------------------------
; FN game.468830 ; ; ; get_some_global_data_468830 () mov eax,[7A6AF0] ; return getInt(GLOBAL_DATA_7A6AF0) ret ; END --------------------------
; FN game.62A0A0
;
; whatever is transmogrify??
; get_item_is_transmogrify_by_unit_62A0A0 (
; pUnit unit
; )
push ebp
mov ebp,esp
mov eax,[ebp+8]
test eax,eax
jne game.62A0C9 ; if unit == null
push 1162 ; raise ERROR 0x1162
; J game.62A0AF call game.408090 push eax ; push game.6CC837 ; call game.408A60 ; add esp,C push FFFFFFFF call game.681E09
; J game.62A0C9
cmp [eax],4 ; if unit.eType != TYPE_UNIT
je game.62A0D5
push 1163 ; raise ERROR 0x1163
jmp game.62A0AF
; J game.62A0D5
mov eax,[eax+4]
push eax
call game.62A060 ; get_item_is_transmogrify_by_class_62A060(unit.eClass)
pop ebp
ret 4
; END --------------------------
; FN game.62A060
;
; whatever is transmogrify??
;
; get_item_is_transmogrify_by_class_62A060 (
; int eClass
; )
push ebp
mov ebp,esp
mov eax,[ebp+8]
push eax ;
call game.6335F0 ; itemDesc = get_item_description_by_class_6335F0(eClass)
test eax,eax ; if itemDesc == null:
jne game.62A08F
push 1155 ; raise ERROR 0x1155
call game.408090
push eax
push game.6CC837
call game.408A60
add esp,C
push FFFFFFFF
call game.681E09
; J game.62A08F xor ecx,ecx ; cmp [eax+139],cl ; return itemDesc.transmogrify !== 0 setne cl ; mov eax,ecx ; pop ebp ret 4 ; END --------------------------
; FN game.48d1d0 (Game.exe+8D1D0) ; called when hovering over a set item in inventory ; [...] ; END --------------------------
; START ------------------------ ; FN game.4E6560 ; ; called when hovering over a set item in inventory (eg called from game.48d1d0) ; ; game_4E6560 ( ; edx pUnit item ; ecx pUnit owner ? ; ) push ebp mov ebp,esp push ecx push esi push edi mov edi,edx ; test edi,edi ; mov esi,ecx ; je game.4E666A ; if item == null ; return
cmp [edi],4 jne game.4E666A ; if item.eType != TYPE_ITEM ; return
push edi call game.627E70 ; quality = get_item_quality_627E70(item)
cmp eax,5 jne game.4E666A ; if quality != ItemQuality.Set ; return
push edi call game.62A490 ; desc = get_set_item_description_62A490(item)
test eax,eax je game.4E666A ; if desc == null ; return
movzx eax,byte[eax+87] ; sub eax,1 ; push ebx je game.4E660E ; if desc.AddFunction == 1 ; goto: AddFunc1
sub eax,1 ; jne game.4E6669 ; if desc.AddFunction == 2 ; goto: AddFunc2
; J game.4E65AE (AddFunc2) push 1 push edi push esi call game.62A370 ; setCompletionFlags = get_active_set_completion_flags_62A370(owner, item, true) cmp eax,40 ; jb game.4E65C0 ; if setCompletionFlags < 0x40 ; goto: 4E65C0
xor eax,eax ; jmp game.4E65C7 ; setBonsuses = -1 ; goto: 4E65C7
; J game.4E65C0 mov eax,[eax*4+6DBD90] ; setBonsuses = GLOBAL.SetBonuses[setCompletionFlags] - 1
; J game.4E65C7 lea ebx,[eax-1] ; xor esi,esi ; bonusIdx = 0 test ebx,ebx jle game.4E6669 ; if setBonuses <= 0 ; goto: AddFunc2
jmp game.4E65E0
lea esp,[esp] ; lea ecx,[ecx] ;
; J game.4E65E0 mov eax,[esi*4+6DBD70] ; GLOBAL.SetBonuses2[bonusIdx] mov ecx,[ebp+C] ; mov edx,[ebp+8] ; push 1 push 0 push 0 push eax push 0 push ecx mov ecx,edi call game.4E60A0 ; game_4E60A0( ; (ecx) pUnit item ; (edx) ??? ; pUnit item ; 0 ; GLOBAL.SetBonuses2[bonusIdx] ; 0 ; 0 ; 1 ; ) add esi,1 cmp esi,ebx jl game.4E65E0 pop ebx pop edi pop esi mov esp,ebp pop ebp ret 8
; J game.4E660E (AddFunc1) push 0 push edi push esi call game.62A370 push edi mov [ebp-4],eax call game.62B3A0 mov ebx,eax xor esi,esi cmp esi,ebx lea eax,[esi*4] je game.4E6661 jle game.4E6634 add eax,FFFFFFFC mov ecx,esi mov edx,1 shl edx,cl mov ecx,[ebp-4] test ecx,edx je game.4E6661 mov edx,[eax+6DBD70] mov eax,[ebp+C] push 1 push 0 push 0 push edx mov edx,[ebp+8] push 0 push eax mov ecx,edi call game.4E60A0 add esi,1 cmp esi,6 jl game.4E6624
; J game.4E6669 pop ebx pop edi pop esi mov esp,ebp pop ebp ret 8 ; END --------------------------
; START ------------------------ ; GatewayAccess::UpdateGatewaysFromIni+111B20 ; FN game.62A370 ; ; called when hovering over a set item (not always) ; (sometimes requires to click on it) ; ; calculates the set completion flags for an item ; - only equipped/active/valid items are included ; ; get_active_set_completion_flags_62A370 ( ; ebp+8 pUnit player ; ebp+C pUnit item ; ebp+10 bool include_item ; ) push ebp mov ebp, esp mov ecx,[ebp+8] test ecx,ecx je game.62A396 ; if player == null ; return 0
mov edx,[ebp+C] test edx,edx je game.62A396 ; if item == null ; return 0
mov eax,[edx] cmp eax,4 jne game.62A396 ; if item.eType != TYPE_ITEM ; return 0
mov eax,[edx+14] test eax,eax je game.62A396 ; if item.UnitData == null ; return 0
mov eax,[eax] cmp eax,5 je game.62A39C ; if item.UnitData.Quality != ItemQuality.Set ; return 0
; J game.62A396 xor eax,eax pop ebp ret C
push esi mov esi,[ecx+60] test esi,esi jne game.62A3AB ; if player.pInventory == null ; return 0
xor eax,eax pop esi pop ebp ret C
; J game.62A3AB push ebx push edx call game.629DA0 ; fileIndex = get_item_file_index_629DA0(item) mov ecx,eax call game.483440 ; itemDesc = get_set_item_description_483440(fileIndex) mov ebx,eax test ebx,ebx je game.62A3CC ; if itemDesc == null ; return 0
movsx ecx,[ebx+2C] call game.483410 ; setDesc = get_set_description_483410(itemDesc.SetCode) test eax,eax jne game.62A3D4 ; if setDesc == null ; return 0
; J game.62A3CC pop ebx xor eax,eax pop esi pop ebp ret C
; J game.62A3D4 push edi push esi xor edi,edi ; setCompletionFlags = None call game.63B2C0 ; invItem = get_first_inventory_item_63B2C0(player.pInventory) mov esi,eax test esi,esi je game.62A486 ; if invItem == null ; return 0
; J game.62A3E7 push esi call game.63E020 ; unknownD = game_63E020(invItem)
cmp eax,3 ; jne game.62A476 ; if unknownD != 3 ; goto 62A476
push esi call game.63DFD0 ; // invItem2 is === invItem, if anything ; invItem2 = get_item_if_is_item_63DFD0(invItem) mov ecx,eax test ecx,ecx je game.62A476 ; if invItem2 == null ; goto 62A476
cmp [ecx],4 ; jne game.62A476 ; if invItem2.eType != TYPE_ITEM ; goto 62A476
cmp [ebp+10],0 ; jne game.62A412 ; if include_item == false
cmp ecx,[ebp+C] ; je game.62A476 ; if invItem2 == item ; goto 62A476
; J game.62A412 push ecx call game.627E70 ; quality = get_item_quality_627E70(invItem2) cmp eax,5 ; jne game.62A476 ; if quality != ItemQuality.Set ; goto 62A476
push game.6E1150 push 144E push 4000 ; push ecx call game.6280A0 ; requirementsNotMet = item_has_item_flag_6280A0( ; invItem2 ; ItemFlag.RequirementsNotMet ; 144E ; game.6E1150 ; ) test eax,eax jne game.62A476 ; if requirementsNotMet ; goto 62A476
push game.6E1150 push 144F push 100 ; push ecx call game.6280A0 ; noDurability = item_has_item_flag_6280A0( ; invItem2 ; ItemFlag.NoDurability ; 144E ; game.6E1150 ; ) test eax,eax jne game.62A476 ; if noDurability ; goto 62A476
push ecx call game.629DA0 ; fileIndex = get_item_file_index_629DA0(invItem2) mov ecx,eax call game.483440 ; desc = get_set_item_description_483440(fileIndex) test eax,eax je game.62A476 ; if desc == null ; goto 62A476
mov cx,short[eax+2C] cmp cx,short[ebx+2C] jne game.62A476 ; if desc.SetCode != itemDesc.SetCode ; goto 62A476
mov cl,byte[eax+2E] ; mov edx,1 ; shl edx,cl ; setCompletionFlag = 1 << desc.SetPointerIndex or edi,edx ; setCompletionFlags |= setCompletionFlag
; J game.62A476 push esi ; call game.63DFA0 ; invItem = game_63DFA0(invItem) mov esi,eax test esi,esi ; jne game.62A3E7 ; if invItem != null ; goto 62A3E7
mov eax,edi ; return setCompletionFlags pop edi pop ebx pop esi pop ebp ret C ; END --------------------------
; START ------------------------ ; FN game.627E70 ; ; returns quality of item ; ; get_item_quality_627E70 ( ; ebp+8 pUnit item ; ) push ebp mov ebp,esp mov eax,[ebp+8] test eax,eax je game.627E8C ; if item == null ; return ItemQuality.Normal
cmp [eax],4 jne game.627E8C ; if item.eType != TYPE_ITEM ; return ItemQuality.Normal
mov eax,[eax+14] test eax,eax je game.627E8C ; if item.UnitData == null ; return ItemQuality.Normal
mov eax,[eax] pop ebp ret 4 ; return item.UnitData.Quality
; J game.627E8C mov eax,2 pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.62A490 ; ; get_set_item_description_62A490 ( ; ebp+8 pUnit item ; ) push ebp mov ebp,esp mov eax,[ebp+8] test eax,eax je game.62A4D5 ; if item == null ; return 0
mov ecx,[eax] cmp ecx,4 jne game.62A4D5 ; if item.eType != TYPE_ITEM ; return 0
mov ecx,[eax+14] test ecx,ecx je game.62A4D5 ; if item.UnitData == null ; return 0
cmp [ecx],5 jne game.62A4D5 ; if item.UnitData.Quality != ItemQuality.Set ; return 0
push eax call game.629DA0 ; fileIndex = get_item_file_index_629DA0(item) test eax,eax jl game.62A4D5 ; if fileIndex < 0 ; return 0
mov ecx,[744304] cmp eax,[ecx+C1C] jge game.62A4D5 ; if fileIndex >= D2GlobalData.SetItemDescriptionCount ; return 0
imul eax,eax,1B8 add eax,[ecx+C18] ; return D2GlobalData.SetItemDescriptions[fileIndex] pop ebp ret 4
; J game.62A4D5 xor eax,eax pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.629DA0 ; ; get_item_file_index_629DA0 ( ; ebp+8 pUnit item ; ) push ebp mov ebp, esp mov eax,[ebp+8] test eax,eax jne game.629DC9 ; if item == null ; raise ERROR 1070
push 1070 ; ; J game.629DAF call game.408090 push eax push game.6CC837 call game.408A60 add esp,C push FFFFFFFF call game.681E09
; J game.629DC9 cmp [eax],4 je game.629DD5 ; if item.eType != TYPE_ITEM ; raise ERROR 1071
push 1071 jmp game.629DAF ;
; J game.629DD5 mov eax,[eax+14] test eax,eax jne game.629DE3 ; if item.UnitData == null ; raise ERROR 1073
push 1073 ; jmp game.629DAF
mov eax,[eax+28] ; return item.UnitData.FileIndex pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.483440 ; ; get_set_item_description_483440 ( ; eax int fileIndex ; ) mov eax,ecx test eax,eax jl game.483461 ; if fileIndex < 0 ; return 0
mov ecx,[744304] cmp eax,[ecx+C1C] jge game.483461 ; if fileIndex >= D2GlobalData.SetItemDescriptionCount ; return 0
imul eax,eax,1B8 add eax,[ecx+C18] ret ; return D2GlobalData.SetItemDescriptions[fileIndex]
xor eax,eax ret ; END --------------------------
; START ------------------------ ; FN game.483410 ; ; get_set_description_483410 ( ; eax int setCode ; ) mov eax,eax test eax,eax jl game.483431 ; if setCode < 0 ; return 0
mov ecx,[744304] cmp eax,[ecx+C10] jge game.483431 ; if setCode >= D2GlobalData.SetDescriptionCount ; return 0
imul eax,eax,128 add eax,[ecx+C0C] ; return D2GlobalData.SetDescriptions[setCode] ret
xor eax,eax ret ; END --------------------------
; START ------------------------ ; FN game.63B2C0 ; ; get_first_inventory_item_63B2C0 ( ; ebp+8 pInventory inventory ; ) push ebp mov ebp,esp mov eax,[ebp+8] ; test eax,eax jne game.63B2D0 ; if inventory == null ; return 0
xor eax,eax pop ebp ret 4
cmp [eax],01020304 jne game.63B2CA ; if inventory.dwInvStamp != 01020304 ; return 0
mov eax,[eax+C] ; return inventory.pFirstItem pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.63E020 ; ; game_63E020 ( ; ebp+8 pUnit item ; ) push ebp mov ebp,esp mov ecx,[ebp+8] test ecx,ecx jne game.63E030 ; if item == null ; return 0
xor eax,eax pop ebp ret 4
mov eax,[ecx] cmp eax,4 jne game.63E02A ; if item.eType != TYPE_ITEM ; return 0
mov eax,[ecx+14] test eax,eax je game.63E02A ; if item.UnitData == null ; return 0
add eax,5C ; // unsure: je game.63E02A ; if item.UnitData.pNodeOwnerInventory == null ; return 0
movsx eax,byte[eax+D] ; return item.UnitData.pNodeOwnerInventory.unknown_D pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.63DFA0 ; ; game_63DFA0 ( ; ebp+8 pUnit item ; ) push ebp mov ebp,esp mov ecx,[ebp+8] ; test ecx,ecx ; if item == null ; return 0 jne game.63DFB0 xor eax,eax pop ebp ret 4
mov eax,[ecx] ; cmp eax,4 ; jne game.63DFAA ; if item.eType != TYPE_ITEM ; return 0
mov eax,[ecx+14] test eax,eax je game.63DFAA ; if item.UnitData == null ; return 0
add eax,5C je game.63DFAA ; // unsure: ; if item.UnitData.pNodeOwnerInventory == null ; return 0
mov eax,[eax+8] ; return item.UnitData.pNodeOwnerInventory.unknown_unit_ptr_8 pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.63DFD0 ; ; called from game.62A370 when unknown_D == 3 ; ; get_item_if_is_item_63DFD0 ( ; ebp+8 pUnit unit ; ) push ebp mov ebp,esp mov eax,[ebp+8] test eax,eax jne game.63DFDE ; if unit == null ; return 0
pop ebp ret 4
mov ecx,[eax] ; xor edx,edx cmp ecx,4 ;
setne dl ; if unit.eType != TYPE_ITEM ; return 0 ; ; return unit
sub edx,1 ; and eax,edx ; pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.4E60A0 ; ; game_4E60A0 ( ; ecx pUnit item ; edx ??? unknownEdx ; ebp+8 pUnit item () ; ebp+C ??? unknownArg1 (0) ; ebp+10 SetBonus2 ??? (GLOBAL.SetBonuses2[bonusIdx]) ; ebp+14 ??? unknownArg2 (0) ; ebp+18 ??? unknownArg3 (0) ; ebp+1C ??? unknownArg4 (1) ; ) push ebp mov ebp,esp mov eax,12B8 call game.6831B0 ; game_6831B0( ; (eax) 12B8 ; ) push ebx mov ebx,ecx ; push esi push edi
xor eax,eax ; // eax = val mov ecx,40 ; // ecx = len lea edi,[ebp-118] ; // edi = address of where to write rep stosd ; // write a 40 len str. to address
mov esi,edx mov ecx,40 lea edi,[ebp-2C0] push ebx mov [ebp-4],esi ; mov [ebp-10],ebx rep stosd
call game.62B400 ; itemType = get_item_type_by_item_62B400(item) cmp eax,B jne game.4E60F6 ; if itemType != ItemType.Unknown_0B ; goto: 4E60F6
push esi ; // begin not analyzed push ebx mov eax,game.72D6C0 call game.4E5E90 pop edi pop esi pop ebx mov esp,ebp pop ebp ret 18 ; // end not analyzed
; J game.4E60F6 mov eax,[ebp+18] ; unknownArg3 mov ecx,[ebp+10] ; SetBonus2 push eax push ecx push ebx call game.6257D0 ; statlist = get_item_statlist_by_set_state_6257D0(item, SetBonus2, unknownArg3) mov esi,eax test esi,esi je game.4E63FE ; if statlist == null ; return 0
test ebx,ebx jne game.4E611C ; if item == null
or edx,FFFFFFFF ; __unknown_C = -1 // __unknown_C lea ecx,[ebx+6] ; eType = 6 // eType xor eax,eax ; pMempool = 0 // pMempool jmp game.4E6124 ; else
; J game.4E611C mov edx,[ebx+C] ; __unknown_C = item.__unknown_C mov ecx,[ebx] ; eType = item.eType mov eax,[ebx+8] ; pMempool = item.pMempool
; J game.4E6124 push edx push ecx push 0 push 0 push eax call game.6251F0 ; game_6251F0( ; pMempool ; 0 ; 0 ; eType ; __unknown_C ; ) mov edi,eax push esi push edi mov [ebp-8],edi call game.6274F0
; END --------------------------
; START ------------------------ ; FN game.6831B0 ; ; game_6831B0 ( ; (eax) ; ) push ecx lea ecx,[esp+4] sub ecx,eax sbb eax,eax not eax and ecx,eax mov eax,esp and eax,FFFFF000 cmp ecx,eax jb game.6831D2 mov eax,ecx pop ecx xchg esp,eax mov eax,[eax] mov [esp],eax ret sub eax,1000 test [eax],eax jmp game.6831C4 push ebp mov ebp,esp sub esp,20 push ebx xor ebx,ebx cmp [ebp+10],ebx jne game.683206 call game.6896AD push ebx push ebx push ebx push ebx push ebx mov [eax],16 call game.689635 add esp,14 or eax,FFFFFFFF jmp game.683285 mov ecx,[ebp+C] cmp ecx,ebx push esi mov esi,[ebp+8] je game.683232 cmp esi,ebx jne game.683232 call game.6896AD push ebx push ebx push ebx push ebx push ebx mov [eax],16 call game.689635 add esp,14 or eax,FFFFFFFF jmp game.683284 mov eax,7FFFFFFF cmp ecx,eax mov [ebp-1C],eax ja game.683241 mov [ebp-1C],ecx push edi lea eax,[ebp+14] push eax push ebx push [ebp+10] lea eax,[ebp-20] push eax mov [ebp-14],42 mov [ebp-18],esi mov [ebp-20],esi call game.68B5A3 add esp,10 cmp esi,ebx mov edi,eax je game.683283 dec [ebp-1C] js game.683275 mov eax,[ebp-20] mov byte[eax],bl jmp game.683281 lea eax,[ebp-20] push eax push ebx call game.68ABAC pop ecx pop ecx mov eax,edi pop edi pop esi pop ebx leave ret ; END --------------------------
; START ------------------------ ; FN game.62B400 ; ; get_item_type_by_item_62B400 ( ; ebp+8 pUnit item ; ) push ebp mov ebp,esp mov eax,[ebp+8] test eax,eax jne game.62B429 ; if item == null ; raise ERROR 67D push 67D call game.408090 push eax push game.6CC837 call game.408A60 add esp,C push FFFFFFFF call game.681E09
; J game.62B429 cmp [eax],4 je game.62B434 ; if item.eType != TYPE_ITEM ; return 0
xor eax,eax pop ebp ret 4
mov eax,[eax+4] push eax call game.628700 ; return get_item_type_by_class_628700(item.eClass) pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.628700 ; ; get_item_type_by_class_628700 ( ; ebp+8 int eClass ; ) push ebp mov ebp,esp mov eax,[ebp+8] push eax call game.6335F0 ; itemDesc = get_item_description_by_class_6335F0(eClass) test eax,eax jne game.62872F ; if itemDesc == null ; raise ERROR 68D
push 68D call game.408090 push eax push game.6CC837 call game.408A60 add esp,C push FFFFFFFF call game.681E09
movsx eax,[eax+11E] ; return (int)ItemType pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.6335F0 ; ; get_item_description_by_class_6335F0 ( ; ebp+8 int eClass ; ) push ebp mov ebp,esp mov eax,[ebp+8] cmp eax,[96CA58] ; if eClass >= GLOBAL.ItemDescriptions.Length jb game.633604 ; return 0 xor eax,eax pop ebp ret 4
mov ecx,[96CA5C] ; test ecx,ecx jne game.63362D ; if GLOBAL.ItemDescriptions.Memory == null ; raise ERROR 1EF
push 1EF call game.408090 push eax push game.6CC837 call game.408A60 add esp,C push FFFFFFFF call game.681E09
imul eax,eax,1A8 add eax,ecx ; return GLOBAL.ItemDescriptions.Memory[eClass] pop ebp ret 4 ; END --------------------------
; START ------------------------ ; FN game.6257D0 ; ; get_item_statlist_by_set_state_6257D0 ( ; ebp+8 pUnit item ; ebp+C SetBonus2 ... () ; ebp+10 ??? unknownArg3 () some flag ; ) push ebp mov ebp,esp mov eax,[ebp+8] ; mov ecx,[eax+5C] ; test ecx,ecx je game.625819 ; if item.StatListNode == null ; return 0
test [ecx+10],80000000 ; je game.625819 ; if not item.StatListNode.ListFlags & HasCompleteStats ; return 0
mov edx,[ebp+10] ; test edx,2000 mov eax,[ecx+3C] ; list = item.StatListNode.pMyLastList je game.6257FD ; if unknownArg3 & 2000
mov eax,[ecx+40] ; list = item.StatListNode.pMyStats and edx,FFFFDFFF ; unknownArg3 &= FFFDFFF // unset 2000 flag
; J game.6257FD test eax,eax je game.625819 ; if list == null ; return 0
mov ecx,[ebp+C]
; J game.625804 cmp [eax+14],ecx ; jne game.625812 ; if list.State != SetBonus2 ; goto: 625812
test edx,edx je game.62581B ; if unknownArg3 == 0 ; return list
test [eax+10],edx jne game.62581B ; if unknownArg3 == list.ListFlags ; return list
; J game.625812 mov eax,[eax+2C] ; list = list.PreviousList test eax,eax ; jne game.625804 ; if list != null ; goto: 625804
; J game.625819 xor eax,eax ; return 0
; J game.62581B pop ebp ret C ; END --------------------------
; START ------------------------ ; FN game.6251F0 ; ; game_6251F0 ( ; ebp+8 pMempool mempool (pMempool) ; ebp+C int(?) unknownArg2 (0x0) ; ebp+10 int(?) unknownArg3 (0x0) ; ebp+14 int unknownArg4 (eType) ; ebp+18 int(?) unknownArg5 (__unknown_C) ; ) push ebp mov ebp,esp push esi push edi mov edi,[ebp+8] push 0 push 56A push game.6E90A4 mov edx,3C mov ecx,edi call game.40B430 ; game_40B430( ; mempool ; 0x3C ; game.6E90A4 ; 0x56A ; 0x0 ; ) push 3C mov esi,eax push 0 push esi call game.681EF0 ; game_681EF0( ; ; )
; END --------------------------
; START ------------------------ ; FN game.40B430 ; ; game_40B430 ( ; ecx pMempool unknownMempool ; edx int unknownInt (0x3C) ; ebp+8 addr unknownArg1 (game.6E90A4) ; ebp+C int unknownInt2 (0x56A) ; ebp+10 int(?) unknownArg3 (0x0) ; ) push ebp mov ebp,esp push ebx mov ebx,[ebp+8] ; unknownArg1 mov eax,ecx ; unknownMempool mov ecx,[708000] ; globalVal1 ([1|0]?) push esi push edi mov edi,[ebp+C] ; unknownInt2 neg ecx ; // -1 (cf set) | 0 push edi ; sbb ecx,ecx ; // 0xFFFFFFFF 0x00000000 push ebx and ecx,eax ; if globalVal1 == 0 ; pMempool = 0
call game.40A080 ; retval = game_40A080( ; ecx pMempool ; edx unknownInt ; ebp+8 unknownArg1 ; ebp+C unknownInt2 ; ) mov esi,eax test esi,esi ; jne game.40B46A ; if retval == 0
push game.6CC837 ; push edi push ebx push 2 call game.408900 ; game_408900 ( ; 2 ; ebx ; edi ; game.6CC837 ; )
add esp,10 mov eax,esi ;
; J game.40B46A pop edi ; return retval pop esi pop ebx pop ebp ret C ; END --------------------------