X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/df007486f5119620e09930b030c29b62e67bb0b4..9833360b251571f82749c352f49d712c9c8322ad:/armsrc/apps.h diff --git a/armsrc/apps.h b/armsrc/apps.h index b2e3083b..0cb375e6 100644 --- a/armsrc/apps.h +++ b/armsrc/apps.h @@ -11,26 +11,27 @@ #ifndef __APPS_H #define __APPS_H -#include -#include +#ifdef __cplusplus +extern "C" { +#endif + #include -//#include +#include #include "common.h" +#include "usb_cdc.h" #include "crc32.h" #include "lfdemod.h" #include "BigBuf.h" #include "fpgaloader.h" -#include "usb_cdc.h" #include "hitag2.h" #include "hitagS.h" #include "mifare.h" #include "pcf7931.h" -//#include "des.h" -//#include "aes.h" #include "desfire.h" #include "iso14443b.h" +//#include "iso14443a.h" +#include "emvcard.h" -extern const uint8_t OddByteParity[256]; extern int rsamples; // = 0; extern int tracing; // = TRUE; extern uint8_t trigger; @@ -46,6 +47,7 @@ void SamyRun(void); //void DbpIntegers(int a, int b, int c); void DbpString(char *str); void Dbprintf(const char *fmt, ...); +void DbprintfEx(uint32_t cmd, const char *fmt, ...); void Dbhexdump(int len, uint8_t *d, bool bAsci); // ADC Vref = 3300mV, and an (10M+1M):1M voltage divider on the HF input can measure voltages up to 36300 mV @@ -54,6 +56,7 @@ void Dbhexdump(int len, uint8_t *d, bool bAsci); #define MAX_ADC_LF_VOLTAGE 140800 int AvgAdc(int ch); +void print_result(char *name, uint8_t *buf, size_t len); void PrintToSendBuffer(void); void ToSendStuffBit(int b); void ToSendReset(void); @@ -94,9 +97,10 @@ void T55xxWriteBlock(uint32_t Data, uint8_t Block, uint32_t Pwd, uint8_t PwdMode void T55xxWriteBlockExt(uint32_t Data, uint8_t Block, uint32_t Pwd, uint8_t PwdMode); void T55xxReadBlock(uint16_t arg0, uint8_t Block, uint32_t Pwd); void T55xxWakeUp(uint32_t Pwd); -void TurnReadLFOn(); -void EM4xReadWord(uint8_t Address, uint32_t Pwd, uint8_t PwdMode); -void EM4xWriteWord(uint32_t Data, uint8_t Address, uint32_t Pwd, uint8_t PwdMode); +void TurnReadLFOn(uint32_t delay); +void EM4xReadWord(uint8_t addr, uint32_t pwd, uint8_t usepwd); +void EM4xWriteWord(uint32_t flag, uint32_t data, uint32_t pwd); +void Cotag(uint32_t arg0); /// iso14443b.h void SimulateIso14443bTag(uint32_t pupi); @@ -104,6 +108,9 @@ void AcquireRawAdcSamplesIso14443b(uint32_t parameter); void ReadSTMemoryIso14443b(uint8_t numofblocks); void RAMFUNC SnoopIso14443b(void); void SendRawCommand14443B(uint32_t, uint32_t, uint8_t, uint8_t[]); +void SendRawCommand14443B_Ex(UsbCommand *c); +void AppendCrc14443b(uint8_t* data, int len); +void ClearFpgaShiftingRegisters(void); // iso14443a.h void RAMFUNC SniffIso14443a(uint8_t param); @@ -113,6 +120,9 @@ void ReaderIso14443a(UsbCommand * c); //bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t len, uint32_t timestamp_start, uint32_t timestamp_end, uint8_t *parity, bool readerToTag); void GetParity(const uint8_t *pbtCmd, uint16_t len, uint8_t *parity); void iso14a_set_trigger(bool enable); +// also used in emv +bool prepare_allocated_tag_modulation(tag_response_info_t * response_info); +int GetIso14443aCommandFromReader(uint8_t *received, uint8_t *parity, int *len); // epa.h void EPA_PACE_Collect_Nonce(UsbCommand * c); @@ -162,7 +172,6 @@ size_t CreateAPDU( uint8_t *datain, size_t len, uint8_t *dataout); void OnSuccess(); void OnError(uint8_t reason); - // desfire_crypto.h void *mifare_cryto_preprocess_data (desfiretag_t tag, void *data, size_t *nbytes, size_t offset, int communication_settings); void *mifare_cryto_postprocess_data (desfiretag_t tag, void *data, size_t *nbytes, int communication_settings); @@ -175,7 +184,7 @@ size_t enciphered_data_length (const desfiretag_t tag, const size_t nbytes, int void cmac_generate_subkeys (desfirekey_t key); void cmac (const desfirekey_t key, uint8_t *ivect, const uint8_t *data, size_t len, uint8_t *cmac); -/// iso15693.h +// iso15693.h void RecordRawAdcSamplesIso15693(void); void AcquireRawAdcSamplesIso15693(void); void ReaderIso15693(uint32_t parameter); // Simulate an ISO15693 reader - greg @@ -184,7 +193,7 @@ void BruteforceIso15693Afi(uint32_t speed); // find an AFI of a tag - atrox void DirectTag15693Command(uint32_t datalen,uint32_t speed, uint32_t recv, uint8_t data[]); // send arbitrary commands from CLI - atrox void SetDebugIso15693(uint32_t flag); -/// iclass.h +// iclass.h void RAMFUNC SnoopIClass(void); void SimulateIClass(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain); void ReaderIClass(uint8_t arg0); @@ -216,10 +225,25 @@ bool cmd_send(uint32_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* d // util.h void HfSnoop(int , int); -//EMV functions emvcmd.h +//EMV functions +// emvcmd.h void EMVTransaction(void); void EMVgetUDOL(void); void EMVloadvalue(uint32_t tag, uint8_t* datain); void EMVdumpcard(void); +//void EMVSelect(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *data); +void EMVFuzz_RATS(uint8_t ratslen, uint8_t* RATS); +void EMVReadRecord(uint8_t arg0, uint8_t arg1,emvcard* inputcard); +void EMVSelectPPSE(); +void EMVSelectAID(uint8_t *AID, uint8_t AIDlen, emvcard* inputcard); +void EMVTransaction(); +void EMVClone(uint8_t maxsfi, uint8_t maxrecord); +void EMVSim(); +void EMVTest(); +void SimulateEMVcard(); + +#ifdef __cplusplus +} +#endif #endif