+ if(simulationMode == MODE_FULLSIM)
+ { //This is what we must do..
+ //Reader just sent us NR and MAC(k,cc * nr)
+ //The diversified key should be stored on block 3
+ //However, from a typical dump, the key will not be there
+ uint8_t *diversified_key = { 0 };
+ //Get the diversified key from emulator memory
+ memcpy(diversified_key, emulator+(8*3),8);
+ uint8_t ccnr[12] = { 0 };
+ //Put our cc there (block 2)
+ memcpy(ccnr, emulator + (8 * 2), 8);
+ //Put nr there
+ memcpy(ccnr+8, receivedCmd+1,4);
+ //Now, calc MAC
+ doMAC(ccnr,diversified_key, trace_data);
+ trace_data_size = 4;
+ CodeIClassTagAnswer(trace_data , trace_data_size);
+ memcpy(data_response, ToSend, ToSendMax);
+ modulated_response = data_response;
+ modulated_response_size = ToSendMax;
+ }else
+ { //Not fullsim, we don't respond