[*] Binary protection state of get_module
Full RELRO No Canary found NX disabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function printf tear down of get_module
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/get_module @ 0x900 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [13] -r-x section size 1296 named .text */
0x00000900 lui gp, 2 |
0x00000904 addiu gp, gp, -0x78f0 |
0x00000908 addu gp, gp, t9 | gp += t9;
0x0000090c addiu sp, sp, -0x38 |
0x00000910 addiu v0, zero, 2 | v0 = 2;
0x00000914 sw gp, 0x18(sp) | *(var_18h) = gp;
0x00000918 sw ra, 0x34(sp) | *(var_34h) = ra;
0x0000091c sw s3, 0x30(sp) | *(var_30h) = s3;
0x00000920 sw s2, 0x2c(sp) | *(var_2ch) = s2;
0x00000924 sw s1, 0x28(sp) | *(var_28h) = s1;
0x00000928 sw s0, 0x24(sp) | *(var_24h) = s0;
0x0000092c lw t9, -0x7f98(gp) | t9 = sym.imp.sysfs_open_module;
| if (a0 != v0) {
0x00000930 beq a0, v0, 0x974 |
0x00000934 lw v0, -0x7fa0(gp) | v0 = *((gp - 8168));
0x00000938 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x0000093c lw t9, -0x7f88(gp) | t9 = sym.imp.fwrite;
0x00000940 lw a3, (v0) | a3 = *(v0);
0x00000944 addiu a2, zero, 0x19 | a2 = 0x19;
0x00000948 addiu a1, zero, 1 | a1 = 1;
0x0000094c addiu a0, a0, 0xef8 | a0 += str.Usage:_get_module__name__n;
0x00000950 jalr t9 | t9 ();
0x00000954 addiu v0, zero, 1 | v0 = 1;
| label_0:
0x00000958 lw ra, 0x34(sp) | ra = *(var_34h);
0x0000095c lw s3, 0x30(sp) | s3 = *(var_30h);
0x00000960 lw s2, 0x2c(sp) | s2 = *(var_2ch);
0x00000964 lw s1, 0x28(sp) | s1 = *(var_28h);
0x00000968 lw s0, 0x24(sp) | s0 = *(var_24h);
0x0000096c addiu sp, sp, 0x38 |
0x00000970 jr ra | return v0;
| }
0x00000974 lw a0, 4(a1) | a0 = *((a1 + 1));
0x00000978 sw a1, 0x3c(sp) | *(arg_3ch) = a1;
0x0000097c jalr t9 | t9 ();
0x00000980 move s3, v0 | s3 = v0;
0x00000984 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000988 lw a1, 0x3c(sp) | a1 = *(arg_3ch);
| if (v0 == 0) {
0x0000098c beqz v0, 0xbc4 | goto label_1;
| }
0x00000990 lw t9, -0x7f9c(gp) | t9 = sym.imp.sysfs_get_module_attributes;
0x00000994 move a0, v0 | a0 = v0;
0x00000998 jalr t9 | t9 ();
0x0000099c move s1, v0 | s1 = v0;
0x000009a0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x000009a4 beqz v0, 0xa30 | goto label_2;
| }
0x000009a8 lw t9, -0x7f90(gp) | t9 = sym.imp.dlist_start;
0x000009ac move a0, v0 | a0 = v0;
0x000009b0 jalr t9 | t9 ();
0x000009b4 lw gp, 0x18(sp) | gp = *(var_18h);
0x000009b8 move a0, s1 | a0 = s1;
0x000009bc lw t9, -0x7f84(gp) | t9 = sym.imp._dlist_mark_move;
0x000009c0 addiu a1, zero, 1 | a1 = 1;
0x000009c4 jalr t9 | t9 ();
0x000009c8 lw a0, (s1) | a0 = *(s1);
0x000009cc lw v1, 0x1c(s1) | v1 = *((s1 + 7));
0x000009d0 lw gp, 0x18(sp) | gp = *(var_18h);
| if (a0 == v1) {
0x000009d4 beq a0, v1, 0xa30 | goto label_2;
| }
0x000009d8 lw s0, -0x7fdc(gp) | s0 = *((gp - 8183));
0x000009dc lw s2, -0x7fa0(gp) | s2 = *((gp - 8168));
0x000009e0 addiu s0, s0, 0xf2c | s0 += str._t__20s_:__s;
| do {
0x000009e4 lw v1, 0x140(v0) | v1 = *(v0);
0x000009e8 lw t9, -0x7fac(gp) | t9 = sym.imp.__fprintf_chk
0x000009ec lw a0, (s2) | a0 = *(s2);
0x000009f0 move a3, v0 | a3 = v0;
0x000009f4 sw v1, 0x10(sp) | *(var_10h) = v1;
0x000009f8 move a2, s0 | a2 = s0;
0x000009fc addiu a1, zero, 1 | a1 = 1;
0x00000a00 jalr t9 | t9 ();
0x00000a04 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000a08 move a0, s1 | a0 = s1;
0x00000a0c lw t9, -0x7f84(gp) | t9 = sym.imp._dlist_mark_move;
0x00000a10 addiu a1, zero, 1 | a1 = 1;
0x00000a14 jalr t9 | t9 ();
0x00000a18 lw a0, (s1) | a0 = *(s1);
0x00000a1c lw v1, 0x1c(s1) | v1 = *((s1 + 7));
0x00000a20 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000a24 bne a0, v1, 0x9e4 |
| } while (a0 != v1);
0x00000a28 lw t9, -0x7fa8(gp) | t9 = sym.imp.fputc;
0x00000a2c b 0xa38 | goto label_3;
| label_2:
0x00000a30 lw s2, -0x7fa0(gp) | s2 = *((gp - 8168));
0x00000a34 lw t9, -0x7fa8(gp) | t9 = sym.imp.fputc;
| label_3:
0x00000a38 lw a1, (s2) | a1 = *(s2);
0x00000a3c addiu a0, zero, 0xa | a0 = 0xa;
0x00000a40 jalr t9 | t9 ();
0x00000a44 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000a48 lw t9, -0x7fa4(gp) | t9 = sym.imp.sysfs_get_module_parms;
0x00000a4c move a0, s3 | a0 = s3;
0x00000a50 jalr t9 | t9 ();
0x00000a54 move s1, v0 | s1 = v0;
0x00000a58 lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00000a5c beqz v0, 0xafc | goto label_4;
| }
0x00000a60 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000a64 lw t9, -0x7f88(gp) | t9 = sym.imp.fwrite;
0x00000a68 lw a3, (s2) | a3 = *(s2);
0x00000a6c addiu a2, zero, 0xc | a2 = 0xc;
0x00000a70 addiu a1, zero, 1 | a1 = 1;
0x00000a74 addiu a0, a0, 0xf38 | a0 += str.Parameters:_n;
0x00000a78 jalr t9 | t9 ();
0x00000a7c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000a80 lw t9, -0x7f90(gp) | t9 = sym.imp.dlist_start;
0x00000a84 move a0, s1 | a0 = s1;
0x00000a88 jalr t9 | t9 ();
0x00000a8c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000a90 move a0, s1 | a0 = s1;
0x00000a94 lw t9, -0x7f84(gp) | t9 = sym.imp._dlist_mark_move;
0x00000a98 addiu a1, zero, 1 | a1 = 1;
0x00000a9c jalr t9 | t9 ();
0x00000aa0 lw a0, (s1) | a0 = *(s1);
0x00000aa4 lw v1, 0x1c(s1) | v1 = *((s1 + 7));
0x00000aa8 lw gp, 0x18(sp) | gp = *(var_18h);
| if (a0 == v1) {
0x00000aac beq a0, v1, 0xafc | goto label_4;
| }
0x00000ab0 lw s0, -0x7fdc(gp) | s0 = *((gp - 8183));
0x00000ab4 addiu s0, s0, 0xf2c | s0 += str._t__20s_:__s;
| do {
0x00000ab8 lw v1, 0x140(v0) | v1 = *(v0);
0x00000abc lw t9, -0x7fac(gp) | t9 = sym.imp.__fprintf_chk
0x00000ac0 lw a0, (s2) | a0 = *(s2);
0x00000ac4 move a3, v0 | a3 = v0;
0x00000ac8 sw v1, 0x10(sp) | *(var_10h) = v1;
0x00000acc move a2, s0 | a2 = s0;
0x00000ad0 addiu a1, zero, 1 | a1 = 1;
0x00000ad4 jalr t9 | t9 ();
0x00000ad8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000adc move a0, s1 | a0 = s1;
0x00000ae0 lw t9, -0x7f84(gp) | t9 = sym.imp._dlist_mark_move;
0x00000ae4 addiu a1, zero, 1 | a1 = 1;
0x00000ae8 jalr t9 | t9 ();
0x00000aec lw a0, (s1) | a0 = *(s1);
0x00000af0 lw v1, 0x1c(s1) | v1 = *((s1 + 7));
0x00000af4 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000af8 bne a0, v1, 0xab8 |
| } while (a0 != v1);
| label_4:
0x00000afc lw t9, -0x7f78(gp) | t9 = sym.imp.sysfs_get_module_sections;
0x00000b00 move a0, s3 | a0 = s3;
0x00000b04 jalr t9 | t9 ();
0x00000b08 move s1, v0 | s1 = v0;
0x00000b0c lw gp, 0x18(sp) | gp = *(var_18h);
| if (v0 == 0) {
0x00000b10 beqz v0, 0xbb0 | goto label_5;
| }
0x00000b14 lw a0, -0x7fdc(gp) | a0 = *((gp - 8183));
0x00000b18 lw t9, -0x7f88(gp) | t9 = sym.imp.fwrite;
0x00000b1c lw a3, (s2) | a3 = *(s2);
0x00000b20 addiu a2, zero, 0xa | a2 = 0xa;
0x00000b24 addiu a1, zero, 1 | a1 = 1;
0x00000b28 addiu a0, a0, 0xf48 | a0 += str.Sections:_n;
0x00000b2c jalr t9 | t9 ();
0x00000b30 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000b34 lw t9, -0x7f90(gp) | t9 = sym.imp.dlist_start;
0x00000b38 move a0, s1 | a0 = s1;
0x00000b3c jalr t9 | t9 ();
0x00000b40 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000b44 move a0, s1 | a0 = s1;
0x00000b48 lw t9, -0x7f84(gp) | t9 = sym.imp._dlist_mark_move;
0x00000b4c addiu a1, zero, 1 | a1 = 1;
0x00000b50 jalr t9 | t9 ();
0x00000b54 lw a0, 0x1c(s1) | a0 = *((s1 + 7));
0x00000b58 lw v1, (s1) | v1 = *(s1);
0x00000b5c lw gp, 0x18(sp) | gp = *(var_18h);
| if (a0 == v1) {
0x00000b60 beq a0, v1, 0xbb0 | goto label_5;
| }
0x00000b64 lw s0, -0x7fdc(gp) | s0 = *((gp - 8183));
0x00000b68 addiu s0, s0, 0xf2c | s0 += str._t__20s_:__s;
| do {
0x00000b6c lw v1, 0x140(v0) | v1 = *(v0);
0x00000b70 lw t9, -0x7fac(gp) | t9 = sym.imp.__fprintf_chk
0x00000b74 lw a0, (s2) | a0 = *(s2);
0x00000b78 move a3, v0 | a3 = v0;
0x00000b7c sw v1, 0x10(sp) | *(var_10h) = v1;
0x00000b80 move a2, s0 | a2 = s0;
0x00000b84 addiu a1, zero, 1 | a1 = 1;
0x00000b88 jalr t9 | t9 ();
0x00000b8c lw gp, 0x18(sp) | gp = *(var_18h);
0x00000b90 move a0, s1 | a0 = s1;
0x00000b94 lw t9, -0x7f84(gp) | t9 = sym.imp._dlist_mark_move;
0x00000b98 addiu a1, zero, 1 | a1 = 1;
0x00000b9c jalr t9 | t9 ();
0x00000ba0 lw a0, (s1) | a0 = *(s1);
0x00000ba4 lw v1, 0x1c(s1) | v1 = *((s1 + 7));
0x00000ba8 lw gp, 0x18(sp) | gp = *(var_18h);
0x00000bac bne a0, v1, 0xb6c |
| } while (a0 != v1);
| label_5:
0x00000bb0 lw t9, -0x7fb4(gp) | t9 = sym.imp.sysfs_close_module;
0x00000bb4 move a0, s3 | a0 = s3;
0x00000bb8 jalr t9 | t9 ();
0x00000bbc move v0, zero | v0 = 0;
0x00000bc0 b 0x958 | goto label_0;
| label_1:
0x00000bc4 lw v0, -0x7fa0(gp) | v0 = *((gp - 8168));
0x00000bc8 lw a2, -0x7fdc(gp) | a2 = *((gp - 8183));
0x00000bcc lw t9, -0x7fac(gp) | t9 = sym.imp.__fprintf_chk
0x00000bd0 lw a3, 4(a1) | a3 = *((a1 + 1));
0x00000bd4 lw a0, (v0) | a0 = *(v0);
0x00000bd8 addiu a2, a2, 0xf14 | a2 += str.Module___s__not_found_n;
0x00000bdc addiu a1, zero, 1 | a1 = 1;
0x00000be0 jalr t9 | t9 ();
0x00000be4 addiu v0, zero, 1 | v0 = 1;
0x00000be8 b 0x958 | goto label_0;
| }
[*] Function printf used 5 times get_module