[*] Binary protection state of cifsiostat
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function strcpy tear down of cifsiostat
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/cifsiostat @ 0x5e5c */
| #include <stdint.h>
|
; (fcn) sym.get_persistent_names () | void get_persistent_names () {
| label_2:
0x00005e5c lui gp, 2 |
0x00005e60 addiu gp, gp, -0x3dac |
0x00005e64 addu gp, gp, t9 | gp += t9;
0x00005e68 lw v0, -0x7ddc(gp) | v0 = *((gp - 8055));
0x00005e6c addiu sp, sp, -0x58 |
0x00005e70 lw a0, -0x7f14(gp) | a0 = *(gp);
0x00005e74 sw v0, 0x20(sp) | *(var_20h) = v0;
0x00005e78 lw v0, (v0) | v0 = *(v0);
0x00005e7c lw t9, -0x7f18(gp) | t9 = sym.get_persistent_type_dir;
0x00005e80 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00005e84 sw ra, 0x54(sp) | *(var_54h) = ra;
0x00005e88 sw fp, 0x50(sp) | *(var_50h) = fp;
0x00005e8c sw s7, 0x4c(sp) | *(var_4ch) = s7;
0x00005e90 sw s6, 0x48(sp) | *(var_48h) = s6;
0x00005e94 sw s5, 0x44(sp) | *(var_44h) = s5;
0x00005e98 sw s4, 0x40(sp) | *(var_40h) = s4;
0x00005e9c sw s3, 0x3c(sp) | *(var_3ch) = s3;
0x00005ea0 sw s2, 0x38(sp) | *(var_38h) = s2;
0x00005ea4 sw s1, 0x34(sp) | *(var_34h) = s1;
0x00005ea8 sw s0, 0x30(sp) | *(var_30h) = s0;
0x00005eac sw v0, 0x2c(sp) | *(var_2ch) = v0;
0x00005eb0 bal 0x5d20 | sym_get_persistent_type_dir ();
0x00005eb4 nop |
0x00005eb8 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00005ebc beqz v0, 0x6058 | goto label_4;
| }
0x00005ec0 lw t9, -0x7e5c(gp) | t9 = sym.imp.scandir;
0x00005ec4 lw a3, -0x7e84(gp) | a3 = *((gp - 8097));
0x00005ec8 move a2, zero | a2 = 0;
0x00005ecc addiu a1, sp, 0x28 | a1 = sp + 0x28;
0x00005ed0 move a0, v0 | a0 = v0;
0x00005ed4 jalr t9 | t9 ();
0x00005ed8 move s1, v0 | s1 = v0;
0x00005edc lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 < 0) {
0x00005ee0 bltz v0, 0x6058 | goto label_4;
| }
0x00005ee4 slti v0, v0, 3 | v0 = (v0 < 3) ? 1 : 0;
0x00005ee8 lw fp, 0x28(sp) | fp = *(var_28h_2);
| if (v0 == 0) {
0x00005eec beqz v0, 0x5f74 | goto label_5;
| }
0x00005ef0 move s3, zero | s3 = 0;
| if (s1 == 0) {
0x00005ef4 beqz s1, 0x5f20 | goto label_6;
| }
| label_0:
0x00005ef8 move s0, zero | s0 = 0;
| do {
0x00005efc sll a0, s0, 2 | a0 = s0 << 2;
0x00005f00 lw t9, -0x7dd8(gp) | t9 = sym.imp.free;
0x00005f04 lwx a0, a0(fp) | __asm ("lwx a0, a0(fp)");
0x00005f08 addiu s0, s0, 1 | s0++;
0x00005f0c jalr t9 | t9 ();
0x00005f10 slt v0, s0, s1 | v0 = (s0 < s1) ? 1 : 0;
0x00005f14 lw gp, 0x10(sp) | gp = *(var_10h);
0x00005f18 lw fp, 0x28(sp) | fp = *(var_28h_2);
0x00005f1c bnez v0, 0x5efc |
| } while (v0 != 0);
| label_6:
0x00005f20 lw t9, -0x7dd8(gp) | t9 = sym.imp.free;
0x00005f24 move a0, fp | a0 = fp;
0x00005f28 jalr t9 | t9 ();
0x00005f2c lw gp, 0x10(sp) | gp = *(var_10h);
| label_1:
0x00005f30 lw v0, 0x20(sp) | v0 = *(var_20h);
0x00005f34 lw a0, 0x2c(sp) | a0 = *(var_2ch);
0x00005f38 lw v1, (v0) | v1 = *(v0);
0x00005f3c move v0, s3 | v0 = s3;
| if (a0 != v1) {
0x00005f40 bne a0, v1, 0x6060 | goto label_7;
| }
0x00005f44 lw ra, 0x54(sp) | ra = *(var_54h);
0x00005f48 lw fp, 0x50(sp) | fp = *(var_50h);
0x00005f4c lw s7, 0x4c(sp) | s7 = *(var_4ch);
0x00005f50 lw s6, 0x48(sp) | s6 = *(var_48h);
0x00005f54 lw s5, 0x44(sp) | s5 = *(var_44h);
0x00005f58 lw s4, 0x40(sp) | s4 = *(var_40h);
0x00005f5c lw s3, 0x3c(sp) | s3 = *(var_3ch);
0x00005f60 lw s2, 0x38(sp) | s2 = *(var_38h);
0x00005f64 lw s1, 0x34(sp) | s1 = *(var_34h);
0x00005f68 lw s0, 0x30(sp) | s0 = *(var_30h);
0x00005f6c addiu sp, sp, 0x58 |
0x00005f70 jr ra | return v0;
| label_5:
0x00005f74 lw t9, -0x7eb4(gp) | t9 = sym.imp.calloc;
0x00005f78 addiu a1, zero, 4 | a1 = 4;
0x00005f7c addiu a0, s1, -1 | a0 = s1 + -1;
0x00005f80 jalr t9 | t9 ();
0x00005f84 move s3, v0 | s3 = v0;
0x00005f88 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00005f8c beqz v0, 0x5ef8 | goto label_0;
| }
0x00005f90 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
0x00005f94 sll s5, s1, 2 | s5 = s1 << 2;
0x00005f98 addiu v0, v0, -0x6dd0 | v0 += -0x6dd0;
0x00005f9c sw v0, 0x1c(sp) | *(var_1ch_3) = v0;
0x00005fa0 lw v0, -0x7fd8(gp) | v0 = *((gp - 8182));
0x00005fa4 move s7, fp | s7 = fp;
0x00005fa8 addiu v0, v0, -0x6dcc | v0 += -0x6dcc;
0x00005fac addu s5, s5, fp | s5 += fp;
0x00005fb0 move s6, zero | s6 = 0;
0x00005fb4 sw v0, 0x24(sp) | *(var_24h_2) = v0;
0x00005fb8 lw s0, (s7) | s0 = *(s7);
| do {
0x00005fbc lw t9, -0x7dbc(gp) | t9 = sym.imp.strcmp;
0x00005fc0 addiu s0, s0, 0xb | s0 += 0xb;
0x00005fc4 lw a0, 0x1c(sp) | a0 = *(var_1ch_3);
0x00005fc8 move a1, s0 | a1 = s0;
0x00005fcc jalr t9 | t9 ();
0x00005fd0 sll s2, s6, 2 | s2 = s6 << 2;
0x00005fd4 lw gp, 0x10(sp) | gp = *(var_10h);
0x00005fd8 addu s4, s3, s2 | s4 = s3 + s2;
| if (v0 != 0) {
0x00005fdc beqz v0, 0x6044 |
0x00005fe0 lw t9, -0x7dbc(gp) | t9 = sym.imp.strcmp;
0x00005fe4 lw a0, 0x24(sp) | a0 = *(var_24h_2);
0x00005fe8 move a1, s0 | a1 = s0;
0x00005fec jalr t9 | t9 ();
0x00005ff0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00005ff4 beqz v0, 0x6044 | goto label_8;
| }
0x00005ff8 lw t9, -0x7e3c(gp) | t9 = sym.imp.strlen;
0x00005ffc move a0, s0 | a0 = s0;
0x00006000 jalr t9 | t9 ();
0x00006004 lw gp, 0x10(sp) | gp = *(var_10h);
0x00006008 addiu a1, zero, 1 | a1 = 1;
0x0000600c lw t9, -0x7eb4(gp) | t9 = sym.imp.calloc;
0x00006010 addiu a0, v0, 1 | a0 = v0 + 1;
0x00006014 jalr t9 | t9 ();
0x00006018 lw gp, 0x10(sp) | gp = *(var_10h);
0x0000601c sw v0, (s4) | *(s4) = v0;
| if (v0 == 0) {
0x00006020 beqz v0, 0x6044 | goto label_8;
| }
0x00006024 lw t9, -0x7e14(gp) | t9 = sym.imp.strcpy
0x00006028 move a1, s0 | a1 = s0;
0x0000602c move a0, v0 | a0 = v0;
0x00006030 jalr t9 | t9 ();
0x00006034 addiu s2, s2, 4 | s2 += 4;
0x00006038 lw gp, 0x10(sp) | gp = *(var_10h);
0x0000603c addiu s6, s6, 1 | s6++;
0x00006040 addu s4, s3, s2 | s4 = s3 + s2;
| }
| label_8:
0x00006044 addiu s7, s7, 4 | s7 += 4;
0x00006048 lw s0, (s7) | s0 = *(s7);
0x0000604c bnel s5, s7, 0x5fbc |
| } while (s5 == s7);
0x00006050 sw zero, (s4) | *(s4) = 0;
0x00006054 b 0x5ef8 | goto label_0;
| label_4:
0x00006058 move s3, zero | s3 = 0;
0x0000605c b 0x5f30 | goto label_1;
| label_7:
0x00006060 lw t9, -0x7df0(gp) | t9 = sym.imp.__stack_chk_fail;
0x00006064 jalr t9 | t9 ();
0x00006068 nop |
0x0000606c lui gp, 2 |
0x00006070 addiu gp, gp, -0x3fbc |
0x00006074 addu gp, gp, t9 | gp += t9;
0x00006078 addiu sp, sp, -0x1040 |
0x0000607c lw t9, -0x7f10(gp) | t9 = sym.get_persistent_names;
0x00006080 sw s5, 0x1034(sp) | *(var_1034h) = s5;
0x00006084 lw s5, -0x7ddc(gp) | s5 = *((gp - 8055));
0x00006088 sw s2, 0x1028(sp) | *(var_1028h) = s2;
0x0000608c lw s2, -0x7f4c(gp) | s2 = *((gp - 8147));
0x00006090 lw v0, (s5) | v0 = *(s5);
0x00006094 sw gp, 0x10(sp) | *(var_10h_2) = gp;
0x00006098 sw s4, 0x1030(sp) | *(var_1030h) = s4;
0x0000609c sw ra, 0x103c(sp) | *(var_103ch) = ra;
0x000060a0 sw s6, 0x1038(sp) | *(var_1038h) = s6;
0x000060a4 sw s3, 0x102c(sp) | *(var_102ch) = s3;
0x000060a8 sw s1, 0x1024(sp) | *(var_1024h) = s1;
0x000060ac sw s0, 0x1020(sp) | *(var_1020h) = s0;
0x000060b0 sw v0, 0x101c(sp) | *(var_101ch) = v0;
0x000060b4 sb zero, -0x5cb0(s2) | *((s2 - 23728)) = 0;
0x000060b8 move s4, a0 | s4 = a0;
0x000060bc bal 0x5e5c | sym_get_persistent_names ();
| goto label_2;
0x000060c0 lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (v0 == 0) {
0x000060c4 beqz v0, 0x61e0 | goto label_9;
| }
0x000060c8 move s0, v0 | s0 = v0;
0x000060cc move s3, v0 | s3 = v0;
0x000060d0 lw a0, (s0) | a0 = *(s0);
0x000060d4 lw s1, -0x7f0c(gp) | s1 = sym.get_persistent_name_path;
0x000060d8 addiu s6, sp, 0x1c | s6 = sp + 0x1c;
| if (a0 == 0) {
0x000060dc beqz a0, 0x616c | goto label_3;
| }
0x000060e0 move t9, s1 | t9 = s1;
| do {
0x000060e4 bal 0x5db0 | sym_get_persistent_name_path ();
0x000060e8 nop |
0x000060ec lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (v0 != 0) {
0x000060f0 beqz v0, 0x615c |
0x000060f4 lw t9, -0x7dfc(gp) | t9 = sym.imp.readlink;
0x000060f8 addiu a2, zero, 0x1000 | a2 = 0x1000;
0x000060fc move a1, s6 | a1 = s6;
0x00006100 move a0, v0 | a0 = v0;
0x00006104 jalr t9 | t9 ();
0x00006108 addiu v1, v0, -1 | v1 = v0 + -1;
0x0000610c sltiu v1, v1, 0xfff | v1 = (v1 < 0xfff) ? 1 : 0;
0x00006110 lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (v1 == 0) {
0x00006114 beqz v1, 0x615c | goto label_10;
| }
0x00006118 addiu v1, sp, 0x1020 | v1 = sp + 0x1020;
0x0000611c addu v0, v1, v0 | v0 = v1 + v0;
0x00006120 lw t9, -0x7e60(gp) | t9 = sym.imp.__xpg_basename;
0x00006124 move a0, s6 | a0 = s6;
0x00006128 sb zero, -0x1004(v0) | *((v0 - 4100)) = 0;
0x0000612c jalr t9 | t9 ();
0x00006130 lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (v0 == 0) {
0x00006134 beqz v0, 0x615c | goto label_10;
| }
0x00006138 lb v1, (v0) | v1 = *(v0);
0x0000613c lw t9, -0x7e94(gp) | t9 = sym.imp.strncmp;
| if (v1 == 0) {
0x00006140 beqz v1, 0x615c | goto label_10;
| }
0x00006144 addiu a2, zero, 0x1000 | a2 = 0x1000;
0x00006148 move a1, s4 | a1 = s4;
0x0000614c move a0, v0 | a0 = v0;
0x00006150 jalr t9 | t9 ();
0x00006154 lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (v0 == 0) {
0x00006158 beqz v0, 0x61e8 | goto label_11;
| }
| }
| label_10:
0x0000615c addiu s0, s0, 4 | s0 += 4;
0x00006160 lw a0, (s0) | a0 = *(s0);
0x00006164 move t9, s1 | t9 = s1;
0x00006168 bnez a0, 0x60e4 |
| } while (a0 != 0);
| label_3:
0x0000616c lw a0, (s3) | a0 = *(s3);
0x00006170 addiu s0, s3, 4 | s0 = s3 + 4;
| if (a0 == 0) {
0x00006174 beqz a0, 0x6190 | goto label_12;
| }
| do {
0x00006178 lw t9, -0x7dd8(gp) | t9 = sym.imp.free;
0x0000617c addiu s0, s0, 4 | s0 += 4;
0x00006180 jalr t9 | t9 ();
0x00006184 lw a0, -4(s0) | a0 = *((s0 - 1));
0x00006188 lw gp, 0x10(sp) | gp = *(var_10h_2);
0x0000618c bnez a0, 0x6178 |
| } while (a0 != 0);
| label_12:
0x00006190 lw t9, -0x7dd8(gp) | t9 = sym.imp.free;
0x00006194 move a0, s3 | a0 = s3;
0x00006198 jalr t9 | t9 ();
0x0000619c lb v0, -0x5cb0(s2) | v0 = *((s2 - 23728));
0x000061a0 lw gp, 0x10(sp) | gp = *(var_10h_2);
| if (v0 == 0) {
0x000061a4 beqz v0, 0x61e0 | goto label_9;
| }
0x000061a8 addiu v0, s2, -0x5cb0 | v0 = s2 + -0x5cb0;
| do {
0x000061ac lw a0, 0x101c(sp) | a0 = *(var_101ch);
0x000061b0 lw v1, (s5) | v1 = *(s5);
0x000061b4 lw ra, 0x103c(sp) | ra = *(var_103ch);
| if (a0 != v1) {
0x000061b8 bne a0, v1, 0x620c | goto label_13;
| }
0x000061bc lw s6, 0x1038(sp) | s6 = *(var_1038h);
0x000061c0 lw s5, 0x1034(sp) | s5 = *(var_1034h);
0x000061c4 lw s4, 0x1030(sp) | s4 = *(var_1030h);
0x000061c8 lw s3, 0x102c(sp) | s3 = *(var_102ch);
0x000061cc lw s2, 0x1028(sp) | s2 = *(var_1028h);
0x000061d0 lw s1, 0x1024(sp) | s1 = *(var_1024h);
0x000061d4 lw s0, 0x1020(sp) | s0 = *(var_1020h);
0x000061d8 addiu sp, sp, 0x1040 |
0x000061dc jr ra | return v0;
| label_9:
0x000061e0 move v0, zero | v0 = 0;
0x000061e4 b 0x61ac |
| } while (1);
| label_11:
0x000061e8 lw t9, -0x7e58(gp) | t9 = sym.imp.strncpy;
0x000061ec lw a1, (s0) | a1 = *(s0);
0x000061f0 addiu a2, zero, 0x1000 | a2 = 0x1000;
0x000061f4 addiu a0, s2, -0x5cb0 | a0 = s2 + -0x5cb0;
0x000061f8 jalr t9 | t9 ();
0x000061fc addiu v0, s2, -0x5cb0 | v0 = s2 + -0x5cb0;
0x00006200 lw gp, 0x10(sp) | gp = *(var_10h_2);
0x00006204 sb zero, 0xfff(v0) | *((v0 + 4095)) = 0;
0x00006208 b 0x616c | goto label_3;
| label_13:
0x0000620c lw t9, -0x7df0(gp) | t9 = sym.imp.__stack_chk_fail;
0x00006210 jalr t9 | t9 ();
0x00006214 nop |
0x00006218 lui gp, 2 |
0x0000621c addiu gp, gp, -0x4168 |
0x00006220 addu gp, gp, t9 | gp += t9;
0x00006224 addiu sp, sp, -0x1030 |
0x00006228 lw t9, -0x7f0c(gp) | t9 = sym.get_persistent_name_path;
0x0000622c sw s0, 0x1024(sp) | *(var_1024h_2) = s0;
0x00006230 lw s0, -0x7ddc(gp) | s0 = *((gp - 8055));
0x00006234 sw gp, 0x10(sp) | *(var_10h_3) = gp;
0x00006238 sw ra, 0x102c(sp) | *(var_102ch_2) = ra;
0x0000623c lw v0, (s0) | v0 = *(s0);
0x00006240 sw s1, 0x1028(sp) | *(var_1028h_2) = s1;
0x00006244 sw v0, 0x101c(sp) | *(var_101ch_2) = v0;
0x00006248 bal 0x5db0 | sym_get_persistent_name_path ();
0x0000624c nop |
0x00006250 lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v0 == 0) {
0x00006254 beqz v0, 0x62cc | goto label_14;
| }
0x00006258 lw t9, -0x7dfc(gp) | t9 = sym.imp.readlink;
0x0000625c addiu s1, sp, 0x1c | s1 = sp + 0x1c;
0x00006260 addiu a2, zero, 0x1000 | a2 = 0x1000;
0x00006264 move a1, s1 | a1 = s1;
0x00006268 move a0, v0 | a0 = v0;
0x0000626c jalr t9 | t9 ();
0x00006270 addiu v1, v0, -1 | v1 = v0 + -1;
0x00006274 sltiu v1, v1, 0xfff | v1 = (v1 < 0xfff) ? 1 : 0;
0x00006278 lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v1 == 0) {
0x0000627c beqz v1, 0x62cc | goto label_14;
| }
0x00006280 addiu v1, sp, 0x1020 | v1 = sp + 0x1020;
0x00006284 addu v0, v1, v0 | v0 = v1 + v0;
0x00006288 lw t9, -0x7e60(gp) | t9 = sym.imp.__xpg_basename;
0x0000628c move a0, s1 | a0 = s1;
0x00006290 sb zero, -0x1004(v0) | *((v0 - 4100)) = 0;
0x00006294 jalr t9 | t9 ();
0x00006298 lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v0 == 0) {
0x0000629c beqz v0, 0x62cc | goto label_14;
| }
0x000062a0 lb v1, (v0) | v1 = *(v0);
| if (v1 == 0) {
0x000062a4 beql v1, zero, 0x62ac | goto label_15;
| }
0x000062a8 move v0, zero | v0 = 0;
| do {
| label_15:
0x000062ac lw a0, 0x101c(sp) | a0 = *(var_101ch_2);
0x000062b0 lw v1, (s0) | v1 = *(s0);
0x000062b4 lw ra, 0x102c(sp) | ra = *(var_102ch_2);
| if (a0 != v1) {
0x000062b8 bne a0, v1, 0x62d4 | goto label_16;
| }
0x000062bc lw s1, 0x1028(sp) | s1 = *(var_1028h_2);
0x000062c0 lw s0, 0x1024(sp) | s0 = *(var_1024h_2);
0x000062c4 addiu sp, sp, 0x1030 |
0x000062c8 jr ra | return v0;
| label_14:
0x000062cc move v0, zero | v0 = 0;
0x000062d0 b 0x62ac |
| } while (1);
| label_16:
0x000062d4 lw t9, -0x7df0(gp) | t9 = sym.imp.__stack_chk_fail;
0x000062d8 jalr t9 | t9 ();
0x000062dc nop |
| }
[*] Function strcpy used 2 times cifsiostat