mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
fix integer representation
This commit is contained in:
parent
164b64a611
commit
736840cce7
1 changed files with 9 additions and 1 deletions
|
@ -216,11 +216,19 @@ static void asn1_tag_dump_boolean(const struct tlv *tlv, const struct asn1_tag *
|
||||||
|
|
||||||
static void asn1_tag_dump_integer(const struct tlv *tlv, const struct asn1_tag *tag, FILE *f, int level) {
|
static void asn1_tag_dump_integer(const struct tlv *tlv, const struct asn1_tag *tag, FILE *f, int level) {
|
||||||
PRINT_INDENT(level);
|
PRINT_INDENT(level);
|
||||||
|
if (tlv->len == 4) {
|
||||||
|
int32_t val = 0;
|
||||||
|
for (int i = 0; i < tlv->len; i++)
|
||||||
|
val = (val << 8) + tlv->value[i];
|
||||||
|
fprintf(f, "\tvalue4b: %d\n", val);
|
||||||
|
return;
|
||||||
|
}
|
||||||
fprintf(f, "\tvalue: %lu\n", asn1_value_integer(tlv, 0, tlv->len * 2));
|
fprintf(f, "\tvalue: %lu\n", asn1_value_integer(tlv, 0, tlv->len * 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *asn1_oid_description(const char *oid, bool with_group_desc) {
|
static char *asn1_oid_description(const char *oid, bool with_group_desc) {
|
||||||
json_error_t error;
|
json_error_t error;
|
||||||
|
json_t *root = NULL;
|
||||||
char fname[300] = {0};
|
char fname[300] = {0};
|
||||||
static char res[300];
|
static char res[300];
|
||||||
memset(res, 0x00, sizeof(res));
|
memset(res, 0x00, sizeof(res));
|
||||||
|
@ -236,7 +244,7 @@ static char *asn1_oid_description(const char *oid, bool with_group_desc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// load `oids.json`
|
// load `oids.json`
|
||||||
json_t *root = json_load_file(fname, 0, &error);
|
root = json_load_file(fname, 0, &error);
|
||||||
|
|
||||||
if (!root || !json_is_object(root)) {
|
if (!root || !json_is_object(root)) {
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue