[*] Binary protection state of axisns
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function strcpy tear down of axisns
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/axisns @ 0x7dc4 */
| #include <stdint.h>
|
; (fcn) sym.get_last_state () | void get_last_state () {
0x00007dc4 lui gp, 2 |
0x00007dc8 addiu gp, gp, -0x4da4 |
0x00007dcc addu gp, gp, t9 | gp += t9;
0x00007dd0 addiu sp, sp, -0xc8 |
0x00007dd4 lw t9, -0x7ed8(gp) | t9 = sym.imp.lseek;
0x00007dd8 sw s3, 0xc0(sp) | *(var_c0h) = s3;
0x00007ddc lw s3, -0x7e40(gp) | s3 = *((gp - 8080));
0x00007de0 sw gp, 0x10(sp) | *(var_10h_3) = gp;
0x00007de4 sw s2, 0xbc(sp) | *(var_bch) = s2;
0x00007de8 lw v0, (s3) | v0 = *(s3);
0x00007dec sw s0, 0xb4(sp) | *(var_b4h) = s0;
0x00007df0 sw ra, 0xc4(sp) | *(var_c4h) = ra;
0x00007df4 sw s1, 0xb8(sp) | *(var_b8h) = s1;
0x00007df8 move s2, a1 | s2 = a1;
0x00007dfc move a2, zero | a2 = 0;
0x00007e00 move a1, zero | a1 = 0;
0x00007e04 sw v0, 0xac(sp) | *(var_ach) = v0;
0x00007e08 move s0, a0 | s0 = a0;
0x00007e0c jalr t9 | t9 ();
0x00007e10 lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v0 < 0) {
0x00007e14 bltz v0, 0x7f24 | goto label_0;
| }
0x00007e18 lw t9, -0x7db8(gp) | t9 = sym.imp.read;
0x00007e1c addiu s1, sp, 0x1c | s1 = sp + 0x1c;
0x00007e20 addiu a2, zero, 0x8d | a2 = 0x8d;
0x00007e24 move a1, s1 | a1 = s1;
0x00007e28 move a0, s0 | a0 = s0;
0x00007e2c jalr t9 | t9 ();
0x00007e30 lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v0 < 0) {
0x00007e34 bltz v0, 0x7f24 | goto label_0;
| }
0x00007e38 addiu v1, sp, 0xb0 | v1 = sp + 0xb0;
0x00007e3c addu v0, v1, v0 | v0 = v1 + v0;
0x00007e40 lw t9, -0x7d7c(gp) | t9 = sym.imp.strchr;
0x00007e44 addiu a1, zero, 0xa | a1 = 0xa;
0x00007e48 move a0, s1 | a0 = s1;
0x00007e4c sb zero, -0x94(v0) | *((v0 - 148)) = 0;
0x00007e50 jalr t9 | t9 ();
0x00007e54 move s0, v0 | s0 = v0;
0x00007e58 lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v0 == 0) {
0x00007e5c beqz v0, 0x7f24 | goto label_0;
| }
0x00007e60 lw t9, -0x7dd8(gp) | t9 = sym.imp.inet_pton;
0x00007e64 sb zero, (v0) | *(v0) = 0;
0x00007e68 move a2, s2 | a2 = s2;
0x00007e6c move a1, s1 | a1 = s1;
0x00007e70 addiu a0, zero, 2 | a0 = 2;
0x00007e74 jalr t9 | t9 ();
0x00007e78 addiu v1, zero, 1 | v1 = 1;
0x00007e7c lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v0 != v1) {
0x00007e80 bne v0, v1, 0x7f24 | goto label_0;
| }
0x00007e84 addiu s0, s0, 1 | s0++;
0x00007e88 lw t9, -0x7d7c(gp) | t9 = sym.imp.strchr;
| if (s0 == 0) {
0x00007e8c beqz s0, 0x7f24 | goto label_0;
| }
0x00007e90 addiu a1, zero, 0xa | a1 = 0xa;
0x00007e94 move a0, s0 | a0 = s0;
0x00007e98 jalr t9 | t9 ();
0x00007e9c lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v0 == 0) {
0x00007ea0 beqz v0, 0x7f24 | goto label_0;
| }
0x00007ea4 lw t9, -0x7e4c(gp) | t9 = sym.imp.__strcpy_chk
0x00007ea8 move a1, s0 | a1 = s0;
0x00007eac sb zero, (v0) | *(v0) = 0;
0x00007eb0 addiu a2, zero, 0x51 | a2 = 0x51;
0x00007eb4 addiu a0, s2, 4 | a0 = s2 + 4;
0x00007eb8 addiu s0, v0, 1 | s0 = v0 + 1;
0x00007ebc jalr t9 | t9 ();
0x00007ec0 lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (s0 == 0) {
0x00007ec4 beqz s0, 0x7f24 | goto label_0;
| }
0x00007ec8 lw t9, -0x7d7c(gp) | t9 = sym.imp.strchr;
0x00007ecc addiu a1, zero, 0xa | a1 = 0xa;
0x00007ed0 move a0, s0 | a0 = s0;
0x00007ed4 jalr t9 | t9 ();
0x00007ed8 lw gp, 0x10(sp) | gp = *(var_10h_3);
| if (v0 == 0) {
0x00007edc beqz v0, 0x7f24 | goto label_0;
| }
0x00007ee0 lw t9, -0x7e3c(gp) | t9 = sym.imp.strcpy
0x00007ee4 sb zero, (v0) | *(v0) = 0;
0x00007ee8 move a1, s0 | a1 = s0;
0x00007eec addiu a0, s2, 0x55 | a0 = s2 + 0x55;
0x00007ef0 jalr t9 | t9 ();
0x00007ef4 lw gp, 0x10(sp) | gp = *(var_10h_3);
0x00007ef8 move v0, zero | v0 = 0;
| do {
0x00007efc lw a0, 0xac(sp) | a0 = *(var_ach);
0x00007f00 lw v1, (s3) | v1 = *(s3);
0x00007f04 lw ra, 0xc4(sp) | ra = *(var_c4h);
| if (a0 != v1) {
0x00007f08 bne a0, v1, 0x7f2c | goto label_1;
| }
0x00007f0c lw s3, 0xc0(sp) | s3 = *(var_c0h);
0x00007f10 lw s2, 0xbc(sp) | s2 = *(var_bch);
0x00007f14 lw s1, 0xb8(sp) | s1 = *(var_b8h);
0x00007f18 lw s0, 0xb4(sp) | s0 = *(var_b4h);
0x00007f1c addiu sp, sp, 0xc8 |
0x00007f20 jr ra | return v0;
| label_0:
0x00007f24 addiu v0, zero, -1 | v0 = -1;
0x00007f28 b 0x7efc |
| } while (1);
| label_1:
0x00007f2c lw t9, -0x7e80(gp) | t9 = sym.imp.__stack_chk_fail;
0x00007f30 jalr t9 | t9 ();
0x00007f34 nop |
| }
[*] Function strcpy used 3 times axisns