$val) { if ($val['size'] > 6) { $item_data = unpack('Vdata1/vdata2/a'.($val['size']-6).'name', substr($data, $val['offset'], 300)); $items[$key]['data1']= $item_data['data1']; $items[$key]['data2']= $item_data['data2']; $items[$key]['name'] = $item_data['name']; } else { $items[$key]['data1']= 0; $items[$key]['data2']= 0x1b81; $items[$key]['name'] = ''; } $items[$key]['key'] = $key; # Just to make sorting nicer. } function mysort($a, $b) { # Comment out fields you don't want to sort by. # Put most important fields to sort by first. #if (strnatcasecmp($a['data2'], $b['data2'])) { return strnatcasecmp($a['data2'], $b['data2']); } #if (strnatcasecmp($a['name'], $b['name'])) { return strnatcasecmp($a['name'], $b['name']); } if (strnatcasecmp($a['key'], $b['key'])) { return strnatcasecmp($a['key'], $b['key']); } #if (strnatcasecmp($a['data1'], $b['data1'])) { return strnatcasecmp($a['data1'], $b['data1']); } #if (strnatcasecmp($a['size'], $b['size'])) { return strnatcasecmp($a['size'], $b['size']); } #if (strnatcasecmp($a['offset'],$b['offset'])){ return strnatcasecmp($a['offset'],$b['offset']); } } uasort($items, 'mysort'); foreach ($items as $key => $item) { # comment out relevant lines to display only matching items. #if ($item['name'] == '') { continue; } # Show only named items. if ($item['size'] == 6) { continue; } # Show only named items (faster way). #if ($item['data2'] == 0x1b81) { continue; } # Show only takable items #if ($item['data2'] != 0x1b81) { continue; } # Show only untakeable named items printf("%5d %8x %4x %s\n", $key, $item['data1'], $item['data2'], $item['name']); } /* ; This is for the fully patched, 1.18 (unofficial) exe. ; May differ in earlier vers. ; Bytes 0-7f are metadata and can be ignored. ; Bytes 80-1007f are the typename lookup (0x10000 bytes). ; Bytes 10080-end are name data. ; Typename lookup is groups of 8 bytes, starting at offset 0x0080. ; 1-4: offset in file, in 0xdcba order (offset 00013f18 stored as 183f0100) ; 5-8: length, in the same order, though only the first byte is ever used, since none are>256. ; Names are varying length, 6 bytes or more ; 1-4: data, usually null. ; 5-6: unknown: poss script pointer to handle actions? ; 7 onwards: name, if any, as a null terminated string. ; ; So, the item numbers are [offset in the file of the index-128]/8 ; or, [[offset in the file of the index]/8]-16 ; or, [offset of the index fromthefirst index]/8] ; [address-10000h] [preceding number in typename file] [itemnumber] = desc [notes] ; Preceding number 1a, 1b(ungettable), 1d(avatar gauntlets)) ; ; addr|data|item ; 229b 261a 833 = black potion [invisibility] ; 22ae 3a1a 834 = blue potion [water breathing] ; 22c0 3b1a 835 = green potion [poison] ; 22d3 3c1a 836 = orange potion ; 22e7 3d1a 837 = purple potion ; 22fb 3e1a 838 = red potion [cure poison] ; 230c 3f1a 839 = white potion [flame armour] ; 231f 401a 840 = yellow potion [heal] ; 2a2c 601a 1042 = broadsword ; 879c 601a 1042 = broadsword ; a853 591a 2673 = shortsword ; aced 941a 4900 = avatar tunic ; b2db 711a 5106 = avatar sleeves ; b2f0 721a 5107 = avatar boots ; b303 051d 5108 = avatar gauntlets ; b31a 771a 5109 = avatar leggings ; ---- 811b ---- = Prefix for ungettable (and some gettable) items ; ---- ---- 5101-5106 = X - big red X in the inventory. ; ---- ---- 5110-5113 = X - big red X in the inventory. */ ?>