[*] Binary protection state of getbrand.cgi
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function printf tear down of getbrand.cgi
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/html/axis-cgi/prod_brand_info/getbrand.cgi @ 0xcd0 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 1664 named .text */
0x00000cd0 lui gp, 2 |
0x00000cd4 addiu gp, gp, -0x6cb0 |
0x00000cd8 addu gp, gp, t9 | gp += t9;
0x00000cdc addiu sp, sp, -0xb8 |
0x00000ce0 lw t9, -0x7f90(gp) | t9 = sym.imp.ax_log_syslog;
0x00000ce4 sw s4, 0xa0(sp) | *(var_a0h) = s4;
0x00000ce8 lw s4, -0x7f50(gp) | s4 = *((gp - 8148));
0x00000cec sw gp, 0x30(sp) | *(var_30h) = gp;
0x00000cf0 sw ra, 0xb4(sp) | *(var_b4h) = ra;
0x00000cf4 lw v0, (s4) | v0 = *(s4);
0x00000cf8 sw s3, 0x9c(sp) | *(var_9ch) = s3;
0x00000cfc sw v0, 0x8c(sp) | *(var_8ch) = v0;
0x00000d00 sw fp, 0xb0(sp) | *(var_b0h) = fp;
0x00000d04 sw s7, 0xac(sp) | *(var_ach) = s7;
0x00000d08 sw s6, 0xa8(sp) | *(var_a8h) = s6;
0x00000d0c sw s5, 0xa4(sp) | *(var_a4h) = s5;
0x00000d10 sw s2, 0x98(sp) | *(var_98h) = s2;
0x00000d14 sw s1, 0x94(sp) | *(var_94h) = s1;
0x00000d18 sw s0, 0x90(sp) | *(var_90h) = s0;
0x00000d1c addiu s3, sp, 0x40 | s3 = sp + 0x40;
0x00000d20 jalr t9 | t9 ();
0x00000d24 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000d28 move a2, s3 | a2 = s3;
0x00000d2c lw t9, -0x7f68(gp) | t9 = sym.imp.g_bus_get_sync;
0x00000d30 move a1, zero | a1 = 0;
0x00000d34 addiu a0, zero, 1 | a0 = 1;
0x00000d38 sw zero, 0x40(sp) | *(var_40h) = 0;
0x00000d3c sw zero, 0x44(sp) | *(var_44h) = 0;
0x00000d40 sw zero, 0x48(sp) | *(var_48h) = 0;
0x00000d44 jalr t9 | t9 ();
0x00000d48 lw gp, 0x30(sp) | gp = *(var_30h);
| if (v0 == 0) {
0x00000d4c beqz v0, 0x10a0 | goto label_2;
| }
0x00000d50 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000d54 lw t9, -0x7f34(gp) | t9 = sym.imp.g_variant_type_checked_;
0x00000d58 addiu a0, a0, 0x1538 | a0 += 0x1538;
0x00000d5c move s2, v0 | s2 = v0;
0x00000d60 jalr t9 | t9 ();
0x00000d64 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000d68 lw t9, -0x7f64(gp) | t9 = sym.imp.g_variant_builder_new;
0x00000d6c move a0, v0 | a0 = v0;
0x00000d70 jalr t9 | t9 ();
0x00000d74 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000d78 move a0, v0 | a0 = v0;
0x00000d7c move s0, v0 | s0 = v0;
0x00000d80 lw s1, -0x7fdc(gp) | s1 = *((gp - 8183));
0x00000d84 lw s5, -0x7fdc(gp) | s5 = *((gp - 8183));
0x00000d88 lw t9, -0x7f60(gp) | t9 = sym.imp.g_variant_builder_add;
0x00000d8c addiu a2, s5, 0x153c | a2 = s5 + str.Brand;
0x00000d90 addiu a1, s1, 0x1544 | a1 = s1 + 0x1544;
0x00000d94 jalr t9 | t9 ();
0x00000d98 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000d9c addiu a1, s1, 0x1544 | a1 = s1 + 0x1544;
0x00000da0 move a0, s0 | a0 = s0;
0x00000da4 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000da8 lw t9, -0x7f60(gp) | t9 = sym.imp.g_variant_builder_add;
0x00000dac addiu a2, a2, 0x1548 | a2 += str.ProdFullName;
0x00000db0 jalr t9 | t9 ();
0x00000db4 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000db8 addiu a1, s1, 0x1544 | a1 = s1 + 0x1544;
0x00000dbc move a0, s0 | a0 = s0;
0x00000dc0 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000dc4 lw t9, -0x7f60(gp) | t9 = sym.imp.g_variant_builder_add;
0x00000dc8 addiu a2, a2, 0x1558 | a2 += str.ProdShortName;
0x00000dcc jalr t9 | t9 ();
0x00000dd0 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000dd4 addiu a1, s1, 0x1544 | a1 = s1 + 0x1544;
0x00000dd8 move a0, s0 | a0 = s0;
0x00000ddc lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000de0 lw t9, -0x7f60(gp) | t9 = sym.imp.g_variant_builder_add;
0x00000de4 addiu a2, a2, 0x1568 | a2 += str.ProdNbr;
0x00000de8 jalr t9 | t9 ();
0x00000dec lw gp, 0x30(sp) | gp = *(var_30h);
0x00000df0 addiu a1, s1, 0x1544 | a1 = s1 + 0x1544;
0x00000df4 move a0, s0 | a0 = s0;
0x00000df8 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000dfc lw t9, -0x7f60(gp) | t9 = sym.imp.g_variant_builder_add;
0x00000e00 addiu a2, a2, 0x1570 | a2 += str.ProdType;
0x00000e04 jalr t9 | t9 ();
0x00000e08 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000e0c move a1, s0 | a1 = s0;
0x00000e10 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000e14 lw t9, -0x7f94(gp) | t9 = sym.imp.g_variant_new;
0x00000e18 addiu a0, a0, 0x157c | a0 += str._as_;
0x00000e1c jalr t9 | t9 ();
0x00000e20 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000e24 move a0, s2 | a0 = s2;
0x00000e28 lw v1, -0x7fd8(gp) | v1 = *(gp);
0x00000e2c lw t9, -0x7f88(gp) | t9 = sym.imp.g_dbus_connection_call_sync;
0x00000e30 lw a3, (v1) | a3 = *(v1);
0x00000e34 lw v1, -0x7fd4(gp) | v1 = *(gp);
0x00000e38 lw a2, (v1) | a2 = *(v1);
0x00000e3c lw v1, -0x7fd0(gp) | v1 = *(gp);
0x00000e40 lw a1, (v1) | a1 = *(v1);
0x00000e44 sw v0, 0x14(sp) | *(var_14h_2) = v0;
0x00000e48 lw v0, -0x7fdc(gp) | v0 = *((gp - 8183));
0x00000e4c addiu v1, zero, -1 | v1 = -1;
0x00000e50 addiu v0, v0, 0x1584 | v0 += 0x1584;
0x00000e54 sw v1, 0x20(sp) | *(var_20h) = v1;
0x00000e58 sw s3, 0x28(sp) | *(var_28h) = s3;
0x00000e5c sw zero, 0x24(sp) | *(var_24h) = 0;
0x00000e60 sw zero, 0x1c(sp) | *(var_1ch) = 0;
0x00000e64 sw zero, 0x18(sp) | *(var_18h_2) = 0;
0x00000e68 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00000e6c jalr t9 | t9 ();
0x00000e70 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000e74 move a0, s0 | a0 = s0;
0x00000e78 lw t9, -0x7fa4(gp) | t9 = sym.imp.g_variant_builder_unref;
0x00000e7c move s3, v0 | s3 = v0;
0x00000e80 jalr t9 | t9 ();
0x00000e84 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000e88 lw t9, -0x7f44(gp) | t9 = sym.imp.g_object_unref;
0x00000e8c move a0, s2 | a0 = s2;
0x00000e90 jalr t9 | t9 ();
0x00000e94 lw gp, 0x30(sp) | gp = *(var_30h);
| if (s3 == 0) {
0x00000e98 beqz s3, 0x10f8 | goto label_3;
| }
0x00000e9c lw t9, -0x7f54(gp) | t9 = sym.imp.json_object;
0x00000ea0 addiu s1, sp, 0x4c | s1 = sp + 0x4c;
0x00000ea4 sw s1, 0x3c(sp) | *(var_3ch) = s1;
0x00000ea8 jalr t9 | t9 ();
0x00000eac lw gp, 0x30(sp) | gp = *(var_30h);
0x00000eb0 move s0, v0 | s0 = v0;
0x00000eb4 addiu s2, sp, 0x44 | s2 = sp + 0x44;
0x00000eb8 lw t9, -0x7f54(gp) | t9 = sym.imp.json_object;
0x00000ebc addiu fp, sp, 0x48 | fp = sp + 0x48;
0x00000ec0 jalr t9 | t9 ();
0x00000ec4 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000ec8 move a2, v0 | a2 = v0;
0x00000ecc addiu a1, s5, 0x153c | a1 = s5 + str.Brand;
0x00000ed0 lw t9, -0x7f74(gp) | t9 = sym.imp.json_object_set_new;
0x00000ed4 move a0, s0 | a0 = s0;
0x00000ed8 move s6, v0 | s6 = v0;
0x00000edc jalr t9 | t9 ();
0x00000ee0 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000ee4 move a1, zero | a1 = 0;
0x00000ee8 lw t9, -0x7f3c(gp) | t9 = sym.imp.g_variant_get_child_value;
0x00000eec move a0, s3 | a0 = s3;
0x00000ef0 jalr t9 | t9 ();
0x00000ef4 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000ef8 move a0, s1 | a0 = s1;
0x00000efc move a1, v0 | a1 = v0;
0x00000f00 lw t9, -0x7fa0(gp) | t9 = sym.imp.g_variant_iter_init;
0x00000f04 move s5, v0 | s5 = v0;
0x00000f08 jalr t9 | t9 ();
0x00000f0c lw gp, 0x30(sp) | gp = *(var_30h);
0x00000f10 lw s1, -0x7fdc(gp) | s1 = *((gp - 8183));
0x00000f14 addiu s1, s1, 0x15b0 | s1 += str.ss;
0x00000f18 b 0xf68 |
| while (v0 != 0) {
0x00000f1c lw t9, -0x7f78(gp) | t9 = sym.imp.json_string;
0x00000f20 lw a0, 0x44(sp) | a0 = *(var_44h);
0x00000f24 lw s7, 0x48(sp) | s7 = *(var_48h);
0x00000f28 jalr t9 | t9 ();
0x00000f2c lw gp, 0x30(sp) | gp = *(var_30h);
0x00000f30 move a2, v0 | a2 = v0;
0x00000f34 move a1, s7 | a1 = s7;
0x00000f38 lw t9, -0x7f74(gp) | t9 = sym.imp.json_object_set_new;
0x00000f3c move a0, s6 | a0 = s6;
0x00000f40 jalr t9 | t9 ();
0x00000f44 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000f48 lw t9, -0x7f48(gp) | t9 = sym.imp.g_free;
0x00000f4c lw a0, 0x44(sp) | a0 = *(var_44h);
0x00000f50 jalr t9 | t9 ();
0x00000f54 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000f58 lw t9, -0x7f48(gp) | t9 = sym.imp.g_free;
0x00000f5c lw a0, 0x48(sp) | a0 = *(var_48h);
0x00000f60 jalr t9 | t9 ();
0x00000f64 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000f68 lw t9, -0x7f7c(gp) | t9 = sym.imp.g_variant_iter_next;
0x00000f6c lw a0, 0x3c(sp) | a0 = *(var_3ch);
0x00000f70 move a3, s2 | a3 = s2;
0x00000f74 move a2, fp | a2 = fp;
0x00000f78 move a1, s1 | a1 = s1;
0x00000f7c jalr t9 | t9 ();
0x00000f80 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000f84 bnez v0, 0xf1c |
| }
0x00000f88 lw t9, -0x7f98(gp) | t9 = sym.imp.json_dumps;
0x00000f8c addiu a1, zero, 0x102 | a1 = 0x102;
0x00000f90 move a0, s0 | a0 = s0;
0x00000f94 jalr t9 | t9 ();
0x00000f98 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000f9c move a0, s5 | a0 = s5;
0x00000fa0 lw t9, -0x7f4c(gp) | t9 = sym.imp.g_variant_unref;
0x00000fa4 move s1, v0 | s1 = v0;
0x00000fa8 jalr t9 | t9 ();
0x00000fac lw gp, 0x30(sp) | gp = *(var_30h);
0x00000fb0 lw t9, -0x7f4c(gp) | t9 = sym.imp.g_variant_unref;
0x00000fb4 move a0, s3 | a0 = s3;
0x00000fb8 jalr t9 | t9 ();
0x00000fbc lw gp, 0x30(sp) | gp = *(var_30h);
| if (s0 != 0) {
0x00000fc0 beqz s0, 0xfd4 |
0x00000fc4 lw v1, 4(s0) | v1 = *((s0 + 1));
0x00000fc8 addiu v0, zero, -1 | v0 = -1;
| if (v1 != v0) {
0x00000fcc bne v1, v0, 0x106c | goto label_4;
| }
0x00000fd0 nop |
| }
| label_0:
0x00000fd4 lw t9, -0x7f6c(gp) | t9 = sym.imp.puts;
| if (s1 == 0) {
0x00000fd8 beqz s1, 0x10e0 | goto label_5;
| }
0x00000fdc lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000fe0 addiu a0, a0, 0x15b8 | a0 += str.Content_Type:_application_json_r;
0x00000fe4 jalr t9 | t9 ();
0x00000fe8 lw gp, 0x30(sp) | gp = *(var_30h);
0x00000fec lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000ff0 lw t9, -0x7f6c(gp) | t9 = sym.imp.puts;
0x00000ff4 addiu a0, a0, 0x15d8 | a0 += 0x15d8;
0x00000ff8 jalr t9 | t9 ();
0x00000ffc lw gp, 0x30(sp) | gp = *(var_30h);
0x00001000 move a2, s1 | a2 = s1;
0x00001004 addiu a0, zero, 1 | a0 = 1;
0x00001008 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x0000100c lw t9, -0x7f8c(gp) | t9 = sym.imp.__printf_chk
0x00001010 addiu a1, a1, 0x1534 | a1 += 0x1534;
0x00001014 jalr t9 | t9 ();
0x00001018 lw gp, 0x30(sp) | gp = *(var_30h);
0x0000101c lw t9, -0x7f48(gp) | t9 = sym.imp.g_free;
0x00001020 move a0, s1 | a0 = s1;
0x00001024 jalr t9 | t9 ();
0x00001028 lw gp, 0x30(sp) | gp = *(var_30h);
| label_1:
0x0000102c lw a0, 0x8c(sp) | a0 = *(var_8ch);
0x00001030 lw v1, (s4) | v1 = *(s4);
0x00001034 move v0, zero | v0 = 0;
| if (a0 != v1) {
0x00001038 bne a0, v1, 0x1118 | goto label_6;
| }
0x0000103c lw ra, 0xb4(sp) | ra = *(var_b4h);
0x00001040 lw fp, 0xb0(sp) | fp = *(var_b0h);
0x00001044 lw s7, 0xac(sp) | s7 = *(var_ach);
0x00001048 lw s6, 0xa8(sp) | s6 = *(var_a8h);
0x0000104c lw s5, 0xa4(sp) | s5 = *(var_a4h);
0x00001050 lw s4, 0xa0(sp) | s4 = *(var_a0h);
0x00001054 lw s3, 0x9c(sp) | s3 = *(var_9ch);
0x00001058 lw s2, 0x98(sp) | s2 = *(var_98h);
0x0000105c lw s1, 0x94(sp) | s1 = *(var_94h);
0x00001060 lw s0, 0x90(sp) | s0 = *(var_90h);
0x00001064 addiu sp, sp, 0xb8 |
0x00001068 jr ra | return v0;
| label_4:
0x0000106c sync | __asm ("sync");
| do {
0x00001070 ll v0, 4(s0) | __asm ("ll v0, 4(s0)");
0x00001074 addiu at, v0, -1 | at = v0 + -1;
0x00001078 sc at, 4(s0) | __asm ("sc at, 4(s0)");
0x0000107c addiu v0, v0, -1 | v0 += -1;
0x00001080 beqz at, 0x1070 |
| } while (at == 0);
0x00001084 sync | __asm ("sync");
0x00001088 lw t9, -0x7f58(gp) | t9 = sym.imp.json_delete;
| if (v0 != 0) {
0x0000108c bnez v0, 0xfd4 | goto label_0;
| }
0x00001090 move a0, s0 | a0 = s0;
0x00001094 jalr t9 | t9 ();
0x00001098 lw gp, 0x30(sp) | gp = *(var_30h);
0x0000109c b 0xfd4 | goto label_0;
| label_2:
0x000010a0 lw v0, 0x40(sp) | v0 = *(var_40h);
0x000010a4 lw a3, -0x7fdc(gp) | a3 = *((gp - 8183));
0x000010a8 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x000010ac lw v0, 8(v0) | v0 = *((v0 + 2));
0x000010b0 lw t9, -0x7f84(gp) | t9 = sym.imp.g_log;
0x000010b4 addiu a3, a3, 0x1600 | a3 += 0x1600;
0x000010b8 addiu a2, a2, 0x1518 | a2 += str._sFailed_to_get_connection:__s;
| do {
0x000010bc addiu a1, zero, 0x100 | a1 = 0x100;
0x000010c0 move a0, zero | a0 = 0;
0x000010c4 sw v0, 0x10(sp) | *(var_10h) = v0;
0x000010c8 jalr t9 | t9 ();
0x000010cc lw gp, 0x30(sp) | gp = *(var_30h);
0x000010d0 lw t9, -0x7fa8(gp) | t9 = sym.imp.g_error_free;
0x000010d4 lw a0, 0x40(sp) | a0 = *(var_40h);
0x000010d8 jalr t9 | t9 ();
0x000010dc lw gp, 0x30(sp) | gp = *(var_30h);
| label_5:
0x000010e0 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x000010e4 lw t9, -0x7f6c(gp) | t9 = sym.imp.puts;
0x000010e8 addiu a0, a0, 0x15dc | a0 += str.Status:_500_Internal_Server_Error_r_n_r;
0x000010ec jalr t9 | t9 ();
0x000010f0 lw gp, 0x30(sp) | gp = *(var_30h);
0x000010f4 b 0x102c | goto label_1;
| label_3:
0x000010f8 lw v0, 0x40(sp) | v0 = *(var_40h);
0x000010fc lw a3, -0x7fdc(gp) | a3 = *((gp - 8183));
0x00001100 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001104 lw v0, 8(v0) | v0 = *((v0 + 2));
0x00001108 lw t9, -0x7f84(gp) | t9 = sym.imp.g_log;
0x0000110c addiu a3, a3, 0x1600 | a3 += 0x1600;
0x00001110 addiu a2, a2, 0x1588 | a2 += str._sCan_not_get_the_Brand_Information:__s;
0x00001114 b 0x10bc |
| } while (1);
| label_6:
0x00001118 lw t9, -0x7f5c(gp) | t9 = sym.imp.__stack_chk_fail;
0x0000111c jalr t9 | t9 ();
0x00001120 nop |
0x00001124 nop |
0x00001128 nop |
0x0000112c nop |
| }
[*] Function printf used 2 times getbrand.cgi