![]() |
|
|||||||
| Register | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Registered Member
Join Date: Mar 2005
Posts: 12
|
ns1 fileformat not correct?
Since there doesn't appear to be a 'decent' php-based ns1-parser, I'm currently my own. For some reason, some files seem to work fine (read all data from all AP's), but others don't.
The problem seems to lie in the "location source" value of APDATA entries. This is a 32bit int, and should normally only have the value 0 (no GPS data present) of 1 (GPS data present). If a file fails, the value of location source is 80 ff 14 7c, giving a decimal value of 2081750912. I've attached 2 ns1 files that show this behaviour. The funny thing is that both files open in netstumber without problems. test1.ns1 -> first APDATA element of 7th AP in file (no SSID), position in file = 16737 to 16740 test2.ns1 -> first APDATA element of 4th AP in file (SSID = dorp), position in file = 6926 to 6929 Does anyone know why they have this value, and how I should treat this? Greetings, Tom |
|
|
|
|
|
#2 (permalink) |
|
root\.workspace\.garbage.
Join Date: Aug 2003
Posts: 4,789
|
You're right however I don't think Marius intention was to have a binary value. It is related to the data contained in the GPSData structure, I think
I've requested information on this but he has yet to respond. If you treat the data as 0 being no GPS and any other number as GPS being present and you interpret that value as a signed 32bit integer you'll be fine. I ran into the same issue with the programs developed in my signature.
__________________
It's not Intelligent Design, it's peer pressure. ┌──────────────────────────────┐ ╞ NS Icons Explained|et hoc genus omne ╡ └──────────────────────────────┘ |
|
|
|
|
|
#4 (permalink) |
|
Registered Member
Join Date: Mar 2005
Posts: 12
|
Ok, that worked just fine.
I worked out my script so that it is now able to read a ns1 file, and put it into an object for easy access in a php script. Since I can assume other people would be interested in this, I'll soon make it public so everyone can use it. There's only one main problem I'm having, and that are the FILETIME fields. Those are 64bit values, and appearantly PHP doesn't quite convert them as well as I would have hoped (lack of 64bit int). If anyone knows a good way to convert such value to a more usable format, do speak up I currently split it up in 2 uint(32), giving me the low part and high part of the value.Tom |
|
|
|
|
|
#5 (permalink) |
|
root\.workspace\.garbage.
Join Date: Aug 2003
Posts: 4,789
|
You'll want to split it into two longs to be Microsoft compatible as the FILETIME structure is as follows:
Code:
VB
Private Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
C
typedef struct _FILETIME {
DWORD dwLowDateTime; /* low 32 bits */
DWORD dwHighDateTime; /* high 32 bits */
} FILETIME, *PFILETIME, *LPFILETIME;
<edit> How did you handle the channel bit field? Are you handling just version 12 of the Ns1 format or the 3 other public versions (not counting version 1)?
__________________
It's not Intelligent Design, it's peer pressure. ┌──────────────────────────────┐ ╞ NS Icons Explained|et hoc genus omne ╡ └──────────────────────────────┘ Last edited by beakmyn : 03-02-2005 at 05:40 PM. |
|
|
|
|
|
#6 (permalink) |
|
Registered Member
Join Date: Mar 2005
Posts: 12
|
Well, the problem with the FILETIME is that as far as I know, PHP does not have a easy way to handle it, like in VB or C. PHP uses the unix time epoch to handle date/times (number of seconds since 1/1/1970).
As for the channel bits, those should be looked at through binary goggles .Say you have a value of 2240, it means that channels 11, 7 and 6 were used: 2240 in binary: 00000000 00000000 00001000 11000000 giving: bit 0 = 0 -> chan 0? not used bit 1 = 0 -> chan 1 not used bit 2 = 0 -> chan 2 not used ... bit 6 = 1 -> chan 6 was used bit 7 = 1 -> chan 7 was used bit 8 = 0 -> chan 8 not used ... bit 11 = 1 -> chan 11 was used ... |
|
|
|
|
|
#7 (permalink) |
|
root\.workspace\.garbage.
Join Date: Aug 2003
Posts: 4,789
|
Just checking. A quick google did find some tools to do filetimes in PHP one was $9.95
__________________
It's not Intelligent Design, it's peer pressure. ┌──────────────────────────────┐ ╞ NS Icons Explained|et hoc genus omne ╡ └──────────────────────────────┘ |
|
|
|
|
|
#8 (permalink) |
|
Banned
Join Date: Dec 2004
Location: South Dakota
Posts: 32
|
You definantly have to post the source once your done
I am intested to see how this works. I am far from having enough coding experiance to code something like this so we will see how much of it i can actually understand :P BTW when your script is done parsing the ns1 file how will you store the information? An array, a database, a file? |
|
|
|