[*] Binary protection state of ifrename
No RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of ifrename
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/sbin/ifrename @ 0x400e20 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [11] -r-x section size 11920 named .text */
0x00400e20 addiu sp, sp, -0x68 |
0x00400e24 sw ra, 0x64(sp) | *(var_64h) = ra;
0x00400e28 sw fp, 0x60(sp) | *(var_60h) = fp;
0x00400e2c sw s7, 0x5c(sp) | *(var_5ch) = s7;
0x00400e30 sw s6, 0x58(sp) | *(var_58h) = s6;
0x00400e34 sw s5, 0x54(sp) | *(var_54h) = s5;
0x00400e38 sw s4, 0x50(sp) | *(var_50h) = s4;
0x00400e3c sw s3, 0x4c(sp) | *(var_4ch) = s3;
0x00400e40 sw s2, 0x48(sp) | *(var_48h) = s2;
0x00400e44 sw s1, 0x44(sp) | *(var_44h) = s1;
0x00400e48 sw s0, 0x40(sp) | *(var_40h) = s0;
0x00400e4c lui s5, 0x40 | s5 = 0x400000;
0x00400e50 lui fp, 0x40 | fp = 0x400000;
0x00400e54 lui t8, 0x40 | t8 = 0x400000;
0x00400e58 move s1, a0 | s1 = a0;
0x00400e5c move s6, zero | s6 = 0;
0x00400e60 move s7, a1 | s7 = a1;
0x00400e64 move s4, zero | s4 = 0;
0x00400e68 move s3, zero | s3 = 0;
0x00400e6c move s2, zero | s2 = 0;
| /* str._etc_iftab */
0x00400e70 addiu s5, s5, 0x4e08 | s5 += 0x4e08;
| /* str.c:CdDi:n:ptuvV */
0x00400e74 addiu fp, fp, 0x4a40 | fp += 0x4a40;
| /* esilref: 'config-file' */
0x00400e78 addiu t8, t8, 0x4d00 | t8 += 0x4d00;
0x00400e7c lui v1, 0x41 | v1 = 0x410000;
0x00400e80 addiu s0, zero, 1 | s0 = 1;
| do {
| label_0:
0x00400e84 move a0, s1 | a0 = s1;
0x00400e88 sw zero, 0x10(sp) | *(var_10h) = 0;
0x00400e8c move a3, t8 | a3 = t8;
0x00400e90 sw v1, 0x3c(sp) | *(var_3ch) = v1;
0x00400e94 move a1, s7 | a1 = s7;
0x00400e98 sw t8, 0x38(sp) | *(var_38h) = t8;
0x00400e9c move a2, fp | a2 = fp;
0x00400ea0 jal 0x404ed0 | fcn_00404ed0 ();
0x00400ea4 addiu a0, zero, -1 | a0 = -1;
0x00400ea8 lw v1, 0x3c(sp) | v1 = *(var_3ch);
0x00400eac lw t8, 0x38(sp) | t8 = *(var_38h);
| if (v0 == a0) {
0x00400eb0 beq v0, a0, 0x400fec | goto label_1;
| }
0x00400eb4 addiu a0, zero, 0x69 | a0 = 0x69;
0x00400eb8 slti a0, v0, 0x6a | a0 = (v0 < 0x6a) ? 1 : 0;
| if (v0 == a0) {
0x00400ebc beq v0, a0, 0x400f88 | goto label_2;
| }
0x00400ec0 addiu a0, zero, 0x56 | a0 = 0x56;
| if (a0 == 0) {
0x00400ec4 beqz a0, 0x400f14 | goto label_3;
| }
0x00400ec8 slti a0, v0, 0x57 | a0 = (v0 < 0x57) ? 1 : 0;
| if (v0 == a0) {
0x00400ecc beq v0, a0, 0x400fe0 | goto label_4;
| }
0x00400ed0 addiu a0, zero, 0x63 | a0 = 0x63;
| if (a0 == 0) {
0x00400ed4 beqz a0, 0x400efc | goto label_5;
| }
0x00400ed8 addiu a0, zero, 0x43 | a0 = 0x43;
0x00400edc addiu a0, zero, 0x44 | a0 = 0x44;
| if (v0 != a0) {
0x00400ee0 bne v0, a0, 0x400eec | goto label_6;
| }
0x00400ee4 j 0x400e84 |
| } while (1);
0x00400ee8 addiu s6, zero, 1 | s6 = 1;
| label_6:
0x00400eec lui v0, 0x41 | v0 = 0x410000;
| if (v0 != a0) {
0x00400ef0 beq v0, a0, 0x400f80 |
0x00400ef4 j 0x400f5c | goto label_7;
0x00400ef8 lui t8, 0x41 | t8 = 0x410000;
| label_5:
0x00400efc addiu a0, zero, 0x64 | a0 = 0x64;
| if (v0 != a0) {
0x00400f00 beq v0, a0, 0x400f74 |
| if (v0 == a0) {
0x00400f04 bne v0, a0, 0x400f58 |
0x00400f08 nop |
0x00400f0c j 0x400e84 | goto label_0;
0x00400f10 addiu s4, zero, 1 | s4 = 1;
| label_3:
0x00400f14 addiu a0, zero, 0x74 | a0 = 0x74;
0x00400f18 slti a0, v0, 0x75 | a0 = (v0 < 0x75) ? 1 : 0;
| if (v0 == a0) {
0x00400f1c beq v0, a0, 0x400fb0 | goto label_8;
| }
0x00400f20 addiu a0, zero, 0x75 | a0 = 0x75;
| if (a0 != 0) {
0x00400f24 beqz a0, 0x400f44 |
0x00400f28 addiu a0, zero, 0x6e | a0 = 0x6e;
0x00400f2c addiu a0, zero, 0x70 | a0 = 0x70;
| if (v0 == a0) {
0x00400f30 beq v0, a0, 0x400f94 | goto label_9;
| }
| if (v0 == a0) {
0x00400f34 beq v0, a0, 0x400fa8 | goto label_10;
| }
0x00400f38 nop |
0x00400f3c j 0x400f5c | goto label_7;
0x00400f40 lui t8, 0x41 | t8 = 0x410000;
| }
| if (v0 == a0) {
0x00400f44 beq v0, a0, 0x400fb8 | goto label_11;
| }
0x00400f48 nop |
0x00400f4c addiu t8, zero, 0x76 | t8 = 0x76;
0x00400f50 lui a1, 0x40 | a1 = 0x400000;
| if (v0 == t8) {
0x00400f54 beq v0, t8, 0x400fc4 | goto label_12;
| }
| }
0x00400f58 lui t8, 0x41 | t8 = 0x410000;
| label_7:
0x00400f5c lui a0, 0x40 | a0 = 0x400000;
0x00400f60 lw a1, 0x52fc(t8) | a1 = *((t8 + 5311));
| /* str.usage:_ifrename___c_configurationfile____i_ifname____p____t____d____D__n */
0x00400f64 addiu a0, a0, 0x4a50 | a0 += 0x4a50;
0x00400f68 jal 0x405180 | fcn_00405180 ();
0x00400f6c addiu a0, zero, 1 | a0 = 1;
0x00400f70 jal 0x405120 | fcn_00405120 ();
| }
0x00400f74 lui v0, 0x41 | v0 = 0x410000;
0x00400f78 j 0x400e84 | goto label_0;
0x00400f7c lw s5, 0x52f4(v0) | s5 = *((v0 + 5309));
| }
0x00400f80 j 0x400e84 | goto label_0;
0x00400f84 sw s0, 0x5344(v0) | *((v0 + 5329)) = s0;
| label_2:
0x00400f88 lui v0, 0x41 | v0 = 0x410000;
0x00400f8c j 0x400e84 | goto label_0;
0x00400f90 lw s2, 0x52f4(v0) | s2 = *((v0 + 5309));
| label_9:
0x00400f94 lui v0, 0x41 | v0 = 0x410000;
0x00400f98 lw a0, 0x52f4(v0) | a0 = *((v0 + 5309));
0x00400f9c lui v0, 0x41 | v0 = 0x410000;
0x00400fa0 j 0x400e84 | goto label_0;
0x00400fa4 sw a0, 0x5354(v0) | *((v0 + 5333)) = a0;
| label_10:
0x00400fa8 j 0x400e84 | goto label_0;
0x00400fac addiu s3, zero, 1 | s3 = 1;
| label_8:
0x00400fb0 j 0x400e84 | goto label_0;
0x00400fb4 sw s0, 0x5350(v1) | *((v1 + 5332)) = s0;
| label_11:
0x00400fb8 lui v0, 0x41 | v0 = 0x410000;
0x00400fbc j 0x400e84 | goto label_0;
0x00400fc0 sw s0, 0x533c(v0) | *((v0 + 5327)) = s0;
| label_12:
0x00400fc4 lui a0, 0x40 | a0 = "%-8.16s Wireless-Tools version %d\n";
| /* str.__8.16s__Wireless_Tools_version__d_n */
0x00400fc8 addiu a0, a0, 0x4a98 |
| /* str.ifrename */
0x00400fcc addiu a1, a1, 0x4abc | a1 += 0x4abc;
0x00400fd0 addiu a2, zero, 0x1e | a2 = 0x1e;
0x00400fd4 jal 0x404e90 | fcn_00404e90 ();
0x00400fd8 j 0x40118c | goto label_13;
0x00400fdc move v0, zero | v0 = 0;
| label_4:
0x00400fe0 lui v0, 0x41 | v0 = 0x410000;
0x00400fe4 j 0x400e84 | goto label_0;
0x00400fe8 sw s0, 0x5340(v0) | *((v0 + 5328)) = s0;
| label_1:
0x00400fec jal 0x404f10 | fcn_00404f10 ();
0x00400ff0 nop |
0x00400ff4 move s1, v0 | s1 = v0;
| if (v0 < 0) {
0x00400ff8 bgez v0, 0x401010 |
0x00400ffc lui a0, 0x40 | a0 = "socket";
| /* str.socket */
0x00401000 addiu a0, a0, 0x4ac8 |
0x00401004 jal 0x404f30 | fcn_00404f30 ();
0x00401008 j 0x40118c | goto label_13;
0x0040100c addiu v0, zero, -1 | v0 = -1;
| }
0x00401010 lui t8, 0x41 | t8 = 0x410000;
| if (s2 == 0) {
0x00401014 beqz s2, 0x40110c | goto label_14;
| }
0x00401018 lw s0, 0x5354(t8) | s0 = *((t8 + 5333));
| if (s0 != 0) {
0x0040101c beqz s0, 0x4010d0 |
0x00401020 nop |
0x00401024 move a0, s0 | a0 = s0;
0x00401028 jal 0x405140 | fcn_00405140 ();
0x0040102c move a0, s0 | a0 = s0;
0x00401030 addiu a1, zero, 0x2a | a1 = 0x2a;
0x00401034 move s3, v0 | s3 = v0;
0x00401038 jal 0x405170 | fcn_00405170 ();
0x0040103c sltu v0, zero, v0 | v0 = (0 < v0) ? 1 : 0;
0x00401040 addu s3, s3, v0 | s3 += v0;
0x00401044 slti s3, s3, 0x11 | s3 = (s3 < 0x11) ? 1 : 0;
0x00401048 addiu a3, sp, 0x20 | a3 = sp + 0x20;
| if (s3 == 0) {
0x0040104c bnez s3, 0x401070 |
0x00401050 lui t8, 0x41 | t8 = 0x410000;
0x00401054 lui a1, 0x40 | a1 = 0x400000;
0x00401058 lw a0, 0x52fc(t8) | a0 = *((t8 + 5311));
| /* str.Error:_Interface_name___s_too_long._n */
0x0040105c addiu a1, a1, 0x4ad0 | a1 += 0x4ad0;
0x00401060 move a2, s0 | a2 = s0;
0x00401064 jal 0x404fc0 | fcn_00404fc0 ();
0x00401068 j 0x4010b4 | goto label_15;
0x0040106c nop |
| }
0x00401070 move a0, s1 | a0 = s1;
0x00401074 move a1, s2 | a1 = s2;
0x00401078 move a2, s0 | a2 = s0;
0x0040107c jal 0x402600 | fcn_00402600 ();
0x00401080 lui t8, 0x41 | t8 = 0x410000;
| if (v0 < 0) {
0x00401084 bgez v0, 0x4010bc |
0x00401088 lw s3, 0x52fc(t8) | s3 = *((t8 + 5311));
0x0040108c jal 0x405110 | fcn_00405110 ();
0x00401090 lw a0, (v0) | a0 = *(v0);
0x00401094 jal 0x404ea0 | fcn_00404ea0 ();
0x00401098 lui a1, 0x40 | a1 = 0x400000;
0x0040109c sw v0, 0x10(sp) | *(var_10h) = v0;
0x004010a0 move a0, s3 | a0 = s3;
| /* str.Error:_cannot_change_name_of__s_to__s:__s_n */
0x004010a4 addiu a1, a1, 0x465c | a1 += 0x465c;
0x004010a8 move a2, s2 | a2 = s2;
0x004010ac move a3, s0 | a3 = s0;
0x004010b0 jal 0x404fc0 | fcn_00404fc0 ();
| label_15:
0x004010b4 j 0x401180 | goto label_16;
0x004010b8 addiu s0, zero, -1 | s0 = -1;
| }
0x004010bc addiu a0, sp, 0x20 | a0 = sp + 0x20;
0x004010c0 move s0, zero | s0 = 0;
0x004010c4 jal 0x404f50 | fcn_00404f50 ();
0x004010c8 j 0x401180 | goto label_16;
0x004010cc nop |
| }
0x004010d0 move a0, s5 | a0 = s5;
0x004010d4 jal 0x40349c | fcn_0040349c ();
0x004010d8 lui t8, 0x41 | t8 = 0x410000;
0x004010dc bgez v0, 0x4010e8 |
| while (v0 < 0) {
0x004010e0 j 0x40118c | goto label_13;
0x004010e4 addiu v0, zero, -1 | v0 = -1;
0x004010e8 addiu v0, zero, 1 | v0 = 1;
0x004010ec move a0, s1 | a0 = s1;
0x004010f0 move a2, zero | a2 = 0;
0x004010f4 move a1, s2 | a1 = s2;
0x004010f8 move a3, zero | a3 = 0;
0x004010fc sw v0, 0x5358(t8) | *((t8 + 21336)) = v0;
0x00401100 jal 0x402f60 | fcn_00402f60 ();
0x00401104 j 0x401180 | goto label_16;
0x00401108 move s0, v0 | s0 = v0;
| label_14:
0x0040110c move a0, s5 | a0 = s5;
0x00401110 jal 0x40349c | fcn_0040349c ();
0x00401114 move a1, s3 | a1 = s3;
0x00401118 bltz v0, 0x4010e0 |
| }
0x0040111c move a0, s1 | a0 = s1;
0x00401120 move a2, s4 | a2 = s4;
0x00401124 jal 0x403a1c | fcn_00403a1c ();
0x00401128 lui t8, 0x41 | t8 = 0x410000;
0x0040112c lw t8, 0x5350(t8) | t8 = *((t8 + 5332));
0x00401130 move s0, v0 | s0 = v0;
| if (t8 != 0) {
0x00401134 beqz t8, 0x40115c |
0x00401138 lui t8, 0x41 | t8 = 0x410000;
0x0040113c lw t8, 0x534c(t8) | t8 = *((t8 + 5331));
0x00401140 or t8, s3, t8 | t8 = s3 | t8;
0x00401144 move a0, s1 | a0 = s1;
| if (t8 == 0) {
0x00401148 beqz t8, 0x40115c | goto label_17;
| }
0x0040114c move a1, s3 | a1 = s3;
0x00401150 move a2, s4 | a2 = s4;
0x00401154 jal 0x403a1c | fcn_00403a1c ();
0x00401158 move s0, v0 | s0 = v0;
| }
| label_17:
0x0040115c lui t8, 0x41 | t8 = 0x410000;
| if (s6 != 0) {
0x00401160 beqz s6, 0x401180 |
0x00401164 lui s0, 0x41 | s0 = 0x410000;
0x00401168 lw a2, 0x5348(s0) | a2 = *((s0 + 5330));
0x0040116c lui a1, 0x40 | a1 = 0x400000;
0x00401170 lw a0, 0x52fc(t8) | a0 = *((t8 + 5311));
| /* str.Setting_:__d_mapping_matched._n */
0x00401174 addiu a1, a1, 0x4af8 | a1 += 0x4af8;
0x00401178 jal 0x404fc0 | fcn_00404fc0 ();
0x0040117c lw s0, 0x5348(s0) | s0 = *((s0 + 5330));
| }
| label_16:
0x00401180 move a0, s1 | a0 = s1;
0x00401184 jal 0x405190 | fcn_00405190 ();
0x00401188 move v0, s0 | v0 = s0;
| label_13:
0x0040118c lw ra, 0x64(sp) | ra = *(var_64h);
0x00401190 lw fp, 0x60(sp) | fp = *(var_60h);
0x00401194 lw s7, 0x5c(sp) | s7 = *(var_5ch);
0x00401198 lw s6, 0x58(sp) | s6 = *(var_58h);
0x0040119c lw s5, 0x54(sp) | s5 = *(var_54h);
0x004011a0 lw s4, 0x50(sp) | s4 = *(var_50h);
0x004011a4 lw s3, 0x4c(sp) | s3 = *(var_4ch);
0x004011a8 lw s2, 0x48(sp) | s2 = *(var_48h);
0x004011ac lw s1, 0x44(sp) | s1 = *(var_44h);
0x004011b0 lw s0, 0x40(sp) | s0 = *(var_40h);
0x004011b4 addiu sp, sp, 0x68 |
0x004011b8 jr ra | return v0;
| }
[*] Function fprintf used 1 times ifrename