thebestpatrick / nda-extractor

Extracts data from Neware binary files (.nda)
BSD 2-Clause "Simplified" License
9 stars 2 forks source link

Bin2csv.py issue (how to use properly this scritpt) #2

Open Fousseno opened 6 years ago

Fousseno commented 6 years ago

Hi

I tried to use the bin2csv.py but I keep getting this error :

print(process_nda(sys.argv[0], sys.argv[2])) IndexError: list index out of range

Please can you help me to solve it

thebestpatrick commented 6 years ago

I believe the issue is you need to tell the script both where the nda file is, and where you want it to output the finished csv to. So the syntax should be something like python3 bin2csv.py input.nda output.csv

Fousseno commented 6 years ago

Hi

Thank you very much (sorry I am a beginner in python) I got a second issue my nda file is not recognise as a NEWARE file : raise RuntimeError("Magic number wrong. Not valid .nda file") Do you have any idea how can I fix that

2018-06-01 17:42 GMT+01:00 thebestpatrick notifications@github.com:

I believe the issue is you need to tell the script both where the nda file is, and where you want it to output the finished csv to. So the syntax should be something like python3 bin2csv.py input.nda output.csv

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thebestpatrick/nda-extractor/issues/2#issuecomment-393939165, or mute the thread https://github.com/notifications/unsubscribe-auth/Al_BLhYvx54wLrjDk_JkyVm5tZZvdJ5zks5t4W72gaJpZM4UWp4m .

thebestpatrick commented 6 years ago

When I was working with the script regularly, only nda files which started with the characters NEWARE right at the beginning were appropriate for being processed, and if they lacked that tag it could produce a nonsense csv file or crash the script elsewhere.

If you would like to attempt running the script on your nda file anyway, just comment out lines 126 and 127 in the bin2csv.py script. All that will happen if the file doesn't work with the script is the script will error out or just make a wrong csv, it won't break your nda file or anything.

Fousseno commented 6 years ago

Thank you again One last point and I think I will make your script for me I got this error: UnboundLocalError: local variable 'csv_line' referenced before assignment

2018-06-03 19:02 GMT+01:00 thebestpatrick notifications@github.com:

When I was working with the script regularly, only nda files which started with the characters NEWARE right at the beginning were appropriate for being processed, and if they lacked that tag it could produce a nonsense csv file or crash the script elsewhere.

If you would like to attempt running the script on your nda file anyway, just comment out lines 126 and 127 in the bin2csv.py script. All that will happen if the file doesn't work with the script is the script will error out or just make a wrong csv, it won't break your nda file or anything.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thebestpatrick/nda-extractor/issues/2#issuecomment-394179876, or mute the thread https://github.com/notifications/unsubscribe-auth/Al_BLkRgR0mwArrQAvluUbCIiyM4kUD7ks5t5CTTgaJpZM4UWp4m .

thebestpatrick commented 6 years ago

Did it produce a csv file despite that? The only case I can see in the code where csv_line gets referenced before it could be assigned is if it could find no valid data within the nda file.

Fousseno commented 6 years ago

yes a csv file was produce but it's empty (no data) I think your assumption is right I will try with others nda file to see the result

2018-06-03 19:26 GMT+01:00 thebestpatrick notifications@github.com:

Did it produce a csv file despite that? The only case I can see in the code where csv_line gets referenced before it could be assigned is if it could find no valid data within the nda file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thebestpatrick/nda-extractor/issues/2#issuecomment-394181368, or mute the thread https://github.com/notifications/unsubscribe-auth/Al_BLoVzmTAK7l7IGMG8KmrTdKUCUg8Gks5t5CpqgaJpZM4UWp4m .

thebestpatrick commented 6 years ago

Let me know if things work out, unfortunately my ability to actually troubleshoot is going to be extremely limited because I no longer have access to nda data files for testing, but I will help if I can. This was a script used at a previous job.

Fousseno commented 6 years ago

I tried with others files same issue Find attached a neware nda file if you got some time to take a look

2018-06-03 19:43 GMT+01:00 thebestpatrick notifications@github.com:

Let me know if things work out, unfortunately my ability to actually troubleshoot is going to be extremely limited because I no longer have access to nda data files for testing, but I will help if I can. This was a script used at a previous job.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thebestpatrick/nda-extractor/issues/2#issuecomment-394182465, or mute the thread https://github.com/notifications/unsubscribe-auth/Al_BLtHMYL9T7yVntAgcAUIRTyF1l846ks5t5C5pgaJpZM4UWp4m .

thebestpatrick commented 6 years ago

I don't see a file attached there, you could try uploading it to your github account and linking me to it. I'll take a look.

Fousseno commented 6 years ago

New Compressed (zipped) Folder.zip

let me know if you can see it now

thebestpatrick commented 6 years ago

Yes