[*] Binary protection state of licensekey_cli
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of licensekey_cli
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/licensekey_cli @ 0xe80 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 3760 named .text */
0x00000e80 lui gp, 2 |
0x00000e84 addiu gp, gp, -0x5e70 |
0x00000e88 addu gp, gp, t9 | gp += t9;
0x00000e8c addiu sp, sp, -0x50 |
0x00000e90 addiu v0, zero, 1 | v0 = 1;
0x00000e94 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00000e98 sw s7, 0x44(sp) | *(var_44h) = s7;
0x00000e9c sw ra, 0x4c(sp) | *(var_4ch) = ra;
0x00000ea0 sw fp, 0x48(sp) | *(var_48h) = fp;
0x00000ea4 sw s6, 0x40(sp) | *(var_40h) = s6;
0x00000ea8 sw s5, 0x3c(sp) | *(var_3ch) = s5;
0x00000eac sw s4, 0x38(sp) | *(var_38h) = s4;
0x00000eb0 sw s3, 0x34(sp) | *(var_34h) = s3;
0x00000eb4 sw s2, 0x30(sp) | *(var_30h) = s2;
0x00000eb8 sw s1, 0x2c(sp) | *(var_2ch) = s1;
0x00000ebc sw s0, 0x28(sp) | *(var_28h) = s0;
0x00000ec0 move s7, a1 | s7 = a1;
| if (a0 == v0) {
0x00000ec4 beq a0, v0, 0x10ec | goto label_1;
| }
0x00000ec8 lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
0x00000ecc lw s1, -0x7fdc(gp) | s1 = *((gp - 8183));
0x00000ed0 addiu v0, v0, 0x21d0 | v0 += 0x21d0;
0x00000ed4 lw s0, -0x7f98(gp) | s0 = *((gp - 8166));
0x00000ed8 move s2, a0 | s2 = a0;
0x00000edc move s3, zero | s3 = 0;
0x00000ee0 move s6, zero | s6 = 0;
0x00000ee4 move s5, zero | s5 = 0;
0x00000ee8 move s4, zero | s4 = 0;
0x00000eec addiu s1, s1, 0x2178 | s1 += str.a:hi:m:n:;
0x00000ef0 addiu fp, zero, -1 | fp = -1;
0x00000ef4 sw v0, 0x24(sp) | *(var_24h) = v0;
0x00000ef8 lw t9, -0x7fb0(gp) | t9 = sym.imp.getopt;
0x00000efc move a2, s1 | a2 = s1;
0x00000f00 move a1, s7 | a1 = s7;
0x00000f04 move a0, s2 | a0 = s2;
0x00000f08 jalr t9 | t9 ();
0x00000f0c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != fp) {
0x00000f10 beq v0, fp, 0xf70 |
0x00000f14 addiu v1, v0, -0x61 | v1 = v0 + -0x61;
0x00000f18 sltiu a0, v1, 0xe | a0 = (v1 < 0xe) ? 1 : 0;
0x00000f1c lw a0, 0x24(sp) | a0 = *(var_24h);
| if (a0 == 0) {
0x00000f20 beqz a0, 0x10d0 | goto label_2;
| }
0x00000f24 sll v1, v1, 2 | v1 <<= 2;
0x00000f28 lwx v1, v1(a0) | __asm ("lwx v1, v1(a0)");
0x00000f2c addu v1, v1, gp | v1 += gp;
0x00000f30 jr v1 | v1 ();
0x00000f34 nop |
| }
0x00000f70 lw t9, -0x7fd8(gp) | t9 = sym.licensekey_verify;
0x00000f74 move a3, s6 | a3 = s6;
0x00000f78 move a2, s5 | a2 = s5;
0x00000f7c move a1, s4 | a1 = s4;
0x00000f80 move a0, s3 | a0 = s3;
0x00000f84 bal 0x1aa8 | sym_licensekey_verify ();
0x00000f88 move s0, v0 | s0 = v0;
0x00000f8c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00000f90 beqz v0, 0x10a4 | goto label_3;
| }
0x00000f94 addiu v0, zero, 1 | v0 = 1;
0x00000f98 lw v0, -0x7f3c(gp) | v0 = *((gp - 8143));
| if (s0 != v0) {
0x00000f9c bne s0, v0, 0x1040 | goto label_4;
| }
0x00000fa0 lw a3, -0x7fdc(gp) | a3 = *((gp - 8183));
0x00000fa4 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000fa8 lw t9, -0x7f8c(gp) | t9 = sym.imp.__fprintf_chk
0x00000fac lw a0, (v0) | a0 = *(v0);
0x00000fb0 addiu a3, a3, 0x218c | a3 += str.Valid;
0x00000fb4 addiu a2, a2, 0x2244 | a2 += 0x2244;
0x00000fb8 addiu a1, zero, 1 | a1 = 1;
0x00000fbc move s0, zero | s0 = 0;
0x00000fc0 jalr t9 | t9 ();
| do {
0x00000fc4 lw ra, 0x4c(sp) | ra = *(var_4ch);
| label_0:
0x00000fc8 move v0, s0 | v0 = s0;
0x00000fcc lw fp, 0x48(sp) | fp = *(var_48h);
0x00000fd0 lw s7, 0x44(sp) | s7 = *(var_44h);
0x00000fd4 lw s6, 0x40(sp) | s6 = *(var_40h);
0x00000fd8 lw s5, 0x3c(sp) | s5 = *(var_3ch);
0x00000fdc lw s4, 0x38(sp) | s4 = *(var_38h);
0x00000fe0 lw s3, 0x34(sp) | s3 = *(var_34h);
0x00000fe4 lw s2, 0x30(sp) | s2 = *(var_30h);
0x00000fe8 lw s1, 0x2c(sp) | s1 = *(var_2ch);
0x00000fec lw s0, 0x28(sp) | s0 = *(var_28h);
0x00000ff0 addiu sp, sp, 0x50 |
0x00000ff4 jr ra | return v0;
| label_4:
0x00001040 lw a3, -0x7fdc(gp) | a3 = *((gp - 8183));
0x00001044 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001048 lw t9, -0x7f8c(gp) | t9 = sym.imp.__fprintf_chk
0x0000104c lw a0, (v0) | a0 = *(v0);
0x00001050 addiu a3, a3, 0x2184 | a3 += str.Invalid;
0x00001054 addiu a2, a2, 0x2244 | a2 += 0x2244;
0x00001058 addiu a1, zero, 1 | a1 = 1;
0x0000105c jalr t9 | t9 ();
0x00001060 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001064 lw a0, (s7) | a0 = *(s7);
0x00001068 lw v0, -0x7fa0(gp) | v0 = *((gp - 8168));
0x0000106c lw t9, -0x7f58(gp) | t9 = sym.imp.__xpg_basename;
0x00001070 lw s1, (v0) | s1 = *(v0);
0x00001074 jalr t9 | t9 ();
0x00001078 lw gp, 0x18(sp) | gp = *(var_18h);
0x0000107c sw s0, 0x10(sp) | *(var_10h_2) = s0;
0x00001080 move a3, v0 | a3 = v0;
0x00001084 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001088 lw t9, -0x7f8c(gp) | t9 = sym.imp.__fprintf_chk
0x0000108c addiu a2, a2, 0x2194 | a2 += str._s:_Unknown_Error___licensekey_verify_returned_:__d__n;
0x00001090 addiu a1, zero, 1 | a1 = 1;
0x00001094 move a0, s1 | a0 = s1;
0x00001098 jalr t9 | t9 ();
0x0000109c addiu s0, zero, 1 | s0 = 1;
0x000010a0 b 0xfc4 |
| } while (1);
| label_3:
0x000010a4 lw v0, -0x7f3c(gp) | v0 = *((gp - 8143));
0x000010a8 lw a3, -0x7fdc(gp) | a3 = *((gp - 8183));
0x000010ac lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x000010b0 lw t9, -0x7f8c(gp) | t9 = sym.imp.__fprintf_chk
0x000010b4 lw a0, (v0) | a0 = *(v0);
0x000010b8 addiu a3, a3, 0x2184 | a3 += str.Invalid;
0x000010bc addiu a2, a2, 0x2244 | a2 += 0x2244;
0x000010c0 addiu a1, zero, 1 | a1 = 1;
0x000010c4 jalr t9 | t9 ();
0x000010c8 lw ra, 0x4c(sp) | ra = *(var_4ch);
0x000010cc b 0xfc8 | goto label_0;
| label_2:
0x000010d0 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x000010d4 lw t9, -0x7f04(gp) | t9 = sym.imp.__printf_chk;
0x000010d8 move a2, v0 | a2 = v0;
0x000010dc addiu a1, a1, 0x2160 | a1 += str.Unknown_Option...__c_n;
0x000010e0 addiu a0, zero, 1 | a0 = 1;
0x000010e4 jalr t9 | t9 ();
0x000010e8 lw gp, 0x18(sp) | gp = *(var_18h);
| label_1:
0x000010ec lw t9, -0x7f58(gp) | t9 = sym.imp.__xpg_basename;
0x000010f0 lw a0, (s7) | a0 = *(s7);
0x000010f4 jalr t9 | t9 ();
0x000010f8 lw gp, 0x18(sp) | gp = *(var_18h);
0x000010fc lw t9, -0x7fdc(gp) | t9 = *((gp - 8183));
0x00001100 addiu t9, t9, 0x1280 | t9 += fcn.00001280;
0x00001104 move a0, v0 | a0 = v0;
0x00001108 bal 0x1280 | fcn_00001280 ();
0x0000110c nop |
| }
[*] Function fprintf used 5 times licensekey_cli