[*] Binary protection state of cidrmatch
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function printf tear down of cidrmatch
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/cidrmatch @ 0x7c0 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 1520 named .text */
0x000007c0 lui gp, 2 |
0x000007c4 addiu gp, gp, -0x77b0 |
0x000007c8 addu gp, gp, t9 | gp += t9;
0x000007cc lw v0, -0x7f88(gp) | v0 = *((gp - 8162));
0x000007d0 addiu sp, sp, -0x78 |
0x000007d4 move v1, v0 | v1 = v0;
0x000007d8 sw gp, 0x10(sp) | *(var_10h) = gp;
0x000007dc lw v1, (v1) | v1 = *(v1);
0x000007e0 sw v0, 0x20(sp) | *(var_20h) = v0;
0x000007e4 slti v0, a0, 2 | v0 = (a0 < 2) ? 1 : 0;
0x000007e8 sw s0, 0x50(sp) | *(var_50h) = s0;
0x000007ec sw ra, 0x74(sp) | *(var_74h) = ra;
0x000007f0 sw fp, 0x70(sp) | *(var_70h) = fp;
0x000007f4 sw s7, 0x6c(sp) | *(var_6ch) = s7;
0x000007f8 sw s6, 0x68(sp) | *(var_68h) = s6;
0x000007fc sw s5, 0x64(sp) | *(var_64h) = s5;
0x00000800 sw s4, 0x60(sp) | *(var_60h) = s4;
0x00000804 sw s3, 0x5c(sp) | *(var_5ch) = s3;
0x00000808 sw s2, 0x58(sp) | *(var_58h) = s2;
0x0000080c sw s1, 0x54(sp) | *(var_54h) = s1;
0x00000810 move s0, a1 | s0 = a1;
0x00000814 sw v1, 0x4c(sp) | *(var_4ch) = v1;
0x00000818 lw a2, (a1) | a2 = *(a1);
| if (v0 == 0) {
0x0000081c bnel v0, zero, 0xa00 | goto label_5;
| }
0x00000820 lw s3, -0x7fdc(gp) | s3 = *((gp - 8183));
0x00000824 move s1, a0 | s1 = a0;
0x00000828 addiu s6, sp, 0x2c | s6 = sp + 0x2c;
0x0000082c lw a0, 4(a1) | a0 = *((a1 + 1));
0x00000830 addiu s3, s3, 0xbc0 | s3 += fcn.00000bc0;
0x00000834 move t9, s3 | t9 = s3;
0x00000838 move a1, s6 | a1 = s6;
0x0000083c bal 0xbc0 | fcn_00000bc0 ();
0x00000840 move s4, v0 | s4 = v0;
0x00000844 addiu v0, zero, 2 | v0 = 2;
0x00000848 lw gp, 0x10(sp) | gp = *(var_10h);
| if (s4 == v0) {
0x0000084c beq s4, v0, 0x8dc | goto label_6;
| }
0x00000850 addiu v0, zero, 0xa | v0 = 0xa;
0x00000854 lw v0, 0x2c(sp) | v0 = *(var_2ch);
| if (s4 == v0) {
0x00000858 beq s4, v0, 0x8b4 | goto label_7;
| }
0x0000085c lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000860 lw t9, -0x7f94(gp) | t9 = sym.imp.puts;
0x00000864 addiu a0, a0, 0xe94 | a0 += str.unsupported_address_family;
0x00000868 jalr t9 | t9 ();
0x0000086c lw gp, 0x10(sp) | gp = *(var_10h);
0x00000870 addiu v0, zero, 1 | v0 = 1;
| label_2:
0x00000874 lw v1, 0x20(sp) | v1 = *(var_20h);
| do {
| label_0:
0x00000878 lw a0, 0x4c(sp) | a0 = *(var_4ch);
0x0000087c lw v1, (v1) | v1 = *(v1);
0x00000880 lw ra, 0x74(sp) | ra = *(var_74h);
| if (a0 != v1) {
0x00000884 bne a0, v1, 0xa38 | goto label_8;
| }
0x00000888 lw fp, 0x70(sp) | fp = *(var_70h);
0x0000088c lw s7, 0x6c(sp) | s7 = *(var_6ch);
0x00000890 lw s6, 0x68(sp) | s6 = *(var_68h);
0x00000894 lw s5, 0x64(sp) | s5 = *(var_64h);
0x00000898 lw s4, 0x60(sp) | s4 = *(var_60h);
0x0000089c lw s3, 0x5c(sp) | s3 = *(var_5ch);
0x000008a0 lw s2, 0x58(sp) | s2 = *(var_58h);
0x000008a4 lw s1, 0x54(sp) | s1 = *(var_54h);
0x000008a8 lw s0, 0x50(sp) | s0 = *(var_50h);
0x000008ac addiu sp, sp, 0x78 |
0x000008b0 jr ra | return v0;
| label_7:
0x000008b4 lw v1, 0x30(sp) | v1 = *(var_30h);
0x000008b8 or v0, v0, v1 | v0 |= v1;
0x000008bc addiu v0, zero, 0x80 | v0 = 0x80;
| if (v0 == 0) {
0x000008c0 bnez v0, 0x8d4 |
0x000008c4 lw v1, 0x34(sp) | v1 = *(var_34h);
0x000008c8 lui v0, 0xffff | v0 = 0xffff0000;
0x000008cc addiu v0, zero, 0x80 | v0 = 0x80;
| if (v1 == v0) {
0x000008d0 beq v1, v0, 0xa20 | goto label_9;
| }
| }
0x000008d4 sw v0, 0x1c(sp) | *(var_1ch) = v0;
0x000008d8 b 0x8e4 | goto label_4;
| label_6:
0x000008dc addiu v0, zero, 0x20 | v0 = 0x20;
0x000008e0 sw v0, 0x1c(sp) | *(var_1ch) = v0;
| label_4:
0x000008e4 sll v0, s1, 2 | v0 = s1 << 2;
0x000008e8 addu s0, s0, v0 | s0 += v0;
0x000008ec lui v0, 0x8000 | v0 = 0x80000007;
0x000008f0 addiu v0, v0, 7 |
0x000008f4 addiu s5, zero, 1 | s5 = 1;
0x000008f8 addiu s1, s1, -1 | s1 += -1;
0x000008fc addiu fp, sp, 0x3c | fp = sp + 0x3c;
0x00000900 sw v0, 0x24(sp) | *(var_24h) = v0;
| if (s1 == s5) {
0x00000904 beq s1, s5, 0x9f0 | goto label_10;
| }
| label_1:
0x00000908 lw s7, -4(s0) | s7 = *((s0 - 1));
0x0000090c lw t9, -0x7f9c(gp) | t9 = sym.imp.strchr;
0x00000910 addiu a1, zero, 0x2f | a1 = 0x2f;
0x00000914 move a0, s7 | a0 = s7;
0x00000918 jalr t9 | t9 ();
0x0000091c move s2, v0 | s2 = v0;
0x00000920 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00000924 beqz v0, 0x9f8 | goto label_11;
| }
0x00000928 lw t9, -0x7fb4(gp) | t9 = sym.imp.strtol;
0x0000092c addiu a2, zero, 0xa | a2 = 0xa;
0x00000930 move a1, zero | a1 = 0;
0x00000934 addiu a0, v0, 1 | a0 = v0 + 1;
0x00000938 jalr t9 | t9 ();
0x0000093c sb zero, (s2) | *(s2) = 0;
0x00000940 lw s7, -4(s0) | s7 = *((s0 - 1));
0x00000944 move s2, v0 | s2 = v0;
| label_3:
0x00000948 move a1, fp | a1 = fp;
0x0000094c move t9, s3 | t9 = s3;
0x00000950 move a0, s7 | a0 = s7;
0x00000954 bal 0xbc0 | fcn_00000bc0 ();
0x00000958 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != s4) {
0x0000095c bne v0, s4, 0x9e4 | goto label_12;
| }
0x00000960 move a2, s2 | a2 = s2;
| if (s2 < 0) {
0x00000964 bgez s2, 0x96c |
0x00000968 addiu a2, s2, 7 | a2 = s2 + 7;
| }
0x0000096c lw t9, -0x7f8c(gp) | t9 = sym.imp.memcmp;
0x00000970 sra s7, a2, 3 | s7 = a2 >> 3;
0x00000974 move a2, s7 | a2 = s7;
0x00000978 move a1, fp | a1 = fp;
0x0000097c move a0, s6 | a0 = s6;
0x00000980 jalr t9 | t9 ();
0x00000984 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x00000988 bnez v0, 0x9e4 | goto label_12;
| }
0x0000098c andi a0, s2, 7 | a0 = s2 & 7;
0x00000990 lw v1, 0x20(sp) | v1 = *(var_20h);
0x00000994 beqz a0, 0x878 |
| } while (a0 == 0);
0x00000998 addiu v0, sp, 0x50 | v0 = sp + 0x50;
0x0000099c addu a2, v0, s7 | a2 = v0 + s7;
0x000009a0 lw v0, 0x24(sp) | v0 = *(var_24h);
0x000009a4 lbu v1, -0x14(a2) | v1 = *((a2 - 20));
0x000009a8 and s2, s2, v0 | s2 &= v0;
0x000009ac lbu v0, -0x24(a2) | v0 = *((a2 - 36));
0x000009b0 xor v0, v0, v1 | v0 ^= v1;
| if (s2 < 0) {
0x000009b4 bgez s2, 0x9c8 |
0x000009b8 addiu s2, s2, -1 | s2 += -1;
0x000009bc addiu v1, zero, -8 | v1 = -8;
0x000009c0 or s2, s2, v1 | s2 |= v1;
0x000009c4 addiu s2, s2, 1 | s2++;
| }
0x000009c8 addiu v1, zero, 8 | v1 = 8;
0x000009cc subu v1, v1, s2 | __asm ("subu v1, v1, s2");
0x000009d0 addiu s2, zero, 0xff | s2 = 0xff;
0x000009d4 sllv s2, s2, v1 | s2 <<= v1;
0x000009d8 and v0, v0, s2 | v0 &= s2;
0x000009dc lw v1, 0x20(sp) | v1 = *(var_20h);
| if (v0 == 0) {
0x000009e0 beqz v0, 0x878 | goto label_0;
| }
| label_12:
0x000009e4 addiu s1, s1, -1 | s1 += -1;
0x000009e8 addiu s0, s0, -4 | s0 += -4;
| if (s1 != s5) {
0x000009ec bne s1, s5, 0x908 | goto label_1;
| }
| label_10:
0x000009f0 addiu v0, zero, 1 | v0 = 1;
0x000009f4 b 0x874 | goto label_2;
| label_11:
0x000009f8 lw s2, 0x1c(sp) | s2 = *(var_1ch);
0x000009fc b 0x948 | goto label_3;
| label_5:
0x00000a00 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000a04 lw t9, -0x7fa4(gp) | t9 = sym.imp.__printf_chk
0x00000a08 addiu a1, a1, 0xe78 | a1 += str.USAGE:__s_addr_prefixlist_n;
0x00000a0c addiu a0, zero, 1 | a0 = 1;
0x00000a10 jalr t9 | t9 ();
0x00000a14 lw gp, 0x10(sp) | gp = *(var_10h);
0x00000a18 addiu v0, zero, 1 | v0 = 1;
0x00000a1c b 0x874 | goto label_2;
| label_9:
0x00000a20 addiu v0, zero, 0x20 | v0 = 0x20;
0x00000a24 sw v0, 0x1c(sp) | *(var_1ch) = v0;
0x00000a28 lw v0, 0x38(sp) | v0 = *(var_38h);
0x00000a2c addiu s4, zero, 2 | s4 = 2;
0x00000a30 sw v0, 0x2c(sp) | *(var_2ch) = v0;
0x00000a34 b 0x8e4 | goto label_4;
| label_8:
0x00000a38 lw t9, -0x7f90(gp) | t9 = sym.imp.__stack_chk_fail;
0x00000a3c jalr t9 | t9 ();
0x00000a40 nop |
0x00000a44 nop |
0x00000a48 nop |
0x00000a4c nop |
| }
[*] Function printf used 2 times cidrmatch