[*] Binary protection state of libmbedtls.so.2.2.1
Partial RELRO No Canary found NX disabled DSO No RPATH No RUNPATH Symbols
[*] Function printf tear down of libmbedtls.so.2.2.1
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libmbedtls.so.2.2.1 @ 0x523c */
| #include <stdint.h>
|
; (fcn) sym.mbedtls_debug_print_buf () | void mbedtls_debug_print_buf (int32_t arg_260h, int32_t arg_264h, int32_t arg_268h, int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_1ch;
| int32_t var_24h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_ch_2;
| int8_t var_10h_2;
| char * s;
| char * var_0h_2;
| int32_t var_0h_3;
| int32_t var_238h;
| int32_t var_23ch;
| r0 = arg1;
| r1 = arg2;
0x0000523c ldr ip, [r0] | ip = *(r0);
0x00005240 cmp ip, 0 |
| if (ip != 0) {
0x00005244 bxeq lr | return;
| }
0x00005248 ldr ip, [ip, 0x10] | ip = *((ip + 0x10));
0x0000524c cmp ip, 0 |
| if (ip != 0) {
0x00005250 bxeq lr | return;
| }
0x00005254 ldr ip, [pc, 0x22c] | ip = *(0x00005488);
0x00005258 add ip, pc, ip |
0x0000525c ldr ip, [ip] | ip = *(ip);
0x00005260 cmp ip, r1 |
| if (ip >= r1) {
0x00005264 bxlt lr | return;
| }
0x00005268 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0000526c sub sp, sp, 0x23c |
0x00005270 mov r8, r3 | r8 = r3;
0x00005274 str r3, [sp, 0x18] | var_18h = r3;
0x00005278 mov r6, r2 | r6 = r2;
0x0000527c ldr r3, [sp, 0x268] | r3 = *(arg_268h);
0x00005280 str r2, [sp, 0x14] | var_14h = r2;
0x00005284 ldr r2, [pc, 0x200] | r2 = *(0x5488);
0x00005288 add r7, sp, 0x38 | r7 += s;
0x0000528c mov r4, r0 | r4 = r0;
0x00005290 mov r5, r1 | r5 = r1;
0x00005294 str r1, [sp, 0x10] | var_10h = r1;
0x00005298 str r0, [sp, 0xc] | var_ch = r0;
0x0000529c str r3, [sp] | *(sp) = r3;
0x000052a0 add r2, pc, r2 | r2 = pc + r2;
0x000052a4 ldr r3, [sp, 0x260] | r3 = *(arg_260h);
0x000052a8 mov r1, 0x200 | r1 = 0x200;
0x000052ac mov r0, r7 | r0 = r7;
0x000052b0 bl 0x448c | snprintf (r0, r1, r2, r3)
0x000052b4 ldr ip, [r4] | ip = *(r4);
0x000052b8 mov r3, r8 | r3 = r8;
0x000052bc ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x000052c0 mov r2, r6 | r2 = r6;
0x000052c4 str r7, [sp] | *(sp) = r7;
0x000052c8 mov r1, r5 | r1 = r5;
0x000052cc ldr r4, [ip, 0x10] | r4 = *((ip + 0x10));
0x000052d0 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x000052d4 ldr r3, [sp, 0x268] | r3 = *(arg_268h);
0x000052d8 mov r4, 0 | r4 = 0;
0x000052dc add r8, sp, 0x24 | r8 += var_24h;
0x000052e0 cmp r3, 0 |
0x000052e4 str r4, [r8, 4] | var_4h = r4;
0x000052e8 str r4, [sp, 0x24] | var_24h = r4;
0x000052ec str r4, [r8, 8] | var_8h = r4;
0x000052f0 str r4, [r8, 0xc] | var_ch_2 = r4;
0x000052f4 strb r4, [r8, 0x10] | var_10h_2 = r4;
| if (r3 == 0) {
0x000052f8 beq 0x5480 | goto label_0;
| }
0x000052fc ldr r3, [sp, 0x264] | r3 = *(arg_264h);
0x00005300 ldr fp, [pc, 0x188] | fp = *(0x548c);
0x00005304 sub sb, r3, 1 | sb = r3 - 1;
0x00005308 ldr r3, [pc, 0x184] | r3 = *(0x5490);
0x0000530c ldr sl, [pc, 0x184] | sl = *(0x5494);
0x00005310 add r3, pc, r3 | r3 = pc + r3;
0x00005314 mov r5, r4 | r5 = r4;
0x00005318 mov lr, 0x200 | lr = 0x200;
0x0000531c str r3, [sp, 0x1c] | var_1ch = r3;
0x00005320 add fp, pc, fp |
0x00005324 add sl, pc, sl | sl = pc + sl;
0x00005328 b 0x5334 |
| while (r2 != r5) {
0x0000532c cmp r5, 0x1000 |
| if (r5 == 0x1000) {
0x00005330 beq 0x544c | goto label_1;
| }
0x00005334 add ip, r7, r4 |
0x00005338 ands r6, r5, 0xf | r6 = r5 & 0xf;
0x0000533c mov r3, r8 | r3 = r8;
0x00005340 mov r2, fp | r2 = fp;
0x00005344 mov r1, lr | r1 = lr;
0x00005348 mov r0, ip | r0 = ip;
| if (r6 == r5) {
0x0000534c bne 0x53c0 |
0x00005350 cmp r5, 0 |
| if (r5 != 0) {
0x00005354 beq 0x53a0 |
0x00005358 bl 0x448c | snprintf (r0, r1, r2, r3)
0x0000535c ldr r3, [sp, 0xc] | r3 = var_ch;
0x00005360 ldr r2, [sp, 0x14] | r2 = var_14h;
0x00005364 ldr ip, [r3] | ip = *(r3);
0x00005368 ldr r1, [sp, 0x10] | r1 = var_10h;
0x0000536c ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x00005370 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00005374 str r7, [sp] | *(sp) = r7;
0x00005378 ldr r4, [ip, 0x10] | r4 = *((ip + 0x10));
0x0000537c blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00005380 mov r4, r6 | r4 = r6;
0x00005384 mov lr, 0x200 | lr = 0x200;
0x00005388 mov ip, r7 |
0x0000538c str r6, [r8] | *(r8) = r6;
0x00005390 str r6, [r8, 4] | var_4h = r6;
0x00005394 str r6, [r8, 8] | var_8h = r6;
0x00005398 str r6, [r8, 0xc] | var_ch_2 = r6;
0x0000539c strb r6, [r8, 0x10] | var_10h_2 = r6;
| }
0x000053a0 mov r1, lr | r1 = lr;
0x000053a4 mov r0, ip | r0 = ip;
0x000053a8 add r4, r4, 6 | r4 += 6;
0x000053ac mov r3, r5 | r3 = r5;
0x000053b0 ldr r2, [sp, 0x1c] | r2 = var_1ch;
0x000053b4 bl 0x448c | snprintf (r0, r1, r2, r3)
0x000053b8 add ip, r7, r4 |
0x000053bc rsb lr, r4, 0x200 | lr = 0x200 - r4;
| }
0x000053c0 ldrb r3, [sb, 1]! | r3 = *((sb += 1));
0x000053c4 mov r1, lr | r1 = lr;
0x000053c8 mov r2, sl | r2 = sl;
0x000053cc mov r0, ip | r0 = ip;
0x000053d0 bl 0x448c | snprintf (r0, r1, r2, r3)
0x000053d4 ldrb r3, [sb] | r3 = *(sb);
0x000053d8 add r4, r4, 3 | r4 += 3;
0x000053dc sub r2, r3, 0x20 | r2 = r3 - 0x20;
0x000053e0 cmp r2, 0x5e |
0x000053e4 add r2, sp, 0x238 | r2 += var_238h;
0x000053e8 add r6, r2, r6 | r6 = r2 + r6;
0x000053ec ldr r2, [sp, 0x268] | r2 = *(arg_268h);
0x000053f0 add r5, r5, 1 | r5++;
| if (r2 <= 0x5e) {
0x000053f4 movhi r3, 0x2e | r3 = 0x2e;
| }
0x000053f8 rsb lr, r4, 0x200 | lr = 0x200 - r4;
0x000053fc cmp r2, r5 |
0x00005400 strb r3, [r6, -0x214] | var_24h = r3;
0x00005404 mov r1, lr | r1 = lr;
0x00005408 add r0, r7, r4 | r0 = r7 + r4;
0x0000540c bne 0x532c |
| }
0x00005410 tst r5, 0xf |
| if ((r5 & 0xf) == 0) {
0x00005414 beq 0x544c | goto label_1;
| }
0x00005418 ldr r6, [pc, 0x7c] | r6 = *(0x5498);
0x0000541c add r6, pc, r6 | r6 = pc + r6;
0x00005420 b 0x5428 |
| while ((r5 & 0xf) != 0) {
0x00005424 rsb r1, r4, 0x200 | r1 = 0x200 - r4;
0x00005428 add r0, r7, r4 | r0 = r7 + r4;
0x0000542c add r5, r5, 1 | r5++;
0x00005430 mov r2, r6 | r2 = r6;
0x00005434 bl 0x448c | snprintf (r0, r1, r2, r3)
0x00005438 tst r5, 0xf |
0x0000543c add r4, r4, 3 | r4 += 3;
0x00005440 bne 0x5424 |
| }
0x00005444 add r0, r7, r4 | r0 = r7 + r4;
0x00005448 rsb r1, r4, 0x200 | r1 = 0x200 - r4;
| label_1:
0x0000544c ldr r2, [pc, 0x4c] | r2 = *(0x549c);
0x00005450 mov r3, r8 | r3 = r8;
0x00005454 add r2, pc, r2 | r2 = pc + r2;
0x00005458 bl 0x448c | snprintf (r0, r1, r2, r3)
0x0000545c ldr r3, [sp, 0xc] | r3 = var_ch;
0x00005460 ldr r2, [sp, 0x14] | r2 = var_14h;
0x00005464 ldr ip, [r3] | ip = *(r3);
0x00005468 ldr r1, [sp, 0x10] | r1 = var_10h;
0x0000546c ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x00005470 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00005474 str r7, [sp] | *(sp) = r7;
0x00005478 ldr r4, [ip, 0x10] | r4 = *((ip + 0x10));
0x0000547c blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
| label_0:
0x00005480 add sp, sp, 0x23c |
0x00005484 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libmbedtls.so.2.2.1 @ 0x55c0 */
| #include <stdint.h>
|
; (fcn) sym.mbedtls_debug_print_crt () | void mbedtls_debug_print_crt (int32_t arg_868h, int32_t arg_86ch, int32_t arg1, uint32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| char * s;
| int32_t var_20h;
| int32_t var_24h;
| int32_t var_28h;
| int32_t var_2ch;
| int32_t var_30h;
| int32_t var_3fh;
| int32_t var_40h;
| void * s1;
| int8_t var_600h;
| int32_t var_4h_3;
| int32_t var_8h;
| int32_t var_ch_2;
| int32_t var_24h_2;
| int32_t var_440h;
| int32_t var_840h;
| int32_t var_0h_2;
| int32_t var_4h_2;
| r0 = arg1;
| r1 = arg2;
0x000055c0 ldr ip, [r0] | ip = *(r0);
0x000055c4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000055c8 sub sp, sp, 0x840 |
0x000055cc sub sp, sp, 4 |
0x000055d0 cmp ip, 0 |
0x000055d4 ldr r4, [sp, 0x86c] | r4 = *(arg_86ch);
| if (ip == 0) {
0x000055d8 beq 0x55f8 | goto label_4;
| }
0x000055dc ldr lr, [ip, 0x10] |
0x000055e0 clz ip, r4 |
0x000055e4 lsr ip, ip, 5 |
0x000055e8 cmp lr, 0 |
| if (lr != 0) {
0x000055ec moveq ip, 1 |
| }
0x000055f0 cmp ip, 0 |
0x000055f4 beq 0x5604 |
| while (lr < r1) {
| label_4:
0x000055f8 add sp, sp, 0x840 |
0x000055fc add sp, sp, 4 |
0x00005600 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00005604 ldr lr, [pc, 0x270] |
0x00005608 add lr, pc, lr | lr = pc + lr;
0x0000560c ldr lr, [lr] |
0x00005610 cmp lr, r1 |
0x00005614 blt 0x55f8 |
| }
0x00005618 mov sl, r3 | sl = r3;
0x0000561c ldr r3, [pc, 0x25c] | r3 = *(0x587c);
0x00005620 mov sb, r2 | sb = r2;
0x00005624 add r3, pc, r3 | r3 = pc + r3;
0x00005628 str r3, [sp, 0x10] | var_10h = r3;
0x0000562c ldr r3, [pc, 0x250] | r3 = *(0x5880);
0x00005630 mov fp, r1 |
0x00005634 add r3, pc, r3 | r3 = pc + r3;
0x00005638 str r3, [sp, 0x14] | var_14h = r3;
0x0000563c add r3, sp, 0x40 | r3 += var_40h;
0x00005640 str r3, [sp, 0x1c] | s = r3;
0x00005644 mov r8, r0 | r8 = r0;
0x00005648 add r3, sp, 0x440 | r3 += var_440h;
0x0000564c add r5, sp, 0x240 | r5 += s1;
0x00005650 str ip, [sp, 0xc] | var_ch = ip;
0x00005654 str r3, [sp, 0x18] | var_18h = r3;
| label_0:
0x00005658 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0000565c ldr r6, [sp, 0x1c] | r6 = s;
0x00005660 add r3, r3, 1 | r3++;
0x00005664 str r3, [sp, 0xc] | var_ch = r3;
0x00005668 str r3, [sp] | *(sp) = r3;
0x0000566c ldr r2, [sp, 0x10] | r2 = var_10h;
0x00005670 ldr r3, [sp, 0x868] | r3 = *(arg_868h);
0x00005674 mov r1, 0x200 | r1 = 0x200;
0x00005678 mov r0, r6 | r0 = r6;
0x0000567c bl 0x448c | snprintf (r0, r1, r2, r3)
0x00005680 ldr ip, [r8] | ip = *(r8);
0x00005684 mov r3, sl | r3 = sl;
0x00005688 ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x0000568c mov r2, sb | r2 = sb;
0x00005690 str r6, [sp] | *(sp) = r6;
0x00005694 mov r1, fp | r1 = fp;
0x00005698 ldr r6, [ip, 0x10] | r6 = *((ip + 0x10));
0x0000569c blx r6 | uint32_t (*r6)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x000056a0 ldr r6, [sp, 0x18] | r6 = var_18h;
0x000056a4 mov r3, r4 | r3 = r4;
0x000056a8 ldr r2, [sp, 0x14] | r2 = var_14h;
0x000056ac ldr r1, [pc, 0x1d4] | r1 = *(0x5884);
0x000056b0 mov r0, r6 | r0 = r6;
0x000056b4 bl 0x44c8 | mbedtls_x509_crt_info ();
0x000056b8 ldrb r3, [sp, 0x440] | r3 = var_440h;
0x000056bc cmp r3, 0 |
| if (r3 == 0) {
0x000056c0 beq 0x5730 | goto label_5;
| }
0x000056c4 mov r1, r6 | r1 = r6;
0x000056c8 add r6, r6, 1 | r6++;
| do {
0x000056cc cmp r3, 0xa |
| if (r3 == 0xa) {
0x000056d0 bne 0x5724 |
0x000056d4 ldr r3, [pc, 0x1b0] | r3 = *(0x5888);
0x000056d8 sub r7, r6, r1 | r7 = r6 - r1;
0x000056dc cmp r7, r3 |
| if (r7 < r3) {
0x000056e0 movhs r7, r3 | r7 = r3;
| }
0x000056e4 mov r2, r7 | r2 = r7;
0x000056e8 mov r0, r5 | r0 = r5;
0x000056ec bl 0x4558 | memcpy (r0, r1, r2);
0x000056f0 ldr r1, [r8] | r1 = *(r8);
0x000056f4 add r3, sp, 0x840 | r3 += var_840h;
0x000056f8 add r7, r3, r7 | r7 = r3 + r7;
0x000056fc mov r3, 0 | r3 = 0;
0x00005700 strb r3, [r7, -0x600] | var_600h = r3;
0x00005704 mov r2, sb | r2 = sb;
0x00005708 ldr r0, [r1, 0x14] | r0 = *((r1 + 0x14));
0x0000570c mov r3, sl | r3 = sl;
0x00005710 str r5, [sp] | *(sp) = r5;
0x00005714 ldr r7, [r1, 0x10] | r7 = *((r1 + 0x10));
0x00005718 mov r1, fp | r1 = fp;
0x0000571c blx r7 | uint32_t (*r7)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00005720 mov r1, r6 | r1 = r6;
| }
0x00005724 ldrb r3, [r6], 1 | r3 = *(r6);
| r6++;
0x00005728 cmp r3, 0 |
0x0000572c bne 0x56cc |
| } while (r3 != 0);
| label_5:
0x00005730 mov r2, 0x24 | r2 = 0x24;
0x00005734 mov r1, 0 | r1 = 0;
0x00005738 mov r0, r5 | r0 = r5;
0x0000573c bl 0x48f4 | memset (r0, r1, r2);
0x00005740 mov r1, r5 | r1 = r5;
0x00005744 add r0, r4, 0xbc | r0 = r4 + 0xbc;
0x00005748 bl 0x4a20 | r0 = mbedtls_pk_debug ();
0x0000574c cmp r0, 0 |
| if (r0 == 0) {
0x00005750 beq 0x5794 | goto label_6;
| }
0x00005754 ldr r2, [pc, 0x134] | r2 = *(0x588c);
0x00005758 ldr r1, [r8] | r1 = *(r8);
0x0000575c add r2, pc, r2 | r2 = pc + r2;
0x00005760 ldr r0, [r1, 0x14] | r0 = *((r1 + 0x14));
0x00005764 mov r3, sl | r3 = sl;
0x00005768 str r2, [sp] | *(sp) = r2;
0x0000576c mov r2, sb | r2 = sb;
0x00005770 ldr r6, [r1, 0x10] | r6 = *((r1 + 0x10));
0x00005774 mov r1, fp | r1 = fp;
0x00005778 blx r6 | uint32_t (*r6)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
| label_1:
0x0000577c ldr r4, [r4, 0x134] | r4 = *((r4 + 0x134));
0x00005780 cmp r4, 0 |
| if (r4 != 0) {
0x00005784 bne 0x5658 | goto label_0;
| }
0x00005788 add sp, sp, 0x840 |
0x0000578c add sp, sp, 4 |
0x00005790 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_6:
0x00005794 ldr r3, [pc, 0xf8] | r3 = *(0x5890);
0x00005798 mov r6, r5 | r6 = r5;
0x0000579c add r3, pc, r3 | r3 = pc + r3;
0x000057a0 str r3, [sp, 0x20] | var_20h = r3;
0x000057a4 ldr r3, [pc, 0xec] | r3 = *(0x5894);
0x000057a8 add r3, pc, r3 | r3 = pc + r3;
0x000057ac str r3, [sp, 0x24] | var_24h = r3;
0x000057b0 ldr r3, [pc, 0xe4] | r3 = *(0x5898);
0x000057b4 add r3, pc, r3 | r3 = pc + r3;
0x000057b8 str r3, [sp, 0x2c] | var_2ch = r3;
0x000057bc add r3, r5, 0x24 | r3 += var_24h_2;
0x000057c0 str r3, [sp, 0x28] | var_28h = r3;
| label_2:
0x000057c4 ldr ip, [r6] | ip = *(r6);
0x000057c8 add r7, sp, 0x30 | r7 += var_30h;
0x000057cc cmp ip, 0 |
0x000057d0 ldr r3, [sp, 0x20] | r3 = var_20h;
0x000057d4 ldr r2, [sp, 0x24] | r2 = var_24h;
0x000057d8 mov r1, 0x10 | r1 = 0x10;
0x000057dc mov r0, r7 | r0 = r7;
| if (ip == 0) {
0x000057e0 beq 0x577c | goto label_1;
| }
0x000057e4 ldr ip, [r6, 4] | ip = var_4h_3;
0x000057e8 str ip, [sp] | *(sp) = ip;
0x000057ec bl 0x448c | snprintf (r0, r1, r2, r3)
0x000057f0 ldr r0, [r6] | r0 = *(r6);
0x000057f4 mov ip, 0 |
0x000057f8 cmp r0, 1 |
0x000057fc mov r3, sl | r3 = sl;
0x00005800 mov r2, sb | r2 = sb;
0x00005804 mov r1, fp | r1 = fp;
0x00005808 strb ip, [sp, 0x3f] | var_3fh = ip;
| if (r0 == 1) {
0x0000580c beq 0x5844 | goto label_7;
| }
0x00005810 cmp r0, 2 |
| if (r0 == 2) {
0x00005814 beq 0x5860 | goto label_8;
| }
0x00005818 ldr ip, [r8] | ip = *(r8);
0x0000581c ldr lr, [sp, 0x2c] | lr = var_2ch;
0x00005820 ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x00005824 str lr, [sp] |
0x00005828 ldr r7, [ip, 0x10] | r7 = *((ip + 0x10));
0x0000582c blx r7 | uint32_t (*r7)(uint32_t) (r0);
| label_3:
0x00005830 ldr r3, [sp, 0x28] | r3 = var_28h;
0x00005834 add r6, r6, 0xc | r6 += var_ch_2;
0x00005838 cmp r6, r3 |
| if (r6 != r3) {
0x0000583c bne 0x57c4 | goto label_2;
| }
0x00005840 b 0x577c | goto label_1;
| label_7:
0x00005844 ldr r3, [r6, 8] | r3 = var_8h;
0x00005848 mov r0, r8 | r0 = r8;
0x0000584c str r3, [sp, 4] | var_4h = r3;
0x00005850 str r7, [sp] | *(sp) = r7;
0x00005854 mov r3, sl | r3 = sl;
0x00005858 bl 0x49fc | fcn_000049fc ();
0x0000585c b 0x5830 | goto label_3;
| label_8:
0x00005860 ldr r3, [r6, 8] | r3 = var_8h;
0x00005864 mov r0, r8 | r0 = r8;
0x00005868 str r3, [sp, 4] | var_4h = r3;
0x0000586c str r7, [sp] | *(sp) = r7;
0x00005870 mov r3, sl | r3 = sl;
0x00005874 bl 0x4ba0 | fcn_00004ba0 ();
0x00005878 b 0x5830 | goto label_3;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libmbedtls.so.2.2.1 @ 0x54ec */
| #include <stdint.h>
|
; (fcn) sym.mbedtls_debug_print_ecp.part.2 () | void mbedtls_debug_print_ecp_part_2 (int32_t arg_228h, int32_t arg_22ch, int32_t arg1, int32_t arg2) {
| char * s;
| r0 = arg1;
| r1 = arg2;
0x000054ec push {r4, r5, r6, r7, r8, sb, lr} |
0x000054f0 mov r8, r2 | r8 = r2;
0x000054f4 sub sp, sp, 0x20c |
0x000054f8 ldr r2, [pc, 0x78] | r2 = *(0x5574);
0x000054fc ldr r5, [sp, 0x22c] | r5 = *(arg_22ch);
0x00005500 add r4, sp, 8 | r4 += s;
0x00005504 mov r6, r0 | r6 = r0;
0x00005508 mov r7, r1 | r7 = r1;
0x0000550c mov sb, r3 | sb = r3;
0x00005510 mov r0, r4 | r0 = r4;
0x00005514 ldr r3, [sp, 0x228] | r3 = *(arg_228h);
0x00005518 add r2, pc, r2 | r2 = pc + r2;
0x0000551c mov r1, 0x200 | r1 = 0x200;
0x00005520 bl 0x448c | snprintf (r0, r1, r2, r3)
0x00005524 stm sp, {r4, r5} | *(sp) = r4;
| *((sp + 4)) = r5;
0x00005528 mov r3, sb | r3 = sb;
0x0000552c mov r2, r8 | r2 = r8;
0x00005530 mov r1, r7 | r1 = r7;
0x00005534 mov r0, r6 | r0 = r6;
0x00005538 bl 0x49fc | fcn_000049fc ();
0x0000553c ldr r2, [pc, 0x38] | r2 = *(0x5578);
0x00005540 ldr r3, [sp, 0x228] | r3 = *(arg_228h);
0x00005544 mov r0, r4 | r0 = r4;
0x00005548 add r2, pc, r2 | r2 = pc + r2;
0x0000554c mov r1, 0x200 | r1 = 0x200;
0x00005550 add r5, r5, 0xc | r5 += 0xc;
0x00005554 bl 0x448c | snprintf (r0, r1, r2, r3)
0x00005558 stm sp, {r4, r5} | *(sp) = r4;
| *((sp + 4)) = r5;
0x0000555c mov r3, sb | r3 = sb;
0x00005560 mov r2, r8 | r2 = r8;
0x00005564 mov r1, r7 | r1 = r7;
0x00005568 mov r0, r6 | r0 = r6;
0x0000556c bl 0x49fc | fcn_000049fc ();
0x00005570 add sp, sp, 0x20c |
0x00005574 pop {r4, r5, r6, r7, r8, sb, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libmbedtls.so.2.2.1 @ 0x4dfc */
| #include <stdint.h>
|
; (fcn) sym.mbedtls_debug_print_mpi.part.1 () | void mbedtls_debug_print_mpi_part_1 (int32_t arg_8h, int32_t arg_250h, int32_t arg_254h, int32_t arg_ch, int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_1ch;
| int32_t var_20h;
| int32_t var_24h;
| char * s;
| r0 = arg1;
| r1 = arg2;
0x00004dfc push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00004e00 sub sp, sp, 0x22c |
0x00004e04 ldr fp, [sp, 0x254] | fp = *(arg_254h);
0x00004e08 str r0, [sp, 0x14] | var_14h = r0;
0x00004e0c ldr r0, [fp, 4] | r0 = *(arg_ch);
0x00004e10 str r1, [sp, 0x18] | var_18h = r1;
0x00004e14 subs r7, r0, 1 | r7 = r0 - 1;
0x00004e18 str r2, [sp, 0x1c] | var_1ch = r2;
0x00004e1c str r3, [sp, 0x20] | var_20h = r3;
0x00004e20 ldr r1, [fp, 8] | r1 = *(arg_8h);
| if (r7 == r0) {
0x00004e24 beq 0x5084 | goto label_6;
| }
0x00004e28 ldr r2, [r1, r7, lsl 2] | offset_0 = r7 << 2;
| r2 = *((r1 + offset_0));
0x00004e2c cmp r2, 0 |
| if (r2 == 0) {
0x00004e30 lslne ip, r7, 5 |
| }
| if (r2 == 0) {
0x00004e34 addne lr, ip, 1 | lr = ip + 1;
| }
| if (r2 == 0) {
0x00004e38 movne r7, r0 | r7 = r0;
| }
| if (r2 != 0) {
0x00004e3c bne 0x4e70 | goto label_4;
| }
0x00004e40 sub r3, r0, 0xc0000001 | r3 = r0 - 0xc0000001;
0x00004e44 add r3, r1, r3, lsl 2 | r3 = r1 + (r3 << 2);
0x00004e48 b 0x4e5c |
| while (ip != r7) {
0x00004e4c ldr r2, [r3, -4]! | r2 = *((r3 -= 4));
0x00004e50 cmp r2, 0 |
| if (r2 != 0) {
0x00004e54 bne 0x5054 | goto label_7;
| }
0x00004e58 mov r7, ip | r7 = ip;
0x00004e5c subs ip, r7, 1 |
0x00004e60 bne 0x4e4c |
| }
0x00004e64 ldr r2, [r1] | r2 = *(r1);
0x00004e68 mov r7, 1 | r7 = 1;
0x00004e6c mov lr, r7 | lr = r7;
| label_4:
0x00004e70 mov r3, 0x1f | r3 = 0x1f;
0x00004e74 b 0x4e80 |
| while ((r1 & 1) == 0) {
0x00004e78 subs r3, r3, 1 | r3--;
| if (r3 <= r3) {
0x00004e7c blo 0x4e90 | goto label_8;
| }
0x00004e80 lsr r1, r2, r3 | r1 = r2 >> r3;
0x00004e84 tst r1, 1 |
0x00004e88 beq 0x4e78 |
| }
0x00004e8c add ip, r3, lr |
| label_8:
0x00004e90 ldr r2, [pc, 0x200] | r2 = *(0x5094);
0x00004e94 add sl, sp, 0x28 | sl += s;
0x00004e98 str ip, [sp] | *(sp) = ip;
0x00004e9c ldr r3, [sp, 0x250] | r3 = *(arg_250h);
0x00004ea0 add r2, pc, r2 | r2 = pc + r2;
0x00004ea4 mov r1, 0x200 | r1 = 0x200;
0x00004ea8 mov r0, sl | r0 = sl;
0x00004eac bl 0x448c | snprintf (r0, r1, r2, r3)
0x00004eb0 ldr r3, [sp, 0x14] | r3 = var_14h;
0x00004eb4 ldr r2, [sp, 0x1c] | r2 = var_1ch;
0x00004eb8 ldr ip, [r3] | ip = *(r3);
0x00004ebc ldr r1, [sp, 0x18] | r1 = var_18h;
0x00004ec0 ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x00004ec4 ldr r3, [sp, 0x20] | r3 = var_20h;
0x00004ec8 str sl, [sp] | *(sp) = sl;
0x00004ecc ldr r4, [ip, 0x10] | r4 = *((ip + 0x10));
0x00004ed0 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00004ed4 cmp r7, 0 |
| if (r7 == 0) {
0x00004ed8 beq 0x5060 | goto label_9;
| }
0x00004edc ldr r3, [pc, 0x1b8] | r3 = *(0x5098);
0x00004ee0 sub r8, r7, 0xc0000001 | r8 = r7 - 0xc0000001;
0x00004ee4 add r3, pc, r3 | r3 = pc + r3;
0x00004ee8 str r3, [sp, 0x24] | var_24h = r3;
0x00004eec ldr r3, [pc, 0x1ac] | r3 = *(0x509c);
0x00004ef0 mov r4, 0 | r4 = 0;
0x00004ef4 add r3, pc, r3 | r3 = pc + r3;
0x00004ef8 lsl r8, r8, 2 | r8 <<= 2;
0x00004efc mov sb, 1 | sb = 1;
0x00004f00 str r3, [sp, 0xc] | var_ch = r3;
0x00004f04 str r4, [sp, 0x10] | var_10h = r4;
| label_0:
0x00004f08 cmp sb, 0 |
| if (sb != 0) {
0x00004f0c beq 0x4f28 |
0x00004f10 ldr r3, [fp, 8] | r3 = *(arg_8h);
0x00004f14 ldr r3, [r3, r8] | r3 = *((r3 + r8));
0x00004f18 cmp r3, 0 |
| if (r3 == 0) {
0x00004f1c beq 0x4f98 | goto label_3;
| }
0x00004f20 lsrs r2, r3, 0x18 | r2 = r3 >> 0x18;
| if (r2 == r3) {
0x00004f24 beq 0x502c | goto label_10;
| }
| }
0x00004f28 mov sb, 3 | sb = 3;
| label_2:
0x00004f2c ldr r5, [sp, 0x10] | r5 = var_10h;
0x00004f30 lsl r6, sb, 3 | r6 = sb << 3;
| do {
0x00004f34 tst r5, 0xf |
| if ((r5 & 0xf) != 0) {
0x00004f38 moveq r3, 1 | r3 = 1;
| }
| if ((r5 & 0xf) == 0) {
0x00004f3c movne r3, 0 | r3 = 0;
| }
0x00004f40 cmp r5, 0 |
| if (r5 != 0) {
0x00004f44 moveq r3, 0 | r3 = 0;
| }
0x00004f48 cmp r3, 0 |
0x00004f4c add r0, sl, r4 | r0 = sl + r4;
0x00004f50 rsb r1, r4, 0x200 | r1 = 0x200 - r4;
| if (r3 != 0) {
0x00004f54 bne 0x4ff0 | goto label_11;
| }
| label_1:
0x00004f58 ldr r3, [fp, 8] | r3 = *(arg_8h);
0x00004f5c ldr r2, [sp, 0xc] | r2 = var_ch;
0x00004f60 ldr r3, [r3, r8] | r3 = *((r3 + r8));
0x00004f64 add r4, r4, 3 | r4 += 3;
0x00004f68 lsr r3, r3, r6 | r3 >>= r6;
0x00004f6c sub r6, r6, 8 | r6 -= 8;
0x00004f70 and r3, r3, 0xff | r3 &= 0xff;
0x00004f74 bl 0x448c | snprintf (r0, r1, r2, r3)
0x00004f78 cmn r6, 8 |
0x00004f7c add r5, r5, 1 | r5++;
0x00004f80 bne 0x4f34 |
| } while (r6 != 8);
0x00004f84 ldr r3, [sp, 0x10] | r3 = var_10h;
0x00004f88 add r3, r3, 1 | r3++;
0x00004f8c add r3, sb, r3 | r3 = sb + r3;
0x00004f90 mov sb, 0 | sb = 0;
0x00004f94 str r3, [sp, 0x10] | var_10h = r3;
| label_3:
0x00004f98 subs r7, r7, 1 | r7--;
0x00004f9c sub r8, r8, 4 | r8 -= 4;
| if (r7 != r7) {
0x00004fa0 bne 0x4f08 | goto label_0;
| }
0x00004fa4 cmp sb, 1 |
0x00004fa8 add r0, sl, r4 | r0 = sl + r4;
0x00004fac rsb r1, r4, 0x200 | r1 = 0x200 - r4;
| if (sb != 1) {
0x00004fb0 moveq r7, r4 | r7 = r4;
| }
| if (sb == 1) {
0x00004fb4 beq 0x5068 | goto label_12;
| }
| label_5:
0x00004fb8 ldr r2, [pc, 0xe4] | r2 = *(0x50a0);
0x00004fbc add r2, pc, r2 | r2 = pc + r2;
0x00004fc0 bl 0x448c | snprintf (r0, r1, r2, r3)
0x00004fc4 ldr r3, [sp, 0x14] | r3 = var_14h;
0x00004fc8 ldr r2, [sp, 0x1c] | r2 = var_1ch;
0x00004fcc ldr ip, [r3] | ip = *(r3);
0x00004fd0 ldr r1, [sp, 0x18] | r1 = var_18h;
0x00004fd4 ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x00004fd8 ldr r3, [sp, 0x20] | r3 = var_20h;
0x00004fdc str sl, [sp] | *(sp) = sl;
0x00004fe0 ldr r4, [ip, 0x10] | r4 = *((ip + 0x10));
0x00004fe4 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x00004fe8 add sp, sp, 0x22c |
0x00004fec pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_11:
0x00004ff0 ldr r2, [sp, 0x24] | r2 = var_24h;
0x00004ff4 bl 0x448c | snprintf (r0, r1, r2, r3)
0x00004ff8 ldr r3, [sp, 0x14] | r3 = var_14h;
0x00004ffc ldr r1, [sp, 0x18] | r1 = var_18h;
0x00005000 ldr ip, [r3] | ip = *(r3);
0x00005004 ldr r2, [sp, 0x1c] | r2 = var_1ch;
0x00005008 ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x0000500c ldr r3, [sp, 0x20] | r3 = var_20h;
0x00005010 str sl, [sp] | *(sp) = sl;
0x00005014 ldr r4, [ip, 0x10] | r4 = *((ip + 0x10));
0x00005018 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x0000501c mov r4, 0 | r4 = 0;
0x00005020 mov r1, 0x200 | r1 = 0x200;
0x00005024 mov r0, sl | r0 = sl;
0x00005028 b 0x4f58 | goto label_1;
| label_10:
0x0000502c lsrs r2, r3, 0x10 | r2 = r3 >> 0x10;
| if (r2 != r3) {
0x00005030 movne sb, 2 | sb = 2;
| goto label_13;
| }
| if (r2 != r3) {
| label_13:
0x00005034 bne 0x4f2c | goto label_2;
| }
0x00005038 lsr r2, r3, 8 | r2 = r3 >> 8;
0x0000503c ands r2, r2, 0xff | r2 &= 0xff;
| if (r2 != r2) {
0x00005040 bne 0x4f2c | goto label_2;
| }
0x00005044 tst r3, 0xff |
| if ((r3 & 0xff) != 0) {
0x00005048 movne sb, r2 | sb = r2;
| goto label_14;
| }
| if ((r3 & 0xff) != 0) {
| label_14:
0x0000504c bne 0x4f2c | goto label_2;
| }
0x00005050 b 0x4f98 | goto label_3;
| label_7:
0x00005054 lsl ip, ip, 5 |
0x00005058 add lr, ip, 1 | lr = ip + 1;
0x0000505c b 0x4e70 | goto label_4;
| label_9:
0x00005060 mov r1, 0x200 | r1 = 0x200;
0x00005064 mov r0, sl | r0 = sl;
| label_12:
0x00005068 ldr r2, [pc, 0x38] | r2 = *(0x50a4);
0x0000506c add r7, r7, 3 | r7 += 3;
0x00005070 add r2, pc, r2 | r2 = pc + r2;
0x00005074 bl 0x448c | snprintf (r0, r1, r2, r3)
0x00005078 add r0, sl, r7 | r0 = sl + r7;
0x0000507c rsb r1, r7, 0x200 | r1 = 0x200 - r7;
0x00005080 b 0x4fb8 | goto label_5;
| label_6:
0x00005084 mov ip, r7 |
0x00005088 mov r7, 1 | r7 = 1;
0x0000508c ldr r2, [r1] | r2 = *(r1);
0x00005090 mov lr, r7 | lr = r7;
0x00005094 b 0x4e70 | goto label_4;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libmbedtls.so.2.2.1 @ 0x5178 */
| #include <stdint.h>
|
; (fcn) sym.mbedtls_debug_print_ret () | void mbedtls_debug_print_ret (int32_t arg_220h, int32_t arg_224h, int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| char * s;
| int32_t var_208h;
| r0 = arg1;
| r1 = arg2;
0x00005178 ldr ip, [r0] | ip = *(r0);
0x0000517c cmp ip, 0 |
| if (ip != 0) {
0x00005180 bxeq lr | return;
| }
0x00005184 ldr ip, [ip, 0x10] | ip = *((ip + 0x10));
0x00005188 cmp ip, 0 |
| if (ip != 0) {
0x0000518c bxeq lr | return;
| }
0x00005190 push {r4, r5, r6, r7, r8, lr} |
0x00005194 ldr lr, [pc, 0x98] |
0x00005198 sub sp, sp, 0x208 |
0x0000519c ldr ip, [sp, 0x224] | ip = *(arg_224h);
0x000051a0 add lr, pc, lr | lr = pc + lr;
0x000051a4 ldr lr, [lr] |
0x000051a8 cmn ip, 0x6900 |
| if (ip == 0x6900) {
0x000051ac movne ip, 0 |
| }
| if (ip != 0x6900) {
0x000051b0 moveq ip, 1 |
| }
0x000051b4 cmp lr, r1 |
| if (lr >= r1) {
0x000051b8 orrlt ip, ip, 1 |
| }
0x000051bc cmp ip, 0 |
| if (ip != 0) {
0x000051c0 beq 0x51cc |
0x000051c4 add sp, sp, 0x208 |
0x000051c8 pop {r4, r5, r6, r7, r8, pc} |
| }
0x000051cc mov r5, r2 | r5 = r2;
0x000051d0 ldr r2, [sp, 0x224] | r2 = *(arg_224h);
0x000051d4 mov r6, r3 | r6 = r3;
0x000051d8 ldr r3, [sp, 0x224] | r3 = *(arg_224h);
0x000051dc str r2, [sp] | *(sp) = r2;
0x000051e0 ldr r2, [pc, 0x50] | r2 = *(0x5234);
0x000051e4 add r7, sp, 8 | r7 += s;
0x000051e8 rsb r3, r3, 0 | r3 -= ;
0x000051ec mov r8, r1 | r8 = r1;
0x000051f0 mov r4, r0 | r4 = r0;
0x000051f4 str r3, [sp, 4] | var_4h = r3;
0x000051f8 mov r0, r7 | r0 = r7;
0x000051fc ldr r3, [sp, 0x220] | r3 = *(arg_220h);
0x00005200 add r2, pc, r2 | r2 = pc + r2;
0x00005204 mov r1, 0x200 | r1 = 0x200;
0x00005208 bl 0x448c | snprintf (r0, r1, r2, r3)
0x0000520c ldr ip, [r4] | ip = *(r4);
0x00005210 mov r3, r6 | r3 = r6;
0x00005214 ldr r0, [ip, 0x14] | r0 = *((ip + 0x14));
0x00005218 mov r2, r5 | r2 = r5;
0x0000521c str r7, [sp] | *(sp) = r7;
0x00005220 mov r1, r8 | r1 = r8;
0x00005224 ldr r4, [ip, 0x10] | r4 = *((ip + 0x10));
0x00005228 blx r4 | uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
0x0000522c add sp, sp, 0x208 |
0x00005230 pop {r4, r5, r6, r7, r8, pc} |
| }
[*] Function printf used 17 times libmbedtls.so.2.2.1