various stuff
This commit is contained in:
+15
-9
@@ -38,8 +38,12 @@
|
|||||||
|
|
||||||
#include "cmdline.h"
|
#include "cmdline.h"
|
||||||
|
|
||||||
typedef struct
|
unsigned const char default_key[] =
|
||||||
{
|
{ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04,
|
||||||
|
0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
unsigned char cla;
|
unsigned char cla;
|
||||||
unsigned char ins;
|
unsigned char ins;
|
||||||
unsigned char p1;
|
unsigned char p1;
|
||||||
@@ -48,26 +52,28 @@ typedef struct
|
|||||||
unsigned char data[0xff];
|
unsigned char data[0xff];
|
||||||
} APDU;
|
} APDU;
|
||||||
|
|
||||||
static void
|
static void dump_hex(const unsigned char *buf, int len)
|
||||||
dumpHex (unsigned char *buf, int len)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < len; i++) {
|
printf("length: %d\n", len);
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
printf("0x%02x ", buf[i]);
|
printf("0x%02x ", buf[i]);
|
||||||
if(i != 0 && i % 8) {
|
if (i % 8 == 7) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int main(int argc, char *argv[])
|
||||||
main (int argc, char *argv[])
|
|
||||||
{
|
{
|
||||||
struct gengetopt_args_info args_info;
|
struct gengetopt_args_info args_info;
|
||||||
|
|
||||||
if (cmdline_parser (argc, argv, &args_info) != 0)
|
if (cmdline_parser(argc, argv, &args_info) != 0) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
dump_hex(default_key, 24);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user