NetStumbler.org Forums

Go Back   NetStumbler.org Forums > NetStumbler Community > Scripts
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 03-01-2005   #1 (permalink)
Cakkie
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
Attached Files
File Type: zip ns1files.zip (8.6 KB, 41 views)
Cakkie is offline   Reply With Quote
Old 03-01-2005   #2 (permalink)
beakmyn
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
└──────────────────────────────┘
beakmyn is offline   Reply With Quote
Old 03-02-2005   #3 (permalink)
Cakkie
Registered Member
 
Join Date: Mar 2005
Posts: 12
Thanks, I'll give that a try when I get back home and I'll keep you posted
Cakkie is offline   Reply With Quote
Old 03-02-2005   #4 (permalink)
Cakkie
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
Cakkie is offline   Reply With Quote
Old 03-02-2005   #5 (permalink)
beakmyn
root\.workspace\.garbage.
 
Join Date: Aug 2003
Posts: 4,789
Post

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;
This is the standard format which PHP may be able to handle (don't know, don't use PHP) The filetime is stored in UTC time so you'll then also need to convert it to "local" time. I.E. Eastern Standard, Moutain, etc if you system clock is not set to GMT time. Otherwise there will be xx hours discrepency in the time.

<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.
beakmyn is offline   Reply With Quote
Old 03-03-2005   #6 (permalink)
Cakkie
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
...
Cakkie is offline   Reply With Quote
Old 03-03-2005   #7 (permalink)
beakmyn
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
└──────────────────────────────┘
beakmyn is offline   Reply With Quote
Old 03-03-2005   #8 (permalink)
icefreez
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?
icefreez is offline   Reply With Quote
Old 03-28-2005   #9 (permalink)
syst0lic
Registered Member
 
Join Date: Jan 2005
Posts: 18
Any updates on this project?
syst0lic is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Google
 
Web NetStumbler.org

All times are GMT -7. The time now is 03:10 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 ©2007, Crawlability, Inc.


All messages express the views of the author and are for entertainment purposes only. Netstumbler.org cannot be held responsible for the authenticity of the content or the actions of its members. By using this site and its services, you warrant that you will not post any messages that are discriminating, obscene, hateful, threatening, or otherwise violates any laws and you release Netstumbler.org from any future claims of any kind whatsoever including, but not limited to, addiction and loss of productivity. All forum messages, private messages and any other content are properties of Netstumbler.org. Even if publicly available, personal or copyrighted information are not to be posted without the consent of the owner. Distribution of licensed and copyrighted materials in any way not endorsed by the copyright owner is strictly prohibited. You may not use this site and its resources to spam other sites or individuals or perform any action that violates any law. Items sold or bought in the For Sale forum are sold as is and no warranty or insurance of any kind is provided. Netstumbler.org cannot be held responsible for the outcome of any transactions and no warranty of any kind is provided, either express or implied. Vulgar words are not allowed in the subject lines ; they may be used in the message body in any forum. The Administrator, Super Moderators and Moderators of Netstumbler.org have the right to remove, edit, move or close any thread for any reason and to reveal your identity and other known information in the event of a complaint or legal action arising from any message posted by you.