[*] Binary protection state of cert.cgi
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function printf tear down of cert.cgi
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/html/axis-cgi/certificate2/cert.cgi @ 0x30a8 */
| #include <stdint.h>
|
; (fcn) sym.deleteCertificate () | void deleteCertificate () {
0x000030a8 lui gp, 2 |
0x000030ac addiu gp, gp, -0x5098 |
0x000030b0 addu gp, gp, t9 | gp += t9;
0x000030b4 addiu sp, sp, -0x48 |
0x000030b8 sw s0, 0x2c(sp) | *(var_2ch) = s0;
0x000030bc lw s0, -0x7ec4(gp) | s0 = *((gp - 8113));
0x000030c0 sw gp, 0x10(sp) | *(var_10h) = gp;
0x000030c4 sw s2, 0x34(sp) | *(var_34h) = s2;
0x000030c8 lw v0, (s0) | v0 = *(s0);
0x000030cc sw ra, 0x44(sp) | *(var_44h) = ra;
0x000030d0 sw s5, 0x40(sp) | *(var_40h) = s5;
0x000030d4 sw s4, 0x3c(sp) | *(var_3ch) = s4;
0x000030d8 sw s3, 0x38(sp) | *(var_38h) = s3;
0x000030dc sw s1, 0x30(sp) | *(var_30h) = s1;
0x000030e0 move s2, a2 | s2 = a2;
0x000030e4 sw zero, 0x1c(sp) | *(var_1ch) = 0;
0x000030e8 sw v0, 0x24(sp) | *(var_24h) = v0;
0x000030ec sw zero, 0x20(sp) | *(var_20h) = 0;
| if (a0 == 0) {
0x000030f0 beqz a0, 0x3268 | goto label_1;
| }
0x000030f4 lw s3, -0x7fd8(gp) | s3 = *((gp - 8182));
0x000030f8 lw t9, -0x7ef8(gp) | t9 = sym.imp.jc_get_string;
0x000030fc move s5, a1 | s5 = a1;
0x00003100 addiu a1, s3, 0x4e18 | a1 = s3 + 0x4e18;
0x00003104 jalr t9 | t9 ();
0x00003108 lw v1, (s2) | v1 = *(s2);
0x0000310c lw gp, 0x10(sp) | gp = *(var_10h);
0x00003110 move s4, v0 | s4 = v0;
| if (v1 == 0) {
0x00003114 beqz v1, 0x3184 | goto label_2;
| }
0x00003118 move s3, zero | s3 = 0;
0x0000311c move s1, zero | s1 = 0;
| do {
| label_0:
0x00003120 lw t9, -0x7f1c(gp) | t9 = sym.imp.cert_msg_destroy;
0x00003124 lw a0, 0x1c(sp) | a0 = *(var_1ch);
0x00003128 jalr t9 | t9 ();
0x0000312c lw gp, 0x10(sp) | gp = *(var_10h);
0x00003130 lw t9, -0x7f1c(gp) | t9 = sym.imp.cert_msg_destroy;
0x00003134 lw a0, 0x20(sp) | a0 = *(var_20h);
0x00003138 jalr t9 | t9 ();
0x0000313c lw gp, 0x10(sp) | gp = *(var_10h);
0x00003140 lw t9, -0x7f38(gp) | t9 = sym.imp.g_free;
0x00003144 move a0, s3 | a0 = s3;
0x00003148 jalr t9 | t9 ();
0x0000314c lw a0, 0x24(sp) | a0 = *(var_24h);
0x00003150 lw v1, (s0) | v1 = *(s0);
0x00003154 lw gp, 0x10(sp) | gp = *(var_10h);
0x00003158 move v0, s1 | v0 = s1;
| if (a0 != v1) {
0x0000315c bne a0, v1, 0x3374 | goto label_3;
| }
0x00003160 lw ra, 0x44(sp) | ra = *(var_44h);
0x00003164 lw s5, 0x40(sp) | s5 = *(var_40h);
0x00003168 lw s4, 0x3c(sp) | s4 = *(var_3ch);
0x0000316c lw s3, 0x38(sp) | s3 = *(var_38h);
0x00003170 lw s2, 0x34(sp) | s2 = *(var_34h);
0x00003174 lw s1, 0x30(sp) | s1 = *(var_30h);
0x00003178 lw s0, 0x2c(sp) | s0 = *(var_2ch);
0x0000317c addiu sp, sp, 0x48 |
0x00003180 jr ra | return v0;
| label_2:
0x00003184 lw t9, -0x7ea0(gp) | t9 = sym.imp.cert_set_is_in_use;
0x00003188 move a0, v0 | a0 = v0;
0x0000318c jalr t9 | t9 ();
0x00003190 move s1, v0 | s1 = v0;
0x00003194 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x00003198 bnez v0, 0x3238 | goto label_4;
| }
0x0000319c lw t9, -0x7eec(gp) | t9 = sym.imp.cert_msg_init;
0x000031a0 addiu a1, zero, 3 | a1 = 3;
0x000031a4 addiu a0, sp, 0x1c | a0 = sp + 0x1c;
0x000031a8 jalr t9 | t9 ();
0x000031ac lw gp, 0x10(sp) | gp = *(var_10h);
0x000031b0 lw a0, 0x1c(sp) | a0 = *(var_1ch);
0x000031b4 move a2, s4 | a2 = s4;
0x000031b8 lw t9, -0x7ec8(gp) | t9 = sym.imp.cert_msg_add_op;
0x000031bc move a1, zero | a1 = 0;
0x000031c0 jalr t9 | t9 ();
0x000031c4 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x000031c8 bnez v0, 0x3284 | goto label_5;
| }
0x000031cc lw t9, -0x7ea8(gp) | t9 = sym.imp.cert_msg_send_req;
0x000031d0 lw a1, 0x1c(sp) | a1 = *(var_1ch);
0x000031d4 addiu a0, sp, 0x20 | a0 = sp + 0x20;
0x000031d8 jalr t9 | t9 ();
0x000031dc move s1, v0 | s1 = v0;
0x000031e0 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 != 0) {
0x000031e4 bnez v0, 0x332c | goto label_6;
| }
0x000031e8 lw v0, 0x20(sp) | v0 = *(var_20h);
0x000031ec lw t9, -0x7eb8(gp) | t9 = sym.imp.cert_prm_get_int;
0x000031f0 lw v0, (v0) | v0 = *(v0);
0x000031f4 lw v0, (v0) | v0 = *(v0);
0x000031f8 lw v0, (v0) | v0 = *(v0);
0x000031fc lw a0, (v0) | a0 = *(v0);
0x00003200 jalr t9 | t9 ();
0x00003204 lw gp, 0x10(sp) | gp = *(var_10h);
| if (v0 == 0) {
0x00003208 beqz v0, 0x32b0 | goto label_7;
| }
0x0000320c lw t9, -0x7f0c(gp) | t9 = sym.imp.json_utils_add_element_to_json_elements_list;
0x00003210 lw a0, (s5) | a0 = *(s5);
0x00003214 addiu a1, s3, 0x4e18 | a1 = s3 + 0x4e18;
0x00003218 addiu a3, zero, 3 | a3 = 3;
0x0000321c move a2, s4 | a2 = s4;
0x00003220 jalr t9 | t9 ();
0x00003224 move s3, zero | s3 = 0;
0x00003228 lw gp, 0x10(sp) | gp = *(var_10h);
0x0000322c sw v0, (s5) | *(s5) = v0;
0x00003230 addiu s1, zero, 1 | s1 = 1;
0x00003234 b 0x3120 |
| } while (1);
| label_4:
0x00003238 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x0000323c lw t9, -0x7f3c(gp) | t9 = sym.imp.jc_generic_error;
0x00003240 lw a0, (s2) | a0 = *(s2);
0x00003244 move a3, zero | a3 = 0;
0x00003248 addiu a2, a2, 0x4eb4 | a2 += str.Certificate_cant_be_deleted__its_in_use;
0x0000324c addiu a1, zero, 6 | a1 = 6;
| do {
0x00003250 move s3, zero | s3 = 0;
0x00003254 jalr t9 | t9 ();
0x00003258 lw gp, 0x10(sp) | gp = *(var_10h);
0x0000325c sw v0, (s2) | *(s2) = v0;
0x00003260 move s1, zero | s1 = 0;
0x00003264 b 0x3120 | goto label_0;
| label_1:
0x00003268 lw a0, (a2) | a0 = *(a2);
0x0000326c lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00003270 lw t9, -0x7f3c(gp) | t9 = sym.imp.jc_generic_error;
0x00003274 move a3, zero | a3 = 0;
0x00003278 addiu a2, a2, 0x4c30 | a2 += str.No_JSON_data;
0x0000327c addiu a1, zero, 1 | a1 = 1;
0x00003280 b 0x3250 |
| } while (1);
| label_5:
0x00003284 lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00003288 lw t9, -0x7f3c(gp) | t9 = sym.imp.jc_generic_error;
0x0000328c lw a0, (s2) | a0 = *(s2);
0x00003290 move a3, zero | a3 = 0;
0x00003294 addiu a2, a2, 0x4ee0 | a2 += str.Failed_to_delete_certificate;
0x00003298 addiu a1, zero, 1 | a1 = 1;
0x0000329c jalr t9 | t9 ();
0x000032a0 move s3, zero | s3 = 0;
0x000032a4 lw gp, 0x10(sp) | gp = *(var_10h);
0x000032a8 sw v0, (s2) | *(s2) = v0;
0x000032ac b 0x3120 | goto label_0;
| label_7:
0x000032b0 lw t9, -0x7f40(gp) | t9 = sym.imp.cert_msg_get_op;
0x000032b4 lw a0, 0x20(sp) | a0 = *(var_20h);
0x000032b8 addiu a1, zero, 1 | a1 = 1;
0x000032bc jalr t9 | t9 ();
0x000032c0 lw gp, 0x10(sp) | gp = *(var_10h);
0x000032c4 move a1, zero | a1 = 0;
0x000032c8 lw t9, -0x7efc(gp) | t9 = sym.imp.cert_op_get_prm;
0x000032cc move a0, v0 | a0 = v0;
0x000032d0 jalr t9 | t9 ();
0x000032d4 lw gp, 0x10(sp) | gp = *(var_10h);
0x000032d8 lw t9, -0x7eb8(gp) | t9 = sym.imp.cert_prm_get_int;
0x000032dc move a0, v0 | a0 = v0;
0x000032e0 jalr t9 | t9 ();
0x000032e4 lw gp, 0x10(sp) | gp = *(var_10h);
0x000032e8 addiu v1, zero, 4 | v1 = 4;
0x000032ec lw t9, -0x7f08(gp) | t9 = sym.imp.g_strdup_printf
| if (v0 == v1) {
0x000032f0 beq v0, v1, 0x335c | goto label_8;
| }
0x000032f4 lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x000032f8 addiu a0, a0, 0x4ee0 | a0 += str.Failed_to_delete_certificate;
0x000032fc jalr t9 | t9 ();
0x00003300 lw gp, 0x10(sp) | gp = *(var_10h);
0x00003304 move s3, v0 | s3 = v0;
| do {
0x00003308 lw t9, -0x7f3c(gp) | t9 = sym.imp.jc_generic_error;
0x0000330c lw a0, (s2) | a0 = *(s2);
0x00003310 move a3, zero | a3 = 0;
0x00003314 move a2, s3 | a2 = s3;
0x00003318 addiu a1, zero, 6 | a1 = 6;
0x0000331c jalr t9 | t9 ();
0x00003320 lw gp, 0x10(sp) | gp = *(var_10h);
0x00003324 sw v0, (s2) | *(s2) = v0;
0x00003328 b 0x3120 | goto label_0;
| label_6:
0x0000332c lw a2, -0x7fd8(gp) | a2 = *((gp - 8182));
0x00003330 lw t9, -0x7f3c(gp) | t9 = sym.imp.jc_generic_error;
0x00003334 lw a0, (s2) | a0 = *(s2);
0x00003338 move a3, zero | a3 = 0;
0x0000333c addiu a2, a2, 0x4ee0 | a2 += str.Failed_to_delete_certificate;
0x00003340 addiu a1, zero, 1 | a1 = 1;
0x00003344 jalr t9 | t9 ();
0x00003348 move s1, zero | s1 = 0;
0x0000334c lw gp, 0x10(sp) | gp = *(var_10h);
0x00003350 sw v0, (s2) | *(s2) = v0;
0x00003354 move s3, zero | s3 = 0;
0x00003358 b 0x3120 | goto label_0;
| label_8:
0x0000335c lw a0, -0x7fd8(gp) | a0 = *((gp - 8182));
0x00003360 addiu a0, a0, 0x4f00 | a0 += str.Unknown_certificate;
0x00003364 jalr t9 | t9 ();
0x00003368 move s3, v0 | s3 = v0;
0x0000336c lw gp, 0x10(sp) | gp = *(var_10h);
0x00003370 b 0x3308 |
| } while (1);
| label_3:
0x00003374 lw t9, -0x7f34(gp) | t9 = sym.imp.__stack_chk_fail;
0x00003378 jalr t9 | t9 ();
0x0000337c nop |
| }
[*] Function printf used 2 times cert.cgi