diff options
Diffstat (limited to 'src/libirecovery.c')
| -rw-r--r-- | src/libirecovery.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index c7186a0..e82bce2 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -1549,39 +1549,3 @@ irecv_client_t irecv_reconnect(irecv_client_t client, int initial_pause) { | |||
| 1549 | new_client->progress_callback = progress_callback; | 1549 | new_client->progress_callback = progress_callback; |
| 1550 | return new_client; | 1550 | return new_client; |
| 1551 | } | 1551 | } |
| 1552 | |||
| 1553 | void irecv_hexdump(unsigned char* buf, unsigned int len, unsigned int addr) { | ||
| 1554 | int i, j; | ||
| 1555 | printf("0x%08x: ", addr); | ||
| 1556 | for (i = 0; i < (int)len; i++) { | ||
| 1557 | if (i % 16 == 0 && i != 0) { | ||
| 1558 | for (j=i-16; j < i; j++) { | ||
| 1559 | unsigned char car = buf[j]; | ||
| 1560 | if (car < 0x20 || car > 0x7f) car = '.'; | ||
| 1561 | printf("%c", car); | ||
| 1562 | } | ||
| 1563 | printf("\n"); | ||
| 1564 | addr += 0x10; | ||
| 1565 | printf("0x%08x: ", addr); | ||
| 1566 | } | ||
| 1567 | printf("%02x ", buf[i]); | ||
| 1568 | } | ||
| 1569 | |||
| 1570 | int done = (i % 16); | ||
| 1571 | int remains = 16 - done; | ||
| 1572 | if (done > 0) { | ||
| 1573 | for (j = 0; j < remains; j++) { | ||
| 1574 | printf(" "); | ||
| 1575 | } | ||
| 1576 | } | ||
| 1577 | |||
| 1578 | if ((i - done) >= 0) { | ||
| 1579 | if (done == 0 && i > 0) done = 16; | ||
| 1580 | for (j = (i - done); j < i; j++) { | ||
| 1581 | unsigned char car = buf[j]; | ||
| 1582 | if (car < 0x20 || car > 0x7f) car = '.'; | ||
| 1583 | printf("%c", car); | ||
| 1584 | } | ||
| 1585 | } | ||
| 1586 | printf("\n"); | ||
| 1587 | } | ||
