tjamesw123 / flipper-to-proxmark3-and-back

MIT License
37 stars 3 forks source link

Incorrect nfc file size, swapped keys #4

Closed jirjirjir closed 8 months ago

jirjirjir commented 8 months ago

While converting json (MF1K) to nfc got: 1) only 20 (0-19) sectors are in output file; 2) A and B keys are swapped.

Sample is attached (nfc is renamed to txt to comply with github upload naming rule): hf-mf-894F163F-dump.json hf-mf-894F163F-dump.txt

tjamesw123 commented 8 months ago

Ok I have seen this, might not be able to get to it for like a day or so but I will get to it.

tjamesw123 commented 8 months ago

Also thanks for the example files will make this a lot easier

tjamesw123 commented 8 months ago

Both bugs have been solved in the latest release. https://github.com/tjamesw123/flipper-to-proxmark3-and-back/releases/tag/v1.1.0

jirjirjir commented 8 months ago

Hi!

Looks like something was broken during the fix, got following output while trying to convert another .json (hf-mf-6E7A8E41-dump.json):

c:\proxmark3\client>java -jar flippertoproxmark3andback-v1.1.0.jar convert "hf-mf-6E7A8E41-dump.json" export default nfc convert hf-mf-6E7A8E41-dump.json export default nfc Convert! proxmark3-894F163F.nfc! Invalid input file path

As you can see there is artefact from my previous file (but .nfc extention): proxmark3-894F163F.nfc

tjamesw123 commented 8 months ago

Fixed it and tested to be sure. it should be working now. https://github.com/tjamesw123/flipper-to-proxmark3-and-back/releases/tag/v1.1.1

jirjirjir commented 8 months ago

Hi!

It's me again!)

Trying to convert resulted .nfc back to .json, got awry result (attached).

hf-mf-894F163F-dump.nfc.txt hf-mf-894F163F-dump.json hf-mf-894F163F-dump.json.orig.txt

Also could I ask you to insert CR/LFs at the end of every string in the generated .json for redability?

Thanx!

tjamesw123 commented 8 months ago

I fixed the formatting and now the output should be one to one with the original. https://github.com/tjamesw123/flipper-to-proxmark3-and-back/releases/tag/v1.1.2

jirjirjir commented 8 months ago

Hi!

Could you please (not)confirm the correct behavior of the utility in the following case.

Trying to convert back previously converted .nfc:

java -jar flippertoproxmark3andback-v1.1.2.jar convert "hf-mf-894F163F-dump.nfc" export "hf-mf-894F163F-dump.json"

Got (probably wrong?) header in .json: { "Created": "FlipperZero",

Maybe it should be like in the original .json? { "Created": "proxmark3",

hf-mf-894F163F-dump.json

Thanx!

tjamesw123 commented 8 months ago

Intended behavior, that line is irrelevant to reading the json properly it's just for marking point of origin so when an nfc file is read it marks it as FlipperZero. There is no way to determine actual point of origin beyond one file transfer so it's just marked as the point of origin of the file you started the transfer with, in this case the nfc file.

jirjirjir commented 8 months ago

Hi!

Is it possible to correct headers of the produced .nfc files to comply with latest format of Flipper's apps (should I create other issue)?

Here is the comparation of example files (one is produced by Flipper, second - by converter) by FC command line utility^

C:\downloads>fc Deda_Tolya.nfc hf-mf-894F163F-dump.nfc
Сравнение файлов Deda_Tolya.nfc и HF-MF-894F163F-DUMP.NFC
***** Deda_Tolya.nfc
Filetype: Flipper NFC device
Version: 4

Device type can be ISO14443-3A, ISO14443-3B, ISO14443-4A, ISO14443-4B, ISO15693-3, FeliCa, NTAG/Ultralight, Mifare Classic, Mifare DESFire, SLIX, ST25TB, EMV

Device type: Mifare Classic
***** HF-MF-894F163F-DUMP.NFC
Filetype: Flipper NFC device
Version: 3

Nfc device type can be UID, Mifare Ultralight, Mifare Classic, FeliCa or ISO15693

Device type: Mifare Classic
Deda_Tolya.nfc
UID: 89 4F 16 3F

ISO14443-3A specific data

ATQA: 00 04
***** HF-MF-894F163F-DUMP.NFC
UID: 89 4F 16 3F

ISO14443 specific fields

ATQA: 00 04


Thanx!

tjamesw123 commented 8 months ago

Yeah I made a new issue for this. but yes it is possible and isn't that hard to be honest. I just am not constantly monitoring flipper zero's formatting changes really so things slip by. same with proxmark3.

tjamesw123 commented 8 months ago

Also the issue has been solved with the latest release