X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/6b882a3918590b9c0f45643323adae9862eedde5..refs/pull/910/head:/client/util.h diff --git a/client/util.h b/client/util.h index 1867519e..5f3335ac 100644 --- a/client/util.h +++ b/client/util.h @@ -15,6 +15,12 @@ #include #include +#ifdef _MSC_VER +#define PACKED +#else +#define PACKED __attribute__((packed)) +#endif + #ifndef ROTR # define ROTR(x,n) (((uintmax_t)(x) >> (n)) | ((uintmax_t)(x) << ((sizeof(x) * 8) - (n)))) #endif @@ -76,6 +82,11 @@ #endif extern int ukbhit(void); +#ifndef _WIN32 +extern char getch(void); +#else +#include +#endif extern void AddLogLine(char *fileName, char *extData, char *c); extern void AddLogHex(char *fileName, char *extData, const uint8_t * data, const size_t len); @@ -86,6 +97,7 @@ extern void FillFileNameByUID(char *fileName, uint8_t * uid, char *ext, int byte // fill buffer from structure [{uint8_t data, size_t length},...] extern int FillBuffer(uint8_t *data, size_t maxDataLength, size_t *dataLength, ...); +extern bool CheckStringIsHEXValue(const char *value); extern 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); @@ -95,6 +107,7 @@ extern char *sprint_hex_inrow_ex(const uint8_t *data, const size_t len, const si 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_ascii_ex(const uint8_t *data, const size_t len, const size_t min_str_len); +extern char *sprint_ascii(const uint8_t *data, const size_t 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);