This commit is contained in:
刘可亮
2024-09-03 11:16:08 +08:00
parent cf270df8d6
commit 803cac77d5
2931 changed files with 614364 additions and 31222 deletions

View File

@@ -112,3 +112,20 @@ void hexdump(unsigned char *buf, unsigned long len, int groupsize)
hex_dump_1(buf, len);
}
}
void hexdump_msg(char *msg, unsigned char *buf, unsigned long len, int groupsize)
{
printf("%s\n", msg);
if (groupsize <= 1) {
hex_dump_1(buf, len);
} else if (groupsize <= 2) {
hex_dump_2(buf, len);
} else if (groupsize <= 4) {
hex_dump_4(buf, len);
} else if (groupsize <= 8) {
hex_dump_8(buf, len);
} else {
hex_dump_1(buf, len);
}
}