Proxmark3 community

Research, development and trades concerning the powerful Proxmark3 device.

Remember; sharing is caring. Bring something back to the community.


"Learn the tools of the trade the hard way." +Fravia

You are not logged in.

Announcement

Time changes and with it the technology
Proxmark3 @ discord

Users of this forum, please be aware that information stored on this site is not private.

#1 2014-05-20 14:15:18

hheile
Contributor
Registered: 2014-03-03
Posts: 35

restoring to card fails

hello,

just for my understanding:
i did
hf mf mifare
hf mf nested 1 0 a FFFFFFFFFFFF
hf mf dump

so i have a dumpkey.bin and a dumpdata.bin file.

nothing special until now.
now, i want to restore this dump to an chinese card with
hf mf restore

but it fails:
Writing to block 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff           
#db# Cmd Error: 04                 
#db# Write block error                 
#db# WRITE BLOCK FINISHED                 
isOk:00

BUT when i use
hf mf csetblk 1 0102030405000000090a0b0c0d0e8079
--block number:01 data:01 02 03 04 05 00 00 00 09 0a 0b 0c 0d 0e 80 79

it works like a charm, means row per row manually works.

it there any way to write the datadump completly to the chinese without manual intervention?

thanks for reading and answering

hheile

Offline

#2 2014-05-20 15:16:24

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: restoring to card fails

I though 'hf mf restore' was for genuine/original mifare cards e.g restoring a previous sector/balance.

For Chinese magic cards i thought the best way was to first store the original card in an emulated format *.eml file, then use:
hf mf cload 12345.eml
where 12345.eml is the emulated file with all your card data.

Offline

#3 2014-05-20 15:22:21

hheile
Contributor
Registered: 2014-03-03
Posts: 35

Re: restoring to card fails

midnitesnake, awesome.
here is a script to convert from bin to eml:
http://www.fuzzysecurity.com/scripts/12.html

thanks in advance

Offline

#4 2014-05-20 15:37:26

hheile
Contributor
Registered: 2014-03-03
Posts: 35

Re: restoring to card fails

by the way, there seems to be a problem using the dumptoemul script in proxmark

proxmark3> script run dumptoemul -i dumpdata.bin -o mensacard2.eml
--- Executing: ./scripts/dumptoemul.lua, args'-i dumpdata.bin -o test.eml'
./scripts/dumptoemul.lua:99: bad argument #1 to 'sub' (string expected, got nil)

-----Finished

Offline

#5 2014-05-20 15:42:16

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: restoring to card fails

handy to know that they are already in the repo, but slightly renamed:
./client/pm3_mfd2eml.py
./client/pm3_eml2mfd.py

Last edited by midnitesnake (2014-05-20 16:09:44)

Offline

#6 2014-05-20 16:12:03

iceman
Administrator
Registered: 2013-04-25
Posts: 9,507
Website

Re: restoring to card fails

"ht mf restore"  uses the dumpdata.bin file to restore the card with (and the keyfile for keys),   the command can be used to restore a normal card but  not a magic card gen1..

and in your error messages,  it say block 50,   but your "csetblk" uses block 1...

Offline

#7 2014-05-20 18:27:28

holiman
Contributor
Registered: 2013-05-03
Posts: 566

Re: restoring to card fails

hheile wrote:

by the way, there seems to be a problem using the dumptoemul script in proxmark

proxmark3> script run dumptoemul -i dumpdata.bin -o mensacard2.eml
--- Executing: ./scripts/dumptoemul.lua, args'-i dumpdata.bin -o test.eml'
./scripts/dumptoemul.lua:99: bad argument #1 to 'sub' (string expected, got nil)

-----Finished

That's a bad error message. Code:

	local dumpdata = readdump(infile)
	-- The hex-data is now in ascii-format,

	-- But first, check the uid
	local uid = string.sub(dumpdata,1,8) -- <<-- Here's the exception

You data wasn't read. strange.

Offline

Board footer

Powered by FluxBB