Thread: Bank Items?
View Single Post
  #8  
Old 07-27-2010, 09:47 PM
GeorgeS
Forum Guide
 
Join Date: Sep 2003
Location: California
Posts: 1,474
Default

That does not sound correct. You need to remember these are short integers as in 4 bytes per record (1 word = 4 bytes)
Little endian - as in reverse byte order, so the order is -

(example of a conversion 4 HEX bytes => 4 byte integer)

0A 0B 0C 0D
0D*16777216 + 0C*65536 + 0B*256 + 0A*1

So convert the 8 bit -Hex into 8 bit decimal - so that $FF = 255 etc..
and use the formula above.

here's my code for the above
Code:
Function getbytes_convert32bit(location As Integer, bytes As Integer)
Dim result32 As Long
Dim byte1 As Byte
Dim byte2 As Byte
Dim byte3 As Byte
Dim byte4 As Byte
'start position=location  ,  bytes=#bytes to read
Open "profile.bin" For Binary As #1
 
    Get #1, location + 1, byte1: Get #1, location + 2, byte2: Get #1, location + 3, byte3: Get #1, location + 4, byte4
    result32 = (byte4 * 16777216#) + (byte3 * 65536#) + (byte2 * 256#) + (byte1 * 1#)
    getbytes_convert32bit = result32
Close #1
End Function
..btw my program serverstats does profile editing of toons and other things..

GeorgeS
__________________
Your source for EQ database tools
Toolshop is open for business


http://www.georgestools.chrsschb.com//

Last edited by GeorgeS; 07-27-2010 at 09:54 PM..
Reply With Quote