[*] Binary protection state of gen_btconfig_rtl8723bu
Full RELRO Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf tear down of gen_btconfig_rtl8723bu
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/sbin/gen_btconfig_rtl8723bu @ 0x4010dc */
| #include <stdint.h>
|
; (fcn) sym.gen_btconfig_rtl8723bu_char_const__char_const_ () | void gen_btconfig_rtl8723bu_char_const_char_const_ () {
| /* gen_btconfig_rtl8723bu(char const*, char const*) */
0x004010dc lui gp, 2 |
0x004010e0 addiu gp, gp, -0x60ac |
0x004010e4 addu gp, gp, t9 | gp += t9;
0x004010e8 addiu sp, sp, -0x35c0 |
0x004010ec sw ra, 0x35bc(sp) | *(arg_35bch) = ra;
0x004010f0 sw fp, 0x35b8(sp) | *(arg_35b8h) = fp;
0x004010f4 sw s1, 0x35b4(sp) | *(arg_35b4h) = s1;
0x004010f8 sw s0, 0x35b0(sp) | *(arg_35b0h) = s0;
0x004010fc move fp, sp | fp = sp;
0x00401100 sw gp, 0x18(sp) | *(arg_18h) = gp;
0x00401104 sw a0, 0x24(fp) | *(arg_24h) = a0;
0x00401108 sw a1, 0x20(fp) | *(arg_20h) = a1;
0x0040110c lw t8, -0x7f58(gp) | t8 = *((gp - 8150));
0x00401110 lw t8, (t8) | t8 = *(t8);
0x00401114 sw t8, 0x35ac(fp) | *(arg_35ach) = t8;
0x00401118 addiu t8, fp, 0x48 | t8 = fp + 0x48;
0x0040111c move a0, t8 | a0 = t8;
0x00401120 lw t8, -0x7fd8(gp) | t8 = *(gp);
0x00401124 move t9, t8 | t9 = t8;
0x00401128 jalr t9 | t9 ();
0x0040112c nop |
0x00401130 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401134 lw a0, 0x24(fp) | a0 = *(arg_24h);
0x00401138 move a1, zero | a1 = 0;
0x0040113c lw t8, -0x7f9c(gp) | t8 = sym.imp.open64;
0x00401140 move t9, t8 | t9 = t8;
0x00401144 jalr t9 | t9 ();
0x00401148 nop |
0x0040114c lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401150 move t8, v0 | t8 = v0;
0x00401154 sw t8, 0x38(fp) | *(arg_38h) = t8;
0x00401158 lw t8, 0x38(fp) | t8 = *(arg_38h);
| if (t8 < 0) {
0x0040115c bgez t8, 0x4011cc |
0x00401160 nop |
0x00401164 lw t8, -0x7f54(gp) | t8 = sym.imp.__errno_location;
0x00401168 move t9, t8 | t9 = t8;
0x0040116c jalr t9 | t9 ();
0x00401170 nop |
0x00401174 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401178 move t8, v0 | t8 = v0;
0x0040117c lw t8, (t8) | t8 = *(t8);
0x00401180 move a0, t8 | a0 = t8;
0x00401184 lw t8, -0x7fa0(gp) | t8 = sym.imp.strerror;
0x00401188 move t9, t8 | t9 = t8;
0x0040118c jalr t9 | t9 ();
0x00401190 nop |
0x00401194 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401198 move t8, v0 | t8 = v0;
0x0040119c lw v0, -0x7fdc(gp) | v0 = *(gp);
| /* str.Open__s_failure:__s_n */
0x004011a0 addiu a0, v0, 0x1dfc | a0 = v0 + 0x1dfc;
0x004011a4 lw a1, 0x24(fp) | a1 = *(arg_24h);
0x004011a8 move a2, t8 | a2 = t8;
0x004011ac lw t8, -0x7fa4(gp) | t8 = sym.imp.printf
0x004011b0 move t9, t8 | t9 = t8;
0x004011b4 jalr t9 | t9 ();
0x004011b8 nop |
0x004011bc lw gp, 0x18(fp) | gp = *(arg_18h);
0x004011c0 addiu s0, zero, -1 | s0 = -1;
0x004011c4 b 0x401588 | goto label_0;
0x004011c8 nop |
| }
0x004011cc lw a0, 0x20(fp) | a0 = *(arg_20h);
0x004011d0 addiu a1, zero, 0x1c0 | a1 = 0x1c0;
0x004011d4 lw t8, -0x7f98(gp) | t8 = sym.imp.creat64;
0x004011d8 move t9, t8 | t9 = t8;
0x004011dc jalr t9 | t9 ();
0x004011e0 nop |
0x004011e4 lw gp, 0x18(fp) | gp = *(arg_18h);
0x004011e8 move t8, v0 | t8 = v0;
0x004011ec sw t8, 0x3c(fp) | *(arg_3ch) = t8;
0x004011f0 lw t8, 0x38(fp) | t8 = *(arg_38h);
| if (t8 < 0) {
0x004011f4 bgez t8, 0x401264 |
0x004011f8 nop |
0x004011fc lw t8, -0x7f54(gp) | t8 = sym.imp.__errno_location;
0x00401200 move t9, t8 | t9 = t8;
0x00401204 jalr t9 | t9 ();
0x00401208 nop |
0x0040120c lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401210 move t8, v0 | t8 = v0;
0x00401214 lw t8, (t8) | t8 = *(t8);
0x00401218 move a0, t8 | a0 = t8;
0x0040121c lw t8, -0x7fa0(gp) | t8 = sym.imp.strerror;
0x00401220 move t9, t8 | t9 = t8;
0x00401224 jalr t9 | t9 ();
0x00401228 nop |
0x0040122c lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401230 move t8, v0 | t8 = v0;
0x00401234 lw v0, -0x7fdc(gp) | v0 = *(gp);
| /* str.Creat__s_failure:__s_n */
0x00401238 addiu a0, v0, 0x1e14 | a0 = v0 + 0x1e14;
0x0040123c lw a1, 0x20(fp) | a1 = *(arg_20h);
0x00401240 move a2, t8 | a2 = t8;
0x00401244 lw t8, -0x7fa4(gp) | t8 = sym.imp.printf
0x00401248 move t9, t8 | t9 = t8;
0x0040124c jalr t9 | t9 ();
0x00401250 nop |
0x00401254 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401258 addiu s0, zero, -1 | s0 = -1;
0x0040125c b 0x401588 | goto label_0;
0x00401260 nop |
| }
0x00401264 sw zero, 0x40(fp) | *(arg_40h) = 0;
0x00401268 lw a0, 0x3c(fp) | a0 = *(arg_3ch);
0x0040126c lw a1, -0x7fd4(gp) | a1 = *(gp);
0x00401270 addiu a2, zero, 4 | a2 = 4;
0x00401274 lw t8, -0x7f84(gp) | t8 = sym.imp.write;
0x00401278 move t9, t8 | t9 = t8;
0x0040127c jalr t9 | t9 ();
0x00401280 nop |
0x00401284 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401288 lw t8, 0x40(fp) | t8 = *(arg_40h);
0x0040128c addiu t8, t8, 4 | t8 += 4;
0x00401290 sw t8, 0x40(fp) | *(arg_40h) = t8;
0x00401294 lw a0, 0x3c(fp) | a0 = *(arg_3ch);
0x00401298 lw a1, -0x7fd0(gp) | a1 = *(gp);
0x0040129c addiu a2, zero, 2 | a2 = 2;
0x004012a0 lw t8, -0x7f84(gp) | t8 = sym.imp.write;
0x004012a4 move t9, t8 | t9 = t8;
0x004012a8 jalr t9 | t9 ();
0x004012ac nop |
0x004012b0 lw gp, 0x18(fp) | gp = *(arg_18h);
0x004012b4 lw t8, 0x40(fp) | t8 = *(arg_40h);
0x004012b8 addiu t8, t8, 2 | t8 += 2;
0x004012bc sw t8, 0x40(fp) | *(arg_40h) = t8;
0x004012c0 lw t8, 0x40(fp) | t8 = *(arg_40h);
0x004012c4 move s0, t8 | s0 = t8;
0x004012c8 sra t8, t8, 0x1f | t8 >>= 0x1f;
0x004012cc move s1, t8 | s1 = t8;
0x004012d0 sw zero, 0x10(sp) | *(arg_10h) = 0;
0x004012d4 lw a0, 0x38(fp) | a0 = *(arg_38h);
0x004012d8 move a2, s0 | a2 = s0;
0x004012dc move a3, s1 | a3 = s1;
0x004012e0 lw t8, -0x7f70(gp) | t8 = sym.imp.lseek64;
0x004012e4 move t9, t8 | t9 = t8;
0x004012e8 jalr t9 | t9 ();
0x004012ec nop |
0x004012f0 lw gp, 0x18(fp) | gp = *(arg_18h);
0x004012f4 addiu t8, fp, 0x3578 | t8 = fp + 0x3578;
0x004012f8 lw a0, 0x38(fp) | a0 = *(arg_38h);
0x004012fc move a1, t8 | a1 = t8;
0x00401300 addiu a2, zero, 0x13 | a2 = 0x13;
0x00401304 lw t8, -0x7f6c(gp) | t8 = sym.imp.read;
0x00401308 move t9, t8 | t9 = t8;
0x0040130c jalr t9 | t9 ();
0x00401310 nop |
0x00401314 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401318 addiu t8, fp, 0x3578 | t8 = fp + 0x3578;
0x0040131c lw a0, 0x3c(fp) | a0 = *(arg_3ch);
0x00401320 move a1, t8 | a1 = t8;
0x00401324 addiu a2, zero, 0x13 | a2 = 0x13;
0x00401328 lw t8, -0x7f84(gp) | t8 = sym.imp.write;
0x0040132c move t9, t8 | t9 = t8;
0x00401330 jalr t9 | t9 ();
0x00401334 nop |
0x00401338 lw gp, 0x18(fp) | gp = *(arg_18h);
0x0040133c lw a0, 0x3c(fp) | a0 = *(arg_3ch);
0x00401340 lw a1, -0x7fcc(gp) | a1 = *(gp);
0x00401344 addiu a2, zero, 3 | a2 = 3;
0x00401348 lw t8, -0x7f84(gp) | t8 = sym.imp.write;
0x0040134c move t9, t8 | t9 = t8;
0x00401350 jalr t9 | t9 ();
0x00401354 nop |
0x00401358 lw gp, 0x18(fp) | gp = *(arg_18h);
0x0040135c addiu t8, fp, 0x48 | t8 = fp + 0x48;
0x00401360 move a0, t8 | a0 = t8;
0x00401364 lw t8, -0x7f94(gp) | t8 = *(gp);
0x00401368 move t9, t8 | t9 = t8;
0x0040136c jalr t9 | t9 ();
0x00401370 nop |
0x00401374 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401378 addiu t8, fp, 0x358c | t8 = fp + 0x358c;
0x0040137c move a0, t8 | a0 = t8;
0x00401380 addiu a1, zero, 0x20 | a1 = 0x20;
0x00401384 lw t8, -0x7f8c(gp) | t8 = sym.imp.bzero;
0x00401388 move t9, t8 | t9 = t8;
0x0040138c jalr t9 | t9 ();
0x00401390 nop |
0x00401394 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401398 addiu s0, zero, 0x1f | s0 = 0x1f;
0x0040139c addiu v0, fp, 0x30 | v0 = fp + 0x30;
0x004013a0 addiu t8, fp, 0x48 | t8 = fp + 0x48;
0x004013a4 move a0, v0 | a0 = v0;
0x004013a8 move a1, t8 | a1 = t8;
0x004013ac lw t8, -0x7f90(gp) | t8 = *(gp);
0x004013b0 move t9, t8 | t9 = t8;
0x004013b4 jalr t9 | t9 ();
0x004013b8 nop |
0x004013bc lw gp, 0x18(fp) | gp = *(arg_18h);
0x004013c0 addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x004013c4 move a0, t8 | a0 = t8;
0x004013c8 lw t8, -0x7f5c(gp) | t8 = *(gp);
0x004013cc move t9, t8 | t9 = t8;
0x004013d0 jalr t9 | t9 ();
0x004013d4 nop |
0x004013d8 lw gp, 0x18(fp) | gp = *(arg_18h);
0x004013dc move t8, v0 | t8 = v0;
0x004013e0 addiu v0, fp, 0x358c | v0 = fp + 0x358c;
0x004013e4 move a0, v0 | a0 = v0;
0x004013e8 move a1, s0 | a1 = s0;
0x004013ec lw v0, -0x7fdc(gp) | v0 = *(gp);
| /* esilref: '&s' */
0x004013f0 addiu a2, v0, 0x1e2c | a2 = v0 + 0x1e2c;
0x004013f4 move a3, t8 | a3 = t8;
0x004013f8 lw t8, -0x7f68(gp) | t8 = sym.imp.snprintf
0x004013fc move t9, t8 | t9 = t8;
0x00401400 jalr t9 | t9 ();
0x00401404 nop |
0x00401408 lw gp, 0x18(fp) | gp = *(arg_18h);
0x0040140c addiu t8, fp, 0x30 | t8 = fp + 0x30;
0x00401410 move a0, t8 | a0 = t8;
0x00401414 lw t8, -0x7f74(gp) | t8 = *(gp);
0x00401418 move t9, t8 | t9 = t8;
0x0040141c jalr t9 | t9 ();
0x00401420 nop |
0x00401424 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401428 addiu v0, fp, 0x358c | v0 = fp + 0x358c;
0x0040142c addiu t8, fp, 0x28 | t8 = fp + 0x28;
0x00401430 move a0, v0 | a0 = v0;
0x00401434 lw v0, -0x7fdc(gp) | v0 = *(gp);
0x00401438 addiu a1, v0, 0x1e30 | a1 = v0 + 0x1e30;
0x0040143c move a2, t8 | a2 = t8;
0x00401440 lw t8, -0x7f50(gp) | t8 = sym.imp.strtok_r;
0x00401444 move t9, t8 | t9 = t8;
0x00401448 jalr t9 | t9 ();
0x0040144c nop |
0x00401450 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401454 sw v0, 0x44(fp) | *(arg_44h) = v0;
0x00401458 addiu t8, zero, 5 | t8 = 5;
0x0040145c sw t8, 0x34(fp) | *(arg_34h) = t8;
0x00401460 lw s0, 0x34(fp) | s0 = *(arg_34h);
0x00401464 addiu t8, s0, -1 | t8 = s0 + -1;
0x00401468 sw t8, 0x34(fp) | *(arg_34h) = t8;
0x0040146c addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x00401470 lw a0, 0x44(fp) | a0 = *(arg_44h);
0x00401474 move a1, t8 | a1 = t8;
0x00401478 addiu a2, zero, 0x10 | a2 = 0x10;
0x0040147c lw t8, -0x7f64(gp) | t8 = sym.imp.strtol;
0x00401480 move t9, t8 | t9 = t8;
0x00401484 jalr t9 | t9 ();
0x00401488 nop |
0x0040148c lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401490 move t8, v0 | t8 = v0;
0x00401494 andi v0, t8, 0xff | v0 = t8 & 0xff;
0x00401498 addiu v1, fp, 0x35b0 | v1 = fp + 0x35b0;
0x0040149c addu t8, v1, s0 | t8 = v1 + s0;
0x004014a0 sb v0, -0x40(t8) | *((t8 - 64)) = v0;
0x004014a4 b 0x4014f0 | goto label_1;
0x004014a8 nop |
| do {
0x004014ac lw s0, 0x34(fp) | s0 = *(arg_34h);
0x004014b0 addiu t8, s0, -1 | t8 = s0 + -1;
0x004014b4 sw t8, 0x34(fp) | *(arg_34h) = t8;
0x004014b8 addiu t8, fp, 0x2c | t8 = fp + 0x2c;
0x004014bc lw a0, 0x44(fp) | a0 = *(arg_44h);
0x004014c0 move a1, t8 | a1 = t8;
0x004014c4 addiu a2, zero, 0x10 | a2 = 0x10;
0x004014c8 lw t8, -0x7f64(gp) | t8 = sym.imp.strtol;
0x004014cc move t9, t8 | t9 = t8;
0x004014d0 jalr t9 | t9 ();
0x004014d4 nop |
0x004014d8 lw gp, 0x18(fp) | gp = *(arg_18h);
0x004014dc move t8, v0 | t8 = v0;
0x004014e0 andi v0, t8, 0xff | v0 = t8 & 0xff;
0x004014e4 addiu v1, fp, 0x35b0 | v1 = fp + 0x35b0;
0x004014e8 addu t8, v1, s0 | t8 = v1 + s0;
0x004014ec sb v0, -0x40(t8) | *((t8 - 64)) = v0;
| label_1:
0x004014f0 addiu t8, fp, 0x28 | t8 = fp + 0x28;
0x004014f4 move a0, zero | a0 = 0;
0x004014f8 lw v0, -0x7fdc(gp) | v0 = *(gp);
0x004014fc addiu a1, v0, 0x1e30 | a1 = v0 + 0x1e30;
0x00401500 move a2, t8 | a2 = t8;
0x00401504 lw t8, -0x7f50(gp) | t8 = sym.imp.strtok_r;
0x00401508 move t9, t8 | t9 = t8;
0x0040150c jalr t9 | t9 ();
0x00401510 nop |
0x00401514 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401518 sw v0, 0x44(fp) | *(arg_44h) = v0;
0x0040151c lw t8, 0x44(fp) | t8 = *(arg_44h);
0x00401520 sltu t8, zero, t8 | t8 = (0 < t8) ? 1 : 0;
0x00401524 andi t8, t8, 0xff | t8 &= 0xff;
0x00401528 bnez t8, 0x4014ac |
| } while (t8 != 0);
0x0040152c nop |
0x00401530 addiu t8, fp, 0x3570 | t8 = fp + 0x3570;
0x00401534 lw a0, 0x3c(fp) | a0 = *(arg_3ch);
0x00401538 move a1, t8 | a1 = t8;
0x0040153c addiu a2, zero, 6 | a2 = 6;
0x00401540 lw t8, -0x7f84(gp) | t8 = sym.imp.write;
0x00401544 move t9, t8 | t9 = t8;
0x00401548 jalr t9 | t9 ();
0x0040154c nop |
0x00401550 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401554 lw a0, 0x38(fp) | a0 = *(arg_38h);
0x00401558 lw t8, -0x7f88(gp) | t8 = sym.imp.close;
0x0040155c move t9, t8 | t9 = t8;
0x00401560 jalr t9 | t9 ();
0x00401564 nop |
0x00401568 lw gp, 0x18(fp) | gp = *(arg_18h);
0x0040156c lw a0, 0x3c(fp) | a0 = *(arg_3ch);
0x00401570 lw t8, -0x7f88(gp) | t8 = sym.imp.close;
0x00401574 move t9, t8 | t9 = t8;
0x00401578 jalr t9 | t9 ();
0x0040157c nop |
0x00401580 lw gp, 0x18(fp) | gp = *(arg_18h);
0x00401584 move s0, zero | s0 = 0;
| label_0:
0x00401588 addiu t8, fp, 0x48 | t8 = fp + 0x48;
0x0040158c move a0, t8 | a0 = t8;
0x00401590 lw t8, -0x7f48(gp) | t8 = sym.imp.PIB::PIB__;
0x00401594 move t9, t8 | t9 = t8;
0x00401598 jalr t9 | t9 ();
0x0040159c nop |
0x004015a0 lw gp, 0x18(fp) | gp = *(arg_18h);
0x004015a4 move t8, s0 | t8 = s0;
0x004015a8 move v0, t8 | v0 = t8;
0x004015ac lw t8, -0x7f58(gp) | t8 = *((gp - 8150));
0x004015b0 lw v1, 0x35ac(fp) | v1 = *(arg_35ach);
0x004015b4 lw t8, (t8) | t8 = *(t8);
| if (v1 != t8) {
0x004015b8 beq v1, t8, 0x401640 |
0x004015bc nop |
0x004015c0 b 0x401630 | goto label_2;
0x004015c4 nop |
| label_2:
0x00401630 lw t8, -0x7f80(gp) | t8 = sym.imp.__stack_chk_fail;
0x00401634 move t9, t8 | t9 = t8;
0x00401638 jalr t9 | t9 ();
0x0040163c nop |
| }
0x00401640 move sp, fp |
0x00401644 lw ra, 0x35bc(sp) | ra = *(arg_35bch);
0x00401648 lw fp, 0x35b8(sp) | fp = *(arg_35b8h);
0x0040164c lw s1, 0x35b4(sp) | s1 = *(arg_35b4h);
0x00401650 lw s0, 0x35b0(sp) | s0 = *(arg_35b0h);
0x00401654 addiu sp, sp, 0x35c0 |
0x00401658 jr ra | return v1;
0x0040165c nop |
| }
[*] Function printf used 4 times gen_btconfig_rtl8723bu