[*] Binary protection state of libled_lib.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols
[*] Function printf tear down of libled_lib.so
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/blinkenlights_plugins/libled_lib.so @ 0xd8c */
| #include <stdint.h>
|
; (fcn) sym.plugin_init () | void plugin_init (int16_t arg_8h, int16_t arg_ch, int16_t arg_20h, int16_t arg_24h, char * path, char * arg_30h) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_64h;
0x00000d8c svcmi 0xf0e92d | __asm ("svcmi 0xf0e92d");
0x00000d90 sub sp, 0x6c |
0x00000d92 ldr r5, [pc, 0x328] |
0x00000d94 movs r0, 0xff | r0 = 0xff;
0x00000d96 ldr r4, [pc, 0x328] | r4 = *(0x10c2);
0x00000d98 add r5, pc | r5 = 0x1e5a;
0x00000d9a ldr r3, [pc, 0x328] |
0x00000d9c ldr r1, [pc, 0x328] |
0x00000d9e ldr r4, [r5, r4] |
0x00000da0 ldr r2, [pc, 0x328] | r2 = *(0x10cc);
0x00000da2 add r3, pc | r3 = 0x1e6c;
0x00000da4 add r1, pc | r1 = 0x1e70;
0x00000da6 ldr r4, [r4] | r4 = *(0x1e5a);
0x00000da8 str r4, [sp, 0x64] | var_64h = r4;
0x00000daa mov.w r4, 0 | r4 = 0;
0x00000dae str r0, [r1] | *(r1) = r0;
0x00000db0 ldr r5, [r3, r2] | r5 = *(0x1e6c);
0x00000db2 ldr r1, [r5] | r1 = *(0x1e6c);
0x00000db4 cmp r1, 0 |
| if (r1 == 0) {
0x00000db6 beq.w 0xffc | goto label_11;
| }
0x00000dba ldr r3, [pc, 0x314] |
0x00000dbc add.w r4, r5, 0x5c | r4 = r5 + 0x5c;
0x00000dc0 ldr.w sl, [pc, 0x310] |
0x00000dc4 add.w r8, sp, 8 | r8 += var_8h;
0x00000dc8 ldr.w sb, [pc, 0x30c] |
0x00000dcc add r3, pc | r3 = 0x1ea2;
0x00000dce add sl, pc | sl = 0x1ea6;
0x00000dd0 str r3, [sp] | *(sp) = r3;
0x00000dd2 add sb, pc | sb = 0x1eae;
0x00000dd4 b 0xea4 |
| while (r3 == 0) {
| label_0:
0x00000dd6 add.w fp, r6, r7 |
0x00000dda add.w fp, r5, fp, lsl 5 |
0x00000dde ldr.w r3, [fp, 0x24] | r3 = *(arg_24h);
0x00000de2 cmp r3, 0 |
| if (r3 != 0) {
0x00000de4 bne.w 0x1040 | goto label_12;
| }
| label_8:
0x00000de8 add r6, r7 | r6 += r7;
0x00000dea add.w r6, r5, r6, lsl 5 | r6 = r5 + (r6 << 5);
0x00000dee ldr r3, [r6, 0x28] | r3 = *((r6 + 0x28));
0x00000df0 cmp r3, 0 |
| if (r3 != 0) {
0x00000df2 bne.w 0x106c | goto label_13;
| }
| label_9:
0x00000df6 ldr r3, [r4, -0x3c] | r3 = *((r4 - 0x3c));
0x00000dfa cmp r3, 0 |
| if (r3 != 0) {
0x00000dfc bne.w 0xf68 | goto label_14;
| }
| label_1:
0x00000e00 ldr r3, [r4, -0x38] | r3 = *((r4 - 0x38));
0x00000e04 cmp r3, 0 |
| if (r3 != 0) {
0x00000e06 bne.w 0xf82 | goto label_15;
| }
| label_2:
0x00000e0a ldr r3, [r4, -0x34] | r3 = *((r4 - 0x34));
0x00000e0e cmp r3, 0 |
| if (r3 != 0) {
0x00000e10 bne.w 0xf9a | goto label_16;
| }
| label_3:
0x00000e14 ldr r6, [pc, 0x2c4] |
0x00000e16 movs r7, 0 | r7 = 0;
0x00000e18 ldr r3, [pc, 0x2c4] |
0x00000e1a movs r0, 1 | r0 = 1;
0x00000e1c ldr r2, [pc, 0x2c4] |
0x00000e1e add r6, pc | r6 = 0x1efe;
0x00000e20 strd r0, r7, [r4, -0x18] | __asm ("strd r0, r7, [r4, -0x18]");
0x00000e24 add r3, pc | r3 = 0x1f08;
0x00000e26 ldr r1, [r4, -0x5c] | r1 = *((r4 - 0x5c));
0x00000e2a add r2, pc | r2 = 0x1f12;
0x00000e2c mov r0, r6 | r0 = r6;
0x00000e2e str r7, [r4, -0xc] | *((r4 - 0xc)) = r7;
0x00000e32 mov fp, r3 |
0x00000e34 blx 0x864 | g_strdup_printf ()
0x00000e38 ldr r2, [pc, 0x2ac] |
0x00000e3a mov r3, fp | r3 = fp;
0x00000e3c ldr r1, [r4, -0x5c] | r1 = *((r4 - 0x5c));
0x00000e40 str r0, [r4, -0x24] | *((r4 - 0x24)) = r0;
0x00000e44 mov r0, r6 | r0 = r6;
0x00000e46 add r2, pc | r2 = 0x1f32;
0x00000e48 blx 0x864 | g_strdup_printf ()
0x00000e4c ldr r2, [pc, 0x29c] |
0x00000e4e mov ip, r0 |
0x00000e50 mov r3, fp | r3 = fp;
0x00000e52 mov r0, r6 | r0 = r6;
0x00000e54 ldr r1, [r4, -0x5c] | r1 = *((r4 - 0x5c));
0x00000e58 add r2, pc | r2 = 0x1f48;
0x00000e5a str ip, [r4, -0x20] | *((r4 - 0x20)) = ip;
0x00000e5e blx 0x864 | g_strdup_printf ()
0x00000e62 ldr r3, [r4, -0x58] | r3 = *((r4 - 0x58));
0x00000e66 strb r7, [r4, -0x10] | *((r4 - 0x10)) = r7;
0x00000e6a str r0, [r4, -0x1c] | *((r4 - 0x1c)) = r0;
0x00000e6e lsls r6, r3, 1 | r6 = r3 << 1;
0x00000e70 adds r7, r6, r3 | r7 = r6 + r3;
0x00000e72 add.w r7, r5, r7, lsl 5 | r7 = r5 + (r7 << 5);
0x00000e76 ldr r2, [r7, 0x20] | r2 = *((r7 + 0x20));
0x00000e78 cmp r2, 0 |
| if (r2 != 0) {
0x00000e7a bne.w 0xfaa | goto label_17;
| }
| label_4:
0x00000e7e adds r7, r6, r3 | r7 = r6 + r3;
0x00000e80 add.w r7, r5, r7, lsl 5 | r7 = r5 + (r7 << 5);
0x00000e84 ldr r2, [r7, 0x24] | r2 = *((r7 + 0x24));
0x00000e86 cmp r2, 0 |
| if (r2 != 0) {
0x00000e88 bne.w 0x1016 | goto label_18;
| }
| label_6:
0x00000e8c add r6, r3 | r6 += r3;
0x00000e8e add.w r6, r5, r6, lsl 5 | r6 = r5 + (r6 << 5);
0x00000e92 ldr r3, [r6, 0x28] | r3 = *((r6 + 0x28));
0x00000e94 cmp r3, 0 |
| if (r3 != 0) {
0x00000e96 bne.w 0x1092 | goto label_19;
| }
| label_10:
0x00000e9a ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00000e9c adds r4, 0x60 | r4 += 0x60;
0x00000e9e cmp r1, 0 |
| if (r1 == 0) {
0x00000ea0 beq.w 0xffc | goto label_11;
| }
| label_5:
0x00000ea4 ldr r2, [sp] | r2 = *(sp);
0x00000ea6 mov r3, sl | r3 = sl;
0x00000ea8 mov r0, sb | r0 = sb;
0x00000eaa blx 0x864 | g_strdup_printf ()
0x00000eae ldr r2, [pc, 0x240] |
0x00000eb0 mov r6, r0 | r6 = r0;
0x00000eb2 ldr r1, [r4, -0x5c] | r1 = *((r4 - 0x5c));
0x00000eb6 mov r3, sl | r3 = sl;
0x00000eb8 str r6, [r4, -0x30] | *((r4 - 0x30)) = r6;
0x00000ebc mov r0, sb | r0 = sb;
0x00000ebe add r2, pc | r2 = 0x1fb4;
0x00000ec0 blx 0x864 | g_strdup_printf ()
0x00000ec4 ldr r2, [pc, 0x22c] |
0x00000ec6 mov r6, r0 | r6 = r0;
0x00000ec8 ldr r1, [r4, -0x5c] | r1 = *((r4 - 0x5c));
0x00000ecc mov r3, sl | r3 = sl;
0x00000ece str r6, [r4, -0x2c] | *((r4 - 0x2c)) = r6;
0x00000ed2 mov r0, sb | r0 = sb;
0x00000ed4 add r2, pc | r2 = 0x1fcc;
0x00000ed6 blx 0x864 | r0 = g_strdup_printf ()
0x00000eda mov r3, r0 | r3 = r0;
0x00000edc mov r1, r8 | r1 = r8;
0x00000ede str r3, [r4, -0x28] | *((r4 - 0x28)) = r3;
0x00000ee2 ldr r0, [r4, -0x30] | r0 = *((r4 - 0x30));
0x00000ee6 blx 0x87c | r0 = stat ();
0x00000eea clz r3, r0 | r3 &= r0;
0x00000eee mov r1, r8 | r1 = r8;
0x00000ef0 lsrs r3, r3, 5 | r3 >>= 5;
0x00000ef2 ldr r0, [r4, -0x2c] | r0 = *((r4 - 0x2c));
0x00000ef6 str r3, [r4, -0x3c] | *((r4 - 0x3c)) = r3;
0x00000efa blx 0x87c | r0 = stat ();
0x00000efe clz r3, r0 | r3 &= r0;
0x00000f02 mov r1, r8 | r1 = r8;
0x00000f04 lsrs r3, r3, 5 | r3 >>= 5;
0x00000f06 ldr r0, [r4, -0x28] | r0 = *((r4 - 0x28));
0x00000f0a str r3, [r4, -0x38] | *((r4 - 0x38)) = r3;
0x00000f0e blx 0x87c | stat ();
0x00000f12 ldr r7, [r4, -0x58] | r7 = *((r4 - 0x58));
0x00000f14 ldrb r0, [r3, 0x11] | r0 = *((r3 + 0x11));
0x00000f16 clz r0, r0 | r0 &= r0;
0x00000f1a lsrs r0, r0, 5 | r0 >>= 5;
0x00000f1c str r0, [r4, -0x34] | *((r4 - 0x34)) = r0;
0x00000f20 lsls r6, r7, 1 | r6 = r7 << 1;
0x00000f22 add.w fp, r6, r7 |
0x00000f26 add.w fp, r5, fp, lsl 5 |
0x00000f2a ldr.w r3, [fp, 0x20] | r3 = *(arg_20h);
0x00000f2e cmp r3, 0 |
0x00000f30 beq.w 0xdd6 |
| }
0x00000f34 movw r1, 0x1001 |
0x00000f38 ldr.w r0, [fp, 0x2c] | r0 = *(path);
0x00000f3c movt r1, 0x10 | r1 = 0x101001;
0x00000f40 blx 0x888 | r0 = open (r0, r1, r2);
0x00000f44 cmp r0, 0 |
0x00000f46 str.w r0, [fp, 8] | __asm ("str.w r0, [arg_8h]");
| if (r0 >= 0) {
0x00000f4a bge.w 0xdd6 | goto label_0;
| }
0x00000f4e ldr r2, [pc, 0x1a8] |
0x00000f50 movs r1, 1 | r1 = 1;
0x00000f52 ldr.w r3, [fp, 0x2c] | r3 = *(path);
0x00000f56 movs r0, 3 | r0 = 3;
0x00000f58 add r2, pc | r2 = 0x2056;
0x00000f5a blx 0x8d4 | fcn_000008d4 ();
0x00000f5e ldr r3, [r4, -0x3c] | r3 = *((r4 - 0x3c));
0x00000f62 cmp r3, 0 |
| if (r3 == 0) {
0x00000f64 beq.w 0xe00 | goto label_1;
| }
| label_14:
0x00000f68 ldr r1, [pc, 0x190] |
0x00000f6a sub.w r2, r4, 8 | r2 = r4 - 8;
0x00000f6e ldr r0, [r4, -0x58] | r0 = *((r4 - 0x58));
0x00000f72 add r1, pc | r1 = 0x2072;
0x00000f74 bl 0x9cc | fcn_000009cc (r0, r1, r2);
0x00000f78 ldr r3, [r4, -0x38] | r3 = *((r4 - 0x38));
0x00000f7c cmp r3, 0 |
| if (r3 == 0) {
0x00000f7e beq.w 0xe0a | goto label_2;
| }
| label_15:
0x00000f82 ldr r1, [pc, 0x17c] |
0x00000f84 subs r2, r4, 4 | r2 = r4 - 4;
0x00000f86 ldr r0, [r4, -0x58] | r0 = *((r4 - 0x58));
0x00000f8a add r1, pc | r1 = 0x2090;
0x00000f8c bl 0x9cc | fcn_000009cc (r0, r1, r2);
0x00000f90 ldr r3, [r4, -0x34] | r3 = *((r4 - 0x34));
0x00000f94 cmp r3, 0 |
| if (r3 == 0) {
0x00000f96 beq.w 0xe14 | goto label_3;
| }
| label_16:
0x00000f9a ldr r1, [pc, 0x168] |
0x00000f9c mov r2, r4 | r2 = r4;
0x00000f9e ldr r0, [r4, -0x58] | r0 = *((r4 - 0x58));
0x00000fa2 add r1, pc | r1 = 0x20ac;
0x00000fa4 bl 0x9cc | fcn_000009cc (r0, r1, r2);
0x00000fa8 b 0xe14 | goto label_3;
| label_17:
0x00000faa movw r1, 0x1001 |
0x00000fae ldr r0, [r7, 0x38] | r0 = *((r7 + 0x38));
0x00000fb0 movt r1, 0x10 | r1 = 0x101001;
0x00000fb4 str r3, [sp, 4] | var_4h = r3;
0x00000fb6 blx 0x888 | r0 = open (r0, r1, r2);
0x00000fba cmp r0, 0 |
0x00000fbc ldr r3, [sp, 4] | r3 = var_4h;
0x00000fbe str r0, [r7, 0x14] | *((r7 + 0x14)) = r0;
| if (r0 >= 0) {
0x00000fc0 bge.w 0xe7e | goto label_4;
| }
0x00000fc4 ldr r2, [pc, 0x140] |
0x00000fc6 movs r1, 1 | r1 = 1;
0x00000fc8 ldr r3, [r7, 0x38] | r3 = *((r7 + 0x38));
0x00000fca movs r0, 6 | r0 = 6;
0x00000fcc add r2, pc | r2 = 0x20d8;
0x00000fce blx 0x8d4 | fcn_000008d4 ();
| label_7:
0x00000fd2 movs r3, 0 | r3 = 0;
0x00000fd4 ldr r0, [r4, -0x24] | r0 = *((r4 - 0x24));
0x00000fd8 str r3, [r4, -0x18] | *((r4 - 0x18)) = r3;
0x00000fdc adds r4, 0x60 | r4 += 0x60;
0x00000fde blx 0x81c | g_free ();
0x00000fe2 ldr r0, [r4, -0x80] | r0 = *((r4 - 0x80));
0x00000fe6 blx 0x81c | g_free ();
0x00000fea ldr r0, [r4, -0x7c] | r0 = *((r4 - 0x7c));
0x00000fee blx 0x81c | g_free ();
0x00000ff2 ldr r1, [r4, -0x5c] | r1 = *((r4 - 0x5c));
0x00000ff6 cmp r1, 0 |
| if (r1 != 0) {
0x00000ff8 bne.w 0xea4 | goto label_5;
| }
| label_11:
0x00000ffc ldr r2, [pc, 0x10c] |
0x00000ffe ldr r3, [pc, 0xc0] | r3 = *(0x10c2);
0x00001000 add r2, pc | r2 = 0x2110;
0x00001002 ldr r3, [r2, r3] | r3 = *(0x2110);
0x00001004 ldr r2, [r3] | r2 = *(0x2110);
0x00001006 ldr r3, [sp, 0x64] | r3 = var_64h;
0x00001008 eors r2, r3 | r2 ^= r3;
0x0000100a mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0000100e bne 0x10b8 | goto label_20;
| }
0x00001010 add sp, 0x6c |
0x00001012 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_18:
0x00001016 movw r1, 0x1001 |
0x0000101a ldr r0, [r7, 0x3c] | r0 = *((r7 + 0x3c));
0x0000101c movt r1, 0x10 | r1 = 0x101001;
0x00001020 str r3, [sp, 4] | var_4h = r3;
0x00001022 blx 0x888 | r0 = open (r0, r1, r2);
0x00001026 cmp r0, 0 |
0x00001028 ldr r3, [sp, 4] | r3 = var_4h;
0x0000102a str r0, [r7, 0x18] | *((r7 + 0x18)) = r0;
| if (r0 >= 0) {
0x0000102c bge.w 0xe8c | goto label_6;
| }
0x00001030 ldr r2, [pc, 0xdc] |
0x00001032 movs r1, 1 | r1 = 1;
0x00001034 ldr r3, [r7, 0x3c] | r3 = *((r7 + 0x3c));
0x00001036 movs r0, 6 | r0 = 6;
0x00001038 add r2, pc | r2 = 0x214c;
0x0000103a blx 0x8d4 | fcn_000008d4 ();
0x0000103e b 0xfd2 | goto label_7;
| label_12:
0x00001040 movw r1, 0x1001 |
0x00001044 ldr.w r0, [fp, 0x30] | r0 = *(arg_30h);
0x00001048 movt r1, 0x10 | r1 = 0x101001;
0x0000104c blx 0x888 | r0 = open (r0, r1, r2);
0x00001050 cmp r0, 0 |
0x00001052 str.w r0, [fp, 0xc] | __asm ("str.w r0, [arg_ch]");
| if (r0 >= 0) {
0x00001056 bge.w 0xde8 | goto label_8;
| }
0x0000105a ldr r2, [pc, 0xb8] |
0x0000105c movs r1, 1 | r1 = 1;
0x0000105e ldr.w r3, [fp, 0x30] | r3 = *(arg_30h);
0x00001062 movs r0, 3 | r0 = 3;
0x00001064 add r2, pc | r2 = 0x217e;
0x00001066 blx 0x8d4 | fcn_000008d4 ();
0x0000106a b 0xdf6 | goto label_9;
| label_13:
0x0000106c movw r1, 0x1001 |
0x00001070 ldr r0, [r6, 0x34] | r0 = *((r6 + 0x34));
0x00001072 movt r1, 0x10 | r1 = 0x101001;
0x00001076 blx 0x888 | r0 = open (r0, r1, r2);
0x0000107a cmp r0, 0 |
0x0000107c str r0, [r6, 0x10] | *((r6 + 0x10)) = r0;
| if (r0 >= 0) {
0x0000107e bge.w 0xdf6 | goto label_9;
| }
0x00001082 ldr r2, [pc, 0x94] |
0x00001084 movs r1, 1 | r1 = 1;
0x00001086 ldr r3, [r6, 0x34] | r3 = *((r6 + 0x34));
0x00001088 movs r0, 3 | r0 = 3;
0x0000108a add r2, pc | r2 = 0x21a8;
0x0000108c blx 0x8d4 | fcn_000008d4 ();
0x00001090 b 0xdf6 | goto label_9;
| label_19:
0x00001092 movw r1, 0x1001 |
0x00001096 ldr r0, [r6, 0x40] | r0 = *((r6 + 0x40));
0x00001098 movt r1, 0x10 | r1 = 0x101001;
0x0000109c blx 0x888 | r0 = open (r0, r1, r2);
0x000010a0 cmp r0, 0 |
0x000010a2 str r0, [r6, 0x1c] | *((r6 + 0x1c)) = r0;
| if (r0 >= 0) {
0x000010a4 bge.w 0xe9a | goto label_10;
| }
0x000010a8 ldr r2, [pc, 0x70] |
0x000010aa movs r1, 1 | r1 = 1;
0x000010ac ldr r3, [r6, 0x40] | r3 = *((r6 + 0x40));
0x000010ae movs r0, 6 | r0 = 6;
0x000010b0 add r2, pc | r2 = 0x21d0;
0x000010b2 blx 0x8d4 | fcn_000008d4 ();
0x000010b6 b 0xfd2 | goto label_7;
| label_20:
0x000010b8 blx 0x840 | stack_chk_fail ();
0x000010bc asrs r0, r6, 7 | r0 = r6 >> 7;
0x000010be movs r1, r0 | r1 = r0;
0x000010c0 lsls r4, r4, 1 | r4 <<= 1;
0x000010c2 movs r0, r0 |
0x000010c4 asrs r6, r4, 7 | r6 = r4 >> 7;
0x000010c6 movs r1, r0 | r1 = r0;
0x000010c8 asrs r4, r3, 9 | r4 = r3 >> 9;
0x000010ca movs r1, r0 | r1 = r0;
0x000010cc lsls r4, r5, 1 | r4 = r5 << 1;
0x000010ce movs r0, r0 |
0x000010d0 lsrs r0, r0, 0x13 | r0 >>= 0x13;
0x000010d2 movs r0, r0 |
0x000010d4 lsrs r2, r1, 0xe | r2 = r1 >> 0xe;
0x000010d6 movs r0, r0 |
0x000010d8 lsrs r6, r4, 0xd | r6 = r4 >> 0xd;
0x000010da movs r0, r0 |
0x000010dc lsrs r2, r3, 0xc | r2 = r3 >> 0xc;
0x000010de movs r0, r0 |
0x000010e0 lsrs r4, r4, 0xe | r4 >>= 0xe;
0x000010e2 movs r0, r0 |
0x000010e4 lsrs r2, r4, 0x11 | r2 = r4 >> 0x11;
0x000010e6 movs r0, r0 |
0x000010e8 lsrs r6, r6, 0x10 | r6 >>= 0x10;
0x000010ea movs r0, r0 |
0x000010ec lsrs r0, r0, 0x11 | r0 >>= 0x11;
0x000010ee movs r0, r0 |
0x000010f0 lsrs r6, r7, 0xe | r6 = r7 >> 0xe;
0x000010f2 movs r0, r0 |
0x000010f4 lsrs r4, r0, 0xf | r4 = r0 >> 0xf;
0x000010f6 movs r0, r0 |
0x000010f8 lsrs r0, r3, 9 | r0 = r3 >> 9;
0x000010fa movs r0, r0 |
0x000010fc lsrs r2, r3, 0xc | r2 = r3 >> 0xc;
0x000010fe movs r0, r0 |
0x00001100 lsrs r2, r6, 0xb | r2 = r6 >> 0xb;
0x00001102 movs r0, r0 |
0x00001104 lsrs r6, r6, 0xb | r6 >>= 0xb;
0x00001106 movs r0, r0 |
0x00001108 lsrs r4, r4, 7 | r4 >>= 7;
0x0000110a movs r0, r0 |
0x0000110c lsrs r0, r1, 0x1e | r0 = r1 >> 0x1e;
0x0000110e movs r1, r0 | r1 = r0;
0x00001110 lsrs r0, r7, 5 | r0 = r7 >> 5;
0x00001112 movs r0, r0 |
0x00001114 lsrs r4, r1, 5 | r4 = r1 >> 5;
0x00001116 movs r0, r0 |
0x00001118 lsrs r6, r4, 4 | r6 = r4 >> 4;
0x0000111a movs r0, r0 |
0x0000111c lsrs r0, r0, 4 | r0 >>= 4;
0x0000111e movs r0, r0 |
| }
[*] Function printf used 7 times libled_lib.so