[*] Binary protection state of libmbedcrypto.so.0
No RELRO No Canary found NX disabled DSO No RPATH No RUNPATH Symbols
[*] Function fprintf tear down of libmbedcrypto.so.0
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/2097216-5451840.squashfs_v4_le_extract/thirdlib/libmbedcrypto.so.0 @ 0x6c70 */
| #include <stdint.h>
|
; (fcn) sym.__do_global_dtors_aux () | void do_global_dtors_aux () {
0x00006c70 lui gp, 7 |
0x00006c74 addiu gp, gp, 0x27e0 |
0x00006c78 addu gp, gp, t9 | gp += t9;
0x00006c7c addiu sp, sp, -0x30 |
0x00006c80 sw s3, 0x28(sp) | *(var_28h) = s3;
0x00006c84 lw s3, -0x7fe4(gp) | s3 = *(gp);
0x00006c88 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00006c8c sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00006c90 lbu v0, 0x1a50(s3) | v0 = *((s3 + 6736));
0x00006c94 sw s2, 0x24(sp) | *(var_24h) = s2;
0x00006c98 sw s1, 0x20(sp) | *(var_20h) = s1;
0x00006c9c sw s0, 0x1c(sp) | *(var_1ch) = s0;
0x00006ca0 lw v0, -0x7b68(gp) | v0 = *((gp - 7898));
| if (v0 != 0) {
0x00006ca4 bnez v0, 0x6d5c | goto label_1;
| }
0x00006ca8 lw v0, -0x7fe0(gp) | v0 = *(gp);
| if (v0 != 0) {
0x00006cac beqz v0, 0x6cc0 |
0x00006cb0 lw t9, -0x7b68(gp) | t9 = *((gp - 7898));
0x00006cb4 lw a0, (v0) | a0 = *(v0);
0x00006cb8 jalr t9 | t9 ();
0x00006cbc lw gp, 0x10(sp) | gp = *(var_10h);
| }
0x00006cc0 lw s2, -0x7fe4(gp) | s2 = *(gp);
0x00006cc4 lw s0, -0x7fe4(gp) | s0 = *(gp);
0x00006cc8 lw s1, -0x7fdc(gp) | s1 = *(gp);
| /* obj.__DTOR_LIST__ */
0x00006ccc addiu s2, s2, 8 | s2 += 8;
0x00006cd0 lw v0, 0x1a54(s0) | v0 = *((s0 + 1685));
0x00006cd4 subu s1, s1, s2 | __asm ("subu s1, s1, s2");
0x00006cd8 sra s1, s1, 2 | s1 >>= 2;
0x00006cdc addiu s1, s1, -1 | s1 += -1;
0x00006ce0 sltu v1, v0, s1 | v1 = (v0 < s1) ? 1 : 0;
0x00006ce4 lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
| if (v1 == 0) {
0x00006ce8 beqz v1, 0x6d18 | goto label_2;
| }
| do {
0x00006cec addiu v0, v0, 1 | v0++;
0x00006cf0 sll v1, v0, 2 | v1 = v0 << 2;
0x00006cf4 addu v1, s2, v1 | v1 = s2 + v1;
0x00006cf8 lw t9, (v1) | t9 = *(v1);
0x00006cfc sw v0, 0x1a54(s0) | *((s0 + 1685)) = v0;
0x00006d00 jalr t9 | t9 ();
0x00006d04 lw v0, 0x1a54(s0) | v0 = *((s0 + 1685));
0x00006d08 sltu v1, v0, s1 | v1 = (v0 < s1) ? 1 : 0;
0x00006d0c lw gp, 0x10(sp) | gp = *(var_10h);
0x00006d10 bnez v1, 0x6cec |
| } while (v1 != 0);
0x00006d14 lw t9, -0x7fd8(gp) | t9 = *((gp - 8182));
| label_2:
0x00006d18 addiu t9, t9, 0x6be0 | t9 += entry0;
0x00006d1c bal 0x6be0 | entry0 ();
0x00006d20 nop |
0x00006d24 lw gp, 0x10(sp) | gp = *(var_10h);
0x00006d28 lw v0, -0x7d74(gp) | v0 = *((gp - 8029));
0x00006d2c lw a0, -0x7dc4(gp) | a0 = *((gp - 8049));
| if (v0 == 0) {
0x00006d30 beqz v0, 0x6d78 | goto label_3;
| }
0x00006d34 lw v0, -0x7ce0(gp) | v0 = *((gp - 7992));
| if (a0 == 0) {
0x00006d38 beqz a0, 0x6d7c | goto label_4;
| }
0x00006d3c lb v0, (a0) | v0 = *(a0);
0x00006d40 slti v0, v0, 2 | v0 = (v0 < 2) ? 1 : 0;
0x00006d44 lw t9, -0x7ce0(gp) | t9 = *((gp - 7992));
| if (v0 != 0) {
0x00006d48 bnez v0, 0x6d78 | goto label_3;
| }
0x00006d4c jalr t9 | t9 ();
0x00006d50 nop |
| do {
0x00006d54 addiu v0, zero, 1 | v0 = 1;
| label_0:
0x00006d58 sb v0, 0x1a50(s3) | *((s3 + 6736)) = v0;
| label_1:
0x00006d5c lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00006d60 lw s3, 0x28(sp) | s3 = *(var_28h);
0x00006d64 lw s2, 0x24(sp) | s2 = *(var_24h);
0x00006d68 lw s1, 0x20(sp) | s1 = *(var_20h);
0x00006d6c lw s0, 0x1c(sp) | s0 = *(var_1ch);
0x00006d70 addiu sp, sp, 0x30 |
0x00006d74 jr ra | return v0;
| label_3:
0x00006d78 lw v0, -0x7ce0(gp) | v0 = *((gp - 7992));
| label_4:
0x00006d7c lw a0, -0x7fe4(gp) | a0 = *(gp);
0x00006d80 beqz v0, 0x6d54 |
| } while (v0 == 0);
0x00006d84 lw t9, -0x7ce0(gp) | t9 = *((gp - 7992));
| /* obj.__EH_FRAME_BEGIN__ */
0x00006d88 addiu a0, a0, -0x93c | a0 += -0x93c;
0x00006d8c jalr t9 | t9 ();
0x00006d90 addiu v0, zero, 1 | v0 = 1;
0x00006d94 b 0x6d58 | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/2097216-5451840.squashfs_v4_le_extract/thirdlib/libmbedcrypto.so.0 @ 0x3f714 */
| #include <stdint.h>
|
; (fcn) sym.mbedtls_md_file () | void mbedtls_md_file () {
0x0003f714 lui gp, 4 |
0x0003f718 addiu gp, gp, -0x62c4 |
0x0003f71c addu gp, gp, t9 | gp += t9;
0x0003f720 addiu sp, sp, -0x438 |
0x0003f724 sw ra, 0x434(sp) | *(var_434h) = ra;
0x0003f728 sw fp, 0x430(sp) | *(var_430h) = fp;
0x0003f72c move fp, sp | fp = sp;
0x0003f730 sw gp, 0x10(sp) | *(var_10h) = gp;
0x0003f734 sw a0, 0x438(fp) | *(arg_438h) = a0;
0x0003f738 sw a1, 0x43c(fp) | *(arg_43ch) = a1;
0x0003f73c sw a2, 0x440(fp) | *(arg_440h) = a2;
0x0003f740 lw v0, 0x438(fp) | v0 = *(arg_438h);
| if (v0 == 0) {
0x0003f744 bnez v0, 0x3f758 |
0x0003f748 nop |
0x0003f74c addiu v0, zero, -0x5100 | v0 = -0x5100;
0x0003f750 b 0x3f904 | goto label_0;
0x0003f754 nop |
| }
0x0003f758 lw a0, 0x43c(fp) | a0 = *(arg_43ch);
0x0003f75c lw v0, -0x7fe4(gp) | v0 = *(gp);
| /* esilref: 'rb' */
0x0003f760 addiu a1, v0, -0x3eb8 | a1 = v0 + -0x3eb8;
0x0003f764 lw v0, -0x7dac(gp) | v0 = sym.imp.fopen;
0x0003f768 move t9, v0 | t9 = v0;
0x0003f76c jalr t9 | t9 ();
0x0003f770 nop |
0x0003f774 lw gp, 0x10(fp) | gp = *(var_10h);
0x0003f778 sw v0, 0x1c(fp) | *(var_1ch) = v0;
0x0003f77c lw v0, 0x1c(fp) | v0 = *(var_1ch);
| if (v0 == 0) {
0x0003f780 bnez v0, 0x3f794 |
0x0003f784 nop |
0x0003f788 addiu v0, zero, -0x5200 | v0 = -0x5200;
0x0003f78c b 0x3f904 | goto label_0;
0x0003f790 nop |
| }
0x0003f794 addiu v0, fp, 0x24 | v0 = fp + 0x24;
0x0003f798 move a0, v0 | a0 = v0;
0x0003f79c lw v0, -0x7cb0(gp) | v0 = sym.mbedtls_md_init;
0x0003f7a0 move t9, v0 | t9 = v0;
0x0003f7a4 jalr t9 | t9 ();
0x0003f7a8 nop |
0x0003f7ac lw gp, 0x10(fp) | gp = *(var_10h);
0x0003f7b0 addiu v0, fp, 0x24 | v0 = fp + 0x24;
0x0003f7b4 move a0, v0 | a0 = v0;
0x0003f7b8 lw a1, 0x438(fp) | a1 = *(arg_438h);
0x0003f7bc move a2, zero | a2 = 0;
0x0003f7c0 lw v0, -0x7d84(gp) | v0 = sym.mbedtls_md_setup;
0x0003f7c4 move t9, v0 | t9 = v0;
0x0003f7c8 jalr t9 | t9 ();
0x0003f7cc nop |
0x0003f7d0 lw gp, 0x10(fp) | gp = *(var_10h);
0x0003f7d4 sw v0, 0x18(fp) | *(var_18h) = v0;
0x0003f7d8 lw v0, 0x18(fp) | v0 = *(var_18h);
| if (v0 != 0) {
0x0003f7dc bnez v0, 0x3f8c8 | goto label_1;
| }
0x0003f7e0 nop |
0x0003f7e4 lw v0, 0x438(fp) | v0 = *(arg_438h);
0x0003f7e8 lw v0, 0x10(v0) | v0 = *((v0 + 4));
0x0003f7ec lw v1, 0x28(fp) | v1 = *(var_28h);
0x0003f7f0 move a0, v1 | a0 = v1;
0x0003f7f4 move t9, v0 | t9 = v0;
0x0003f7f8 jalr t9 | t9 ();
0x0003f7fc nop |
0x0003f800 lw gp, 0x10(fp) | gp = *(var_10h);
0x0003f804 b 0x3f834 | goto label_2;
0x0003f808 nop |
| do {
0x0003f80c lw v0, 0x438(fp) | v0 = *(arg_438h);
0x0003f810 lw v0, 0x14(v0) | v0 = *((v0 + 5));
0x0003f814 lw a0, 0x28(fp) | a0 = *(var_28h);
0x0003f818 addiu v1, fp, 0x30 | v1 = fp + 0x30;
0x0003f81c move a1, v1 | a1 = v1;
0x0003f820 lw a2, 0x20(fp) | a2 = *(var_20h);
0x0003f824 move t9, v0 | t9 = v0;
0x0003f828 jalr t9 | t9 ();
0x0003f82c nop |
0x0003f830 lw gp, 0x10(fp) | gp = *(var_10h);
| label_2:
0x0003f834 addiu v0, fp, 0x30 | v0 = fp + 0x30;
0x0003f838 move a0, v0 | a0 = v0;
0x0003f83c addiu a1, zero, 1 | a1 = 1;
0x0003f840 addiu a2, zero, 0x400 | a2 = aav.0x00000400;
0x0003f844 lw a3, 0x1c(fp) | a3 = *(var_1ch);
0x0003f848 lw v0, -0x7d80(gp) | v0 = sym.imp.fread;
0x0003f84c move t9, v0 | t9 = v0;
0x0003f850 jalr t9 | t9 ();
0x0003f854 nop |
0x0003f858 lw gp, 0x10(fp) | gp = *(var_10h);
0x0003f85c sw v0, 0x20(fp) | *(var_20h) = v0;
0x0003f860 lw v0, 0x20(fp) | v0 = *(var_20h);
0x0003f864 bnez v0, 0x3f80c |
| } while (v0 != 0);
0x0003f868 nop |
0x0003f86c lw a0, 0x1c(fp) | a0 = *(var_1ch);
0x0003f870 lw v0, -0x7ce4(gp) | v0 = sym.imp.ferror;
0x0003f874 move t9, v0 | t9 = v0;
0x0003f878 jalr t9 | t9 ();
0x0003f87c nop |
0x0003f880 lw gp, 0x10(fp) | gp = *(var_10h);
| if (v0 != 0) {
0x0003f884 beqz v0, 0x3f89c |
0x0003f888 nop |
0x0003f88c addiu v0, zero, -0x5200 | v0 = -0x5200;
0x0003f890 sw v0, 0x18(fp) | *(var_18h) = v0;
0x0003f894 b 0x3f8cc | goto label_3;
0x0003f898 nop |
| }
0x0003f89c lw v0, 0x438(fp) | v0 = *(arg_438h);
0x0003f8a0 lw v0, 0x18(v0) | v0 = *((v0 + 6));
0x0003f8a4 lw v1, 0x28(fp) | v1 = *(var_28h);
0x0003f8a8 move a0, v1 | a0 = v1;
0x0003f8ac lw a1, 0x440(fp) | a1 = *(arg_440h);
0x0003f8b0 move t9, v0 | t9 = v0;
0x0003f8b4 jalr t9 | t9 ();
0x0003f8b8 nop |
0x0003f8bc lw gp, 0x10(fp) | gp = *(var_10h);
0x0003f8c0 b 0x3f8cc | goto label_3;
0x0003f8c4 nop |
| label_1:
0x0003f8c8 nop |
| label_3:
0x0003f8cc lw a0, 0x1c(fp) | a0 = *(var_1ch);
0x0003f8d0 lw v0, -0x7dd4(gp) | v0 = sym.imp.fclose;
0x0003f8d4 move t9, v0 | t9 = v0;
0x0003f8d8 jalr t9 | t9 ();
0x0003f8dc nop |
0x0003f8e0 lw gp, 0x10(fp) | gp = *(var_10h);
0x0003f8e4 addiu v0, fp, 0x24 | v0 = fp + 0x24;
0x0003f8e8 move a0, v0 | a0 = v0;
0x0003f8ec lw v0, -0x7f74(gp) | v0 = sym.mbedtls_md_free;
0x0003f8f0 move t9, v0 | t9 = v0;
0x0003f8f4 jalr t9 | t9 ();
0x0003f8f8 nop |
0x0003f8fc lw gp, 0x10(fp) | gp = *(var_10h);
0x0003f900 lw v0, 0x18(fp) | v0 = *(var_18h);
| label_0:
0x0003f904 move sp, fp |
0x0003f908 lw ra, 0x434(sp) | ra = *(var_434h);
0x0003f90c lw fp, 0x430(sp) | fp = *(var_430h);
0x0003f910 addiu sp, sp, 0x438 |
0x0003f914 jr ra | return v0;
0x0003f918 nop |
| }
[*] Function fprintf used 1 times libmbedcrypto.so.0