[*] Binary protection state of fsck.ext3
Full RELRO Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function popen tear down of fsck.ext3
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/fsck.ext3 @ 0x297a8 */
| #include <stdint.h>
|
; (fcn) sym.read_bad_blocks_file () | void read_bad_blocks_file () {
0x000297a8 lui gp, 4 |
0x000297ac addiu gp, gp, 0x618 |
0x000297b0 addu gp, gp, t9 | gp += t9;
0x000297b4 addiu sp, sp, -0x460 |
0x000297b8 lw t9, -0x7eb0(gp) | t9 = sym.e2fsck_read_bitmaps;
0x000297bc sw s2, 0x444(sp) | *(var_444h) = s2;
0x000297c0 lw s2, -0x7838(gp) | s2 = *((gp - 7694));
0x000297c4 sw gp, 0x28(sp) | *(var_28h) = gp;
0x000297c8 sw ra, 0x45c(sp) | *(var_45ch) = ra;
0x000297cc lw v0, (s2) | v0 = *(s2);
0x000297d0 sw s4, 0x44c(sp) | *(var_44ch) = s4;
0x000297d4 sw s3, 0x448(sp) | *(var_448h) = s3;
0x000297d8 sw s1, 0x440(sp) | *(var_440h) = s1;
0x000297dc sw s0, 0x43c(sp) | *(var_43ch) = s0;
0x000297e0 sw v0, 0x434(sp) | *(var_434h) = v0;
0x000297e4 sw s7, 0x458(sp) | *(var_458h) = s7;
0x000297e8 sw s6, 0x454(sp) | *(var_454h) = s6;
0x000297ec sw s5, 0x450(sp) | *(var_450h) = s5;
0x000297f0 sw zero, 0x30(sp) | *(var_30h) = 0;
0x000297f4 move s1, a0 | s1 = a0;
0x000297f8 move s3, a1 | s3 = a1;
0x000297fc move s4, a2 | s4 = a2;
0x00029800 lw s0, (a0) | s0 = *(a0);
0x00029804 bal 0x2bb54 | sym_e2fsck_read_bitmaps ();
0x00029808 lw gp, 0x28(sp) | gp = *(var_28h);
0x0002980c sw zero, 0x14(sp) | *(var_14h) = 0;
0x00029810 move a3, zero | a3 = 0;
0x00029814 lw v0, -0x7d90(gp) | v0 = *(gp);
0x00029818 lw t9, -0x77fc(gp) | t9 = sym.imp.ext2fs_block_iterate;
0x0002981c addiu v0, v0, -0x691c | v0 += -0x691c;
0x00029820 sw v0, 0x10(sp) | *(var_10h) = v0;
0x00029824 move a2, zero | a2 = 0;
0x00029828 addiu a1, zero, 1 | a1 = 1;
0x0002982c move a0, s0 | a0 = s0;
0x00029830 jalr t9 | t9 ();
0x00029834 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 != 0) {
0x00029838 bnez v0, 0x29a88 | goto label_5;
| }
0x0002983c lw t9, -0x7c84(gp) | t9 = sym.imp.ext2fs_read_bb_inode;
| if (s4 == 0) {
0x00029840 beqz s4, 0x29a48 | goto label_6;
| }
| label_1:
0x00029844 lw a1, -0x7fa8(gp) | a1 = *((gp - 8170));
| if (s3 == 0) {
0x00029848 beqz s3, 0x2991c | goto label_7;
| }
0x0002984c lw t9, -0x77cc(gp) | t9 = sym.imp.fopen;
0x00029850 addiu a1, a1, -0x3c5c | a1 += -0x3c5c;
0x00029854 move a0, s3 | a0 = s3;
0x00029858 jalr t9 | t9 ();
0x0002985c move s4, v0 | s4 = v0;
0x00029860 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == 0) {
0x00029864 beqz v0, 0x29afc | goto label_8;
| }
0x00029868 lw a3, -0x7d90(gp) | a3 = *(gp);
0x0002986c lw t9, -0x7a80(gp) | t9 = sym.imp.ext2fs_read_bb_FILE;
0x00029870 addiu a3, a3, -0x6940 | a3 += -0x6940;
0x00029874 addiu a2, sp, 0x30 | a2 = sp + 0x30;
0x00029878 move a1, v0 | a1 = v0;
0x0002987c move a0, s0 | a0 = s0;
0x00029880 jalr t9 | t9 ();
0x00029884 lw gp, 0x28(sp) | gp = *(var_28h);
0x00029888 move a0, s4 | a0 = s4;
0x0002988c lw t9, -0x7bcc(gp) | t9 = sym.imp.fclose;
0x00029890 move s3, v0 | s3 = v0;
0x00029894 jalr t9 | t9 ();
0x00029898 lw gp, 0x28(sp) | gp = *(var_28h);
| if (s3 != 0) {
0x0002989c bnez s3, 0x299f8 | goto label_9;
| }
| do {
0x000298a0 lw a1, -0x7fd0(gp) | a1 = *(gp);
0x000298a4 lw t9, -0x7b28(gp) | t9 = sym.imp.__printf_chk;
0x000298a8 lw a2, 0xc(s1) | a2 = *((s1 + 3));
| /* str._s:_Updating_bad_block_inode._n */
0x000298ac addiu a1, a1, 0x78fc | a1 += 0x78fc;
0x000298b0 addiu a0, zero, 1 | a0 = 1;
0x000298b4 jalr t9 | t9 ();
0x000298b8 lw gp, 0x28(sp) | gp = *(var_28h);
0x000298bc lw a1, 0x30(sp) | a1 = *(var_30h);
0x000298c0 lw t9, -0x7a2c(gp) | t9 = sym.imp.ext2fs_update_bb_inode;
0x000298c4 move a0, s0 | a0 = s0;
0x000298c8 jalr t9 | t9 ();
0x000298cc lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 != 0) {
0x000298d0 bnez v0, 0x29ad0 | goto label_10;
| }
0x000298d4 lw t9, -0x7a88(gp) | t9 = sym.imp.ext2fs_badblocks_list_free;
0x000298d8 lw a0, 0x30(sp) | a0 = *(var_30h);
0x000298dc jalr t9 | t9 ();
0x000298e0 lw gp, 0x28(sp) | gp = *(var_28h);
| label_0:
0x000298e4 lw v1, 0x434(sp) | v1 = *(var_434h);
0x000298e8 lw v0, (s2) | v0 = *(s2);
0x000298ec lw ra, 0x45c(sp) | ra = *(var_45ch);
| if (v1 != v0) {
0x000298f0 bne v1, v0, 0x29b6c | goto label_11;
| }
0x000298f4 lw s7, 0x458(sp) | s7 = *(var_458h);
0x000298f8 lw s6, 0x454(sp) | s6 = *(var_454h);
0x000298fc lw s5, 0x450(sp) | s5 = *(var_450h);
0x00029900 lw s4, 0x44c(sp) | s4 = *(var_44ch);
0x00029904 lw s3, 0x448(sp) | s3 = *(var_448h);
0x00029908 lw s2, 0x444(sp) | s2 = *(var_444h);
0x0002990c lw s1, 0x440(sp) | s1 = *(var_440h);
0x00029910 lw s0, 0x43c(sp) | s0 = *(var_43ch);
0x00029914 addiu sp, sp, 0x460 |
0x00029918 jr ra | return v0;
| label_7:
0x0002991c lw v0, 0x28(s1) | v0 = *((s1 + 10));
0x00029920 andi v1, v0, 2 | v1 = v0 & 2;
0x00029924 lw s6, 0x14(s0) | s6 = *((s0 + 5));
| if (v1 != 0) {
0x00029928 bnez v1, 0x29ab4 | goto label_12;
| }
0x0002992c lw s3, -0x7fd0(gp) | s3 = *(gp);
0x00029930 andi v0, v0, 0x200 | v0 &= aav.0x00000200;
| /* esilref: '-s ' */
0x00029934 addiu s3, s3, 0x77f8 | s3 += 0x77f8;
| if (v0 != 0) {
0x00029938 bnez v0, 0x29ac4 | goto label_13;
| }
| label_3:
0x0002993c lw s4, -0x7fd0(gp) | s4 = *(gp);
0x00029940 addiu s4, s4, 0x5c60 | s4 += 0x5c60;
| label_4:
0x00029944 lw t9, -0x7994(gp) | t9 = sym.imp.ext2fs_blocks_count;
0x00029948 lw a0, 0x10(s0) | a0 = *((s0 + 4));
0x0002994c lw s7, 0xc(s0) | s7 = *((s0 + 3));
0x00029950 jalr t9 | t9 ();
0x00029954 lw gp, 0x28(sp) | gp = *(var_28h);
0x00029958 sltiu a0, v0, 1 | a0 = (v0 < 1) ? 1 : 0;
0x0002995c subu v1, v1, a0 | __asm ("subu v1, v1, a0");
0x00029960 lw a3, -0x7fd0(gp) | a3 = *(gp);
0x00029964 addiu s5, sp, 0x34 | s5 = sp + 0x34;
0x00029968 lw t9, -0x7cd4(gp) | t9 = sym.imp.__sprintf_chk;
0x0002996c addiu v0, v0, -1 | v0 += -1;
| /* str.badblocks__b__d__X__s_s_s__llu */
0x00029970 addiu a3, a3, 0x7880 | a3 += 0x7880;
0x00029974 addiu a2, zero, 0x400 | a2 = aav.0x00000400;
0x00029978 addiu a1, zero, 1 | a1 = 1;
0x0002997c move a0, s5 | a0 = s5;
0x00029980 sw v1, 0x24(sp) | *(var_24h_2) = v1;
0x00029984 sw s3, 0x14(sp) | *(var_14h) = s3;
0x00029988 sw v0, 0x20(sp) | *(var_20h) = v0;
0x0002998c sw s7, 0x1c(sp) | *(var_1ch_2) = s7;
0x00029990 sw s4, 0x18(sp) | *(var_18h_2) = s4;
0x00029994 sw s6, 0x10(sp) | *(var_10h) = s6;
0x00029998 jalr t9 | t9 ();
0x0002999c lw gp, 0x28(sp) | gp = *(var_28h);
0x000299a0 move a0, s5 | a0 = s5;
0x000299a4 lw a1, -0x7fa8(gp) | a1 = *((gp - 8170));
0x000299a8 lw t9, -0x7b6c(gp) | t9 = sym.imp.popen
0x000299ac addiu a1, a1, -0x3c5c | a1 += -0x3c5c;
0x000299b0 jalr t9 | t9 ();
0x000299b4 move s3, v0 | s3 = v0;
0x000299b8 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == 0) {
0x000299bc beqz v0, 0x29b34 | goto label_14;
| }
0x000299c0 lw a3, -0x7d90(gp) | a3 = *(gp);
0x000299c4 lw t9, -0x7a80(gp) | t9 = sym.imp.ext2fs_read_bb_FILE;
0x000299c8 addiu a3, a3, -0x6940 | a3 += -0x6940;
0x000299cc addiu a2, sp, 0x30 | a2 = sp + 0x30;
0x000299d0 move a1, v0 | a1 = v0;
0x000299d4 move a0, s0 | a0 = s0;
0x000299d8 jalr t9 | t9 ();
0x000299dc lw gp, 0x28(sp) | gp = *(var_28h);
0x000299e0 move a0, s3 | a0 = s3;
0x000299e4 lw t9, -0x7cc4(gp) | t9 = sym.imp.pclose;
0x000299e8 move s3, v0 | s3 = v0;
0x000299ec jalr t9 | t9 ();
0x000299f0 lw gp, 0x28(sp) | gp = *(var_28h);
0x000299f4 beqz s3, 0x298a0 |
| } while (s3 == 0);
| label_9:
0x000299f8 lw a3, -0x7fd0(gp) | a3 = *(gp);
0x000299fc lw a2, -0x7fd0(gp) | a2 = *(gp);
0x00029a00 lw a0, -0x7fd0(gp) | a0 = *(gp);
0x00029a04 lw t9, -0x7914(gp) | t9 = sym.imp.com_err;
| /* str.while_reading_in_list_of_bad_blocks_from_file */
0x00029a08 addiu a3, a3, 0x78b8 | a3 += 0x78b8;
| /* esilref: '&s' */
0x00029a0c addiu a2, a2, 0x62f4 | a2 += 0x62f4;
0x00029a10 move a1, s3 | a1 = s3;
| /* str.ext2fs_read_bb_FILE */
0x00029a14 addiu a0, a0, 0x78e8 | a0 += 0x78e8;
0x00029a18 jalr t9 | t9 ();
0x00029a1c lw gp, 0x28(sp) | gp = *(var_28h);
| label_2:
0x00029a20 lw v0, 0x24(s1) | v0 = *((s1 + 9));
0x00029a24 lw a0, 0x30(sp) | a0 = *(var_30h);
0x00029a28 ori v0, v0, 1 | v0 |= 1;
0x00029a2c sw v0, 0x24(s1) | *((s1 + 9)) = v0;
| if (a0 == 0) {
0x00029a30 beqz a0, 0x298e4 | goto label_0;
| }
0x00029a34 lw t9, -0x7a88(gp) | t9 = sym.imp.ext2fs_badblocks_list_free;
0x00029a38 jalr t9 | t9 ();
0x00029a3c nop |
0x00029a40 lw gp, 0x28(sp) | gp = *(var_28h);
0x00029a44 b 0x298e4 | goto label_0;
| label_6:
0x00029a48 addiu a1, sp, 0x30 | a1 = sp + 0x30;
0x00029a4c move a0, s0 | a0 = s0;
0x00029a50 jalr t9 | t9 ();
0x00029a54 lw gp, 0x28(sp) | gp = *(var_28h);
| if (v0 == 0) {
0x00029a58 beqz v0, 0x29844 | goto label_1;
| }
0x00029a5c lw a3, -0x7fd0(gp) | a3 = *(gp);
0x00029a60 lw a2, -0x7fd0(gp) | a2 = *(gp);
0x00029a64 lw a0, -0x7fd0(gp) | a0 = *(gp);
0x00029a68 lw t9, -0x7914(gp) | t9 = sym.imp.com_err;
| /* str.while_reading_the_bad_blocks_inode */
0x00029a6c addiu a3, a3, 0x782c | a3 += 0x782c;
| /* esilref: '&s' */
0x00029a70 addiu a2, a2, 0x62f4 | a2 += 0x62f4;
0x00029a74 move a1, v0 | a1 = v0;
| /* str.ext2fs_read_bb_inode */
0x00029a78 addiu a0, a0, 0x7850 | a0 += 0x7850;
0x00029a7c jalr t9 | t9 ();
0x00029a80 lw gp, 0x28(sp) | gp = *(var_28h);
0x00029a84 b 0x29a20 | goto label_2;
| label_5:
0x00029a88 lw a3, -0x7fd0(gp) | a3 = *(gp);
0x00029a8c lw a2, -0x7fd0(gp) | a2 = *(gp);
0x00029a90 lw a0, -0x7fd0(gp) | a0 = *(gp);
0x00029a94 lw t9, -0x7914(gp) | t9 = sym.imp.com_err;
| /* str.while_sanity_checking_the_bad_blocks_inode */
0x00029a98 addiu a3, a3, 0x7800 | a3 += 0x7800;
| /* esilref: '&s' */
0x00029a9c addiu a2, a2, 0x62f4 | a2 += 0x62f4;
0x00029aa0 move a1, v0 | a1 = v0;
| /* str.ext2fs_block_iterate */
0x00029aa4 addiu a0, a0, 0x732c | a0 += 0x732c;
0x00029aa8 jalr t9 | t9 ();
0x00029aac lw gp, 0x28(sp) | gp = *(var_28h);
0x00029ab0 b 0x29a20 | goto label_2;
| label_12:
0x00029ab4 lw s3, -0x7fd0(gp) | s3 = *(gp);
0x00029ab8 andi v0, v0, 0x200 | v0 &= aav.0x00000200;
0x00029abc addiu s3, s3, 0x5c60 | s3 += 0x5c60;
| if (v0 == 0) {
0x00029ac0 beqz v0, 0x2993c | goto label_3;
| }
| label_13:
0x00029ac4 lw s4, -0x7fd0(gp) | s4 = *(gp);
| /* esilref: '-n ' */
0x00029ac8 addiu s4, s4, 0x77fc | s4 += 0x77fc;
0x00029acc b 0x29944 | goto label_4;
| label_10:
0x00029ad0 lw a3, -0x7fd0(gp) | a3 = *(gp);
0x00029ad4 lw a2, -0x7fd0(gp) | a2 = *(gp);
0x00029ad8 lw a0, -0x7fd0(gp) | a0 = *(gp);
0x00029adc lw t9, -0x7914(gp) | t9 = sym.imp.com_err;
| /* str.while_updating_bad_block_inode */
0x00029ae0 addiu a3, a3, 0x791c | a3 += 0x791c;
| /* esilref: '&s' */
0x00029ae4 addiu a2, a2, 0x62f4 | a2 += 0x62f4;
0x00029ae8 move a1, v0 | a1 = v0;
| /* str.ext2fs_update_bb_inode */
0x00029aec addiu a0, a0, 0x793c | a0 += 0x793c;
0x00029af0 jalr t9 | t9 ();
0x00029af4 lw gp, 0x28(sp) | gp = *(var_28h);
0x00029af8 b 0x29a20 | goto label_2;
| label_8:
0x00029afc lw t9, -0x7aa4(gp) | t9 = sym.imp.__errno_location;
0x00029b00 jalr t9 | t9 ();
0x00029b04 nop |
0x00029b08 lw gp, 0x28(sp) | gp = *(var_28h);
0x00029b0c lw a1, (v0) | a1 = *(v0);
0x00029b10 move a3, s3 | a3 = s3;
0x00029b14 lw a2, -0x7fd0(gp) | a2 = *(gp);
0x00029b18 lw a0, -0x7fd0(gp) | a0 = *(gp);
0x00029b1c lw t9, -0x7914(gp) | t9 = sym.imp.com_err;
| /* str.while_trying_to_open__s */
0x00029b20 addiu a2, a2, 0x5ea8 | a2 += 0x5ea8;
| /* str.read_bad_blocks_file */
0x00029b24 addiu a0, a0, 0x7868 | a0 += 0x7868;
0x00029b28 jalr t9 | t9 ();
0x00029b2c lw gp, 0x28(sp) | gp = *(var_28h);
0x00029b30 b 0x29a20 | goto label_2;
| label_14:
0x00029b34 lw t9, -0x7aa4(gp) | t9 = sym.imp.__errno_location;
0x00029b38 jalr t9 | t9 ();
0x00029b3c nop |
0x00029b40 lw gp, 0x28(sp) | gp = *(var_28h);
0x00029b44 lw a1, (v0) | a1 = *(v0);
0x00029b48 move a3, s5 | a3 = s5;
0x00029b4c lw a2, -0x7fd0(gp) | a2 = *(gp);
0x00029b50 lw a0, -0x7fd0(gp) | a0 = *(gp);
0x00029b54 lw t9, -0x7914(gp) | t9 = sym.imp.com_err;
| /* str.while_trying_popen__s */
0x00029b58 addiu a2, a2, 0x78a0 | a2 += 0x78a0;
| /* str.read_bad_blocks_file */
0x00029b5c addiu a0, a0, 0x7868 | a0 += 0x7868;
0x00029b60 jalr t9 | t9 ();
0x00029b64 lw gp, 0x28(sp) | gp = *(var_28h);
0x00029b68 b 0x29a20 | goto label_2;
| label_11:
0x00029b6c lw t9, -0x78a4(gp) | t9 = sym.imp.__stack_chk_fail;
0x00029b70 jalr t9 | t9 ();
0x00029b74 nop |
0x00029b78 nop |
0x00029b7c nop |
| }
[*] Function popen used 3 times fsck.ext3