Decipher Posted June 17, 2012 Posted June 17, 2012 (edited) Peers: (binary model), the peers value may be a string consisting of multiples of 6 bytes. First 4 bytes are the IP address and last 2 bytes are the port number. All in network (big endian) notation. The list of peers is length 50 by default. How can I convert the attached?http://en.wikipedia.org/wiki/Endianness#Big-endianI've tried BinaryToString with no luck. Thanks in advance.Peers.txt Edited June 17, 2012 by Decipher Spoiler
jchd Posted June 17, 2012 Posted June 17, 2012 Lookup DllStructCreate in help. Read carefully and come back if you don't succeed. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Decipher Posted June 17, 2012 Author Posted June 17, 2012 Would you please give me an example. I read the documentation for the DllStructCreate function but its confusing to me on how I can use it to change this: uïiƒ¡ã into 127.0.0.1:80 What type would I be using, etc. Spoiler
AndyG Posted June 18, 2012 Posted June 18, 2012 you could create a struct with "char"´s with the lenght of your "text" and fill the struct with the text create a struct with "bytes" at the same position then read these "bytes" one by one and you get the conversion....
Decipher Posted June 18, 2012 Author Posted June 18, 2012 (edited) What type would I specify because I don't think its integers? So I read the bytes one by one and the read information is ASCII? I'm still completely lost as to how this actually works. I've tried: $a = DllStructCreate(FileRead(@DesktopDir & "Peers.txt")) For $i = 1 To 10 MsgBox(0,"",DllStructGetData($a, $i)) Next Dosen't work. Is it possible that the character's ASCII code is what I'm after? I could code that but I wouldn't have a way to verify that it is correct. Edited June 18, 2012 by Decipher Spoiler
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now