[*] Binary protection state of apac-update
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function printf tear down of apac-update
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/apac-update @ 0x1120 */
| #include <stdint.h>
|
; (fcn) fcn.00001120 () | void fcn_00001120 () {
0x00001120 lui gp, 2 |
0x00001124 addiu gp, gp, -0x7110 |
0x00001128 addu gp, gp, t9 | gp += t9;
0x0000112c addiu sp, sp, -0x30 |
0x00001130 lw t9, -0x7f8c(gp) | t9 = sym.imp.open64;
0x00001134 sw s1, 0x24(sp) | *(var_24h) = s1;
0x00001138 lw s1, -0x7fdc(gp) | s1 = *((gp - 8183));
0x0000113c sw gp, 0x18(sp) | *(var_18h) = gp;
0x00001140 sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x00001144 sw s2, 0x28(sp) | *(var_28h) = s2;
0x00001148 sw s0, 0x20(sp) | *(var_20h) = s0;
0x0000114c move a1, zero | a1 = 0;
0x00001150 addiu a0, s1, 0x1898 | a0 = s1 + str._var_lib_apac;
0x00001154 jalr t9 | t9 ();
0x00001158 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 < 0) {
0x0000115c bltz v0, 0x1264 | goto label_1;
| }
0x00001160 lw t9, -0x7f84(gp) | t9 = sym.imp.fsync;
0x00001164 move a0, v0 | a0 = v0;
0x00001168 move s0, v0 | s0 = v0;
0x0000116c jalr t9 | t9 ();
0x00001170 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00001174 bnez v0, 0x1200 | goto label_2;
| }
0x00001178 lw t9, -0x7fa4(gp) | t9 = sym.imp.close;
0x0000117c move a0, s0 | a0 = s0;
0x00001180 jalr t9 | t9 ();
0x00001184 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001188 bnez v0, 0x11a4 |
| while (v0 == 0) {
0x0000118c lw ra, 0x2c(sp) | ra = *(var_2ch);
0x00001190 lw s2, 0x28(sp) | s2 = *(var_28h);
0x00001194 lw s1, 0x24(sp) | s1 = *(var_24h);
0x00001198 lw s0, 0x20(sp) | s0 = *(var_20h);
0x0000119c addiu sp, sp, 0x30 |
0x000011a0 jr ra | return v0;
0x000011a4 lw v0, -0x7f5c(gp) | v0 = *((gp - 8151));
| label_0:
0x000011a8 lw t9, -0x7f90(gp) | t9 = sym.imp.__errno_location;
0x000011ac lw s0, (v0) | s0 = *(v0);
0x000011b0 jalr t9 | t9 ();
0x000011b4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000011b8 lw t9, -0x7f70(gp) | t9 = sym.imp.g_strerror;
0x000011bc lw a0, (v0) | a0 = *(v0);
0x000011c0 jalr t9 | t9 ();
0x000011c4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000011c8 addiu a3, s1, 0x1898 | a3 = s1 + str._var_lib_apac;
0x000011cc move a0, s0 | a0 = s0;
0x000011d0 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x000011d4 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x000011d8 sw v0, 0x10(sp) | *(var_10h) = v0;
0x000011dc addiu a2, a2, 0x18f0 | a2 += str.Warning:_Failed_to_close__s:__s_n;
0x000011e0 addiu a1, zero, 1 | a1 = 1;
0x000011e4 jalr t9 | t9 ();
0x000011e8 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x000011ec lw s2, 0x28(sp) | s2 = *(var_28h);
0x000011f0 lw s1, 0x24(sp) | s1 = *(var_24h);
0x000011f4 lw s0, 0x20(sp) | s0 = *(var_20h);
0x000011f8 addiu sp, sp, 0x30 |
0x000011fc jr ra | return v0;
| label_2:
0x00001200 lw v0, -0x7f5c(gp) | v0 = *((gp - 8151));
0x00001204 lw t9, -0x7f90(gp) | t9 = sym.imp.__errno_location;
0x00001208 lw s2, (v0) | s2 = *(v0);
0x0000120c jalr t9 | t9 ();
0x00001210 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001214 lw t9, -0x7f70(gp) | t9 = sym.imp.g_strerror;
0x00001218 lw a0, (v0) | a0 = *(v0);
0x0000121c jalr t9 | t9 ();
0x00001220 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001224 addiu a3, s1, 0x1898 | a3 = s1 + str._var_lib_apac;
0x00001228 addiu a1, zero, 1 | a1 = 1;
0x0000122c lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001230 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x00001234 addiu a2, a2, 0x18cc | a2 += str.Warning:_Failed_to_sync__s:__s_n;
0x00001238 move a0, s2 | a0 = s2;
0x0000123c sw v0, 0x10(sp) | *(var_10h) = v0;
0x00001240 jalr t9 | t9 ();
0x00001244 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001248 lw t9, -0x7fa4(gp) | t9 = sym.imp.close;
0x0000124c move a0, s0 | a0 = s0;
0x00001250 jalr t9 | t9 ();
0x00001254 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001258 beqz v0, 0x118c |
| }
0x0000125c lw v0, -0x7f5c(gp) | v0 = *((gp - 8151));
0x00001260 b 0x11a8 | goto label_0;
| label_1:
0x00001264 lw v0, -0x7f5c(gp) | v0 = *((gp - 8151));
0x00001268 lw t9, -0x7f90(gp) | t9 = sym.imp.__errno_location;
0x0000126c lw s0, (v0) | s0 = *(v0);
0x00001270 jalr t9 | t9 ();
0x00001274 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001278 lw t9, -0x7f70(gp) | t9 = sym.imp.g_strerror;
0x0000127c lw a0, (v0) | a0 = *(v0);
0x00001280 jalr t9 | t9 ();
0x00001284 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001288 addiu a3, s1, 0x1898 | a3 = s1 + str._var_lib_apac;
0x0000128c move a0, s0 | a0 = s0;
0x00001290 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001294 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x00001298 sw v0, 0x10(sp) | *(var_10h) = v0;
0x0000129c addiu a2, a2, 0x18a8 | a2 += str.Warning:_Failed_to_open__s:__s_n;
0x000012a0 addiu a1, zero, 1 | a1 = 1;
0x000012a4 jalr t9 | t9 ();
0x000012a8 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x000012ac lw s2, 0x28(sp) | s2 = *(var_28h);
0x000012b0 lw s1, 0x24(sp) | s1 = *(var_24h);
0x000012b4 lw s0, 0x20(sp) | s0 = *(var_20h);
0x000012b8 addiu sp, sp, 0x30 |
0x000012bc jr ra | return v0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/apac-update @ 0xb60 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 3024 named .text */
0x00000b60 lui gp, 2 |
0x00000b64 addiu gp, gp, -0x6b50 |
0x00000b68 addu gp, gp, t9 | gp += t9;
0x00000b6c addiu sp, sp, -0x58 |
0x00000b70 addiu v0, zero, 4 | v0 = 4;
0x00000b74 sw s1, 0x38(sp) | *(var_38h) = s1;
0x00000b78 lw s1, -0x7f64(gp) | s1 = *((gp - 8153));
0x00000b7c sw gp, 0x18(sp) | *(var_18h) = gp;
0x00000b80 sw s3, 0x40(sp) | *(var_40h) = s3;
0x00000b84 lw v1, (s1) | v1 = *(s1);
0x00000b88 sw s0, 0x34(sp) | *(var_34h) = s0;
0x00000b8c sw ra, 0x54(sp) | *(var_54h) = ra;
0x00000b90 sw s7, 0x50(sp) | *(var_50h) = s7;
0x00000b94 sw s6, 0x4c(sp) | *(var_4ch) = s6;
0x00000b98 sw s5, 0x48(sp) | *(var_48h) = s5;
0x00000b9c sw s4, 0x44(sp) | *(var_44h) = s4;
0x00000ba0 sw s2, 0x3c(sp) | *(var_3ch) = s2;
0x00000ba4 move s3, a0 | s3 = a0;
0x00000ba8 move s0, a1 | s0 = a1;
0x00000bac sw v1, 0x2c(sp) | *(var_2ch) = v1;
0x00000bb0 addiu v0, zero, 3 | v0 = 3;
| if (a0 == v0) {
0x00000bb4 beq a0, v0, 0xcac | goto label_2;
| }
0x00000bb8 lw t9, -0x7f48(gp) | t9 = sym.imp.strcmp;
| if (a0 != v0) {
0x00000bbc bne a0, v0, 0xbd8 | goto label_3;
| }
0x00000bc0 lw a0, 4(a1) | a0 = *((a1 + 1));
0x00000bc4 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000bc8 addiu a1, a1, 0x1a04 | a1 += str.revoke_all;
0x00000bcc jalr t9 | t9 ();
0x00000bd0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00000bd4 beqz v0, 0xe10 | goto label_4;
| }
| do {
| label_3:
0x00000bd8 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000bdc lw t9, -0x7f94(gp) | t9 = sym.imp.__printf_chk
0x00000be0 addiu a1, a1, 0x1a10 | a1 += str.Usage:_n;
0x00000be4 addiu a0, zero, 1 | a0 = 1;
0x00000be8 jalr t9 | t9 ();
0x00000bec lw gp, 0x18(sp) | gp = *(var_18h);
0x00000bf0 addiu a0, zero, 1 | a0 = 1;
0x00000bf4 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000bf8 lw t9, -0x7f94(gp) | t9 = sym.imp.__printf_chk
0x00000bfc addiu a1, a1, 0x1ab8 | a1 += 0x1ab8;
0x00000c00 jalr t9 | t9 ();
0x00000c04 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000c08 addiu a0, zero, 1 | a0 = 1;
0x00000c0c lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000c10 lw t9, -0x7f94(gp) | t9 = sym.imp.__printf_chk
0x00000c14 addiu a1, a1, 0x1a18 | a1 += str.Grant_a_certain_user_permission_to_do_a_certain_action:_n;
0x00000c18 jalr t9 | t9 ();
0x00000c1c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000c20 lw a2, (s0) | a2 = *(s0);
0x00000c24 addiu a0, zero, 1 | a0 = 1;
0x00000c28 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000c2c lw t9, -0x7f94(gp) | t9 = sym.imp.__printf_chk
0x00000c30 addiu a1, a1, 0x1a54 | a1 += str.___s_grant_username_action_id_n;
0x00000c34 jalr t9 | t9 ();
0x00000c38 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000c3c addiu a0, zero, 1 | a0 = 1;
0x00000c40 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000c44 lw t9, -0x7f94(gp) | t9 = sym.imp.__printf_chk
0x00000c48 addiu a1, a1, 0x1a74 | a1 += str.Revoke_all_dynamic_permissions_for_a_user:_n;
0x00000c4c jalr t9 | t9 ();
0x00000c50 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000c54 lw a2, (s0) | a2 = *(s0);
0x00000c58 addiu a0, zero, 1 | a0 = 1;
0x00000c5c lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000c60 lw t9, -0x7f94(gp) | t9 = sym.imp.__printf_chk
0x00000c64 addiu a1, a1, 0x1aa0 | a1 += str.___s_revoke_all_username_n;
0x00000c68 jalr t9 | t9 ();
0x00000c6c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000c70 addiu v0, zero, 1 | v0 = 1;
| label_0:
0x00000c74 lw a0, 0x2c(sp) | a0 = *(var_2ch);
0x00000c78 lw v1, (s1) | v1 = *(s1);
0x00000c7c lw ra, 0x54(sp) | ra = *(var_54h);
| if (a0 != v1) {
0x00000c80 bne a0, v1, 0xfa4 | goto label_5;
| }
0x00000c84 lw s7, 0x50(sp) | s7 = *(var_50h);
0x00000c88 lw s6, 0x4c(sp) | s6 = *(var_4ch);
0x00000c8c lw s5, 0x48(sp) | s5 = *(var_48h);
0x00000c90 lw s4, 0x44(sp) | s4 = *(var_44h);
0x00000c94 lw s3, 0x40(sp) | s3 = *(var_40h);
0x00000c98 lw s2, 0x3c(sp) | s2 = *(var_3ch);
0x00000c9c lw s1, 0x38(sp) | s1 = *(var_38h);
0x00000ca0 lw s0, 0x34(sp) | s0 = *(var_34h);
0x00000ca4 addiu sp, sp, 0x58 |
0x00000ca8 jr ra | return v0;
| label_2:
0x00000cac lw a0, 4(a1) | a0 = *((a1 + 1));
0x00000cb0 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000cb4 lw t9, -0x7f48(gp) | t9 = sym.imp.strcmp;
0x00000cb8 addiu a1, a1, 0x196c | a1 += str.grant;
0x00000cbc jalr t9 | t9 ();
0x00000cc0 move s2, v0 | s2 = v0;
0x00000cc4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000cc8 bnez v0, 0xbd8 |
| } while (v0 != 0);
0x00000ccc lw s6, 8(s0) | s6 = *((s0 + 2));
0x00000cd0 lw t9, -0x7fd8(gp) | t9 = sym.apac_common_username_valid;
0x00000cd4 move a0, s6 | a0 = s6;
0x00000cd8 sw zero, 0x24(sp) | *(var_24h) = 0;
0x00000cdc sw zero, 0x28(sp) | *(var_28h) = 0;
0x00000ce0 lw s0, 0xc(s0) | s0 = *((s0 + 3));
0x00000ce4 bal 0x159c | sym_apac_common_username_valid ();
0x00000ce8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00000cec beqz v0, 0xe5c | goto label_6;
| }
0x00000cf0 lw t9, -0x7fd4(gp) | t9 = sym.apac_common_convert_to_action_id;
0x00000cf4 move a0, s0 | a0 = s0;
0x00000cf8 bal 0x1400 | sym_apac_common_convert_to_action_id ();
0x00000cfc lw gp, 0x18(sp) | gp = *(var_18h);
0x00000d00 move a1, zero | a1 = 0;
0x00000d04 move a0, v0 | a0 = v0;
0x00000d08 lw t9, -0x7fd0(gp) | t9 = sym.apac_common_action_valid;
0x00000d0c move s0, v0 | s0 = v0;
0x00000d10 bal 0x14d8 | sym_apac_common_action_valid ();
0x00000d14 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00000d18 beqz v0, 0xe28 | goto label_7;
| }
0x00000d1c lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x00000d20 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000d24 lw t9, -0x7f74(gp) | t9 = sym.imp.g_strdup_printf
0x00000d28 move a2, s6 | a2 = s6;
0x00000d2c addiu a1, a1, 0x1898 | a1 += str._var_lib_apac;
0x00000d30 addiu a0, a0, 0x1938 | a0 += str._s__s.policy;
0x00000d34 jalr t9 | t9 ();
0x00000d38 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000d3c addiu s5, sp, 0x28 | s5 = sp + 0x28;
0x00000d40 move a3, s5 | a3 = s5;
0x00000d44 lw t9, -0x7f60(gp) | t9 = sym.imp.g_file_get_contents;
0x00000d48 move a2, zero | a2 = 0;
0x00000d4c addiu a1, sp, 0x24 | a1 = sp + 0x24;
0x00000d50 move a0, v0 | a0 = v0;
0x00000d54 move s4, v0 | s4 = v0;
0x00000d58 jalr t9 | t9 ();
0x00000d5c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 != 0) {
0x00000d60 bnez v0, 0xea0 | goto label_8;
| }
0x00000d64 lw v0, 0x28(sp) | v0 = *(var_28h);
0x00000d68 lw v1, 4(v0) | v1 = *((v0 + 1));
0x00000d6c lw t9, -0x7f98(gp) | t9 = sym.imp.g_clear_error;
| if (v1 == s3) {
0x00000d70 beq v1, s3, 0xe94 | goto label_9;
| }
0x00000d74 lw v1, -0x7f5c(gp) | v1 = *((gp - 8151));
0x00000d78 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000d7c lw v0, 8(v0) | v0 = *((v0 + 2));
0x00000d80 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x00000d84 lw a0, (v1) | a0 = *(v1);
0x00000d88 move a3, s4 | a3 = s4;
0x00000d8c sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x00000d90 addiu a2, a2, 0x199c | a2 += str.Error:_Failed_to_load_existing__s:__s_n;
0x00000d94 addiu a1, zero, 1 | a1 = 1;
0x00000d98 jalr t9 | t9 ();
0x00000d9c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000da0 move s3, zero | s3 = 0;
0x00000da4 move s6, zero | s6 = 0;
| do {
| label_1:
0x00000da8 lw t9, -0x7f58(gp) | t9 = sym.imp.g_free;
0x00000dac move a0, s4 | a0 = s4;
0x00000db0 jalr t9 | t9 ();
0x00000db4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000db8 lw t9, -0x7f58(gp) | t9 = sym.imp.g_free;
0x00000dbc move a0, s0 | a0 = s0;
0x00000dc0 jalr t9 | t9 ();
0x00000dc4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000dc8 lw t9, -0x7f58(gp) | t9 = sym.imp.g_free;
0x00000dcc lw a0, 0x24(sp) | a0 = *(var_24h);
0x00000dd0 jalr t9 | t9 ();
0x00000dd4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000dd8 lw t9, -0x7f58(gp) | t9 = sym.imp.g_free;
0x00000ddc move a0, s6 | a0 = s6;
0x00000de0 jalr t9 | t9 ();
0x00000de4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000de8 lw t9, -0x7f58(gp) | t9 = sym.imp.g_free;
0x00000dec move a0, s3 | a0 = s3;
0x00000df0 jalr t9 | t9 ();
0x00000df4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000df8 lw t9, -0x7f98(gp) | t9 = sym.imp.g_clear_error;
0x00000dfc move a0, s5 | a0 = s5;
0x00000e00 jalr t9 | t9 ();
0x00000e04 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000e08 xori v0, s2, 1 | v0 = s2 ^ 1;
0x00000e0c b 0xc74 | goto label_0;
| label_4:
0x00000e10 lw t9, -0x7fcc(gp) | t9 = sym.revoke_all;
0x00000e14 lw a0, 8(s0) | a0 = *((s0 + 2));
0x00000e18 bal 0x12c0 | sym_revoke_all ();
0x00000e1c sltiu v0, v0, 1 | v0 = (v0 < 1) ? 1 : 0;
0x00000e20 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000e24 b 0xc74 | goto label_0;
| label_7:
0x00000e28 lw v0, -0x7f5c(gp) | v0 = *((gp - 8151));
0x00000e2c lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000e30 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x00000e34 lw a0, (v0) | a0 = *(v0);
0x00000e38 addiu a2, a2, 0x1974 | a2 += str.Error:_Not_a_valid_APAC_action_string_n;
0x00000e3c addiu a1, zero, 1 | a1 = 1;
0x00000e40 jalr t9 | t9 ();
0x00000e44 move s3, zero | s3 = 0;
0x00000e48 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000e4c move s6, zero | s6 = 0;
0x00000e50 move s4, zero | s4 = 0;
0x00000e54 addiu s5, sp, 0x28 | s5 = sp + 0x28;
0x00000e58 b 0xda8 |
| } while (1);
| label_6:
0x00000e5c lw v0, -0x7f5c(gp) | v0 = *((gp - 8151));
0x00000e60 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000e64 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x00000e68 lw a0, (v0) | a0 = *(v0);
0x00000e6c addiu a2, a2, 0x1914 | a2 += str.Error:_Not_a_valid_unix_username_n;
0x00000e70 addiu a1, zero, 1 | a1 = 1;
0x00000e74 jalr t9 | t9 ();
0x00000e78 move s3, zero | s3 = 0;
0x00000e7c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000e80 move s6, zero | s6 = 0;
0x00000e84 move s0, zero | s0 = 0;
0x00000e88 move s4, zero | s4 = 0;
0x00000e8c addiu s5, sp, 0x28 | s5 = sp + 0x28;
0x00000e90 b 0xda8 | goto label_1;
| label_9:
0x00000e94 move a0, s5 | a0 = s5;
0x00000e98 jalr t9 | t9 ();
0x00000e9c lw gp, 0x18(sp) | gp = *(var_18h);
| label_8:
0x00000ea0 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000ea4 lw t9, -0x7f74(gp) | t9 = sym.imp.g_strdup_printf
0x00000ea8 move a1, s0 | a1 = s0;
0x00000eac addiu a0, a0, 0x19c8 | a0 += str._n___s_n;
0x00000eb0 jalr t9 | t9 ();
0x00000eb4 lw s7, 0x24(sp) | s7 = *(var_24h);
0x00000eb8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000ebc move s3, v0 | s3 = v0;
| if (s7 != 0) {
0x00000ec0 beqz s7, 0xee8 |
0x00000ec4 lw t9, -0x7f44(gp) | t9 = sym.imp.strstr;
0x00000ec8 move a1, v0 | a1 = v0;
0x00000ecc move a0, s7 | a0 = s7;
0x00000ed0 jalr t9 | t9 ();
0x00000ed4 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00000ed8 beqz v0, 0xf4c | goto label_10;
| }
0x00000edc addiu s2, zero, 1 | s2 = 1;
0x00000ee0 move s6, zero | s6 = 0;
0x00000ee4 b 0xda8 | goto label_1;
| }
0x00000ee8 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000eec lw t9, -0x7f74(gp) | t9 = sym.imp.g_strdup_printf
0x00000ef0 move a1, s6 | a1 = s6;
0x00000ef4 move a2, s0 | a2 = s0;
0x00000ef8 addiu a0, a0, 0x19d0 | a0 += str._s:_n___s_n;
0x00000efc jalr t9 | t9 ();
0x00000f00 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000f04 move s6, v0 | s6 = v0;
| do {
0x00000f08 lw t9, -0x7f7c(gp) | t9 = sym.imp.g_file_set_contents;
| if (s6 != 0) {
0x00000f0c beqz s6, 0xf44 |
0x00000f10 move a3, s5 | a3 = s5;
0x00000f14 addiu a2, zero, -1 | a2 = -1;
0x00000f18 move a1, s6 | a1 = s6;
0x00000f1c move a0, s4 | a0 = s4;
0x00000f20 jalr t9 | t9 ();
0x00000f24 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00000f28 beqz v0, 0xf70 | goto label_11;
| }
0x00000f2c lw t9, -0x7fdc(gp) | t9 = *((gp - 8183));
0x00000f30 addiu t9, t9, 0x1120 | t9 += fcn.00001120;
0x00000f34 addiu s2, zero, 1 | s2 = 1;
0x00000f38 bal 0x1120 | fcn_00001120 ();
0x00000f3c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000f40 b 0xda8 | goto label_1;
| }
0x00000f44 addiu s2, zero, 1 | s2 = 1;
0x00000f48 b 0xda8 | goto label_1;
| label_10:
0x00000f4c lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000f50 lw t9, -0x7f74(gp) | t9 = sym.imp.g_strdup_printf
0x00000f54 move a2, s0 | a2 = s0;
0x00000f58 move a1, s7 | a1 = s7;
0x00000f5c addiu a0, a0, 0x19dc | a0 += str._s___s_n;
0x00000f60 jalr t9 | t9 ();
0x00000f64 move s6, v0 | s6 = v0;
0x00000f68 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000f6c b 0xf08 |
| } while (1);
| label_11:
0x00000f70 lw v0, 0x28(sp) | v0 = *(var_28h);
0x00000f74 lw v1, -0x7f5c(gp) | v1 = *((gp - 8151));
0x00000f78 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000f7c lw v0, 8(v0) | v0 = *((v0 + 2));
0x00000f80 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x00000f84 lw a0, (v1) | a0 = *(v1);
0x00000f88 move a3, s4 | a3 = s4;
0x00000f8c sw v0, 0x10(sp) | *(var_10h_2) = v0;
0x00000f90 addiu a2, a2, 0x19e4 | a2 += str.Error:_Failed_to_save__s:__s_n;
0x00000f94 addiu a1, zero, 1 | a1 = 1;
0x00000f98 jalr t9 | t9 ();
0x00000f9c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000fa0 b 0xda8 | goto label_1;
| label_5:
0x00000fa4 lw t9, -0x7f68(gp) | t9 = sym.imp.__stack_chk_fail;
0x00000fa8 jalr t9 | t9 ();
0x00000fac nop |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/apac-update @ 0x12c0 */
| #include <stdint.h>
|
; (fcn) sym.revoke_all () | void revoke_all () {
0x000012c0 lui gp, 2 |
0x000012c4 addiu gp, gp, -0x72b0 |
0x000012c8 addu gp, gp, t9 | gp += t9;
0x000012cc addiu sp, sp, -0x30 |
0x000012d0 lw t9, -0x7fd8(gp) | t9 = sym.apac_common_username_valid;
0x000012d4 sw gp, 0x18(sp) | *(var_18h) = gp;
0x000012d8 sw s0, 0x24(sp) | *(var_24h) = s0;
0x000012dc sw ra, 0x2c(sp) | *(var_2ch) = ra;
0x000012e0 sw s1, 0x28(sp) | *(var_28h) = s1;
0x000012e4 move s0, a0 | s0 = a0;
0x000012e8 bal 0x159c | sym_apac_common_username_valid ();
0x000012ec lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x000012f0 beqz v0, 0x1370 | goto label_1;
| }
0x000012f4 lw a1, -0x7fdc(gp) | a1 = *((gp - 8183));
0x000012f8 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x000012fc lw t9, -0x7f74(gp) | t9 = sym.imp.g_strdup_printf
0x00001300 move a2, s0 | a2 = s0;
0x00001304 addiu a1, a1, 0x1898 | a1 += str._var_lib_apac;
0x00001308 addiu a0, a0, 0x1938 | a0 += str._s__s.policy;
0x0000130c jalr t9 | t9 ();
0x00001310 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001314 move a0, v0 | a0 = v0;
0x00001318 lw t9, -0x7f6c(gp) | t9 = sym.imp.unlink;
0x0000131c move s0, v0 | s0 = v0;
0x00001320 jalr t9 | t9 ();
0x00001324 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00001328 beqz v0, 0x139c | goto label_2;
| }
0x0000132c lw t9, -0x7f90(gp) | t9 = sym.imp.__errno_location;
0x00001330 jalr t9 | t9 ();
0x00001334 nop |
0x00001338 lw a0, (v0) | a0 = *(v0);
0x0000133c addiu v0, zero, 2 | v0 = 2;
0x00001340 lw gp, 0x18(sp) | gp = *(var_18h);
| if (a0 != v0) {
0x00001344 bne a0, v0, 0x13b4 | goto label_3;
| }
0x00001348 addiu s1, zero, 1 | s1 = 1;
| do {
| label_0:
0x0000134c lw t9, -0x7f58(gp) | t9 = sym.imp.g_free;
0x00001350 move a0, s0 | a0 = s0;
0x00001354 jalr t9 | t9 ();
0x00001358 lw ra, 0x2c(sp) | ra = *(var_2ch);
0x0000135c move v0, s1 | v0 = s1;
0x00001360 lw s0, 0x24(sp) | s0 = *(var_24h);
0x00001364 lw s1, 0x28(sp) | s1 = *(var_28h);
0x00001368 addiu sp, sp, 0x30 |
0x0000136c jr ra | return v0;
| label_1:
0x00001370 lw v0, -0x7f5c(gp) | v0 = *((gp - 8151));
0x00001374 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00001378 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x0000137c lw a0, (v0) | a0 = *(v0);
0x00001380 addiu a2, a2, 0x1914 | a2 += str.Error:_Not_a_valid_unix_username_n;
0x00001384 addiu a1, zero, 1 | a1 = 1;
0x00001388 jalr t9 | t9 ();
0x0000138c move s1, zero | s1 = 0;
0x00001390 lw gp, 0x18(sp) | gp = *(var_18h);
0x00001394 move s0, zero | s0 = 0;
0x00001398 b 0x134c |
| } while (1);
| label_2:
0x0000139c lw t9, -0x7fdc(gp) | t9 = *((gp - 8183));
0x000013a0 addiu t9, t9, 0x1120 | t9 += fcn.00001120;
0x000013a4 addiu s1, zero, 1 | s1 = 1;
0x000013a8 bal 0x1120 | fcn_00001120 ();
0x000013ac lw gp, 0x18(sp) | gp = *(var_18h);
0x000013b0 b 0x134c | goto label_0;
| label_3:
0x000013b4 lw v0, -0x7f5c(gp) | v0 = *((gp - 8151));
0x000013b8 lw t9, -0x7f70(gp) | t9 = sym.imp.g_strerror;
0x000013bc lw s1, (v0) | s1 = *(v0);
0x000013c0 jalr t9 | t9 ();
0x000013c4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000013c8 move a0, s1 | a0 = s1;
0x000013cc sw v0, 0x10(sp) | *(var_10h) = v0;
0x000013d0 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x000013d4 lw t9, -0x7f9c(gp) | t9 = sym.imp.__fprintf_chk
0x000013d8 move a3, s0 | a3 = s0;
0x000013dc addiu a2, a2, 0x1948 | a2 += str.Error:_Failed_to_remove__s:__s_n;
0x000013e0 addiu a1, zero, 1 | a1 = 1;
0x000013e4 jalr t9 | t9 ();
0x000013e8 move s1, zero | s1 = 0;
0x000013ec lw gp, 0x18(sp) | gp = *(var_18h);
0x000013f0 b 0x134c | goto label_0;
| }
[*] Function printf used 21 times apac-update