mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-30 00:47:48 +08:00
added define PACKED
This commit is contained in:
parent
d2a2acf69c
commit
84c09ce881
3 changed files with 10 additions and 4 deletions
client
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
#include "apduinfo.h"
|
#include "apduinfo.h"
|
||||||
|
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
const APDUCode APDUCodeTable[] = {
|
const APDUCode APDUCodeTable[] = {
|
||||||
// ID Type Description
|
// ID Type Description
|
||||||
{"XXXX", APDUCODE_TYPE_NONE, ""}, // blank string
|
{"XXXX", APDUCODE_TYPE_NONE, ""}, // blank string
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
#define APDUCODE_TYPE_NONE 0
|
#define APDUCODE_TYPE_NONE 0
|
||||||
#define APDUCODE_TYPE_INFO 1
|
#define APDUCODE_TYPE_INFO 1
|
||||||
#define APDUCODE_TYPE_WARNING 2
|
#define APDUCODE_TYPE_WARNING 2
|
||||||
|
@ -38,7 +40,7 @@ typedef struct {
|
||||||
uint8_t p1;
|
uint8_t p1;
|
||||||
uint8_t p2;
|
uint8_t p2;
|
||||||
uint8_t lc[3];
|
uint8_t lc[3];
|
||||||
} __attribute__((packed)) ExtAPDUHeader;
|
} PACKED ExtAPDUHeader;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t cla;
|
uint8_t cla;
|
||||||
|
@ -50,7 +52,7 @@ typedef struct {
|
||||||
uint32_t le;
|
uint32_t le;
|
||||||
bool extended_apdu;
|
bool extended_apdu;
|
||||||
uint8_t case_type;
|
uint8_t case_type;
|
||||||
} __attribute__((packed)) APDUStruct;
|
} PACKED APDUStruct;
|
||||||
|
|
||||||
extern int APDUDecode(uint8_t *data, int len, APDUStruct *apdu);
|
extern int APDUDecode(uint8_t *data, int len, APDUStruct *apdu);
|
||||||
extern int APDUEncode(APDUStruct *apdu, uint8_t *data, int *len);
|
extern int APDUEncode(APDUStruct *apdu, uint8_t *data, int *len);
|
||||||
|
|
|
@ -21,6 +21,12 @@
|
||||||
#include "ui.h" // PrintAndLog
|
#include "ui.h" // PrintAndLog
|
||||||
#include "commonutil.h"
|
#include "commonutil.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define PACKED
|
||||||
|
#else
|
||||||
|
#define PACKED __attribute__((packed))
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue