[*] Binary protection state of licensekey-manager
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function mmap tear down of licensekey-manager
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/licensekey-manager @ 0xdd90 */
| #include <stdint.h>
|
; (fcn) fcn.0000dd90 () | void fcn_0000dd90 () {
0x0000dd90 lui gp, 2 |
0x0000dd94 addiu gp, gp, -0x3d60 |
0x0000dd98 addu gp, gp, t9 | gp += t9;
0x0000dd9c addiu sp, sp, -0xd8 |
0x0000dda0 lw a0, -0x7fdc(gp) | a0 = *(gp);
0x0000dda4 sw s2, 0xc0(sp) | *(var_c0h) = s2;
0x0000dda8 lw s2, -0x7c88(gp) | s2 = *((gp - 7970));
0x0000ddac lw t9, -0x7c30(gp) | t9 = sym.imp.open;
0x0000ddb0 sw gp, 0x18(sp) | *(var_18h) = gp;
0x0000ddb4 lw v0, (s2) | v0 = *(s2);
0x0000ddb8 sw s1, 0xbc(sp) | *(var_bch) = s1;
0x0000ddbc sw ra, 0xd4(sp) | *(var_d4h) = ra;
0x0000ddc0 sw s6, 0xd0(sp) | *(var_d0h) = s6;
0x0000ddc4 sw s5, 0xcc(sp) | *(var_cch) = s5;
0x0000ddc8 sw s4, 0xc8(sp) | *(var_c8h) = s4;
0x0000ddcc sw s3, 0xc4(sp) | *(var_c4h) = s3;
0x0000ddd0 sw s0, 0xb8(sp) | *(var_b8h) = s0;
0x0000ddd4 move a2, zero | a2 = 0;
0x0000ddd8 move a1, zero | a1 = 0;
| /* str._etc_ld.so.preload */
0x0000dddc addiu a0, a0, 0xf38 | a0 += 0xf38;
0x0000dde0 sw v0, 0xb4(sp) | *(var_b4h) = v0;
0x0000dde4 jalr t9 | t9 ();
0x0000dde8 nop |
0x0000ddec move s1, v0 | s1 = v0;
0x0000ddf0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x0000ddf4 bltz v0, 0xdf34 | goto label_3;
| }
0x0000ddf8 lw t9, -0x7cc0(gp) | t9 = sym.imp.__fxstat;
0x0000ddfc addiu a2, sp, 0x24 | a2 = sp + 0x24;
0x0000de00 move a1, v0 | a1 = v0;
0x0000de04 addiu a0, zero, 3 | a0 = 3;
0x0000de08 jalr t9 | t9 ();
0x0000de0c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x0000de10 bltz v0, 0xdfbc | goto label_4;
| }
0x0000de14 lw t9, -0x7ec0(gp) | t9 = sym.imp.mmap
0x0000de18 lw a1, 0x54(sp) | a1 = *(var_54h);
0x0000de1c sw zero, 0x14(sp) | *(var_14h) = 0;
0x0000de20 sw s1, 0x10(sp) | *(var_10h_2) = s1;
0x0000de24 addiu a3, zero, 2 | a3 = 2;
0x0000de28 addiu a2, zero, 1 | a2 = 1;
0x0000de2c move a0, zero | a0 = 0;
0x0000de30 jalr t9 | t9 ();
0x0000de34 move s3, v0 | s3 = v0;
0x0000de38 addiu v0, zero, -1 | v0 = -1;
0x0000de3c lw gp, 0x18(sp) | gp = *(var_18h);
| if (s3 == v0) {
0x0000de40 beq s3, v0, 0xdfd4 | goto label_5;
| }
0x0000de44 lw s0, 0x54(sp) | s0 = *(var_54h);
0x0000de48 lw t9, -0x7ccc(gp) | t9 = sym.imp.malloc;
0x0000de4c addiu a0, s0, 1 | a0 = s0 + 1;
0x0000de50 jalr t9 | t9 ();
0x0000de54 move s6, v0 | s6 = v0;
0x0000de58 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0000de5c beqz v0, 0xdf90 | goto label_6;
| }
0x0000de60 lw t9, -0x7cc4(gp) | t9 = sym.imp.memcpy;
0x0000de64 move a2, s0 | a2 = s0;
0x0000de68 move a1, s3 | a1 = s3;
0x0000de6c move a0, v0 | a0 = v0;
0x0000de70 jalr t9 | t9 ();
0x0000de74 addu v0, s6, s0 | v0 = s6 + s0;
0x0000de78 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000de7c sb zero, (v0) | *(v0) = 0;
| if (s0 == 0) {
0x0000de80 beqz s0, 0xdee4 | goto label_7;
| }
0x0000de84 addiu s4, zero, 0x20 | s4 = 0x20;
0x0000de88 addiu s5, zero, 0xa | s5 = 0xa;
0x0000de8c lw t9, -0x7d08(gp) | t9 = sym.imp.memchr;
| do {
0x0000de90 move a2, s0 | a2 = s0;
0x0000de94 addiu a1, zero, 0x23 | a1 = 0x23;
0x0000de98 move a0, s6 | a0 = s6;
0x0000de9c jalr t9 | t9 ();
0x0000dea0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x0000dea4 beqz v0, 0xdee4 | goto label_7;
| }
0x0000dea8 subu v1, v0, s6 | __asm ("subu v1, v0, s6");
0x0000deac subu s0, s0, v1 | __asm ("subu s0, s0, v1");
0x0000deb0 addiu a1, v0, -1 | a1 = v0 + -1;
0x0000deb4 addiu a0, s0, -1 | a0 = s0 + -1;
0x0000deb8 move v1, v0 | v1 = v0;
0x0000debc addu a1, a1, s0 | a1 += s0;
0x0000dec0 addu v0, v0, a0 | v0 += a0;
0x0000dec4 b 0xded8 | goto label_8;
| label_0:
0x0000dec8 addiu v1, v1, 1 | v1++;
0x0000decc lb a0, (v1) | a0 = *(v1);
0x0000ded0 lw t9, -0x7d08(gp) | t9 = sym.imp.memchr;
0x0000ded4 beq a0, s5, 0xde90 |
| } while (a0 == s5);
| label_8:
0x0000ded8 sb s4, (v1) | *(v1) = s4;
0x0000dedc subu s0, a1, v1 | __asm ("subu s0, a1, v1");
| if (v1 != v0) {
0x0000dee0 bne v1, v0, 0xdec8 | goto label_0;
| }
| label_7:
0x0000dee4 lw a2, -0x7fdc(gp) | a2 = *(gp);
0x0000dee8 lw a1, -0x7fdc(gp) | a1 = *(gp);
0x0000deec lw t9, -0x7fdc(gp) | t9 = *(gp);
0x0000def0 addiu a2, a2, -0x27f0 | a2 += -0x27f0;
| /* str.:__t_n */
0x0000def4 addiu a1, a1, 0xf4c | a1 += 0xf4c;
0x0000def8 addiu t9, t9, -0x273c | t9 += -0x273c;
0x0000defc move a0, s6 | a0 = s6;
0x0000df00 bal 0xd8c4 | fcn_0000d8c4 ();
0x0000df04 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000df08 move a0, s6 | a0 = s6;
0x0000df0c lw t9, -0x7dc4(gp) | t9 = sym.imp.free;
0x0000df10 move s0, v0 | s0 = v0;
0x0000df14 jalr t9 | t9 ();
0x0000df18 lw gp, 0x18(sp) | gp = *(var_18h);
| do {
| label_2:
0x0000df1c lw t9, -0x7cd4(gp) | t9 = sym.imp.munmap;
0x0000df20 lw a1, 0x54(sp) | a1 = *(var_54h);
0x0000df24 move a0, s3 | a0 = s3;
0x0000df28 jalr t9 | t9 ();
0x0000df2c lw gp, 0x18(sp) | gp = *(var_18h);
0x0000df30 b 0xdfc0 | goto label_9;
| label_3:
0x0000df34 lw t9, -0x7d14(gp) | t9 = sym.imp.__errno_location;
0x0000df38 jalr t9 | t9 ();
0x0000df3c nop |
0x0000df40 lw s0, (v0) | s0 = *(v0);
0x0000df44 addiu v0, zero, -1 | v0 = -1;
0x0000df48 xori s0, s0, 0xd | s0 ^= 0xd;
0x0000df4c lw gp, 0x18(sp) | gp = *(var_18h);
0x0000df50 sltiu s0, s0, 1 | s0 = (s0 < 1) ? 1 : 0;
| if (s1 != v0) {
0x0000df54 bne s1, v0, 0xdfc0 | goto label_9;
| }
| label_1:
0x0000df58 lw a0, 0xb4(sp) | a0 = *(var_b4h);
0x0000df5c lw v1, (s2) | v1 = *(s2);
0x0000df60 move v0, s0 | v0 = s0;
| if (a0 != v1) {
0x0000df64 bne a0, v1, 0xdfdc | goto label_10;
| }
0x0000df68 lw ra, 0xd4(sp) | ra = *(var_d4h);
0x0000df6c lw s6, 0xd0(sp) | s6 = *(var_d0h);
0x0000df70 lw s5, 0xcc(sp) | s5 = *(var_cch);
0x0000df74 lw s4, 0xc8(sp) | s4 = *(var_c8h);
0x0000df78 lw s3, 0xc4(sp) | s3 = *(var_c4h);
0x0000df7c lw s2, 0xc0(sp) | s2 = *(var_c0h);
0x0000df80 lw s1, 0xbc(sp) | s1 = *(var_bch);
0x0000df84 lw s0, 0xb8(sp) | s0 = *(var_b8h);
0x0000df88 addiu sp, sp, 0xd8 |
0x0000df8c jr ra | return v0;
| label_6:
0x0000df90 lw a3, -0x7fdc(gp) | a3 = *(gp);
0x0000df94 lw a2, -0x7fdc(gp) | a2 = *(gp);
0x0000df98 lw t9, -0x7d94(gp) | t9 = sym.imp.__syslog_chk;
| /* str.test_ld_so_preload */
0x0000df9c addiu a3, a3, 0x10b0 | a3 += 0x10b0;
| /* str.Memory_allocation_failed_in__s_n */
0x0000dfa0 addiu a2, a2, 0xeb8 | a2 += 0xeb8;
0x0000dfa4 addiu a1, zero, 1 | a1 = 1;
0x0000dfa8 addiu a0, zero, 2 | a0 = 2;
0x0000dfac jalr t9 | t9 ();
0x0000dfb0 move s0, zero | s0 = 0;
0x0000dfb4 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000dfb8 bnez s3, 0xdf1c |
| } while (s3 != 0);
| label_4:
0x0000dfbc move s0, zero | s0 = 0;
| label_9:
0x0000dfc0 lw t9, -0x7e70(gp) | t9 = sym.imp.close;
0x0000dfc4 move a0, s1 | a0 = s1;
0x0000dfc8 jalr t9 | t9 ();
0x0000dfcc lw gp, 0x18(sp) | gp = *(var_18h);
0x0000dfd0 b 0xdf58 | goto label_1;
| label_5:
0x0000dfd4 move s0, zero | s0 = 0;
0x0000dfd8 b 0xdf1c | goto label_2;
| label_10:
0x0000dfdc lw t9, -0x7d9c(gp) | t9 = sym.imp.__stack_chk_fail;
0x0000dfe0 jalr t9 | t9 ();
0x0000dfe4 nop |
| }
[*] Function mmap used 2 times licensekey-manager