BeBadEgg wrote: ↑Sun May 07, 2017 2:48 pm
This script can be used to scan all items ID , Contains DLC 1~2 .
{ Game : DarkSoulsIII.exe
Version:
Date : 2017-04-26
Author : BeBadEgg
This script does blah blah blah
}
[ENABLE]
{$lua}
function tohex(o) return string.format("%X",o) end
function _readInteger(...)
local val = readInteger(...)
if val==nil then return nil end
if val>0x7fffffff then val=val-0x100000000 end
return val
end
function gatherAllItem0()
local sig=([[
40 53 48 83 EC 20 48 8B D9 48 8B 0D xx xx xx xx 48 85 C9 75 26
4C 8D 0D xx xx xx xx 4C 8D 05 xx xx xx xx 48 8D 0D xx xx xx xx
BA AA 00 00 00 E8 xx xx xx xx 48 8B 0D xx xx xx xx 8B 13 48 83
C4 20 5B E9]]):gsub('\n',' ')
if not
autoAssemble("aobscanmodule(spotAOB,DarkSoulsIII.exe,"..sig..")\n"..
"label(messageRepoL)\n"..
"registersymbol(messageRepoL)\n"..
"spotAOB+C:\n"..
"messageRepoL:\n")
then return end
local messageRepoP = _readInteger('messageRepoL')+getAddress('messageRepoL')+4
local tmpMessageRepo = readQword(messageRepoP)
if tmpMessageRepo==nil then return end
messageRepo=tmpMessageRepo
--unregisterSymbol("messageRepoAddr")
--registerSymbol("messageRepoAddr",tmpMessageRepo,true)
end
--messageRepo = readQword('14477F870')
function listItemsFromGroup(group)
local messageRepoGroup = readQword(readQword(readQword(messageRepo+8))+group*8)
if messageRepoGroup==0 then return 0 end
local regionsCount = readInteger(messageRepoGroup+0x0C)
if regionsCount==0 then return 0 end
local TableWithIndexesToStrings = readQword(messageRepoGroup+0x18)
local counter=0
for i=0,regionsCount-1 do repeat
local ID_low = readInteger(messageRepoGroup+i*16+0x2C)
local ID_hi = readInteger(messageRepoGroup+i*16+0x30)
local offset = readInteger(messageRepoGroup+i*16+0x28)
if group==0xB and (ID_low<=0x1ADB0 ) then break end
if group==0xD3 and (ID_low<=0x1ADB0 ) then break end
if group==0xFB and (ID_low<=0x1ADB0 ) then break end
if group==0xC and (ID_low<=0xF4DF8 ) then break end --skip bogus protector items
if group==0xD4 and (ID_low<=0xF4DF8 ) then break end
if group==0xFC and (ID_low<=0xF4DF8 ) then break end
if group==0xE and (ID_low<=0x1716 ) then break end --skip bogus magic items
if group==0xD6 and (ID_low<=0x1716 ) then break end
if group==0xFE and (ID_low<=0x1716 ) then break end
for subID=ID_low,ID_hi do repeat
local index=subID-ID_low+offset
local StringTableIndex = readQword(TableWithIndexesToStrings+index*8)
if StringTableIndex==0 then break end
local name=AnsiToUtf8(readString(messageRepoGroup+StringTableIndex,200,true))
local ID=subID
if group==0xA or group==0xD2 or group==0xFA then ID = (ID | 0x40000000) end --goods
if group==0xB or group==0xD3 or group==0xFB then ID = (ID | 0x00000000) end --weapons
if group==0xC or group==0xD4 or group==0xFC then ID = (ID | 0x10000000) end --protectors
if group==0xD or group==0xD5 or group==0xFD then ID = (ID | 0x20000000) end --accessory
if group==0xE or group==0xD6 or group==0xFE then ID = (ID | 0x40000000) end --magic
local IDh=string.format('%08X',ID)
--local IDh=ID
if globalLists[ID] then -- skip duplicates
--print(IDh,name,tohex(group),'already in group '..tohex(globalList[ID][2]),'with ID '..globalList[ID][1],globalList[ID][3])
else
print(string.format("%-9s:%s",IDh,name))
end
globalLists[ID]={IDh,group,name}
counter=counter+1
until true end -- subID loop
until true end -- regions loop
return counter
end
function listIt()
gatherAllItem0()
globalLists={}
print('Raw')
print('')
print('magic:')
print( 'is number: '..listItemsFromGroup(0xE) )
print('')
print('Prop:')
print( 'is number: '..listItemsFromGroup(0xA) )
print('')
print('Weapon:')
print( 'is number: '..listItemsFromGroup(0xB) )
print('')
print('Armor:')
print( 'is number: '..listItemsFromGroup(0xC) )
print('')
print('accessory:')
print( 'is number: '..listItemsFromGroup(0xD) )
print('')
print('DLC1:')
print('')
print('magic:')
print( 'is number: '..listItemsFromGroup(0xD6) )
print('')
print('Prop:')
print( 'is number: '..listItemsFromGroup(0xD2) )
print('')
print('Weapon:')
print( 'is number: '..listItemsFromGroup(0xD3) )
print('')
print('Armor:')
print( 'is number: '..listItemsFromGroup(0xD4) )
print('')
print('accessory:')
print( 'is number: '..listItemsFromGroup(0xD5) )
print('')
print('DLC2:')
print('')
print('magic:')
print( 'is number: '..listItemsFromGroup(0xFE) )
print('')
print('Prop:')
print( 'is number: '..listItemsFromGroup(0xFA) )
print('')
print('Weapon:')
print( 'is number: '..listItemsFromGroup(0xFB) )
print('')
print('Armor:')
print( 'is number: '..listItemsFromGroup(0xFC) )
print('')
print('accessory:')
print( 'is number: '..listItemsFromGroup(0xFD) )
print('')
end
if not syntaxcheck then listIt() end
{$asm}
[DISABLE]
unregistersymbol(messageRepoL)