mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-22 06:13:27 -07:00
Do not use "extern" in header files
This commit is contained in:
parent
feb1bf4184
commit
741566957d
47 changed files with 448 additions and 448 deletions
|
@ -23,22 +23,22 @@
|
|||
#define CARD_MEMORY_SIZE 4096
|
||||
#define DMA_BUFFER_SIZE 128
|
||||
|
||||
extern uint8_t *BigBuf_get_addr(void);
|
||||
extern uint8_t *BigBuf_get_EM_addr(void);
|
||||
extern uint16_t BigBuf_max_traceLen(void);
|
||||
extern void BigBuf_Clear(void);
|
||||
extern void BigBuf_Clear_ext(bool verbose);
|
||||
extern void BigBuf_Clear_keep_EM(void);
|
||||
extern void BigBuf_Clear_EM(void);
|
||||
extern uint8_t *BigBuf_malloc(uint16_t);
|
||||
extern void BigBuf_free(void);
|
||||
extern void BigBuf_free_keep_EM(void);
|
||||
extern void BigBuf_print_status(void);
|
||||
extern uint16_t BigBuf_get_traceLen(void);
|
||||
extern void clear_trace(void);
|
||||
extern void set_tracing(bool enable);
|
||||
extern bool get_tracing(void);
|
||||
extern bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, uint8_t *parity, bool readerToTag);
|
||||
extern int LogTraceHitag(const uint8_t * btBytes, int iBits, int iSamples, uint32_t dwParity, int bReader);
|
||||
extern uint8_t emlSet(uint8_t *data, uint32_t offset, uint32_t length);
|
||||
uint8_t *BigBuf_get_addr(void);
|
||||
uint8_t *BigBuf_get_EM_addr(void);
|
||||
uint16_t BigBuf_max_traceLen(void);
|
||||
void BigBuf_Clear(void);
|
||||
void BigBuf_Clear_ext(bool verbose);
|
||||
void BigBuf_Clear_keep_EM(void);
|
||||
void BigBuf_Clear_EM(void);
|
||||
uint8_t *BigBuf_malloc(uint16_t);
|
||||
void BigBuf_free(void);
|
||||
void BigBuf_free_keep_EM(void);
|
||||
void BigBuf_print_status(void);
|
||||
uint16_t BigBuf_get_traceLen(void);
|
||||
void clear_trace(void);
|
||||
void set_tracing(bool enable);
|
||||
bool get_tracing(void);
|
||||
bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, uint8_t *parity, bool readerToTag);
|
||||
int LogTraceHitag(const uint8_t * btBytes, int iBits, int iSamples, uint32_t dwParity, int bReader);
|
||||
uint8_t emlSet(uint8_t *data, uint32_t offset, uint32_t length);
|
||||
#endif /* __BIGBUF_H */
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#ifndef __FONTS_H
|
||||
#define __FONTS_H
|
||||
|
||||
extern const char FONT6x8[97][8];
|
||||
extern const char FONT8x8F[97][8];
|
||||
extern const char FONT8x16[97][16];
|
||||
const char FONT6x8[97][8];
|
||||
const char FONT8x8F[97][8];
|
||||
const char FONT8x16[97][16];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,30 +27,30 @@ typedef struct {
|
|||
uint8_t par; // enough for precalculated parity of 8 Byte responses
|
||||
} tag_response_info_t;
|
||||
|
||||
extern void GetParity(const uint8_t *pbtCmd, uint16_t len, uint8_t *par);
|
||||
extern void AppendCrc14443a(uint8_t *data, int len);
|
||||
void GetParity(const uint8_t *pbtCmd, uint16_t len, uint8_t *par);
|
||||
void AppendCrc14443a(uint8_t *data, int len);
|
||||
|
||||
extern void RAMFUNC SnoopIso14443a(uint8_t param);
|
||||
extern void SimulateIso14443aTag(int tagType, int uid_1st, int uid_2nd, byte_t *data);
|
||||
extern void ReaderIso14443a(UsbCommand *c);
|
||||
extern void ReaderTransmit(uint8_t *frame, uint16_t len, uint32_t *timing);
|
||||
extern void ReaderTransmitBitsPar(uint8_t *frame, uint16_t bits, uint8_t *par, uint32_t *timing);
|
||||
extern void ReaderTransmitPar(uint8_t *frame, uint16_t len, uint8_t *par, uint32_t *timing);
|
||||
extern int ReaderReceive(uint8_t *receivedAnswer, uint8_t *par);
|
||||
extern void ReaderMifare(bool first_try);
|
||||
void RAMFUNC SnoopIso14443a(uint8_t param);
|
||||
void SimulateIso14443aTag(int tagType, int uid_1st, int uid_2nd, byte_t *data);
|
||||
void ReaderIso14443a(UsbCommand *c);
|
||||
void ReaderTransmit(uint8_t *frame, uint16_t len, uint32_t *timing);
|
||||
void ReaderTransmitBitsPar(uint8_t *frame, uint16_t bits, uint8_t *par, uint32_t *timing);
|
||||
void ReaderTransmitPar(uint8_t *frame, uint16_t len, uint8_t *par, uint32_t *timing);
|
||||
int ReaderReceive(uint8_t *receivedAnswer, uint8_t *par);
|
||||
void ReaderMifare(bool first_try);
|
||||
|
||||
extern int EmGetCmd(uint8_t *received, uint16_t *len, uint8_t *parity);
|
||||
extern int EmSendCmd(uint8_t *resp, uint16_t respLen);
|
||||
extern int EmSendCmdEx(uint8_t *resp, uint16_t respLen);
|
||||
extern int EmSend4bit(uint8_t resp);
|
||||
extern int EmSendCmdPar(uint8_t *resp, uint16_t respLen, uint8_t *par);
|
||||
extern int EmSendPrecompiledCmd(tag_response_info_t *response_info);
|
||||
int EmGetCmd(uint8_t *received, uint16_t *len, uint8_t *parity);
|
||||
int EmSendCmd(uint8_t *resp, uint16_t respLen);
|
||||
int EmSendCmdEx(uint8_t *resp, uint16_t respLen);
|
||||
int EmSend4bit(uint8_t resp);
|
||||
int EmSendCmdPar(uint8_t *resp, uint16_t respLen, uint8_t *par);
|
||||
int EmSendPrecompiledCmd(tag_response_info_t *response_info);
|
||||
|
||||
extern bool prepare_allocated_tag_modulation(tag_response_info_t *response_info, uint8_t **buffer, size_t *buffer_size);
|
||||
bool prepare_allocated_tag_modulation(tag_response_info_t *response_info, uint8_t **buffer, size_t *buffer_size);
|
||||
|
||||
extern void iso14443a_setup(uint8_t fpga_minor_mode);
|
||||
extern int iso14_apdu(uint8_t *cmd, uint16_t cmd_len, void *data);
|
||||
extern int iso14443a_select_card(uint8_t *uid_ptr, iso14a_card_select_t *resp_data, uint32_t *cuid_ptr, bool anticollision, uint8_t num_cascades, bool no_rats);
|
||||
extern void iso14a_set_trigger(bool enable);
|
||||
extern void iso14a_set_timeout(uint32_t timeout);
|
||||
void iso14443a_setup(uint8_t fpga_minor_mode);
|
||||
int iso14_apdu(uint8_t *cmd, uint16_t cmd_len, void *data);
|
||||
int iso14443a_select_card(uint8_t *uid_ptr, iso14a_card_select_t *resp_data, uint32_t *cuid_ptr, bool anticollision, uint8_t num_cascades, bool no_rats);
|
||||
void iso14a_set_trigger(bool enable);
|
||||
void iso14a_set_timeout(uint32_t timeout);
|
||||
#endif /* __ISO14443A_H */
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
#ifndef __LEGICRF_H
|
||||
#define __LEGICRF_H
|
||||
|
||||
extern void LegicRfSimulate(int phase, int frame, int reqresp);
|
||||
extern int LegicRfReader(int bytes, int offset);
|
||||
extern void LegicRfWriter(int bytes, int offset);
|
||||
void LegicRfSimulate(int phase, int frame, int reqresp);
|
||||
int LegicRfReader(int bytes, int offset);
|
||||
void LegicRfWriter(int bytes, int offset);
|
||||
|
||||
#endif /* __LEGICRF_H */
|
||||
|
|
|
@ -15,6 +15,6 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
extern void Mifare1ksim(uint8_t flags, uint8_t exitAfterNReads, uint8_t arg2, uint8_t *datain);
|
||||
void Mifare1ksim(uint8_t flags, uint8_t exitAfterNReads, uint8_t arg2, uint8_t *datain);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#define MF_DBG_ALL 2
|
||||
#define MF_DBG_EXTENDED 4
|
||||
|
||||
extern int MF_DBGLEVEL;
|
||||
int MF_DBGLEVEL;
|
||||
|
||||
//functions
|
||||
int mifare_sendcmd(uint8_t cmd, uint8_t *data, uint8_t data_size, uint8_t* answer, uint8_t *answer_parity, uint32_t *timing);
|
||||
|
|
|
@ -61,13 +61,13 @@ void StartCountSspClk();
|
|||
void ResetSspClk(void);
|
||||
uint32_t RAMFUNC GetCountSspClk();
|
||||
|
||||
extern void StartTicks(void);
|
||||
extern void WaitTicks(uint32_t ticks);
|
||||
extern void WaitUS(uint16_t us);
|
||||
extern void WaitMS(uint16_t ms);
|
||||
extern void ResetTicks();
|
||||
extern void ResetTimer(AT91PS_TC timer);
|
||||
extern void StopTicks(void);
|
||||
void StartTicks(void);
|
||||
void WaitTicks(uint32_t ticks);
|
||||
void WaitUS(uint16_t us);
|
||||
void WaitMS(uint16_t ms);
|
||||
void ResetTicks();
|
||||
void ResetTimer(AT91PS_TC timer);
|
||||
void StopTicks(void);
|
||||
// end iceman's ticks.h
|
||||
|
||||
uint32_t prand();
|
||||
|
|
|
@ -66,7 +66,7 @@ int NRZrawDemod(const char *Cmd, bool verbose);
|
|||
int getSamples(int n, bool silent);
|
||||
void setClockGrid(int clk, int offset);
|
||||
int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down);
|
||||
extern int AskEdgeDetect(const int *in, int *out, int len, int threshold);
|
||||
int AskEdgeDetect(const int *in, int *out, int len, int threshold);
|
||||
//int autoCorr(const int* in, int *out, size_t len, int window);
|
||||
|
||||
#define MAX_DEMOD_BUF_LEN (1024*128)
|
||||
|
|
|
@ -25,12 +25,12 @@ int CmdHF14A(const char *Cmd);
|
|||
int CmdHF14AList(const char *Cmd);
|
||||
int CmdHF14AMifare(const char *Cmd);
|
||||
int CmdHF14AReader(const char *Cmd);
|
||||
extern int CmdHF14AInfo(const char *Cmd);
|
||||
int CmdHF14AInfo(const char *Cmd);
|
||||
int CmdHF14ASim(const char *Cmd);
|
||||
int CmdHF14ASnoop(const char *Cmd);
|
||||
char* getTagInfo(uint8_t uid);
|
||||
|
||||
extern void DropField();
|
||||
extern int ExchangeAPDU14a(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen);
|
||||
void DropField();
|
||||
int ExchangeAPDU14a(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,35 +13,35 @@
|
|||
|
||||
#include "mifaredefault.h"
|
||||
|
||||
extern int CmdHFMF(const char *Cmd);
|
||||
int CmdHFMF(const char *Cmd);
|
||||
|
||||
extern int CmdHF14AMfDbg(const char* cmd);
|
||||
extern int CmdHF14AMfRdBl(const char* cmd);
|
||||
extern int CmdHF14AMfURdBl(const char* cmd);
|
||||
extern int CmdHF14AMfRdSc(const char* cmd);
|
||||
extern int CmdHF14SMfURdCard(const char* cmd);
|
||||
extern int CmdHF14AMfDump(const char* cmd);
|
||||
extern int CmdHF14AMfRestore(const char* cmd);
|
||||
extern int CmdHF14AMfWrBl(const char* cmd);
|
||||
extern int CmdHF14AMfUWrBl(const char* cmd);
|
||||
extern int CmdHF14AMfChk(const char* cmd);
|
||||
extern int CmdHF14AMifare(const char* cmd);
|
||||
extern int CmdHF14AMfNested(const char* cmd);
|
||||
extern int CmdHF14AMfSniff(const char* cmd);
|
||||
extern int CmdHF14AMf1kSim(const char* cmd);
|
||||
extern int CmdHF14AMfEClear(const char* cmd);
|
||||
extern int CmdHF14AMfEGet(const char* cmd);
|
||||
extern int CmdHF14AMfESet(const char* cmd);
|
||||
extern int CmdHF14AMfELoad(const char* cmd);
|
||||
extern int CmdHF14AMfESave(const char* cmd);
|
||||
extern int CmdHF14AMfECFill(const char* cmd);
|
||||
extern int CmdHF14AMfEKeyPrn(const char* cmd);
|
||||
extern int CmdHF14AMfCWipe(const char* cmd);
|
||||
extern int CmdHF14AMfCSetUID(const char* cmd);
|
||||
extern int CmdHF14AMfCSetBlk(const char* cmd);
|
||||
extern int CmdHF14AMfCGetBlk(const char* cmd);
|
||||
extern int CmdHF14AMfCGetSc(const char* cmd);
|
||||
extern int CmdHF14AMfCLoad(const char* cmd);
|
||||
extern int CmdHF14AMfCSave(const char* cmd);
|
||||
int CmdHF14AMfDbg(const char* cmd);
|
||||
int CmdHF14AMfRdBl(const char* cmd);
|
||||
int CmdHF14AMfURdBl(const char* cmd);
|
||||
int CmdHF14AMfRdSc(const char* cmd);
|
||||
int CmdHF14SMfURdCard(const char* cmd);
|
||||
int CmdHF14AMfDump(const char* cmd);
|
||||
int CmdHF14AMfRestore(const char* cmd);
|
||||
int CmdHF14AMfWrBl(const char* cmd);
|
||||
int CmdHF14AMfUWrBl(const char* cmd);
|
||||
int CmdHF14AMfChk(const char* cmd);
|
||||
int CmdHF14AMifare(const char* cmd);
|
||||
int CmdHF14AMfNested(const char* cmd);
|
||||
int CmdHF14AMfSniff(const char* cmd);
|
||||
int CmdHF14AMf1kSim(const char* cmd);
|
||||
int CmdHF14AMfEClear(const char* cmd);
|
||||
int CmdHF14AMfEGet(const char* cmd);
|
||||
int CmdHF14AMfESet(const char* cmd);
|
||||
int CmdHF14AMfELoad(const char* cmd);
|
||||
int CmdHF14AMfESave(const char* cmd);
|
||||
int CmdHF14AMfECFill(const char* cmd);
|
||||
int CmdHF14AMfEKeyPrn(const char* cmd);
|
||||
int CmdHF14AMfCWipe(const char* cmd);
|
||||
int CmdHF14AMfCSetUID(const char* cmd);
|
||||
int CmdHF14AMfCSetBlk(const char* cmd);
|
||||
int CmdHF14AMfCGetBlk(const char* cmd);
|
||||
int CmdHF14AMfCGetSc(const char* cmd);
|
||||
int CmdHF14AMfCLoad(const char* cmd);
|
||||
int CmdHF14AMfCSave(const char* cmd);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,21 +14,21 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern int CmdLF(const char *Cmd);
|
||||
int CmdLF(const char *Cmd);
|
||||
|
||||
extern int CmdLFCommandRead(const char *Cmd);
|
||||
extern int CmdFlexdemod(const char *Cmd);
|
||||
extern int CmdIndalaDemod(const char *Cmd);
|
||||
extern int CmdIndalaClone(const char *Cmd);
|
||||
extern int CmdLFRead(const char *Cmd);
|
||||
extern int CmdLFSim(const char *Cmd);
|
||||
extern int CmdLFaskSim(const char *Cmd);
|
||||
extern int CmdLFfskSim(const char *Cmd);
|
||||
extern int CmdLFpskSim(const char *Cmd);
|
||||
extern int CmdLFSimBidir(const char *Cmd);
|
||||
extern int CmdLFSnoop(const char *Cmd);
|
||||
extern int CmdVchDemod(const char *Cmd);
|
||||
extern int CmdLFfind(const char *Cmd);
|
||||
extern bool lf_read(bool silent, uint32_t samples);
|
||||
int CmdLFCommandRead(const char *Cmd);
|
||||
int CmdFlexdemod(const char *Cmd);
|
||||
int CmdIndalaDemod(const char *Cmd);
|
||||
int CmdIndalaClone(const char *Cmd);
|
||||
int CmdLFRead(const char *Cmd);
|
||||
int CmdLFSim(const char *Cmd);
|
||||
int CmdLFaskSim(const char *Cmd);
|
||||
int CmdLFfskSim(const char *Cmd);
|
||||
int CmdLFpskSim(const char *Cmd);
|
||||
int CmdLFSimBidir(const char *Cmd);
|
||||
int CmdLFSnoop(const char *Cmd);
|
||||
int CmdVchDemod(const char *Cmd);
|
||||
int CmdLFfind(const char *Cmd);
|
||||
bool lf_read(bool silent, uint32_t samples);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,26 +14,26 @@
|
|||
#include <stdbool.h> // for bool
|
||||
#include <inttypes.h>
|
||||
|
||||
extern int CmdLFEM4X(const char *Cmd);
|
||||
extern void printEM410x(uint32_t hi, uint64_t id);
|
||||
extern int CmdEMdemodASK(const char *Cmd);
|
||||
extern int CmdAskEM410xDemod(const char *Cmd);
|
||||
extern int AskEm410xDecode(bool verbose, uint32_t *hi, uint64_t *lo );
|
||||
extern int AskEm410xDemod(const char *Cmd, uint32_t *hi, uint64_t *lo, bool verbose);
|
||||
extern int CmdEM410xSim(const char *Cmd);
|
||||
extern int CmdEM410xBrute(const char *Cmd);
|
||||
extern int CmdEM410xWatch(const char *Cmd);
|
||||
extern int CmdEM410xWatchnSpoof(const char *Cmd);
|
||||
extern int CmdEM410xWrite(const char *Cmd);
|
||||
extern bool EM4x05Block0Test(uint32_t *wordData);
|
||||
extern int CmdEM4x05info(const char *Cmd);
|
||||
extern int EM4x05WriteWord(uint8_t addr, uint32_t data, uint32_t pwd, bool usePwd, bool swap, bool invert);
|
||||
extern int CmdEM4x05WriteWord(const char *Cmd);
|
||||
extern int CmdEM4x05dump(const char *Cmd);
|
||||
extern int CmdEM4x05ReadWord(const char *Cmd);
|
||||
extern int EM4x05ReadWord_ext(uint8_t addr, uint32_t pwd, bool usePwd, uint32_t *wordData);
|
||||
extern int EM4x50Read(const char *Cmd, bool verbose);
|
||||
extern int CmdEM4x50Read(const char *Cmd);
|
||||
int CmdLFEM4X(const char *Cmd);
|
||||
void printEM410x(uint32_t hi, uint64_t id);
|
||||
int CmdEMdemodASK(const char *Cmd);
|
||||
int CmdAskEM410xDemod(const char *Cmd);
|
||||
int AskEm410xDecode(bool verbose, uint32_t *hi, uint64_t *lo );
|
||||
int AskEm410xDemod(const char *Cmd, uint32_t *hi, uint64_t *lo, bool verbose);
|
||||
int CmdEM410xSim(const char *Cmd);
|
||||
int CmdEM410xBrute(const char *Cmd);
|
||||
int CmdEM410xWatch(const char *Cmd);
|
||||
int CmdEM410xWatchnSpoof(const char *Cmd);
|
||||
int CmdEM410xWrite(const char *Cmd);
|
||||
bool EM4x05Block0Test(uint32_t *wordData);
|
||||
int CmdEM4x05info(const char *Cmd);
|
||||
int EM4x05WriteWord(uint8_t addr, uint32_t data, uint32_t pwd, bool usePwd, bool swap, bool invert);
|
||||
int CmdEM4x05WriteWord(const char *Cmd);
|
||||
int CmdEM4x05dump(const char *Cmd);
|
||||
int CmdEM4x05ReadWord(const char *Cmd);
|
||||
int EM4x05ReadWord_ext(uint8_t addr, uint32_t pwd, bool usePwd, uint32_t *wordData);
|
||||
int EM4x50Read(const char *Cmd, bool verbose);
|
||||
int CmdEM4x50Read(const char *Cmd);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
#ifndef CMDLFFDX_H__
|
||||
#define CMDLFFDX_H__
|
||||
|
||||
extern int CmdLFFdx(const char *Cmd);
|
||||
extern int CmdFdxClone(const char *Cmd);
|
||||
extern int CmdFdxSim(const char *Cmd);
|
||||
extern int CmdFdxRead(const char *Cmd);
|
||||
extern int CmdFdxDemod(const char *Cmd);
|
||||
int CmdLFFdx(const char *Cmd);
|
||||
int CmdFdxClone(const char *Cmd);
|
||||
int CmdFdxSim(const char *Cmd);
|
||||
int CmdFdxRead(const char *Cmd);
|
||||
int CmdFdxDemod(const char *Cmd);
|
||||
#endif
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#ifndef CMDLFGPROXII_H__
|
||||
#define CMDLFGPROXII_H__
|
||||
extern int CmdLF_G_Prox_II(const char *Cmd);
|
||||
extern int CmdG_Prox_II_Demod(const char *Cmd);
|
||||
extern int CmdG_Prox_II_Read(const char *Cmd);
|
||||
int CmdLF_G_Prox_II(const char *Cmd);
|
||||
int CmdG_Prox_II_Demod(const char *Cmd);
|
||||
int CmdG_Prox_II_Read(const char *Cmd);
|
||||
#endif
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
#ifndef CMDLFINDALA_H__
|
||||
#define CMDLFINDALA_H__
|
||||
|
||||
extern int CmdLFINDALA(const char *Cmd);
|
||||
extern int CmdIndalaDecode(const char *Cmd);
|
||||
extern int CmdIndalaRead(const char *Cmd);
|
||||
extern int CmdIndalaClone(const char *Cmd);
|
||||
int CmdLFINDALA(const char *Cmd);
|
||||
int CmdIndalaDecode(const char *Cmd);
|
||||
int CmdIndalaRead(const char *Cmd);
|
||||
int CmdIndalaClone(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#ifndef CMDLFIO_H__
|
||||
#define CMDLFIO_H__
|
||||
|
||||
extern int CmdLFIO(const char *Cmd);
|
||||
extern int CmdFSKdemodIO(const char *Cmd);
|
||||
extern int CmdIOReadFSK(const char *Cmd);
|
||||
int CmdLFIO(const char *Cmd);
|
||||
int CmdFSKdemodIO(const char *Cmd);
|
||||
int CmdIOReadFSK(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#ifndef CMDLFJABLOTRON_H__
|
||||
#define CMDLFJABLOTRON_H__
|
||||
|
||||
extern int CmdLFJablotron(const char *Cmd);
|
||||
extern int CmdJablotronClone(const char *Cmd);
|
||||
extern int CmdJablotronSim(const char *Cmd);
|
||||
extern int CmdJablotronRead(const char *Cmd);
|
||||
extern int CmdJablotronDemod(const char *Cmd);
|
||||
int CmdLFJablotron(const char *Cmd);
|
||||
int CmdJablotronClone(const char *Cmd);
|
||||
int CmdJablotronSim(const char *Cmd);
|
||||
int CmdJablotronRead(const char *Cmd);
|
||||
int CmdJablotronDemod(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#ifndef CMDLFNEXWATCH_H__
|
||||
#define CMDLFNEXWATCH_H__
|
||||
extern int CmdLFNexWatch(const char *Cmd);
|
||||
extern int CmdPSKNexWatch(const char *Cmd);
|
||||
extern int CmdNexWatchRead(const char *Cmd);
|
||||
int CmdLFNexWatch(const char *Cmd);
|
||||
int CmdPSKNexWatch(const char *Cmd);
|
||||
int CmdNexWatchRead(const char *Cmd);
|
||||
#endif
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#ifndef CMDLFNORALSY_H__
|
||||
#define CMDLFNORALSY_H__
|
||||
|
||||
extern int CmdLFNoralsy(const char *Cmd);
|
||||
extern int CmdNoralsyClone(const char *Cmd);
|
||||
extern int CmdNoralsySim(const char *Cmd);
|
||||
extern int CmdNoralsyRead(const char *Cmd);
|
||||
extern int CmdNoralsyDemod(const char *Cmd);
|
||||
int CmdLFNoralsy(const char *Cmd);
|
||||
int CmdNoralsyClone(const char *Cmd);
|
||||
int CmdNoralsySim(const char *Cmd);
|
||||
int CmdNoralsyRead(const char *Cmd);
|
||||
int CmdNoralsyDemod(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
#ifndef CMDLFPAC_H__
|
||||
#define CMDLFPAC_H__
|
||||
|
||||
extern int CmdLFPac(const char *Cmd);
|
||||
extern int CmdPacRead(const char *Cmd);
|
||||
extern int CmdPacDemod(const char *Cmd);
|
||||
int CmdLFPac(const char *Cmd);
|
||||
int CmdPacRead(const char *Cmd);
|
||||
int CmdPacDemod(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#ifndef CMDLFPARADOX_H__
|
||||
#define CMDLFPARADOX_H__
|
||||
extern int CmdLFParadox(const char *Cmd);
|
||||
extern int CmdFSKdemodParadox(const char *Cmd);
|
||||
extern int CmdParadoxRead(const char *Cmd);
|
||||
int CmdLFParadox(const char *Cmd);
|
||||
int CmdFSKdemodParadox(const char *Cmd);
|
||||
int CmdParadoxRead(const char *Cmd);
|
||||
#endif
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
#ifndef CMDLFPYRAMID_H__
|
||||
#define CMDLFPYRAMID_H__
|
||||
|
||||
extern int CmdLFPyramid(const char *Cmd);
|
||||
extern int CmdPyramidClone(const char *Cmd);
|
||||
extern int CmdPyramidSim(const char *Cmd);
|
||||
extern int CmdFSKdemodPyramid(const char *Cmd);
|
||||
extern int CmdPyramidRead(const char *Cmd);
|
||||
int CmdLFPyramid(const char *Cmd);
|
||||
int CmdPyramidClone(const char *Cmd);
|
||||
int CmdPyramidSim(const char *Cmd);
|
||||
int CmdFSKdemodPyramid(const char *Cmd);
|
||||
int CmdPyramidRead(const char *Cmd);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#ifndef CMDLFSECURAKEY_H__
|
||||
#define CMDLFSECURAKEY_H__
|
||||
|
||||
extern int CmdLFSecurakey(const char *Cmd);
|
||||
extern int CmdSecurakeyClone(const char *Cmd);
|
||||
extern int CmdSecurakeySim(const char *Cmd);
|
||||
extern int CmdSecurakeyRead(const char *Cmd);
|
||||
extern int CmdSecurakeyDemod(const char *Cmd);
|
||||
int CmdLFSecurakey(const char *Cmd);
|
||||
int CmdSecurakeyClone(const char *Cmd);
|
||||
int CmdSecurakeySim(const char *Cmd);
|
||||
int CmdSecurakeyRead(const char *Cmd);
|
||||
int CmdSecurakeyDemod(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -69,16 +69,16 @@ typedef struct {
|
|||
t55xx_conf_block_t Get_t55xx_Config(void);
|
||||
void Set_t55xx_Config(t55xx_conf_block_t conf);
|
||||
|
||||
extern int CmdLFT55XX(const char *Cmd);
|
||||
extern int CmdT55xxBruteForce(const char *Cmd);
|
||||
extern int CmdT55xxSetConfig(const char *Cmd);
|
||||
extern int CmdT55xxReadBlock(const char *Cmd);
|
||||
extern int CmdT55xxWriteBlock(const char *Cmd);
|
||||
extern int CmdT55xxReadTrace(const char *Cmd);
|
||||
extern int CmdT55xxInfo(const char *Cmd);
|
||||
extern int CmdT55xxDetect(const char *Cmd);
|
||||
extern int CmdResetRead(const char *Cmd);
|
||||
extern int CmdT55xxWipe(const char *Cmd);
|
||||
int CmdLFT55XX(const char *Cmd);
|
||||
int CmdT55xxBruteForce(const char *Cmd);
|
||||
int CmdT55xxSetConfig(const char *Cmd);
|
||||
int CmdT55xxReadBlock(const char *Cmd);
|
||||
int CmdT55xxWriteBlock(const char *Cmd);
|
||||
int CmdT55xxReadTrace(const char *Cmd);
|
||||
int CmdT55xxInfo(const char *Cmd);
|
||||
int CmdT55xxDetect(const char *Cmd);
|
||||
int CmdResetRead(const char *Cmd);
|
||||
int CmdT55xxWipe(const char *Cmd);
|
||||
|
||||
char * GetBitRateStr(uint32_t id, bool xmode);
|
||||
char * GetSaferStr(uint32_t id);
|
||||
|
@ -92,7 +92,7 @@ int printConfiguration( t55xx_conf_block_t b);
|
|||
|
||||
bool DecodeT55xxBlock(void);
|
||||
bool tryDetectModulation(void);
|
||||
extern bool tryDetectP1(bool getData);
|
||||
bool tryDetectP1(bool getData);
|
||||
bool test(uint8_t mode, uint8_t *offset, int *fndBitRate, uint8_t clk, bool *Q5);
|
||||
int special(const char *Cmd);
|
||||
int AquireData( uint8_t page, uint8_t block, bool pwdmode, uint32_t password );
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#ifndef CMDLFVIKING_H__
|
||||
#define CMDLFVIKING_H__
|
||||
extern int CmdLFViking(const char *Cmd);
|
||||
extern int CmdVikingDemod(const char *Cmd);
|
||||
extern int CmdVikingRead(const char *Cmd);
|
||||
extern int CmdVikingClone(const char *Cmd);
|
||||
extern int CmdVikingSim(const char *Cmd);
|
||||
int CmdLFViking(const char *Cmd);
|
||||
int CmdVikingDemod(const char *Cmd);
|
||||
int CmdVikingRead(const char *Cmd);
|
||||
int CmdVikingClone(const char *Cmd);
|
||||
int CmdVikingSim(const char *Cmd);
|
||||
#endif
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#ifndef CMDLFVISA2000_H__
|
||||
#define CMDLFVISA2000_H__
|
||||
#include <inttypes.h>
|
||||
extern int CmdLFVisa2k(const char *Cmd);
|
||||
extern int CmdVisa2kClone(const char *Cmd);
|
||||
extern int CmdVisa2kSim(const char *Cmd);
|
||||
extern int CmdVisa2kRead(const char *Cmd);
|
||||
extern int CmdVisa2kDemod(const char *Cmd);
|
||||
int CmdLFVisa2k(const char *Cmd);
|
||||
int CmdVisa2kClone(const char *Cmd);
|
||||
int CmdVisa2kSim(const char *Cmd);
|
||||
int CmdVisa2kRead(const char *Cmd);
|
||||
int CmdVisa2kDemod(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
#include "usb_cmd.h"
|
||||
#include "cmdparser.h"
|
||||
|
||||
extern void UsbCommandReceived(UsbCommand *UC);
|
||||
extern int CommandReceived(char *Cmd);
|
||||
extern bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeout, bool show_warning);
|
||||
extern bool WaitForResponseTimeout(uint32_t cmd, UsbCommand* response, size_t ms_timeout);
|
||||
extern bool WaitForResponse(uint32_t cmd, UsbCommand* response);
|
||||
extern void clearCommandBuffer();
|
||||
extern command_t* getTopLevelCommandTable();
|
||||
void UsbCommandReceived(UsbCommand *UC);
|
||||
int CommandReceived(char *Cmd);
|
||||
bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeout, bool show_warning);
|
||||
bool WaitForResponseTimeout(uint32_t cmd, UsbCommand* response, size_t ms_timeout);
|
||||
bool WaitForResponse(uint32_t cmd, UsbCommand* response);
|
||||
void clearCommandBuffer();
|
||||
command_t* getTopLevelCommandTable();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#define FILE_PATH_SIZE 1000
|
||||
|
||||
extern uint8_t* sample_buf;
|
||||
uint8_t* sample_buf;
|
||||
#define arraylen(x) (sizeof(x)/sizeof((x)[0]))
|
||||
|
||||
void GetFromBigBuf(uint8_t *dest, int bytes, int start_index);
|
||||
|
|
|
@ -28,7 +28,7 @@ typedef struct {
|
|||
const char *Description;
|
||||
} APDUCode;
|
||||
|
||||
extern const APDUCode* const GetAPDUCode(uint8_t sw1, uint8_t sw2);
|
||||
extern const char* GetAPDUCodeDescription(uint8_t sw1, uint8_t sw2);
|
||||
const APDUCode* const GetAPDUCode(uint8_t sw1, uint8_t sw2);
|
||||
const char* GetAPDUCodeDescription(uint8_t sw1, uint8_t sw2);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -54,35 +54,35 @@ enum CardPSVendor {
|
|||
CV_CB,
|
||||
CV_OTHER,
|
||||
};
|
||||
extern enum CardPSVendor GetCardPSVendor(uint8_t * AID, size_t AIDlen);
|
||||
enum CardPSVendor GetCardPSVendor(uint8_t * AID, size_t AIDlen);
|
||||
|
||||
extern void TLVPrintFromBuffer(uint8_t *data, int datalen);
|
||||
extern void TLVPrintFromTLV(struct tlvdb *tlv);
|
||||
extern void TLVPrintFromTLVLev(struct tlvdb *tlv, int level);
|
||||
extern void TLVPrintAIDlistFromSelectTLV(struct tlvdb *tlv);
|
||||
void TLVPrintFromBuffer(uint8_t *data, int datalen);
|
||||
void TLVPrintFromTLV(struct tlvdb *tlv);
|
||||
void TLVPrintFromTLVLev(struct tlvdb *tlv, int level);
|
||||
void TLVPrintAIDlistFromSelectTLV(struct tlvdb *tlv);
|
||||
|
||||
extern struct tlvdb *GetPANFromTrack2(const struct tlv *track2);
|
||||
extern struct tlvdb *GetdCVVRawFromTrack2(const struct tlv *track2);
|
||||
struct tlvdb *GetPANFromTrack2(const struct tlv *track2);
|
||||
struct tlvdb *GetdCVVRawFromTrack2(const struct tlv *track2);
|
||||
|
||||
extern void SetAPDULogging(bool logging);
|
||||
void SetAPDULogging(bool logging);
|
||||
|
||||
// search application
|
||||
extern int EMVSearchPSE(bool ActivateField, bool LeaveFieldON, bool decodeTLV, struct tlvdb *tlv);
|
||||
extern int EMVSearch(bool ActivateField, bool LeaveFieldON, bool decodeTLV, struct tlvdb *tlv);
|
||||
extern int EMVSelectPSE(bool ActivateField, bool LeaveFieldON, uint8_t PSENum, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
|
||||
extern int EMVSelect(bool ActivateField, bool LeaveFieldON, uint8_t *AID, size_t AIDLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
int EMVSearchPSE(bool ActivateField, bool LeaveFieldON, bool decodeTLV, struct tlvdb *tlv);
|
||||
int EMVSearch(bool ActivateField, bool LeaveFieldON, bool decodeTLV, struct tlvdb *tlv);
|
||||
int EMVSelectPSE(bool ActivateField, bool LeaveFieldON, uint8_t PSENum, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
|
||||
int EMVSelect(bool ActivateField, bool LeaveFieldON, uint8_t *AID, size_t AIDLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
// select application
|
||||
extern int EMVSelectApplication(struct tlvdb *tlv, uint8_t *AID, size_t *AIDlen);
|
||||
int EMVSelectApplication(struct tlvdb *tlv, uint8_t *AID, size_t *AIDlen);
|
||||
// Get Processing Options
|
||||
extern int EMVGPO(bool LeaveFieldON, uint8_t *PDOL, size_t PDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
extern int EMVReadRecord(bool LeaveFieldON, uint8_t SFI, uint8_t SFIrec, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
int EMVGPO(bool LeaveFieldON, uint8_t *PDOL, size_t PDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
int EMVReadRecord(bool LeaveFieldON, uint8_t SFI, uint8_t SFIrec, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
// AC
|
||||
extern int EMVGenerateChallenge(bool LeaveFieldON, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
extern int EMVAC(bool LeaveFieldON, uint8_t RefControl, uint8_t *CDOL, size_t CDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
int EMVGenerateChallenge(bool LeaveFieldON, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
int EMVAC(bool LeaveFieldON, uint8_t RefControl, uint8_t *CDOL, size_t CDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
// Mastercard
|
||||
int MSCComputeCryptoChecksum(bool LeaveFieldON, uint8_t *UDOL, uint8_t UDOLlen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
|
||||
// Auth
|
||||
extern int trSDA(uint8_t *AID, size_t AIDlen, struct tlvdb *tlv);
|
||||
int trSDA(uint8_t *AID, size_t AIDlen, struct tlvdb *tlv);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ void DetectHighLowInGraph(int *high, int *low, bool addFuzz);
|
|||
#define GRAPH_SAVE 1
|
||||
#define GRAPH_RESTORE 0
|
||||
|
||||
extern int GraphBuffer[MAX_GRAPH_TRACE_LEN];
|
||||
extern int GraphTraceLen;
|
||||
extern int s_Buff[MAX_GRAPH_TRACE_LEN];
|
||||
int GraphBuffer[MAX_GRAPH_TRACE_LEN];
|
||||
int GraphTraceLen;
|
||||
int s_Buff[MAX_GRAPH_TRACE_LEN];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -52,7 +52,7 @@ THE SOFTWARE.
|
|||
|
||||
#include "hardnested_bruteforce.h" // statelist_t
|
||||
|
||||
extern const uint64_t crack_states_bitsliced(uint32_t cuid, uint8_t *best_first_bytes, statelist_t *p, uint32_t *keys_found, uint64_t *num_keys_tested, uint32_t nonces_to_bruteforce, uint8_t *bf_test_nonces_2nd_byte, noncelist_t *nonces);
|
||||
extern void bitslice_test_nonces(uint32_t nonces_to_bruteforce, uint32_t *bf_test_nonces, uint8_t *bf_test_nonce_par);
|
||||
const uint64_t crack_states_bitsliced(uint32_t cuid, uint8_t *best_first_bytes, statelist_t *p, uint32_t *keys_found, uint64_t *num_keys_tested, uint32_t nonces_to_bruteforce, uint8_t *bf_test_nonces_2nd_byte, noncelist_t *nonces);
|
||||
void bitslice_test_nonces(uint32_t nonces_to_bruteforce, uint32_t *bf_test_nonces, uint8_t *bf_test_nonce_par);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -52,18 +52,18 @@ THE SOFTWARE.
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint32_t *malloc_bitarray(uint32_t x);
|
||||
extern void free_bitarray(uint32_t *x);
|
||||
extern uint32_t bitcount(uint32_t a);
|
||||
extern uint32_t count_states(uint32_t *A);
|
||||
extern void bitarray_AND(uint32_t *A, uint32_t *B);
|
||||
extern void bitarray_low20_AND(uint32_t *A, uint32_t *B);
|
||||
extern uint32_t count_bitarray_AND(uint32_t *A, uint32_t *B);
|
||||
extern uint32_t count_bitarray_low20_AND(uint32_t *A, uint32_t *B);
|
||||
extern void bitarray_AND4(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D);
|
||||
extern void bitarray_OR(uint32_t *A, uint32_t *B);
|
||||
extern uint32_t count_bitarray_AND2(uint32_t *A, uint32_t *B);
|
||||
extern uint32_t count_bitarray_AND3(uint32_t *A, uint32_t *B, uint32_t *C);
|
||||
extern uint32_t count_bitarray_AND4(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D);
|
||||
uint32_t *malloc_bitarray(uint32_t x);
|
||||
void free_bitarray(uint32_t *x);
|
||||
uint32_t bitcount(uint32_t a);
|
||||
uint32_t count_states(uint32_t *A);
|
||||
void bitarray_AND(uint32_t *A, uint32_t *B);
|
||||
void bitarray_low20_AND(uint32_t *A, uint32_t *B);
|
||||
uint32_t count_bitarray_AND(uint32_t *A, uint32_t *B);
|
||||
uint32_t count_bitarray_low20_AND(uint32_t *A, uint32_t *B);
|
||||
void bitarray_AND4(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D);
|
||||
void bitarray_OR(uint32_t *A, uint32_t *B);
|
||||
uint32_t count_bitarray_AND2(uint32_t *A, uint32_t *B);
|
||||
uint32_t count_bitarray_AND3(uint32_t *A, uint32_t *B, uint32_t *C);
|
||||
uint32_t count_bitarray_AND4(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,10 +27,10 @@ typedef struct {
|
|||
void* next;
|
||||
} statelist_t;
|
||||
|
||||
extern void prepare_bf_test_nonces(noncelist_t *nonces, uint8_t best_first_byte);
|
||||
extern bool brute_force_bs(float *bf_rate, statelist_t *candidates, uint32_t cuid, uint32_t num_acquired_nonces, uint64_t maximum_states, noncelist_t *nonces, uint8_t *best_first_bytes);
|
||||
extern float brute_force_benchmark();
|
||||
extern uint8_t trailing_zeros(uint8_t byte);
|
||||
extern bool verify_key(uint32_t cuid, noncelist_t *nonces, uint8_t *best_first_bytes, uint32_t odd, uint32_t even);
|
||||
void prepare_bf_test_nonces(noncelist_t *nonces, uint8_t best_first_byte);
|
||||
bool brute_force_bs(float *bf_rate, statelist_t *candidates, uint32_t cuid, uint32_t num_acquired_nonces, uint64_t maximum_states, noncelist_t *nonces, uint8_t *best_first_bytes);
|
||||
float brute_force_benchmark();
|
||||
uint8_t trailing_zeros(uint8_t byte);
|
||||
bool verify_key(uint32_t cuid, noncelist_t *nonces, uint8_t *best_first_bytes, uint32_t odd, uint32_t even);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include <usb.h>
|
||||
#include "usb_cmd.h"
|
||||
|
||||
extern unsigned char return_on_error;
|
||||
extern unsigned char error_occured;
|
||||
unsigned char return_on_error;
|
||||
unsigned char error_occured;
|
||||
|
||||
void SendCommand(UsbCommand *c);
|
||||
bool ReceiveCommandPoll(UsbCommand *c);
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#include <stdbool.h>
|
||||
#include "mifare.h"
|
||||
|
||||
extern bool mfkey32(nonces_t data, uint64_t *outputkey);
|
||||
extern bool mfkey32_moebius(nonces_t data, uint64_t *outputkey);
|
||||
extern int mfkey64(nonces_t data, uint64_t *outputkey);
|
||||
bool mfkey32(nonces_t data, uint64_t *outputkey);
|
||||
bool mfkey32_moebius(nonces_t data, uint64_t *outputkey);
|
||||
int mfkey64(nonces_t data, uint64_t *outputkey);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -34,32 +34,32 @@ typedef struct {
|
|||
int foundKey[2];
|
||||
} sector_t;
|
||||
|
||||
extern char logHexFileName[FILE_PATH_SIZE];
|
||||
char logHexFileName[FILE_PATH_SIZE];
|
||||
|
||||
extern int mfDarkside(uint64_t *key);
|
||||
extern int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBlockNo, uint8_t trgKeyType, uint8_t *ResultKeys, bool calibrate);
|
||||
extern int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t *keyBlock, uint64_t *key);
|
||||
extern int mfCheckKeysSec(uint8_t sectorCnt, uint8_t keyType, uint8_t timeout14a, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, sector_t * e_sector);
|
||||
int mfDarkside(uint64_t *key);
|
||||
int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBlockNo, uint8_t trgKeyType, uint8_t *ResultKeys, bool calibrate);
|
||||
int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t *keyBlock, uint64_t *key);
|
||||
int mfCheckKeysSec(uint8_t sectorCnt, uint8_t keyType, uint8_t timeout14a, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, sector_t * e_sector);
|
||||
|
||||
extern int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount);
|
||||
extern int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount);
|
||||
int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount);
|
||||
int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount);
|
||||
|
||||
extern int mfCWipe(uint32_t numSectors, bool gen1b, bool wantWipe, bool wantFill);
|
||||
extern int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID);
|
||||
extern int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, bool wantWipe, uint8_t params);
|
||||
extern int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params);
|
||||
int mfCWipe(uint32_t numSectors, bool gen1b, bool wantWipe, bool wantFill);
|
||||
int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID);
|
||||
int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, bool wantWipe, uint8_t params);
|
||||
int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params);
|
||||
|
||||
extern int mfTraceInit(uint8_t *tuid, uint8_t *atqa, uint8_t sak, bool wantSaveToEmlFile);
|
||||
extern int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile);
|
||||
int mfTraceInit(uint8_t *tuid, uint8_t *atqa, uint8_t sak, bool wantSaveToEmlFile);
|
||||
int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile);
|
||||
|
||||
extern int isTraceCardEmpty(void);
|
||||
extern int isBlockEmpty(int blockN);
|
||||
extern int isBlockTrailer(int blockN);
|
||||
extern int loadTraceCard(uint8_t *tuid);
|
||||
extern int saveTraceCard(void);
|
||||
extern int tryDecryptWord(uint32_t nt, uint32_t ar_enc, uint32_t at_enc, uint8_t *data, int len);
|
||||
int isTraceCardEmpty(void);
|
||||
int isBlockEmpty(int blockN);
|
||||
int isBlockTrailer(int blockN);
|
||||
int loadTraceCard(uint8_t *tuid);
|
||||
int saveTraceCard(void);
|
||||
int tryDecryptWord(uint32_t nt, uint32_t ar_enc, uint32_t at_enc, uint8_t *data, int len);
|
||||
|
||||
extern int mfCIdentify();
|
||||
extern int DetectClassicPrng(void);
|
||||
int mfCIdentify();
|
||||
int DetectClassicPrng(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,31 +23,31 @@ void InitGraphics(int argc, char **argv, char *script_cmds_file, char *script_cm
|
|||
void ExitGraphics(void);
|
||||
|
||||
#define MAX_GRAPH_TRACE_LEN (40000*8)
|
||||
extern int GraphBuffer[MAX_GRAPH_TRACE_LEN];
|
||||
extern int GraphTraceLen;
|
||||
extern int s_Buff[MAX_GRAPH_TRACE_LEN];
|
||||
int GraphBuffer[MAX_GRAPH_TRACE_LEN];
|
||||
int GraphTraceLen;
|
||||
int s_Buff[MAX_GRAPH_TRACE_LEN];
|
||||
|
||||
extern double CursorScaleFactor;
|
||||
extern int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos, GridOffset;
|
||||
extern int CommandFinished;
|
||||
extern int offline;
|
||||
extern bool GridLocked;
|
||||
double CursorScaleFactor;
|
||||
int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos, GridOffset;
|
||||
int CommandFinished;
|
||||
int offline;
|
||||
bool GridLocked;
|
||||
|
||||
//Operations defined in data_operations
|
||||
//extern int autoCorr(const int* in, int *out, size_t len, int window);
|
||||
extern int AskEdgeDetect(const int *in, int *out, int len, int threshold);
|
||||
extern int AutoCorrelate(const int *in, int *out, size_t len, int window, bool SaveGrph, bool verbose);
|
||||
extern int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down);
|
||||
extern void save_restoreGB(uint8_t saveOpt);
|
||||
int AskEdgeDetect(const int *in, int *out, int len, int threshold);
|
||||
int AutoCorrelate(const int *in, int *out, size_t len, int window, bool SaveGrph, bool verbose);
|
||||
int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down);
|
||||
void save_restoreGB(uint8_t saveOpt);
|
||||
|
||||
#define GRAPH_SAVE 1
|
||||
#define GRAPH_RESTORE 0
|
||||
#define MAX_DEMOD_BUF_LEN (1024*128)
|
||||
extern uint8_t DemodBuffer[MAX_DEMOD_BUF_LEN];
|
||||
extern size_t DemodBufferLen;
|
||||
extern size_t g_DemodStartIdx;
|
||||
extern bool showDemod;
|
||||
extern uint8_t g_debugMode;
|
||||
uint8_t DemodBuffer[MAX_DEMOD_BUF_LEN];
|
||||
size_t DemodBufferLen;
|
||||
size_t g_DemodStartIdx;
|
||||
bool showDemod;
|
||||
uint8_t g_debugMode;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -20,6 +20,6 @@
|
|||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind, opterr, optopt, pos;
|
||||
char *optarg;
|
||||
int optind, opterr, optopt, pos;
|
||||
int getopt(int argc, char *argv[], const char *optstring);
|
||||
|
|
|
@ -97,8 +97,8 @@
|
|||
/* bmpbit.c */
|
||||
typedef BMP_T bmp_t;
|
||||
|
||||
extern int bmpbit, bmpsub;
|
||||
extern void setbmp(void);
|
||||
int bmpbit, bmpsub;
|
||||
void setbmp(void);
|
||||
|
||||
/* poly.c */
|
||||
#define P_REFIN 1
|
||||
|
@ -125,41 +125,41 @@ typedef struct {
|
|||
/* left-justified in each word */
|
||||
} poly_t;
|
||||
|
||||
extern poly_t filtop(FILE *input, unsigned long length, int flags, int bperhx);
|
||||
extern poly_t strtop(const char *string, int flags, int bperhx);
|
||||
extern char *ptostr(const poly_t poly, int flags, int bperhx);
|
||||
extern char *pxsubs(const poly_t poly, int flags, int bperhx, unsigned long start, unsigned long end);
|
||||
extern poly_t pclone(const poly_t poly);
|
||||
extern void pcpy(poly_t *dest, const poly_t src);
|
||||
extern void pcanon(poly_t *poly);
|
||||
extern void pnorm(poly_t *poly);
|
||||
extern void psnorm(poly_t *poly);
|
||||
extern void pchop(poly_t *poly);
|
||||
extern void pkchop(poly_t *poly);
|
||||
extern unsigned long plen(const poly_t poly);
|
||||
extern int pcmp(const poly_t *a, const poly_t *b);
|
||||
extern int psncmp(const poly_t *a, const poly_t *b);
|
||||
extern int ptst(const poly_t poly);
|
||||
extern unsigned long pfirst(const poly_t poly);
|
||||
extern unsigned long plast(const poly_t poly);
|
||||
extern poly_t psubs(const poly_t src, unsigned long head, unsigned long start, unsigned long end, unsigned long tail);
|
||||
extern void pright(poly_t *poly, unsigned long length);
|
||||
extern void pshift(poly_t *dest, const poly_t src, unsigned long head, unsigned long start, unsigned long end, unsigned long tail);
|
||||
extern void ppaste(poly_t *dest, const poly_t src, unsigned long skip, unsigned long seek, unsigned long end, unsigned long fulllength);
|
||||
extern void pdiff(poly_t *dest, const poly_t src, unsigned long ofs);
|
||||
extern void psum(poly_t *dest, const poly_t src, unsigned long ofs);
|
||||
extern void prev(poly_t *poly);
|
||||
extern void prevch(poly_t *poly, int bperhx);
|
||||
extern void prcp(poly_t *poly);
|
||||
extern void pinv(poly_t *poly);
|
||||
extern poly_t pmod(const poly_t dividend, const poly_t divisor);
|
||||
extern poly_t pcrc(const poly_t message, const poly_t divisor, const poly_t init, const poly_t xorout, int flags);
|
||||
extern int piter(poly_t *poly);
|
||||
extern void palloc(poly_t *poly, unsigned long length);
|
||||
extern void pfree(poly_t *poly);
|
||||
extern void praloc(poly_t *poly, unsigned long length);
|
||||
extern int pmpar(const poly_t poly, const poly_t mask);
|
||||
extern int pident(const poly_t a, const poly_t b);
|
||||
poly_t filtop(FILE *input, unsigned long length, int flags, int bperhx);
|
||||
poly_t strtop(const char *string, int flags, int bperhx);
|
||||
char *ptostr(const poly_t poly, int flags, int bperhx);
|
||||
char *pxsubs(const poly_t poly, int flags, int bperhx, unsigned long start, unsigned long end);
|
||||
poly_t pclone(const poly_t poly);
|
||||
void pcpy(poly_t *dest, const poly_t src);
|
||||
void pcanon(poly_t *poly);
|
||||
void pnorm(poly_t *poly);
|
||||
void psnorm(poly_t *poly);
|
||||
void pchop(poly_t *poly);
|
||||
void pkchop(poly_t *poly);
|
||||
unsigned long plen(const poly_t poly);
|
||||
int pcmp(const poly_t *a, const poly_t *b);
|
||||
int psncmp(const poly_t *a, const poly_t *b);
|
||||
int ptst(const poly_t poly);
|
||||
unsigned long pfirst(const poly_t poly);
|
||||
unsigned long plast(const poly_t poly);
|
||||
poly_t psubs(const poly_t src, unsigned long head, unsigned long start, unsigned long end, unsigned long tail);
|
||||
void pright(poly_t *poly, unsigned long length);
|
||||
void pshift(poly_t *dest, const poly_t src, unsigned long head, unsigned long start, unsigned long end, unsigned long tail);
|
||||
void ppaste(poly_t *dest, const poly_t src, unsigned long skip, unsigned long seek, unsigned long end, unsigned long fulllength);
|
||||
void pdiff(poly_t *dest, const poly_t src, unsigned long ofs);
|
||||
void psum(poly_t *dest, const poly_t src, unsigned long ofs);
|
||||
void prev(poly_t *poly);
|
||||
void prevch(poly_t *poly, int bperhx);
|
||||
void prcp(poly_t *poly);
|
||||
void pinv(poly_t *poly);
|
||||
poly_t pmod(const poly_t dividend, const poly_t divisor);
|
||||
poly_t pcrc(const poly_t message, const poly_t divisor, const poly_t init, const poly_t xorout, int flags);
|
||||
int piter(poly_t *poly);
|
||||
void palloc(poly_t *poly, unsigned long length);
|
||||
void pfree(poly_t *poly);
|
||||
void praloc(poly_t *poly, unsigned long length);
|
||||
int pmpar(const poly_t poly, const poly_t mask);
|
||||
int pident(const poly_t a, const poly_t b);
|
||||
|
||||
/* model.c */
|
||||
#define M_OVERWR 256
|
||||
|
@ -173,19 +173,19 @@ typedef struct {
|
|||
const char *name; /* optional canonical name of the model */
|
||||
} model_t;
|
||||
|
||||
extern void mcpy(model_t *dest, const model_t *src);
|
||||
extern void mfree(model_t *model);
|
||||
extern int mcmp(const model_t *a, const model_t *b);
|
||||
extern int mbynam(model_t *dest, const char *key);
|
||||
extern void mbynum(model_t *dest, int num);
|
||||
extern int mcount(void);
|
||||
extern char *mnames(void);
|
||||
extern char *mtostr(const model_t *model);
|
||||
extern void mmatch(model_t *model, int flags);
|
||||
extern void mcanon(model_t *model);
|
||||
extern void mcheck(model_t *model);
|
||||
extern void mrev(model_t *model);
|
||||
extern void mnovel(model_t *model);
|
||||
void mcpy(model_t *dest, const model_t *src);
|
||||
void mfree(model_t *model);
|
||||
int mcmp(const model_t *a, const model_t *b);
|
||||
int mbynam(model_t *dest, const char *key);
|
||||
void mbynum(model_t *dest, int num);
|
||||
int mcount(void);
|
||||
char *mnames(void);
|
||||
char *mtostr(const model_t *model);
|
||||
void mmatch(model_t *model, int flags);
|
||||
void mcanon(model_t *model);
|
||||
void mcheck(model_t *model);
|
||||
void mrev(model_t *model);
|
||||
void mnovel(model_t *model);
|
||||
|
||||
/* reveng.c */
|
||||
#define R_HAVEP 512
|
||||
|
@ -197,7 +197,7 @@ extern void mnovel(model_t *model);
|
|||
|
||||
#define R_SPMASK 0x7FFFFFFUL
|
||||
|
||||
extern model_t *reveng(const model_t *guess, const poly_t qpoly, int rflags, int args, const poly_t *argpolys);
|
||||
model_t *reveng(const model_t *guess, const poly_t qpoly, int rflags, int args, const poly_t *argpolys);
|
||||
|
||||
/* cli.c */
|
||||
#define C_INFILE 1
|
||||
|
@ -206,9 +206,9 @@ extern model_t *reveng(const model_t *guess, const poly_t qpoly, int rflags, int
|
|||
|
||||
#define BUFFER 32768
|
||||
|
||||
extern int reveng_main(int argc, char *argv[]);
|
||||
extern void ufound(const model_t *model);
|
||||
extern void uerror(const char *msg);
|
||||
extern void uprog(const poly_t gpoly, int flags, unsigned long seq);
|
||||
int reveng_main(int argc, char *argv[]);
|
||||
void ufound(const model_t *model);
|
||||
void uerror(const char *msg);
|
||||
void uprog(const poly_t gpoly, int flags, unsigned long seq);
|
||||
|
||||
#endif /* REVENG_H */
|
||||
|
|
12
client/ui.h
12
client/ui.h
|
@ -21,11 +21,11 @@ void RepaintGraphWindow(void);
|
|||
void PrintAndLog(char *fmt, ...);
|
||||
void SetLogFilename(char *fn);
|
||||
|
||||
extern double CursorScaleFactor;
|
||||
extern int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos, GridOffset;
|
||||
extern int offline;
|
||||
extern int flushAfterWrite; //buzzy
|
||||
extern bool GridLocked;
|
||||
extern bool showDemod;
|
||||
double CursorScaleFactor;
|
||||
int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos, GridOffset;
|
||||
int offline;
|
||||
int flushAfterWrite; //buzzy
|
||||
bool GridLocked;
|
||||
bool showDemod;
|
||||
|
||||
#endif
|
||||
|
|
100
client/util.h
100
client/util.h
|
@ -28,68 +28,68 @@
|
|||
#define EVEN 0
|
||||
#define ODD 1
|
||||
|
||||
extern int ukbhit(void);
|
||||
int ukbhit(void);
|
||||
|
||||
extern void AddLogLine(char *fileName, char *extData, char *c);
|
||||
extern void AddLogHex(char *fileName, char *extData, const uint8_t * data, const size_t len);
|
||||
extern void AddLogUint64(char *fileName, char *extData, const uint64_t data);
|
||||
extern void AddLogCurrentDT(char *fileName);
|
||||
extern void FillFileNameByUID(char *fileName, uint8_t * uid, char *ext, int byteCount);
|
||||
void AddLogLine(char *fileName, char *extData, char *c);
|
||||
void AddLogHex(char *fileName, char *extData, const uint8_t * data, const size_t len);
|
||||
void AddLogUint64(char *fileName, char *extData, const uint64_t data);
|
||||
void AddLogCurrentDT(char *fileName);
|
||||
void FillFileNameByUID(char *fileName, uint8_t * uid, char *ext, int byteCount);
|
||||
|
||||
extern void hex_to_buffer(const uint8_t *buf, const uint8_t *hex_data, const size_t hex_len,
|
||||
void hex_to_buffer(const uint8_t *buf, const uint8_t *hex_data, const size_t hex_len,
|
||||
const size_t hex_max_len, const size_t min_str_len, const size_t spaces_between, bool uppercase);
|
||||
|
||||
extern void print_hex(const uint8_t * data, const size_t len);
|
||||
extern char *sprint_hex(const uint8_t * data, const size_t len);
|
||||
extern char *sprint_hex_inrow(const uint8_t *data, const size_t len);
|
||||
extern char *sprint_hex_inrow_ex(const uint8_t *data, const size_t len, const size_t min_str_len);
|
||||
extern char *sprint_bin(const uint8_t * data, const size_t len);
|
||||
extern char *sprint_bin_break(const uint8_t *data, const size_t len, const uint8_t breaks);
|
||||
extern char *sprint_hex_ascii(const uint8_t *data, const size_t len);
|
||||
extern char *sprint_ascii(const uint8_t *data, const size_t len);
|
||||
extern char *sprint_ascii_ex(const uint8_t *data, const size_t len, const size_t min_str_len);
|
||||
void print_hex(const uint8_t * data, const size_t len);
|
||||
char *sprint_hex(const uint8_t * data, const size_t len);
|
||||
char *sprint_hex_inrow(const uint8_t *data, const size_t len);
|
||||
char *sprint_hex_inrow_ex(const uint8_t *data, const size_t len, const size_t min_str_len);
|
||||
char *sprint_bin(const uint8_t * data, const size_t len);
|
||||
char *sprint_bin_break(const uint8_t *data, const size_t len, const uint8_t breaks);
|
||||
char *sprint_hex_ascii(const uint8_t *data, const size_t len);
|
||||
char *sprint_ascii(const uint8_t *data, const size_t len);
|
||||
char *sprint_ascii_ex(const uint8_t *data, const size_t len, const size_t min_str_len);
|
||||
|
||||
extern void num_to_bytes(uint64_t n, size_t len, uint8_t* dest);
|
||||
extern uint64_t bytes_to_num(uint8_t* src, size_t len);
|
||||
extern void num_to_bytebits(uint64_t n, size_t len, uint8_t *dest);
|
||||
extern void num_to_bytebitsLSBF(uint64_t n, size_t len, uint8_t *dest);
|
||||
extern char *printBits(size_t const size, void const * const ptr);
|
||||
extern uint32_t SwapBits(uint32_t value, int nrbits);
|
||||
extern uint8_t *SwapEndian64(const uint8_t *src, const size_t len, const uint8_t blockSize);
|
||||
extern void SwapEndian64ex(const uint8_t *src, const size_t len, const uint8_t blockSize, uint8_t *dest);
|
||||
void num_to_bytes(uint64_t n, size_t len, uint8_t* dest);
|
||||
uint64_t bytes_to_num(uint8_t* src, size_t len);
|
||||
void num_to_bytebits(uint64_t n, size_t len, uint8_t *dest);
|
||||
void num_to_bytebitsLSBF(uint64_t n, size_t len, uint8_t *dest);
|
||||
char *printBits(size_t const size, void const * const ptr);
|
||||
uint32_t SwapBits(uint32_t value, int nrbits);
|
||||
uint8_t *SwapEndian64(const uint8_t *src, const size_t len, const uint8_t blockSize);
|
||||
void SwapEndian64ex(const uint8_t *src, const size_t len, const uint8_t blockSize, uint8_t *dest);
|
||||
|
||||
extern int param_getlength(const char *line, int paramnum);
|
||||
extern char param_getchar(const char *line, int paramnum);
|
||||
extern char param_getchar_indx(const char *line, int indx, int paramnum);
|
||||
extern int param_getptr(const char *line, int *bg, int *en, int paramnum);
|
||||
extern uint8_t param_get8(const char *line, int paramnum);
|
||||
extern uint8_t param_get8ex(const char *line, int paramnum, int deflt, int base);
|
||||
extern uint32_t param_get32ex(const char *line, int paramnum, int deflt, int base);
|
||||
extern uint64_t param_get64ex(const char *line, int paramnum, int deflt, int base);
|
||||
extern uint8_t param_getdec(const char *line, int paramnum, uint8_t *destination);
|
||||
extern uint8_t param_isdec(const char *line, int paramnum);
|
||||
extern int param_gethex(const char *line, int paramnum, uint8_t * data, int hexcnt);
|
||||
extern int param_gethex_ex(const char *line, int paramnum, uint8_t * data, int *hexcnt);
|
||||
extern int param_gethex_to_eol(const char *line, int paramnum, uint8_t * data, int maxdatalen, int *datalen);
|
||||
extern int param_getstr(const char *line, int paramnum, char * str, size_t buffersize);
|
||||
int param_getlength(const char *line, int paramnum);
|
||||
char param_getchar(const char *line, int paramnum);
|
||||
char param_getchar_indx(const char *line, int indx, int paramnum);
|
||||
int param_getptr(const char *line, int *bg, int *en, int paramnum);
|
||||
uint8_t param_get8(const char *line, int paramnum);
|
||||
uint8_t param_get8ex(const char *line, int paramnum, int deflt, int base);
|
||||
uint32_t param_get32ex(const char *line, int paramnum, int deflt, int base);
|
||||
uint64_t param_get64ex(const char *line, int paramnum, int deflt, int base);
|
||||
uint8_t param_getdec(const char *line, int paramnum, uint8_t *destination);
|
||||
uint8_t param_isdec(const char *line, int paramnum);
|
||||
int param_gethex(const char *line, int paramnum, uint8_t * data, int hexcnt);
|
||||
int param_gethex_ex(const char *line, int paramnum, uint8_t * data, int *hexcnt);
|
||||
int param_gethex_to_eol(const char *line, int paramnum, uint8_t * data, int maxdatalen, int *datalen);
|
||||
int param_getstr(const char *line, int paramnum, char * str, size_t buffersize);
|
||||
|
||||
extern int hextobinarray( char *target, char *source);
|
||||
extern int hextobinstring( char *target, char *source);
|
||||
extern int binarraytohex( char *target, char *source, int length);
|
||||
extern void binarraytobinstring(char *target, char *source, int length);
|
||||
extern uint8_t GetParity( uint8_t *string, uint8_t type, int length);
|
||||
extern void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length);
|
||||
int hextobinarray( char *target, char *source);
|
||||
int hextobinstring( char *target, char *source);
|
||||
int binarraytohex( char *target, char *source, int length);
|
||||
void binarraytobinstring(char *target, char *source, int length);
|
||||
uint8_t GetParity( uint8_t *string, uint8_t type, int length);
|
||||
void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length);
|
||||
|
||||
extern void xor(unsigned char *dst, unsigned char *src, size_t len);
|
||||
extern int32_t le24toh(uint8_t data[3]);
|
||||
extern uint32_t le32toh (uint8_t *data);
|
||||
extern void rol(uint8_t *data, const size_t len);
|
||||
void xor(unsigned char *dst, unsigned char *src, size_t len);
|
||||
int32_t le24toh(uint8_t data[3]);
|
||||
uint32_t le32toh (uint8_t *data);
|
||||
void rol(uint8_t *data, const size_t len);
|
||||
|
||||
extern void clean_ascii(unsigned char *buf, size_t len);
|
||||
void clean_ascii(unsigned char *buf, size_t len);
|
||||
void strcleanrn(char *buf, size_t len);
|
||||
void strcreplace(char *buf, size_t len, char from, char to);
|
||||
char *strmcopy(char *buf);
|
||||
|
||||
extern int num_CPUs(void); // number of logical CPUs
|
||||
int num_CPUs(void); // number of logical CPUs
|
||||
|
||||
#endif // UTIL_H__
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
# define sleep(n) Sleep(1000 *(n))
|
||||
# define msleep(n) Sleep((n))
|
||||
#else
|
||||
extern void msleep(uint32_t n); // sleep n milliseconds
|
||||
void msleep(uint32_t n); // sleep n milliseconds
|
||||
#endif // _WIN32
|
||||
|
||||
extern uint64_t msclock(); // a milliseconds clock
|
||||
uint64_t msclock(); // a milliseconds clock
|
||||
|
||||
#endif
|
||||
|
|
|
@ -24,18 +24,18 @@ typedef struct crc {
|
|||
/* Initialize a crc structure. order is the order of the polynom, e.g. 32 for a CRC-32
|
||||
* polynom is the CRC polynom. initial_value is the initial value of a clean state.
|
||||
* final_xor is XORed onto the state before returning it from crc_result(). */
|
||||
extern void crc_init(crc_t *crc, int order, uint32_t polynom, uint32_t initial_value, uint32_t final_xor);
|
||||
void crc_init(crc_t *crc, int order, uint32_t polynom, uint32_t initial_value, uint32_t final_xor);
|
||||
|
||||
/* Update the crc state. data is the data of length data_width bits (only the
|
||||
* data_width lower-most bits are used).
|
||||
*/
|
||||
extern void crc_update(crc_t *crc, uint32_t data, int data_width);
|
||||
void crc_update(crc_t *crc, uint32_t data, int data_width);
|
||||
|
||||
/* Clean the crc state, e.g. reset it to initial_value */
|
||||
extern void crc_clear(crc_t *crc);
|
||||
void crc_clear(crc_t *crc);
|
||||
|
||||
/* Get the result of the crc calculation */
|
||||
extern uint32_t crc_finish(crc_t *crc);
|
||||
uint32_t crc_finish(crc_t *crc);
|
||||
|
||||
// Calculate CRC-8/Maxim checksum
|
||||
uint32_t CRC8Maxim(uint8_t *buff, size_t size );
|
||||
|
|
|
@ -17,49 +17,49 @@
|
|||
#include <stdbool.h> // for bool
|
||||
|
||||
//generic
|
||||
extern size_t addParity(uint8_t *BitSource, uint8_t *dest, uint8_t sourceLen, uint8_t pLen, uint8_t pType);
|
||||
extern int askdemod(uint8_t *BinStream, size_t *size, int *clk, int *invert, int maxErr, uint8_t amp, uint8_t askType);
|
||||
extern int askdemod_ext(uint8_t *BinStream, size_t *size, int *clk, int *invert, int maxErr, uint8_t amp, uint8_t askType, int *startIdx);
|
||||
extern void askAmp(uint8_t *BitStream, size_t size);
|
||||
extern int BiphaseRawDecode(uint8_t * BitStream, size_t *size, int *offset, int invert);
|
||||
extern uint32_t bytebits_to_byte(uint8_t* src, size_t numbits);
|
||||
extern uint32_t bytebits_to_byteLSBF(uint8_t* src, size_t numbits);
|
||||
extern uint16_t countFC(uint8_t *BitStream, size_t size, uint8_t fskAdj);
|
||||
extern int DetectASKClock(uint8_t dest[], size_t size, int *clock, int maxErr);
|
||||
extern uint8_t DetectCleanAskWave(uint8_t dest[], size_t size, uint8_t high, uint8_t low);
|
||||
extern uint8_t detectFSKClk(uint8_t *BitStream, size_t size, uint8_t fcHigh, uint8_t fcLow, int *firstClockEdge);
|
||||
extern int DetectNRZClock(uint8_t dest[], size_t size, int clock, size_t *clockStartIdx);
|
||||
extern int DetectPSKClock(uint8_t dest[], size_t size, int clock, size_t *firstPhaseShift, uint8_t *curPhase, uint8_t *fc);
|
||||
extern int DetectStrongAskClock(uint8_t dest[], size_t size, int high, int low, int *clock);
|
||||
extern bool DetectST(uint8_t buffer[], size_t *size, int *foundclock, size_t *ststart, size_t *stend);
|
||||
extern int fskdemod(uint8_t *dest, size_t size, uint8_t rfLen, uint8_t invert, uint8_t fchigh, uint8_t fclow, int *startIdx);
|
||||
extern int getHiLo(uint8_t *BitStream, size_t size, int *high, int *low, uint8_t fuzzHi, uint8_t fuzzLo);
|
||||
extern uint32_t manchesterEncode2Bytes(uint16_t datain);
|
||||
extern int ManchesterEncode(uint8_t *BitStream, size_t size);
|
||||
extern int manrawdecode(uint8_t *BitStream, size_t *size, uint8_t invert, uint8_t *alignPos);
|
||||
extern int nrzRawDemod(uint8_t *dest, size_t *size, int *clk, int *invert, int *startIdx);
|
||||
extern bool parityTest(uint32_t bits, uint8_t bitLen, uint8_t pType);
|
||||
extern uint8_t preambleSearch(uint8_t *BitStream, uint8_t *preamble, size_t pLen, size_t *size, size_t *startIdx);
|
||||
extern bool preambleSearchEx(uint8_t *BitStream, uint8_t *preamble, size_t pLen, size_t *size, size_t *startIdx, bool findone);
|
||||
extern int pskRawDemod(uint8_t dest[], size_t *size, int *clock, int *invert);
|
||||
extern int pskRawDemod_ext(uint8_t dest[], size_t *size, int *clock, int *invert, int *startIdx);
|
||||
extern void psk2TOpsk1(uint8_t *BitStream, size_t size);
|
||||
extern void psk1TOpsk2(uint8_t *BitStream, size_t size);
|
||||
extern size_t removeParity(uint8_t *BitStream, size_t startIdx, uint8_t pLen, uint8_t pType, size_t bLen);
|
||||
size_t addParity(uint8_t *BitSource, uint8_t *dest, uint8_t sourceLen, uint8_t pLen, uint8_t pType);
|
||||
int askdemod(uint8_t *BinStream, size_t *size, int *clk, int *invert, int maxErr, uint8_t amp, uint8_t askType);
|
||||
int askdemod_ext(uint8_t *BinStream, size_t *size, int *clk, int *invert, int maxErr, uint8_t amp, uint8_t askType, int *startIdx);
|
||||
void askAmp(uint8_t *BitStream, size_t size);
|
||||
int BiphaseRawDecode(uint8_t * BitStream, size_t *size, int *offset, int invert);
|
||||
uint32_t bytebits_to_byte(uint8_t* src, size_t numbits);
|
||||
uint32_t bytebits_to_byteLSBF(uint8_t* src, size_t numbits);
|
||||
uint16_t countFC(uint8_t *BitStream, size_t size, uint8_t fskAdj);
|
||||
int DetectASKClock(uint8_t dest[], size_t size, int *clock, int maxErr);
|
||||
uint8_t DetectCleanAskWave(uint8_t dest[], size_t size, uint8_t high, uint8_t low);
|
||||
uint8_t detectFSKClk(uint8_t *BitStream, size_t size, uint8_t fcHigh, uint8_t fcLow, int *firstClockEdge);
|
||||
int DetectNRZClock(uint8_t dest[], size_t size, int clock, size_t *clockStartIdx);
|
||||
int DetectPSKClock(uint8_t dest[], size_t size, int clock, size_t *firstPhaseShift, uint8_t *curPhase, uint8_t *fc);
|
||||
int DetectStrongAskClock(uint8_t dest[], size_t size, int high, int low, int *clock);
|
||||
bool DetectST(uint8_t buffer[], size_t *size, int *foundclock, size_t *ststart, size_t *stend);
|
||||
int fskdemod(uint8_t *dest, size_t size, uint8_t rfLen, uint8_t invert, uint8_t fchigh, uint8_t fclow, int *startIdx);
|
||||
int getHiLo(uint8_t *BitStream, size_t size, int *high, int *low, uint8_t fuzzHi, uint8_t fuzzLo);
|
||||
uint32_t manchesterEncode2Bytes(uint16_t datain);
|
||||
int ManchesterEncode(uint8_t *BitStream, size_t size);
|
||||
int manrawdecode(uint8_t *BitStream, size_t *size, uint8_t invert, uint8_t *alignPos);
|
||||
int nrzRawDemod(uint8_t *dest, size_t *size, int *clk, int *invert, int *startIdx);
|
||||
bool parityTest(uint32_t bits, uint8_t bitLen, uint8_t pType);
|
||||
uint8_t preambleSearch(uint8_t *BitStream, uint8_t *preamble, size_t pLen, size_t *size, size_t *startIdx);
|
||||
bool preambleSearchEx(uint8_t *BitStream, uint8_t *preamble, size_t pLen, size_t *size, size_t *startIdx, bool findone);
|
||||
int pskRawDemod(uint8_t dest[], size_t *size, int *clock, int *invert);
|
||||
int pskRawDemod_ext(uint8_t dest[], size_t *size, int *clock, int *invert, int *startIdx);
|
||||
void psk2TOpsk1(uint8_t *BitStream, size_t size);
|
||||
void psk1TOpsk2(uint8_t *BitStream, size_t size);
|
||||
size_t removeParity(uint8_t *BitStream, size_t startIdx, uint8_t pLen, uint8_t pType, size_t bLen);
|
||||
|
||||
//tag specific
|
||||
extern int AWIDdemodFSK(uint8_t *dest, size_t *size, int *waveStartIdx);
|
||||
extern uint8_t Em410xDecode(uint8_t *BitStream, size_t *size, size_t *startIdx, uint32_t *hi, uint64_t *lo);
|
||||
extern int FDXBdemodBI(uint8_t *dest, size_t *size);
|
||||
extern int gProxII_Demod(uint8_t BitStream[], size_t *size);
|
||||
extern int HIDdemodFSK(uint8_t *dest, size_t *size, uint32_t *hi2, uint32_t *hi, uint32_t *lo, int *waveStartIdx);
|
||||
extern int IOdemodFSK(uint8_t *dest, size_t size, int *waveStartIdx);
|
||||
extern int indala64decode(uint8_t *bitStream, size_t *size, uint8_t *invert);
|
||||
extern int indala224decode(uint8_t *bitStream, size_t *size, uint8_t *invert);
|
||||
extern int ParadoxdemodFSK(uint8_t *dest, size_t *size, uint32_t *hi2, uint32_t *hi, uint32_t *lo, int *waveStartIdx);
|
||||
extern int PrescoDemod(uint8_t *dest, size_t *size);
|
||||
extern int PyramiddemodFSK(uint8_t *dest, size_t *size, int *waveStartIdx);
|
||||
extern int VikingDemod_AM(uint8_t *dest, size_t *size);
|
||||
extern int Visa2kDemod_AM(uint8_t *dest, size_t *size);
|
||||
int AWIDdemodFSK(uint8_t *dest, size_t *size, int *waveStartIdx);
|
||||
uint8_t Em410xDecode(uint8_t *BitStream, size_t *size, size_t *startIdx, uint32_t *hi, uint64_t *lo);
|
||||
int FDXBdemodBI(uint8_t *dest, size_t *size);
|
||||
int gProxII_Demod(uint8_t BitStream[], size_t *size);
|
||||
int HIDdemodFSK(uint8_t *dest, size_t *size, uint32_t *hi2, uint32_t *hi, uint32_t *lo, int *waveStartIdx);
|
||||
int IOdemodFSK(uint8_t *dest, size_t size, int *waveStartIdx);
|
||||
int indala64decode(uint8_t *bitStream, size_t *size, uint8_t *invert);
|
||||
int indala224decode(uint8_t *bitStream, size_t *size, uint8_t *invert);
|
||||
int ParadoxdemodFSK(uint8_t *dest, size_t *size, uint32_t *hi2, uint32_t *hi, uint32_t *lo, int *waveStartIdx);
|
||||
int PrescoDemod(uint8_t *dest, size_t *size);
|
||||
int PyramiddemodFSK(uint8_t *dest, size_t *size, int *waveStartIdx);
|
||||
int VikingDemod_AM(uint8_t *dest, size_t *size);
|
||||
int Visa2kDemod_AM(uint8_t *dest, size_t *size);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
extern const uint8_t OddByteParity[256];
|
||||
const uint8_t OddByteParity[256];
|
||||
|
||||
|
||||
static inline bool oddparity8(const uint8_t x) {
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
#define __LEGIC_PRNG_H
|
||||
|
||||
#include <stdint.h>
|
||||
extern void legic_prng_init(uint8_t init);
|
||||
extern void legic_prng_forward(int count);
|
||||
extern int legic_prng_count();
|
||||
extern uint8_t legic_prng_get_bit();
|
||||
void legic_prng_init(uint8_t init);
|
||||
void legic_prng_forward(int count);
|
||||
int legic_prng_count();
|
||||
uint8_t legic_prng_get_bit();
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue