Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
n-hutton committed Nov 21, 2024
1 parent 37dd940 commit 27841a5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
6 changes: 1 addition & 5 deletions armsrc/appmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,8 +1629,7 @@ static void PacketReceived(PacketCommandNG *packet) {
ReaderIso14443a(packet);
break;
}
case 0x0386: {
//case CMD_HF_ISO14443A_EMV_SIMULATE: {
case CMD_HF_ISO14443A_EMV_SIMULATE: {
struct p {
uint16_t flags;
uint8_t exitAfter;
Expand All @@ -1640,9 +1639,6 @@ static void PacketReceived(PacketCommandNG *packet) {
} PACKED;
struct p *payload = (struct p *) packet->data.asBytes;

Dbprintf("We have got hereeee");
Dbprintf("Flags: %04x, ExitAfter: %02x, UID: %02x %02x %02x %02x %02x %02x %02x, ATQA: %04x, SAK: %02x",
payload->flags, payload->exitAfter, payload->uid[0], payload->uid[1], payload->uid[2], payload->uid[3], payload->uid[4], payload->uid[5], payload->uid[6], payload->atqa, payload->sak);
EMVsim(payload->flags, payload->exitAfter, payload->uid, payload->atqa, payload->sak);
break;
}
Expand Down
33 changes: 15 additions & 18 deletions armsrc/emvsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
// /!\ Printing Debug message is disrupting emulation,
// Only use with caution during debugging

//#define FLAG_INTERACTIVE 0x01
// These are the old flags which have changed in master since this fork was created.
// Just a temp fix and not intended to go into master
#define FLAG_4B_UID_IN_DATA_OLD 0x02
#define FLAG_7B_UID_IN_DATA_OLD 0x04
#define FLAG_10B_UID_IN_DATA_OLD 0x08
Expand All @@ -39,29 +40,25 @@
#define FLAG_FORCED_ATQA 0x800
#define FLAG_FORCED_SAK 0x1000
#define FLAG_CVE21_0430_OLD 0x2000
//#define FLAG_RATS_IN_DATA_OLD 0x4000
//#define FLAG_NESTED_AUTH_ATTACK 0x8000

#include "emvsim.h"

#include <inttypes.h>

#include "BigBuf.h"
#include "iso14443a.h"
#include "BigBuf.h"
#include "string.h"
#include "mifareutil.h"
//#include "iso14443a.h"
//#include "BigBuf.h"
//#include "string.h"
//#include "mifareutil.h"
#include "fpgaloader.h"
#include "proxmark3_arm.h"
#include "cmd.h"
#include "protocols.h"
#include "appmain.h"
#include "util.h"
#include "commonutil.h"
#include "crc16.h"
//#include "proxmark3_arm.h"
//#include "cmd.h"
//#include "protocols.h"
//#include "appmain.h"
//#include "util.h"
//#include "commonutil.h"
//#include "crc16.h"
#include "dbprint.h"
#include "ticks.h"
#include "i2c.h"
//#include "ticks.h"
//#include "i2c.h"
#include "i2c_direct.h"

#pragma GCC diagnostic ignored "-Wunused-variable"
Expand Down
1 change: 1 addition & 0 deletions include/pm3_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ typedef struct {
#define CMD_HF_ISO14443A_SIM_AID 0x1420

#define CMD_HF_ISO14443A_READER 0x0385
#define CMD_HF_ISO14443A_EMV_SIMULATE 0x0386

#define CMD_HF_LEGIC_SIMULATE 0x0387
#define CMD_HF_LEGIC_READER 0x0388
Expand Down

0 comments on commit 27841a5

Please sign in to comment.