Note that there are some explanatory texts on larger screens.

plurals
  1. PORead hex file, convert to string and load to listBox
    primarykey
    data
    text
    <p>I want the listBox to display the IDs stored at a file. The IDs are in hexadecimal value.</p> <p>I am stuck trying to load the file and converting the HEX to ASCII, so the listBox can load it. The file also contains some more information, like item name, item level, and such...</p> <p>Here is a sample of the file:</p> <pre><code>00000000h: 50 12 00 00 2F D9 01 00 01 00 00 00 00 00 00 00 ; P.../Ù.......... 00000010h: 46 65 61 74 68 65 72 20 45 61 72 72 69 6E 67 00 ; Feather Earring. 00000020h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000030h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000040h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000050h: 00 00 00 00 0A 00 00 00 07 00 02 00 00 00 00 00 ; ................ 00000060h: 00 00 00 00 00 00 00 00 00 00 00 00 B8 88 00 00 ; ............¸ˆ.. 00000070h: 00 0C 00 00 00 00 00 00 00 00 00 00 20 00 00 00 ; ............ ... 00000080h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000090h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000000a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000000b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000000c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000000d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000000e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000000f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000100h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000110h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000120h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000130h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000140h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000150h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000160h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000170h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000180h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000190h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000001a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000001b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000001c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000001d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000001e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000001f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000200h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000210h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000220h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000230h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000240h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000250h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000260h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000270h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000280h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000290h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000002a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000002b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000002c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000002d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000002e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000002f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000300h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000310h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000320h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000330h: 02 00 00 00 00 00 00 00 4A 61 64 65 20 45 61 72 ; ........Jade Ear 00000340h: 72 69 6E 67 00 00 00 00 00 00 00 00 00 00 00 00 ; ring............ 00000350h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000360h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000370h: 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 ; ................ 00000380h: 07 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000390h: 00 00 00 00 20 A1 07 00 00 0C 00 00 00 00 00 00 ; .... ¡.......... 000003a0h: 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 ; .... ........... 000003b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000003c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000003d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000003e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000003f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000400h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000410h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000420h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000430h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000440h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000450h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000460h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000470h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000480h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000490h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000004a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000004b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000004c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000004d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000004e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000004f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000500h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000510h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000520h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000530h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000540h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000550h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000560h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000570h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000580h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000590h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000005a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000005b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000005c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000005d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000005e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000005f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000600h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000610h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000620h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000630h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000640h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000650h: 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 ; ................ </code></pre> <p>Ignore the "50 12 00 00 2F D9 01 00" at the beggining, that is file version and other irrelevant data, what i want to parse into the listBox is the item ID "01" that is right after the version of the file. </p> <p>The next item ID is at "00000330h" and the value is "02". Towards the end of the files you can see that there is ID "03"...</p> <p><strong>EDIT:</strong></p> <p>OK, now I am loading the file and reading the Item's section inside of it, but I have no clue how to load the IDs into the listBox... The IDs are separated from each other by 807 bytes, so every 807 bytes there is an ID.</p> <p>Here is how I am loading the file's section</p> <pre><code> int itemSectionStart = 0x00000000; int itemSectionEnd = 0x002e11e0; FileStream fstream = new FileStream("C:\\Users\\xxx\\Desktop\\xxx\\xxx\\xxx.dec", FileMode.Open); BinaryReader breader = new BinaryReader(fstream); long length = fstream.Length; breader.BaseStream.Position = itemSectionStart; byte[] itemSection = breader.ReadBytes(itemSectionEnd); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload