[*] Binary protection state of shuttergain.cgi
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function mmap tear down of shuttergain.cgi
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/html/axis-cgi/shuttergain.cgi @ 0x20ec */
| #include <stdint.h>
|
; (fcn) fcn.000020ec () | void fcn_000020ec () {
0x000020ec lui gp, 2 |
0x000020f0 addiu gp, gp, 0x1f64 |
0x000020f4 addu gp, gp, t9 | gp += t9;
0x000020f8 addiu sp, sp, -0x30 |
0x000020fc lw t9, -0x7ed8(gp) | t9 = sym.imp.shm_open;
0x00002100 addiu a2, zero, 0x180 | a2 = aav.0x00000180;
0x00002104 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00002108 sw s1, 0x28(sp) | *(var_28h) = s1;
0x0000210c sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00002110 sw s0, 0x24(sp) | *(var_24h) = s0;
0x00002114 move s1, a1 | s1 = a1;
0x00002118 move a1, zero | a1 = 0;
0x0000211c jalr t9 | t9 ();
0x00002120 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x00002124 bltz v0, 0x2184 | goto label_0;
| }
0x00002128 lw t9, -0x7da4(gp) | t9 = sym.imp.mmap
0x0000212c addiu a3, zero, 1 | a3 = 1;
0x00002130 addiu a2, zero, 1 | a2 = 1;
0x00002134 move a1, s1 | a1 = s1;
0x00002138 move a0, zero | a0 = 0;
0x0000213c sw zero, 0x14(sp) | *(var_14h) = 0;
0x00002140 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00002144 move s0, v0 | s0 = v0;
0x00002148 jalr t9 | t9 ();
0x0000214c lw gp, 0x18(sp) | gp = *(var_18h);
0x00002150 move a0, s0 | a0 = s0;
0x00002154 lw t9, -0x7e7c(gp) | t9 = sym.imp.close;
0x00002158 move s0, v0 | s0 = v0;
0x0000215c jalr t9 | t9 ();
0x00002160 addiu v0, zero, -1 | v0 = -1;
0x00002164 lw gp, 0x18(sp) | gp = *(var_18h);
| if (s0 == v0) {
0x00002168 beq s0, v0, 0x21d8 | goto label_1;
| }
0x0000216c lw ra, 0x2c(sp) | ra = *(var_2ch);
| do {
0x00002170 move v0, s0 | v0 = s0;
0x00002174 lw s1, 0x28(sp) | s1 = *(var_28h);
0x00002178 lw s0, 0x24(sp) | s0 = *(var_24h);
0x0000217c addiu sp, sp, 0x30 |
0x00002180 jr ra | return v0;
| label_0:
0x00002184 lw t9, -0x7d9c(gp) | t9 = sym.imp.__errno_location;
0x00002188 move s0, zero | s0 = 0;
0x0000218c jalr t9 | t9 ();
0x00002190 lw gp, 0x18(sp) | gp = *(var_18h);
0x00002194 lw t9, -0x7da8(gp) | t9 = sym.imp.strerror;
0x00002198 lw a0, (v0) | a0 = *(v0);
0x0000219c jalr t9 | t9 ();
0x000021a0 lw gp, 0x18(sp) | gp = *(var_18h);
0x000021a4 move a3, v0 | a3 = v0;
0x000021a8 addiu a1, zero, 1 | a1 = 1;
0x000021ac lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x000021b0 lw t9, -0x7e74(gp) | t9 = sym.imp.__syslog_chk;
0x000021b4 addiu a2, a2, -0x4fb8 | a2 += -0x4fb8;
0x000021b8 addiu a0, zero, 3 | a0 = 3;
0x000021bc jalr t9 | t9 ();
0x000021c0 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x000021c4 move v0, s0 | v0 = s0;
0x000021c8 lw s1, 0x28(sp) | s1 = *(var_28h);
0x000021cc lw s0, 0x24(sp) | s0 = *(var_24h);
0x000021d0 addiu sp, sp, 0x30 |
0x000021d4 jr ra | return v0;
| label_1:
0x000021d8 lw t9, -0x7d9c(gp) | t9 = sym.imp.__errno_location;
0x000021dc move s0, zero | s0 = 0;
0x000021e0 jalr t9 | t9 ();
0x000021e4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000021e8 lw t9, -0x7da8(gp) | t9 = sym.imp.strerror;
0x000021ec lw a0, (v0) | a0 = *(v0);
0x000021f0 jalr t9 | t9 ();
0x000021f4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000021f8 move a3, v0 | a3 = v0;
0x000021fc addiu a1, zero, 1 | a1 = 1;
0x00002200 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00002204 lw t9, -0x7e74(gp) | t9 = sym.imp.__syslog_chk;
0x00002208 addiu a2, a2, -0x4f8c | a2 += -0x4f8c;
0x0000220c addiu a0, zero, 3 | a0 = 3;
0x00002210 jalr t9 | t9 ();
0x00002214 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00002218 b 0x2170 |
| } while (1);
| }
[*] Function mmap used 2 times shuttergain.cgi