Proxmark developers 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.

#1 2014-08-08 03:05:37

gonzo
Member
Registered: 2014-08-08
Posts: 2

Attempt to fix simulation code, problems with IV/prng

Hi community!

in the last days i was trying to understand the legic prime system in depth to improve the simulator code. reading and writing cards (mim256/1024) works flawlessly (using a nice self-made antenna for my C35=100pF proxmark).
Up to now i found some little flaws and irregularities concerning when using non-mim1024 cards, but now to my main issue.

The reader i am 'using' never sends an IV of 0x55.... really never smile i wrote some code to log the timing but everything seems to be fine (first transmitted bit of IV always 1; always 7bits long), except i never get 0x55... (not 10%, not 1.5%... 0% of the time) smile
So i looked at the code: frame_handle_tag(...) is some specific about using 0x55, trying to make it work with any IV failed... so i did a little test and saw where my major problem is.

In the well working reader code i altered the fixed SESSION_IV (0x55) in LegicRfReader(...) to something else and reading a card always now fails. How could that be? The prng-algorithm has to be correct, it is hardwired in the silicon.
LFSR_should be a=IV, LFSR_B=IV<<1|1.
Why isn't the code working for arbitrary IVs? Btw. the first IV used in perform_setup_phase_rwd(...)  to get the card type always works fine, but changing the IV in the 2nd perform_setup_phase_rwd(...) fails with crc-mismatches.

Maybe someone has any idea... i really want to get this simulation code finally fixed.

With best regards,
gonzo

Offline

#2 2014-08-18 01:27:48

gonzo
Member
Registered: 2014-08-08
Posts: 2

Re: Attempt to fix simulation code, problems with IV/prng

Gosh... finally i fixed the simulation code. The reader and writer code had bugs too and only accidentally worked with an IV of 0x55.
I should mention that i did not have a reader on my desk... i had to go 500m to my parking garage every time to test my code wink
I will post a patch in several days as soon i cleaned it up and removed all my debugging code.

Offline

#3 2014-08-18 16:14:52

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

Re: Attempt to fix simulation code, problems with IV/prng

Great!
Please do, and when you do, post it directly as an issue in github, not as text here..

Offline

#4 2014-10-20 12:58:17

andy999
Contributor
Registered: 2010-01-25
Posts: 9

Re: Attempt to fix simulation code, problems with IV/prng

Hello Gonzo,


what about your Simulator code? Is it working? Can you please post it?


Thanks
Andy

Offline

#5 2015-08-17 00:49:09

dutzen
Member
Registered: 2015-08-11
Posts: 3

Re: Attempt to fix simulation code, problems with IV/prng

Push. big_smile

I need a working simulate code, too.

For my master seminar at my university sad

Thanks
Dominik

Offline

Board footer

Powered by FluxBB