[*] Binary protection state of mfgbox
Full RELRO Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function sprintf tear down of mfgbox
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/bin/mfgbox @ 0x403e04 */
| #include <stdint.h>
|
; (fcn) sym.CheckVersion_int__char_const_ () | void CheckVersion_int_char_const_ () {
| /* CheckVersion(int, char const*) */
0x00403e04 lui gp, 2 |
0x00403e08 addiu gp, gp, 0x124c |
0x00403e0c addu gp, gp, t9 | gp += t9;
0x00403e10 addiu sp, sp, -0x1088 |
0x00403e14 sw ra, 0x1084(sp) | *(var_1084h) = ra;
0x00403e18 sw fp, 0x1080(sp) | *(var_1080h) = fp;
0x00403e1c sw s1, 0x107c(sp) | *(var_107ch) = s1;
0x00403e20 sw s0, 0x1078(sp) | *(var_1078h) = s0;
0x00403e24 move fp, sp | fp = sp;
0x00403e28 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00403e2c sw a0, 0x1c(fp) | *(arg_1ch) = a0;
0x00403e30 sw a1, 0x18(fp) | *(arg_18h) = a1;
0x00403e34 lw t8, -0x7e58(gp) | t8 = *((gp - 8086));
0x00403e38 lw t8, (t8) | t8 = *(t8);
0x00403e3c sw t8, 0x1074(fp) | *(arg_1074h) = t8;
0x00403e40 addiu t8, fp, 0x3c | t8 = fp + 0x3c;
0x00403e44 move a0, t8 | a0 = t8;
0x00403e48 lw t8, -0x7f80(gp) | t8 = *(gp);
0x00403e4c move t9, t8 | t9 = t8;
0x00403e50 jalr t9 | t9 ();
0x00403e54 nop |
0x00403e58 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403e5c lw v0, 0x1c(fp) | v0 = *(arg_1ch);
0x00403e60 addiu t8, zero, 2 | t8 = 2;
| if (v0 != t8) {
0x00403e64 beq v0, t8, 0x403e90 |
0x00403e68 nop |
0x00403e6c lw t8, -0x7f8c(gp) | t8 = *(gp);
| /* aav.0x00403d80 */
0x00403e70 addiu t8, t8, 0x3d80 | t8 += 0x3d80;
0x00403e74 move t9, t8 | t9 = t8;
0x00403e78 jalr t9 | t9 ();
0x00403e7c nop |
0x00403e80 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403e84 move s0, zero | s0 = 0;
0x00403e88 b 0x404224 | goto label_0;
0x00403e8c nop |
| }
0x00403e90 addiu t8, fp, 0x3c | t8 = fp + 0x3c;
0x00403e94 move a0, t8 | a0 = t8;
0x00403e98 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'System' */
0x00403e9c addiu a1, t8, -0x5768 | a1 = t8 + -0x5768;
0x00403ea0 move a2, zero | a2 = 0;
0x00403ea4 lw t8, -0x7f1c(gp) | t8 = *(gp);
0x00403ea8 move t9, t8 | t9 = t8;
0x00403eac jalr t9 | t9 ();
0x00403eb0 nop |
0x00403eb4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403eb8 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00403ebc move a0, t8 | a0 = t8;
0x00403ec0 lw t8, -0x7f40(gp) | t8 = *(gp);
0x00403ec4 move t9, t8 | t9 = t8;
0x00403ec8 jalr t9 | t9 ();
0x00403ecc nop |
0x00403ed0 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403ed4 addiu v0, fp, 0x30 | v0 = fp + 0x30;
0x00403ed8 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00403edc move a0, v0 | a0 = v0;
0x00403ee0 lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
| /* esilref: 'Version' */
0x00403ee4 addiu a1, v0, -0x5760 | a1 = v0 + -0x5760;
0x00403ee8 move a2, t8 | a2 = t8;
0x00403eec lw t8, -0x7ed4(gp) | t8 = *(gp);
0x00403ef0 move t9, t8 | t9 = t8;
0x00403ef4 jalr t9 | t9 ();
0x00403ef8 nop |
0x00403efc lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403f00 addiu v1, fp, 0x24 | v1 = fp + 0x24;
0x00403f04 addiu v0, fp, 0x3c | v0 = fp + 0x3c;
0x00403f08 addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x00403f0c move a0, v1 | a0 = v1;
0x00403f10 move a1, v0 | a1 = v0;
0x00403f14 move a2, t8 | a2 = t8;
0x00403f18 lw t8, -0x7ecc(gp) | t8 = *(gp);
0x00403f1c move t9, t8 | t9 = t8;
0x00403f20 jalr t9 | t9 ();
0x00403f24 nop |
0x00403f28 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403f2c addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x00403f30 move a0, t8 | a0 = t8;
0x00403f34 lw t8, -0x7e9c(gp) | t8 = *(gp);
0x00403f38 move t9, t8 | t9 = t8;
0x00403f3c jalr t9 | t9 ();
0x00403f40 nop |
0x00403f44 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403f48 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00403f4c move a0, t8 | a0 = t8;
0x00403f50 lw t8, -0x7f0c(gp) | t8 = *(gp);
0x00403f54 move t9, t8 | t9 = t8;
0x00403f58 jalr t9 | t9 ();
0x00403f5c nop |
0x00403f60 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403f64 addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x00403f68 move a0, t8 | a0 = t8;
0x00403f6c lw t8, -0x7f40(gp) | t8 = *(gp);
0x00403f70 move t9, t8 | t9 = t8;
0x00403f74 jalr t9 | t9 ();
0x00403f78 nop |
0x00403f7c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403f80 addiu v0, fp, 0x2c | v0 = fp + 0x2c;
0x00403f84 addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x00403f88 move a0, v0 | a0 = v0;
0x00403f8c lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
| /* esilref: 'OEMVersion' */
0x00403f90 addiu a1, v0, -0x5758 | a1 = v0 + -0x5758;
0x00403f94 move a2, t8 | a2 = t8;
0x00403f98 lw t8, -0x7ed4(gp) | t8 = *(gp);
0x00403f9c move t9, t8 | t9 = t8;
0x00403fa0 jalr t9 | t9 ();
0x00403fa4 nop |
0x00403fa8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403fac addiu v1, fp, 0x28 | v1 = fp + 0x28;
0x00403fb0 addiu v0, fp, 0x3c | v0 = fp + 0x3c;
0x00403fb4 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00403fb8 move a0, v1 | a0 = v1;
0x00403fbc move a1, v0 | a1 = v0;
0x00403fc0 move a2, t8 | a2 = t8;
0x00403fc4 lw t8, -0x7ecc(gp) | t8 = *(gp);
0x00403fc8 move t9, t8 | t9 = t8;
0x00403fcc jalr t9 | t9 ();
0x00403fd0 nop |
0x00403fd4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403fd8 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00403fdc move a0, t8 | a0 = t8;
0x00403fe0 lw t8, -0x7e9c(gp) | t8 = *(gp);
0x00403fe4 move t9, t8 | t9 = t8;
0x00403fe8 jalr t9 | t9 ();
0x00403fec nop |
0x00403ff0 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00403ff4 addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x00403ff8 move a0, t8 | a0 = t8;
0x00403ffc lw t8, -0x7f0c(gp) | t8 = *(gp);
0x00404000 move t9, t8 | t9 = t8;
0x00404004 jalr t9 | t9 ();
0x00404008 nop |
0x0040400c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00404010 addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x00404014 move a0, t8 | a0 = t8;
0x00404018 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x0040401c addiu a1, t8, -0x574c | a1 = t8 + -0x574c;
0x00404020 move a2, zero | a2 = 0;
0x00404024 lw t8, -0x7e8c(gp) | t8 = *(gp);
0x00404028 move t9, t8 | t9 = t8;
0x0040402c jalr t9 | t9 ();
0x00404030 nop |
0x00404034 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00404038 move t8, v0 | t8 = v0;
0x0040403c sw t8, 0x34(fp) | *(arg_34h) = t8;
0x00404040 lw v0, 0x34(fp) | v0 = *(arg_34h);
0x00404044 addiu t8, zero, -1 | t8 = -1;
| if (v0 == t8) {
0x00404048 bne v0, t8, 0x404078 |
0x0040404c nop |
0x00404050 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'failed ' */
0x00404054 addiu a0, t8, -0x5748 | a0 = t8 + -0x5748;
0x00404058 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x0040405c move t9, t8 | t9 = t8;
0x00404060 jalr t9 | t9 ();
0x00404064 nop |
0x00404068 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040406c move s0, zero | s0 = 0;
0x00404070 b 0x4041a4 | goto label_1;
0x00404074 nop |
| }
0x00404078 lw t8, 0x34(fp) | t8 = *(arg_34h);
0x0040407c addiu v1, fp, 0x30 | v1 = fp + 0x30;
0x00404080 addiu v0, fp, 0x24 | v0 = fp + 0x24;
0x00404084 move a0, v1 | a0 = v1;
0x00404088 move a1, v0 | a1 = v0;
0x0040408c move a2, t8 | a2 = t8;
0x00404090 addiu a3, zero, -1 | a3 = -1;
0x00404094 lw t8, -0x7ef4(gp) | t8 = *(gp);
0x00404098 move t9, t8 | t9 = t8;
0x0040409c jalr t9 | t9 ();
0x004040a0 nop |
0x004040a4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004040a8 addiu t8, fp, 0x28 | t8 = fp + 0x28;
0x004040ac move a0, t8 | a0 = t8;
0x004040b0 lw t8, -0x7e6c(gp) | t8 = *(gp);
0x004040b4 move t9, t8 | t9 = t8;
0x004040b8 jalr t9 | t9 ();
0x004040bc nop |
0x004040c0 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004040c4 move s0, v0 | s0 = v0;
0x004040c8 addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x004040cc move a0, t8 | a0 = t8;
0x004040d0 lw t8, -0x7e6c(gp) | t8 = *(gp);
0x004040d4 move t9, t8 | t9 = t8;
0x004040d8 jalr t9 | t9 ();
0x004040dc nop |
0x004040e0 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004040e4 move t8, v0 | t8 = v0;
0x004040e8 addiu v0, fp, 0x1054 | v0 = fp + 0x1054;
0x004040ec move a0, v0 | a0 = v0;
0x004040f0 lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
| /* str._s_s */
0x004040f4 addiu a1, v0, -0x5740 | a1 = v0 + -0x5740;
0x004040f8 move a2, s0 | a2 = s0;
0x004040fc move a3, t8 | a3 = t8;
0x00404100 lw t8, -0x7f14(gp) | t8 = sym.imp.sprintf
0x00404104 move t9, t8 | t9 = t8;
0x00404108 jalr t9 | t9 ();
0x0040410c nop |
0x00404110 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00404114 addiu t8, fp, 0x1054 | t8 = fp + 0x1054;
0x00404118 move a0, t8 | a0 = t8;
0x0040411c lw a1, 0x18(fp) | a1 = *(arg_18h);
0x00404120 addiu a2, zero, 0x80 | a2 = 0x80;
0x00404124 lw t8, -0x7e7c(gp) | t8 = sym.imp.strncmp;
0x00404128 move t9, t8 | t9 = t8;
0x0040412c jalr t9 | t9 ();
0x00404130 nop |
0x00404134 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00404138 move t8, v0 | t8 = v0;
| if (t8 == 0) {
0x0040413c bnez t8, 0x404168 |
0x00404140 nop |
0x00404144 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'ok' */
0x00404148 addiu a0, t8, -0x5738 | a0 = t8 + -0x5738;
0x0040414c lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x00404150 move t9, t8 | t9 = t8;
0x00404154 jalr t9 | t9 ();
0x00404158 nop |
0x0040415c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00404160 b 0x404184 | goto label_2;
0x00404164 nop |
| }
0x00404168 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'failed' */
0x0040416c addiu a0, t8, -0x5734 | a0 = t8 + -0x5734;
0x00404170 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x00404174 move t9, t8 | t9 = t8;
0x00404178 jalr t9 | t9 ();
0x0040417c nop |
0x00404180 lw gp, 0x10(fp) | gp = *(arg_10h);
| label_2:
0x00404184 addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x00404188 move a0, t8 | a0 = t8;
0x0040418c lw t8, -0x7e9c(gp) | t8 = *(gp);
0x00404190 move t9, t8 | t9 = t8;
0x00404194 jalr t9 | t9 ();
0x00404198 nop |
0x0040419c lw gp, 0x10(fp) | gp = *(arg_10h);
0x004041a0 addiu s0, zero, 1 | s0 = 1;
| label_1:
0x004041a4 addiu t8, fp, 0x28 | t8 = fp + 0x28;
0x004041a8 move a0, t8 | a0 = t8;
0x004041ac lw t8, -0x7e9c(gp) | t8 = *(gp);
0x004041b0 move t9, t8 | t9 = t8;
0x004041b4 jalr t9 | t9 ();
0x004041b8 nop |
0x004041bc lw gp, 0x10(fp) | gp = *(arg_10h);
0x004041c0 addiu t8, zero, 1 | t8 = 1;
| if (s0 != t8) {
0x004041c4 beq s0, t8, 0x4041d8 |
0x004041c8 nop |
0x004041cc move s0, zero | s0 = 0;
0x004041d0 b 0x4041e0 | goto label_3;
0x004041d4 nop |
| }
0x004041d8 nop |
0x004041dc addiu s0, zero, 1 | s0 = 1;
| label_3:
0x004041e0 addiu t8, fp, 0x24 | t8 = fp + 0x24;
0x004041e4 move a0, t8 | a0 = t8;
0x004041e8 lw t8, -0x7e9c(gp) | t8 = *(gp);
0x004041ec move t9, t8 | t9 = t8;
0x004041f0 jalr t9 | t9 ();
0x004041f4 nop |
0x004041f8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004041fc addiu t8, zero, 1 | t8 = 1;
| if (s0 == t8) {
0x00404200 bne s0, t8, 0x404214 |
0x00404204 nop |
0x00404208 nop |
0x0040420c b 0x404220 | goto label_4;
0x00404210 nop |
| }
0x00404214 move s0, zero | s0 = 0;
0x00404218 b 0x404224 | goto label_0;
0x0040421c nop |
| label_4:
0x00404220 addiu s0, zero, 1 | s0 = 1;
| label_0:
0x00404224 addiu t8, fp, 0x3c | t8 = fp + 0x3c;
0x00404228 move a0, t8 | a0 = t8;
0x0040422c lw t8, -0x7f04(gp) | t8 = sym.imp.TinyDB::TinyDB__;
0x00404230 move t9, t8 | t9 = t8;
0x00404234 jalr t9 | t9 ();
0x00404238 nop |
0x0040423c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00404240 addiu t8, zero, 1 | t8 = 1;
| if (s0 == t8) {
0x00404244 bne s0, t8, 0x404524 |
0x00404248 nop |
0x0040424c nop |
0x00404250 b 0x404524 | goto label_5;
0x00404254 nop |
| }
| label_5:
0x00404524 lw t8, -0x7e58(gp) | t8 = *((gp - 8086));
0x00404528 lw v0, 0x1074(fp) | v0 = *(arg_1074h);
0x0040452c lw t8, (t8) | t8 = *(t8);
| if (v0 != t8) {
0x00404530 beq v0, t8, 0x404548 |
0x00404534 nop |
0x00404538 lw t8, -0x7ebc(gp) | t8 = sym.imp.__stack_chk_fail;
0x0040453c move t9, t8 | t9 = t8;
0x00404540 jalr t9 | t9 ();
0x00404544 nop |
| }
0x00404548 move sp, fp |
0x0040454c lw ra, 0x1084(sp) | ra = *(var_1084h);
0x00404550 lw fp, 0x1080(sp) | fp = *(var_1080h);
0x00404554 lw s1, 0x107c(sp) | s1 = *(var_107ch);
0x00404558 lw s0, 0x1078(sp) | s0 = *(var_1078h);
0x0040455c addiu sp, sp, 0x1088 |
0x00404560 jr ra | return v0;
0x00404564 nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/bin/mfgbox @ 0x406fa4 */
| #include <stdint.h>
|
; (fcn) sym.TestRTC_int__char_const_ () | void TestRTC_int_char_const_ () {
| /* TestRTC(int, char const*) */
0x00406fa4 lui gp, 2 |
0x00406fa8 addiu gp, gp, -0x1f54 |
0x00406fac addu gp, gp, t9 | gp += t9;
0x00406fb0 addiu sp, sp, -0x100 |
0x00406fb4 sw ra, 0xfc(sp) | *(var_fch) = ra;
0x00406fb8 sw fp, 0xf8(sp) | *(var_f8h) = fp;
0x00406fbc move fp, sp | fp = sp;
0x00406fc0 sw gp, 0x10(sp) | *(var_10h) = gp;
0x00406fc4 sw a0, 0x1c(fp) | *(arg_1ch) = a0;
0x00406fc8 sw a1, 0x18(fp) | *(arg_18h) = a1;
0x00406fcc lw t8, -0x7e58(gp) | t8 = *((gp - 8086));
0x00406fd0 lw t8, (t8) | t8 = *(t8);
0x00406fd4 sw t8, 0xf4(fp) | *(arg_f4h) = t8;
0x00406fd8 addiu v0, fp, 0x34 | v0 = fp + 0x34;
0x00406fdc addiu t8, zero, 0x40 | t8 = 0x40;
0x00406fe0 move a0, v0 | a0 = v0;
0x00406fe4 move a1, zero | a1 = 0;
0x00406fe8 move a2, t8 | a2 = t8;
0x00406fec lw t8, -0x7ef8(gp) | t8 = sym.imp.memset;
0x00406ff0 move t9, t8 | t9 = t8;
0x00406ff4 jalr t9 | t9 ();
0x00406ff8 nop |
0x00406ffc lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407000 addiu v0, fp, 0x74 | v0 = fp + 0x74;
0x00407004 addiu t8, zero, 0x40 | t8 = 0x40;
0x00407008 move a0, v0 | a0 = v0;
0x0040700c move a1, zero | a1 = 0;
0x00407010 move a2, t8 | a2 = t8;
0x00407014 lw t8, -0x7ef8(gp) | t8 = sym.imp.memset;
0x00407018 move t9, t8 | t9 = t8;
0x0040701c jalr t9 | t9 ();
0x00407020 nop |
0x00407024 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407028 sw zero, 0x28(fp) | *(arg_28h) = 0;
0x0040702c lw v0, 0x1c(fp) | v0 = *(arg_1ch);
0x00407030 addiu t8, zero, 2 | t8 = 2;
| if (v0 != t8) {
0x00407034 beq v0, t8, 0x40705c |
0x00407038 nop |
0x0040703c lw t8, -0x7f8c(gp) | t8 = *(gp);
| /* aav.0x00406f20 */
0x00407040 addiu t8, t8, 0x6f20 | t8 += 0x6f20;
0x00407044 move t9, t8 | t9 = t8;
0x00407048 jalr t9 | t9 ();
0x0040704c nop |
0x00407050 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407054 b 0x40725c | goto label_0;
0x00407058 nop |
| }
0x0040705c addiu t8, fp, 0xb4 | t8 = fp + 0xb4;
0x00407060 move a0, t8 | a0 = t8;
0x00407064 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.date__u__s */
0x00407068 addiu a1, t8, -0x52fc | a1 = t8 + -0x52fc;
0x0040706c lw a2, 0x18(fp) | a2 = *(arg_18h);
0x00407070 lw t8, -0x7f14(gp) | t8 = sym.imp.sprintf
0x00407074 move t9, t8 | t9 = t8;
0x00407078 jalr t9 | t9 ();
0x0040707c nop |
0x00407080 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407084 addiu t8, fp, 0xb4 | t8 = fp + 0xb4;
0x00407088 move a0, t8 | a0 = t8;
0x0040708c lw t8, -0x7e5c(gp) | t8 = sym.imp.system;
0x00407090 move t9, t8 | t9 = t8;
0x00407094 jalr t9 | t9 ();
0x00407098 nop |
0x0040709c lw gp, 0x10(fp) | gp = *(arg_10h);
0x004070a0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.hwclock__w__u */
0x004070a4 addiu a0, t8, -0x52f0 | a0 = t8 + -0x52f0;
0x004070a8 lw t8, -0x7e5c(gp) | t8 = sym.imp.system;
0x004070ac move t9, t8 | t9 = t8;
0x004070b0 jalr t9 | t9 ();
0x004070b4 nop |
0x004070b8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004070bc sw zero, 0x24(fp) | *(arg_24h) = 0;
0x004070c0 b 0x4071fc | goto label_1;
0x004070c4 nop |
| do {
0x004070c8 addiu a0, zero, 1 | a0 = 1;
0x004070cc lw t8, -0x7e70(gp) | t8 = sym.imp.sleep;
0x004070d0 move t9, t8 | t9 = t8;
0x004070d4 jalr t9 | t9 ();
0x004070d8 nop |
0x004070dc lw gp, 0x10(fp) | gp = *(arg_10h);
0x004070e0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.date__u */
0x004070e4 addiu a0, t8, -0x52e0 | a0 = t8 + -0x52e0;
0x004070e8 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x004070ec addiu a1, t8, -0x52d8 | a1 = t8 + -0x52d8;
0x004070f0 lw t8, -0x7f48(gp) | t8 = sym.imp.popen;
0x004070f4 move t9, t8 | t9 = t8;
0x004070f8 jalr t9 | t9 ();
0x004070fc nop |
0x00407100 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407104 move t8, v0 | t8 = v0;
0x00407108 sw t8, 0x2c(fp) | *(arg_2ch) = t8;
0x0040710c lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.hwclock */
0x00407110 addiu a0, t8, -0x52d4 | a0 = t8 + -0x52d4;
0x00407114 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x00407118 addiu a1, t8, -0x52d8 | a1 = t8 + -0x52d8;
0x0040711c lw t8, -0x7f48(gp) | t8 = sym.imp.popen;
0x00407120 move t9, t8 | t9 = t8;
0x00407124 jalr t9 | t9 ();
0x00407128 nop |
0x0040712c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407130 move t8, v0 | t8 = v0;
0x00407134 sw t8, 0x30(fp) | *(arg_30h) = t8;
0x00407138 addiu t8, fp, 0x34 | t8 = fp + 0x34;
0x0040713c move a0, t8 | a0 = t8;
0x00407140 addiu a1, zero, 0x40 | a1 = 0x40;
0x00407144 lw a2, 0x2c(fp) | a2 = *(arg_2ch);
0x00407148 lw t8, -0x7ee8(gp) | t8 = sym.imp.fgets;
0x0040714c move t9, t8 | t9 = t8;
0x00407150 jalr t9 | t9 ();
0x00407154 nop |
0x00407158 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040715c addiu t8, fp, 0x74 | t8 = fp + 0x74;
0x00407160 move a0, t8 | a0 = t8;
0x00407164 addiu a1, zero, 0x40 | a1 = 0x40;
0x00407168 lw a2, 0x30(fp) | a2 = *(arg_30h);
0x0040716c lw t8, -0x7ee8(gp) | t8 = sym.imp.fgets;
0x00407170 move t9, t8 | t9 = t8;
0x00407174 jalr t9 | t9 ();
0x00407178 nop |
0x0040717c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407180 addiu v0, fp, 0x74 | v0 = fp + 0x74;
0x00407184 addiu t8, fp, 0x34 | t8 = fp + 0x34;
0x00407188 move a0, v0 | a0 = v0;
0x0040718c move a1, t8 | a1 = t8;
0x00407190 addiu a2, zero, 0x12 | a2 = 0x12;
0x00407194 lw t8, -0x7e7c(gp) | t8 = sym.imp.strncmp;
0x00407198 move t9, t8 | t9 = t8;
0x0040719c jalr t9 | t9 ();
0x004071a0 nop |
0x004071a4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004071a8 move t8, v0 | t8 = v0;
| if (t8 == 0) {
0x004071ac bnez t8, 0x4071c0 |
0x004071b0 nop |
0x004071b4 lw t8, 0x28(fp) | t8 = *(arg_28h);
0x004071b8 addiu t8, t8, 1 | t8++;
0x004071bc sw t8, 0x28(fp) | *(arg_28h) = t8;
| }
0x004071c0 lw a0, 0x2c(fp) | a0 = *(arg_2ch);
0x004071c4 lw t8, -0x7eac(gp) | t8 = sym.imp.pclose;
0x004071c8 move t9, t8 | t9 = t8;
0x004071cc jalr t9 | t9 ();
0x004071d0 nop |
0x004071d4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004071d8 lw a0, 0x30(fp) | a0 = *(arg_30h);
0x004071dc lw t8, -0x7eac(gp) | t8 = sym.imp.pclose;
0x004071e0 move t9, t8 | t9 = t8;
0x004071e4 jalr t9 | t9 ();
0x004071e8 nop |
0x004071ec lw gp, 0x10(fp) | gp = *(arg_10h);
0x004071f0 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x004071f4 addiu t8, t8, 1 | t8++;
0x004071f8 sw t8, 0x24(fp) | *(arg_24h) = t8;
| label_1:
0x004071fc lw t8, 0x24(fp) | t8 = *(arg_24h);
0x00407200 slti t8, t8, 3 | t8 = (t8 < 3) ? 1 : 0;
0x00407204 bnez t8, 0x4070c8 |
| } while (t8 != 0);
0x00407208 nop |
0x0040720c lw t8, 0x28(fp) | t8 = *(arg_28h);
0x00407210 slti t8, t8, 2 | t8 = (t8 < 2) ? 1 : 0;
| if (t8 == 0) {
0x00407214 bnez t8, 0x407240 |
0x00407218 nop |
0x0040721c lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'ok' */
0x00407220 addiu a0, t8, -0x52cc | a0 = t8 + -0x52cc;
0x00407224 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x00407228 move t9, t8 | t9 = t8;
0x0040722c jalr t9 | t9 ();
0x00407230 nop |
0x00407234 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407238 b 0x40725c | goto label_0;
0x0040723c nop |
| }
0x00407240 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'failed' */
0x00407244 addiu a0, t8, -0x52c8 | a0 = t8 + -0x52c8;
0x00407248 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x0040724c move t9, t8 | t9 = t8;
0x00407250 jalr t9 | t9 ();
0x00407254 nop |
0x00407258 lw gp, 0x10(fp) | gp = *(arg_10h);
| label_0:
0x0040725c lw t8, -0x7e58(gp) | t8 = *((gp - 8086));
0x00407260 lw v0, 0xf4(fp) | v0 = *(arg_f4h);
0x00407264 lw t8, (t8) | t8 = *(t8);
| if (v0 != t8) {
0x00407268 beq v0, t8, 0x407280 |
0x0040726c nop |
0x00407270 lw t8, -0x7ebc(gp) | t8 = sym.imp.__stack_chk_fail;
0x00407274 move t9, t8 | t9 = t8;
0x00407278 jalr t9 | t9 ();
0x0040727c nop |
| }
0x00407280 move sp, fp |
0x00407284 lw ra, 0xfc(sp) | ra = *(var_fch);
0x00407288 lw fp, 0xf8(sp) | fp = *(var_f8h);
0x0040728c addiu sp, sp, 0x100 |
0x00407290 jr ra | return v0;
0x00407294 nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/bin/mfgbox @ 0x408cb8 */
| #include <stdint.h>
|
; (fcn) sym.TestWireless_int__char_const_ () | void TestWireless_int_char_const_ () {
| /* TestWireless(int, char const**) */
0x00408cb8 lui gp, 2 |
0x00408cbc addiu gp, gp, -0x3c68 |
0x00408cc0 addu gp, gp, t9 | gp += t9;
0x00408cc4 addiu sp, sp, -0x3968 |
0x00408cc8 sw ra, 0x3964(sp) | *(arg_3964h) = ra;
0x00408ccc sw fp, 0x3960(sp) | *(arg_3960h) = fp;
0x00408cd0 sw s0, 0x395c(sp) | *(arg_395ch) = s0;
0x00408cd4 move fp, sp | fp = sp;
0x00408cd8 sw gp, 0x10(sp) | *(arg_10h) = gp;
0x00408cdc sw a0, 0x1c(fp) | *(arg_1ch) = a0;
0x00408ce0 sw a1, 0x18(fp) | *(arg_18h) = a1;
0x00408ce4 lw t8, -0x7e58(gp) | t8 = *((gp - 8086));
0x00408ce8 lw t8, (t8) | t8 = *(t8);
0x00408cec sw t8, 0x3954(fp) | *(arg_3954h) = t8;
0x00408cf0 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00408cf4 move a0, t8 | a0 = t8;
0x00408cf8 lw t8, -0x7f84(gp) | t8 = *(gp);
0x00408cfc move t9, t8 | t9 = t8;
0x00408d00 jalr t9 | t9 ();
0x00408d04 nop |
0x00408d08 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408d0c addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00408d10 move a0, t8 | a0 = t8;
0x00408d14 lw t8, -0x7f18(gp) | t8 = *(gp);
0x00408d18 move t9, t8 | t9 = t8;
0x00408d1c jalr t9 | t9 ();
0x00408d20 nop |
0x00408d24 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408d28 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00408d2c move a0, t8 | a0 = t8;
0x00408d30 lw t8, -0x7ec8(gp) | t8 = *(gp);
0x00408d34 move t9, t8 | t9 = t8;
0x00408d38 jalr t9 | t9 ();
0x00408d3c nop |
0x00408d40 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408d44 move t8, v0 | t8 = v0;
0x00408d48 xori t8, t8, 1 | t8 ^= 1;
0x00408d4c andi t8, t8, 0xff | t8 &= 0xff;
| if (t8 != 0) {
0x00408d50 beqz t8, 0x408d80 |
0x00408d54 nop |
0x00408d58 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.No_Wireless_Capabilities */
0x00408d5c addiu a0, t8, -0x4d90 | a0 = t8 + -0x4d90;
0x00408d60 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x00408d64 move t9, t8 | t9 = t8;
0x00408d68 jalr t9 | t9 ();
0x00408d6c nop |
0x00408d70 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408d74 move s0, zero | s0 = 0;
0x00408d78 b 0x409340 | goto label_0;
0x00408d7c nop |
| }
0x00408d80 lw v0, 0x1c(fp) | v0 = *(arg_1ch);
0x00408d84 addiu t8, zero, 2 | t8 = 2;
| if (v0 == t8) {
0x00408d88 bne v0, t8, 0x408e10 |
0x00408d8c nop |
0x00408d90 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00408d94 addiu t8, t8, 4 | t8 += 4;
0x00408d98 lw t8, (t8) | t8 = *(t8);
0x00408d9c move a0, t8 | a0 = t8;
0x00408da0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.region */
0x00408da4 addiu a1, t8, -0x4d74 | a1 = t8 + -0x4d74;
0x00408da8 lw t8, -0x7f2c(gp) | t8 = sym.imp.strcmp;
0x00408dac move t9, t8 | t9 = t8;
0x00408db0 jalr t9 | t9 ();
0x00408db4 nop |
0x00408db8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408dbc move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x00408dc0 bnez t8, 0x408e10 | goto label_1;
| }
0x00408dc4 nop |
0x00408dc8 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00408dcc move a0, t8 | a0 = t8;
0x00408dd0 lw t8, -0x7e74(gp) | t8 = *(gp);
0x00408dd4 move t9, t8 | t9 = t8;
0x00408dd8 jalr t9 | t9 ();
0x00408ddc nop |
0x00408de0 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408de4 move t8, v0 | t8 = v0;
0x00408de8 lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
| /* str.Region___d_n */
0x00408dec addiu a0, v0, -0x4d6c | a0 = v0 + -0x4d6c;
0x00408df0 move a1, t8 | a1 = t8;
0x00408df4 lw t8, -0x7f44(gp) | t8 = sym.imp.printf;
0x00408df8 move t9, t8 | t9 = t8;
0x00408dfc jalr t9 | t9 ();
0x00408e00 nop |
0x00408e04 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408e08 b 0x40933c | goto label_2;
0x00408e0c nop |
| }
| label_1:
0x00408e10 lw v0, 0x1c(fp) | v0 = *(arg_1ch);
0x00408e14 addiu t8, zero, 2 | t8 = 2;
| if (v0 == t8) {
0x00408e18 bne v0, t8, 0x408eb0 |
0x00408e1c nop |
0x00408e20 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00408e24 addiu t8, t8, 4 | t8 += 4;
0x00408e28 lw t8, (t8) | t8 = *(t8);
0x00408e2c move a0, t8 | a0 = t8;
0x00408e30 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.enable */
0x00408e34 addiu a1, t8, -0x4d5c | a1 = t8 + -0x4d5c;
0x00408e38 lw t8, -0x7f2c(gp) | t8 = sym.imp.strcmp;
0x00408e3c move t9, t8 | t9 = t8;
0x00408e40 jalr t9 | t9 ();
0x00408e44 nop |
0x00408e48 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408e4c move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x00408e50 bnez t8, 0x408eb0 | goto label_3;
| }
0x00408e54 nop |
0x00408e58 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.curl_127.0.0.1_config_wireless.cgi_enableon____dev_null_2___dev_null */
0x00408e5c addiu a0, t8, -0x4d54 | a0 = t8 + -0x4d54;
0x00408e60 lw t8, -0x7e5c(gp) | t8 = sym.imp.system;
0x00408e64 move t9, t8 | t9 = t8;
0x00408e68 jalr t9 | t9 ();
0x00408e6c nop |
0x00408e70 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408e74 addiu a0, zero, 3 | a0 = 3;
0x00408e78 lw t8, -0x7e70(gp) | t8 = sym.imp.sleep;
0x00408e7c move t9, t8 | t9 = t8;
0x00408e80 jalr t9 | t9 ();
0x00408e84 nop |
0x00408e88 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408e8c lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'ok' */
0x00408e90 addiu a0, t8, -0x4d0c | a0 = t8 + -0x4d0c;
0x00408e94 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x00408e98 move t9, t8 | t9 = t8;
0x00408e9c jalr t9 | t9 ();
0x00408ea0 nop |
0x00408ea4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408ea8 b 0x40933c | goto label_2;
0x00408eac nop |
| }
| label_3:
0x00408eb0 lw v0, 0x1c(fp) | v0 = *(arg_1ch);
0x00408eb4 addiu t8, zero, 2 | t8 = 2;
| if (v0 == t8) {
0x00408eb8 bne v0, t8, 0x408f50 |
0x00408ebc nop |
0x00408ec0 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00408ec4 addiu t8, t8, 4 | t8 += 4;
0x00408ec8 lw t8, (t8) | t8 = *(t8);
0x00408ecc move a0, t8 | a0 = t8;
0x00408ed0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.disable */
0x00408ed4 addiu a1, t8, -0x4d08 | a1 = t8 + -0x4d08;
0x00408ed8 lw t8, -0x7f2c(gp) | t8 = sym.imp.strcmp;
0x00408edc move t9, t8 | t9 = t8;
0x00408ee0 jalr t9 | t9 ();
0x00408ee4 nop |
0x00408ee8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408eec move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x00408ef0 bnez t8, 0x408f50 | goto label_4;
| }
0x00408ef4 nop |
0x00408ef8 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.curl_127.0.0.1_config_wireless.cgi_enableoff____dev_null_2___dev_null */
0x00408efc addiu a0, t8, -0x4d00 | a0 = t8 + -0x4d00;
0x00408f00 lw t8, -0x7e5c(gp) | t8 = sym.imp.system;
0x00408f04 move t9, t8 | t9 = t8;
0x00408f08 jalr t9 | t9 ();
0x00408f0c nop |
0x00408f10 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408f14 addiu a0, zero, 3 | a0 = 3;
0x00408f18 lw t8, -0x7e70(gp) | t8 = sym.imp.sleep;
0x00408f1c move t9, t8 | t9 = t8;
0x00408f20 jalr t9 | t9 ();
0x00408f24 nop |
0x00408f28 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408f2c lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'ok' */
0x00408f30 addiu a0, t8, -0x4d0c | a0 = t8 + -0x4d0c;
0x00408f34 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x00408f38 move t9, t8 | t9 = t8;
0x00408f3c jalr t9 | t9 ();
0x00408f40 nop |
0x00408f44 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408f48 b 0x40933c | goto label_2;
0x00408f4c nop |
| }
| label_4:
0x00408f50 lw v0, 0x1c(fp) | v0 = *(arg_1ch);
0x00408f54 addiu t8, zero, 3 | t8 = 3;
| if (v0 == t8) {
0x00408f58 bne v0, t8, 0x409104 |
0x00408f5c nop |
0x00408f60 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00408f64 addiu t8, t8, 4 | t8 += 4;
0x00408f68 lw t8, (t8) | t8 = *(t8);
0x00408f6c move a0, t8 | a0 = t8;
0x00408f70 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.region */
0x00408f74 addiu a1, t8, -0x4d74 | a1 = t8 + -0x4d74;
0x00408f78 lw t8, -0x7f2c(gp) | t8 = sym.imp.strcmp;
0x00408f7c move t9, t8 | t9 = t8;
0x00408f80 jalr t9 | t9 ();
0x00408f84 nop |
0x00408f88 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408f8c move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x00408f90 bnez t8, 0x409104 | goto label_5;
| }
0x00408f94 nop |
0x00408f98 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00408f9c addiu t8, t8, 8 | t8 += 8;
0x00408fa0 lw t8, (t8) | t8 = *(t8);
0x00408fa4 move a0, t8 | a0 = t8;
0x00408fa8 lw t8, -0x7f38(gp) | t8 = sym.imp.atoi;
0x00408fac move t9, t8 | t9 = t8;
0x00408fb0 jalr t9 | t9 ();
0x00408fb4 nop |
0x00408fb8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408fbc move t8, v0 | t8 = v0;
| if (t8 < 0) {
0x00408fc0 bltz t8, 0x409104 | goto label_5;
| }
0x00408fc4 nop |
0x00408fc8 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00408fcc addiu t8, t8, 8 | t8 += 8;
0x00408fd0 lw t8, (t8) | t8 = *(t8);
0x00408fd4 move a0, t8 | a0 = t8;
0x00408fd8 lw t8, -0x7f38(gp) | t8 = sym.imp.atoi;
0x00408fdc move t9, t8 | t9 = t8;
0x00408fe0 jalr t9 | t9 ();
0x00408fe4 nop |
0x00408fe8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00408fec move t8, v0 | t8 = v0;
0x00408ff0 slti t8, t8, 8 | t8 = (t8 < 8) ? 1 : 0;
| if (t8 == 0) {
0x00408ff4 beqz t8, 0x409104 | goto label_5;
| }
0x00408ff8 nop |
0x00408ffc lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00409000 addiu t8, t8, 8 | t8 += 8;
0x00409004 lw t8, (t8) | t8 = *(t8);
0x00409008 move a0, t8 | a0 = t8;
0x0040900c lw t8, -0x7f38(gp) | t8 = sym.imp.atoi;
0x00409010 move t9, t8 | t9 = t8;
0x00409014 jalr t9 | t9 ();
0x00409018 nop |
0x0040901c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00409020 move t8, v0 | t8 = v0;
0x00409024 addiu v0, fp, 0x2c | v0 = fp + 0x2c;
0x00409028 move a0, v0 | a0 = v0;
0x0040902c move a1, t8 | a1 = t8;
0x00409030 lw t8, -0x7f3c(gp) | t8 = *(gp);
0x00409034 move t9, t8 | t9 = t8;
0x00409038 jalr t9 | t9 ();
0x0040903c nop |
0x00409040 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00409044 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00409048 move a0, t8 | a0 = t8;
0x0040904c lw t8, -0x7ec4(gp) | t8 = *(gp);
0x00409050 move t9, t8 | t9 = t8;
0x00409054 jalr t9 | t9 ();
0x00409058 nop |
0x0040905c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00409060 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00409064 move a0, t8 | a0 = t8;
0x00409068 lw t8, -0x7e74(gp) | t8 = *(gp);
0x0040906c move t9, t8 | t9 = t8;
0x00409070 jalr t9 | t9 ();
0x00409074 nop |
0x00409078 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040907c move s0, v0 | s0 = v0;
0x00409080 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00409084 addiu t8, t8, 8 | t8 += 8;
0x00409088 lw t8, (t8) | t8 = *(t8);
0x0040908c move a0, t8 | a0 = t8;
0x00409090 lw t8, -0x7f38(gp) | t8 = sym.imp.atoi;
0x00409094 move t9, t8 | t9 = t8;
0x00409098 jalr t9 | t9 ();
0x0040909c nop |
0x004090a0 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004090a4 move t8, v0 | t8 = v0;
0x004090a8 xor t8, s0, t8 | t8 = s0 ^ t8;
0x004090ac sltiu t8, t8, 1 | t8 = (t8 < 1) ? 1 : 0;
0x004090b0 andi t8, t8, 0xff | t8 &= 0xff;
| if (t8 != 0) {
0x004090b4 beqz t8, 0x4090e0 |
0x004090b8 nop |
0x004090bc lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'ok' */
0x004090c0 addiu a0, t8, -0x4d0c | a0 = t8 + -0x4d0c;
0x004090c4 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x004090c8 move t9, t8 | t9 = t8;
0x004090cc jalr t9 | t9 ();
0x004090d0 nop |
0x004090d4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004090d8 b 0x40933c | goto label_2;
0x004090dc nop |
| }
0x004090e0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'failed' */
0x004090e4 addiu a0, t8, -0x4cb8 | a0 = t8 + -0x4cb8;
0x004090e8 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x004090ec move t9, t8 | t9 = t8;
0x004090f0 jalr t9 | t9 ();
0x004090f4 nop |
0x004090f8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004090fc b 0x40933c | goto label_2;
0x00409100 nop |
| }
| label_5:
0x00409104 lw v0, 0x1c(fp) | v0 = *(arg_1ch);
0x00409108 addiu t8, zero, 3 | t8 = 3;
| if (v0 != t8) {
0x0040910c bne v0, t8, 0x409324 | goto label_6;
| }
0x00409110 nop |
0x00409114 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00409118 addiu t8, t8, 4 | t8 += 4;
0x0040911c lw t8, (t8) | t8 = *(t8);
0x00409120 move a0, t8 | a0 = t8;
0x00409124 lw t8, -0x7f38(gp) | t8 = sym.imp.atoi;
0x00409128 move t9, t8 | t9 = t8;
0x0040912c jalr t9 | t9 ();
0x00409130 nop |
0x00409134 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00409138 move t8, v0 | t8 = v0;
| if (t8 < 0) {
0x0040913c bltz t8, 0x409324 | goto label_6;
| }
0x00409140 nop |
0x00409144 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x00409148 addiu t8, t8, 4 | t8 += 4;
0x0040914c lw t8, (t8) | t8 = *(t8);
0x00409150 move a0, t8 | a0 = t8;
0x00409154 lw t8, -0x7f38(gp) | t8 = sym.imp.atoi;
0x00409158 move t9, t8 | t9 = t8;
0x0040915c jalr t9 | t9 ();
0x00409160 nop |
0x00409164 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00409168 move t8, v0 | t8 = v0;
0x0040916c slti t8, t8, 8 | t8 = (t8 < 8) ? 1 : 0;
| if (t8 == 0) {
0x00409170 beqz t8, 0x409324 | goto label_6;
| }
0x00409174 nop |
0x00409178 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x0040917c addiu t8, t8, 4 | t8 += 4;
0x00409180 lw t8, (t8) | t8 = *(t8);
0x00409184 move a0, t8 | a0 = t8;
0x00409188 lw t8, -0x7f38(gp) | t8 = sym.imp.atoi;
0x0040918c move t9, t8 | t9 = t8;
0x00409190 jalr t9 | t9 ();
0x00409194 nop |
0x00409198 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040919c move t8, v0 | t8 = v0;
0x004091a0 addiu v0, fp, 0x2c | v0 = fp + 0x2c;
0x004091a4 move a0, v0 | a0 = v0;
0x004091a8 move a1, t8 | a1 = t8;
0x004091ac lw t8, -0x7f3c(gp) | t8 = *(gp);
0x004091b0 move t9, t8 | t9 = t8;
0x004091b4 jalr t9 | t9 ();
0x004091b8 nop |
0x004091bc lw gp, 0x10(fp) | gp = *(arg_10h);
0x004091c0 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x004091c4 move a0, t8 | a0 = t8;
0x004091c8 lw t8, -0x7ec4(gp) | t8 = *(gp);
0x004091cc move t9, t8 | t9 = t8;
0x004091d0 jalr t9 | t9 ();
0x004091d4 nop |
0x004091d8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004091dc sw zero, 0x20(fp) | *(arg_20h) = 0;
0x004091e0 b 0x4092f0 | goto label_7;
0x004091e4 nop |
| do {
0x004091e8 lw t8, 0x18(fp) | t8 = *(arg_18h);
0x004091ec addiu t8, t8, 8 | t8 += 8;
0x004091f0 lw t8, (t8) | t8 = *(t8);
0x004091f4 addiu v0, fp, 0x3754 | v0 = fp + 0x3754;
0x004091f8 move a0, v0 | a0 = v0;
0x004091fc lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
| /* str.ping__c_1__w_1__s */
0x00409200 addiu a1, v0, -0x4cb0 | a1 = v0 + -0x4cb0;
0x00409204 move a2, t8 | a2 = t8;
0x00409208 lw t8, -0x7f14(gp) | t8 = sym.imp.sprintf
0x0040920c move t9, t8 | t9 = t8;
0x00409210 jalr t9 | t9 ();
0x00409214 nop |
0x00409218 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040921c addiu t8, fp, 0x3754 | t8 = fp + 0x3754;
0x00409220 move a0, t8 | a0 = t8;
0x00409224 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x00409228 addiu a1, t8, -0x4c9c | a1 = t8 + -0x4c9c;
0x0040922c lw t8, -0x7f48(gp) | t8 = sym.imp.popen;
0x00409230 move t9, t8 | t9 = t8;
0x00409234 jalr t9 | t9 ();
0x00409238 nop |
0x0040923c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00409240 move t8, v0 | t8 = v0;
0x00409244 sw t8, 0x24(fp) | *(arg_24h) = t8;
0x00409248 addiu t8, fp, 0x3554 | t8 = fp + 0x3554;
0x0040924c move a0, t8 | a0 = t8;
0x00409250 addiu a1, zero, 0x200 | a1 = 0x200;
0x00409254 addiu a2, zero, 1 | a2 = 1;
0x00409258 lw a3, 0x24(fp) | a3 = *(arg_24h);
0x0040925c lw t8, -0x7eb4(gp) | t8 = sym.imp.fread;
0x00409260 move t9, t8 | t9 = t8;
0x00409264 jalr t9 | t9 ();
0x00409268 nop |
0x0040926c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00409270 addiu t8, fp, 0x3554 | t8 = fp + 0x3554;
0x00409274 move a0, t8 | a0 = t8;
0x00409278 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.1_packets_received */
0x0040927c addiu a1, t8, -0x4c98 | a1 = t8 + -0x4c98;
0x00409280 lw t8, -0x7f24(gp) | t8 = sym.imp.strstr;
0x00409284 move t9, t8 | t9 = t8;
0x00409288 jalr t9 | t9 ();
0x0040928c nop |
0x00409290 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00409294 move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x00409298 beqz t8, 0x4092c8 |
0x0040929c nop |
0x004092a0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'ok' */
0x004092a4 addiu a0, t8, -0x4d0c | a0 = t8 + -0x4d0c;
0x004092a8 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x004092ac move t9, t8 | t9 = t8;
0x004092b0 jalr t9 | t9 ();
0x004092b4 nop |
0x004092b8 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004092bc move s0, zero | s0 = 0;
0x004092c0 b 0x409340 | goto label_0;
0x004092c4 nop |
| }
0x004092c8 lui t8, 7 | t8 = 70000;
0x004092cc ori a0, t8, 0xa120 | a0 = 0x7a120;
0x004092d0 lw t8, -0x7e64(gp) | t8 = sym.imp.usleep;
0x004092d4 move t9, t8 | t9 = t8;
0x004092d8 jalr t9 | t9 ();
0x004092dc nop |
0x004092e0 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004092e4 lw t8, 0x20(fp) | t8 = *(arg_20h);
0x004092e8 addiu t8, t8, 1 | t8++;
0x004092ec sw t8, 0x20(fp) | *(arg_20h) = t8;
| label_7:
0x004092f0 lw t8, 0x20(fp) | t8 = *(arg_20h);
0x004092f4 slti t8, t8, 0xa | t8 = (t8 < 0xa) ? 1 : 0;
0x004092f8 bnez t8, 0x4091e8 |
| } while (t8 != 0);
0x004092fc nop |
0x00409300 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* esilref: 'failed' */
0x00409304 addiu a0, t8, -0x4cb8 | a0 = t8 + -0x4cb8;
0x00409308 lw t8, -0x7f4c(gp) | t8 = sym.imp.puts;
0x0040930c move t9, t8 | t9 = t8;
0x00409310 jalr t9 | t9 ();
0x00409314 nop |
0x00409318 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040931c b 0x40933c | goto label_2;
0x00409320 nop |
| label_6:
0x00409324 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* aav.0x00408be0 */
0x00409328 addiu t8, t8, -0x7420 | t8 += -0x7420;
0x0040932c move t9, t8 | t9 = t8;
0x00409330 jalr t9 | t9 ();
0x00409334 nop |
0x00409338 lw gp, 0x10(fp) | gp = *(arg_10h);
| label_2:
0x0040933c addiu s0, zero, 1 | s0 = 1;
| label_0:
0x00409340 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00409344 move a0, t8 | a0 = t8;
0x00409348 lw t8, -0x7e4c(gp) | t8 = sym.imp.PIB::PIB__;
0x0040934c move t9, t8 | t9 = t8;
0x00409350 jalr t9 | t9 ();
0x00409354 nop |
0x00409358 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040935c addiu t8, zero, 1 | t8 = 1;
| if (s0 == t8) {
0x00409360 bne s0, t8, 0x409478 |
0x00409364 nop |
0x00409368 nop |
0x0040936c b 0x409478 | goto label_8;
0x00409370 nop |
| }
| label_8:
0x00409478 lw t8, -0x7e58(gp) | t8 = *((gp - 8086));
0x0040947c lw v0, 0x3954(fp) | v0 = *(arg_3954h);
0x00409480 lw t8, (t8) | t8 = *(t8);
| if (v0 != t8) {
0x00409484 beq v0, t8, 0x40949c |
0x00409488 nop |
0x0040948c lw t8, -0x7ebc(gp) | t8 = sym.imp.__stack_chk_fail;
0x00409490 move t9, t8 | t9 = t8;
0x00409494 jalr t9 | t9 ();
0x00409498 nop |
| }
0x0040949c move sp, fp |
0x004094a0 lw ra, 0x3964(sp) | ra = *(arg_3964h);
0x004094a4 lw fp, 0x3960(sp) | fp = *(arg_3960h);
0x004094a8 lw s0, 0x395c(sp) | s0 = *(arg_395ch);
0x004094ac addiu sp, sp, 0x3968 |
0x004094b0 jr ra | return v0;
0x004094b4 nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/bin/mfgbox @ 0x407394 */
| #include <stdint.h>
|
; (fcn) sym.test_char_const__char_ () | void test_char_const_char_ () {
| /* test(char const*, char*) */
0x00407394 lui gp, 2 |
0x00407398 addiu gp, gp, -0x2344 |
0x0040739c addu gp, gp, t9 | gp += t9;
0x004073a0 addiu sp, sp, -0x238 |
0x004073a4 sw ra, 0x234(sp) | *(var_234h) = ra;
0x004073a8 sw fp, 0x230(sp) | *(var_230h) = fp;
0x004073ac move fp, sp | fp = sp;
0x004073b0 sw gp, 0x10(sp) | *(var_10h) = gp;
0x004073b4 sw a0, 0x1c(fp) | *(arg_1ch) = a0;
0x004073b8 sw a1, 0x18(fp) | *(arg_18h) = a1;
0x004073bc lw t8, -0x7e58(gp) | t8 = *((gp - 8086));
0x004073c0 lw t8, (t8) | t8 = *(t8);
0x004073c4 sw t8, 0x22c(fp) | *(arg_22ch) = t8;
0x004073c8 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x004073cc move a0, t8 | a0 = t8;
0x004073d0 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.mii_tool__F__s____dev_null_2___dev_null */
0x004073d4 addiu a1, t8, -0x5200 | a1 = t8 + -0x5200;
0x004073d8 lw a2, 0x1c(fp) | a2 = *(arg_1ch);
0x004073dc lw t8, -0x7f14(gp) | t8 = sym.imp.sprintf
0x004073e0 move t9, t8 | t9 = t8;
0x004073e4 jalr t9 | t9 ();
0x004073e8 nop |
0x004073ec lw gp, 0x10(fp) | gp = *(arg_10h);
0x004073f0 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x004073f4 move a0, t8 | a0 = t8;
0x004073f8 lw t8, -0x7e5c(gp) | t8 = sym.imp.system;
0x004073fc move t9, t8 | t9 = t8;
0x00407400 jalr t9 | t9 ();
0x00407404 nop |
0x00407408 lw gp, 0x10(fp) | gp = *(arg_10h);
0x0040740c sw zero, 0x24(fp) | *(arg_24h) = 0;
0x00407410 b 0x4074d8 | goto label_0;
0x00407414 nop |
| do {
0x00407418 lui t8, 7 | t8 = 70000;
0x0040741c ori a0, t8, 0xa120 | a0 = 0x7a120;
0x00407420 lw t8, -0x7e64(gp) | t8 = sym.imp.usleep;
0x00407424 move t9, t8 | t9 = t8;
0x00407428 jalr t9 | t9 ();
0x0040742c nop |
0x00407430 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407434 lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.mii_tool_eth0 */
0x00407438 addiu a0, t8, -0x51d8 | a0 = t8 + -0x51d8;
0x0040743c lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
0x00407440 addiu a1, t8, -0x51c8 | a1 = t8 + -0x51c8;
0x00407444 lw t8, -0x7f48(gp) | t8 = sym.imp.popen;
0x00407448 move t9, t8 | t9 = t8;
0x0040744c jalr t9 | t9 ();
0x00407450 nop |
0x00407454 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407458 move t8, v0 | t8 = v0;
0x0040745c sw t8, 0x28(fp) | *(arg_28h) = t8;
0x00407460 lw a0, 0x18(fp) | a0 = *(arg_18h);
0x00407464 addiu a1, zero, 0x200 | a1 = 0x200;
0x00407468 lw a2, 0x28(fp) | a2 = *(arg_28h);
0x0040746c lw t8, -0x7ee8(gp) | t8 = sym.imp.fgets;
0x00407470 move t9, t8 | t9 = t8;
0x00407474 jalr t9 | t9 ();
0x00407478 nop |
0x0040747c lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407480 lw a0, 0x28(fp) | a0 = *(arg_28h);
0x00407484 lw t8, -0x7eac(gp) | t8 = sym.imp.pclose;
0x00407488 move t9, t8 | t9 = t8;
0x0040748c jalr t9 | t9 ();
0x00407490 nop |
0x00407494 lw gp, 0x10(fp) | gp = *(arg_10h);
0x00407498 lw a0, 0x18(fp) | a0 = *(arg_18h);
0x0040749c lw t8, -0x7fdc(gp) | t8 = *((gp - 8183));
| /* str.link_ok */
0x004074a0 addiu a1, t8, -0x51c4 | a1 = t8 + -0x51c4;
0x004074a4 lw t8, -0x7f24(gp) | t8 = sym.imp.strstr;
0x004074a8 move t9, t8 | t9 = t8;
0x004074ac jalr t9 | t9 ();
0x004074b0 nop |
0x004074b4 lw gp, 0x10(fp) | gp = *(arg_10h);
0x004074b8 move t8, v0 | t8 = v0;
| if (t8 != 0) {
0x004074bc beqz t8, 0x4074cc |
0x004074c0 nop |
0x004074c4 b 0x4074e8 | goto label_1;
0x004074c8 nop |
| }
0x004074cc lw t8, 0x24(fp) | t8 = *(arg_24h);
0x004074d0 addiu t8, t8, 1 | t8++;
0x004074d4 sw t8, 0x24(fp) | *(arg_24h) = t8;
| label_0:
0x004074d8 lw t8, 0x24(fp) | t8 = *(arg_24h);
0x004074dc slti t8, t8, 6 | t8 = (t8 < 6) ? 1 : 0;
0x004074e0 bnez t8, 0x407418 |
| } while (t8 != 0);
0x004074e4 nop |
| label_1:
0x004074e8 lw t8, -0x7e58(gp) | t8 = *((gp - 8086));
0x004074ec lw v0, 0x22c(fp) | v0 = *(arg_22ch);
0x004074f0 lw t8, (t8) | t8 = *(t8);
| if (v0 != t8) {
0x004074f4 beq v0, t8, 0x40750c |
0x004074f8 nop |
0x004074fc lw t8, -0x7ebc(gp) | t8 = sym.imp.__stack_chk_fail;
0x00407500 move t9, t8 | t9 = t8;
0x00407504 jalr t9 | t9 ();
0x00407508 nop |
| }
0x0040750c move sp, fp |
0x00407510 lw ra, 0x234(sp) | ra = *(var_234h);
0x00407514 lw fp, 0x230(sp) | fp = *(var_230h);
0x00407518 addiu sp, sp, 0x238 |
0x0040751c jr ra | return v0;
0x00407520 nop |
| }
[*] Function sprintf used 5 times mfgbox