[*] Binary protection state of agetty
Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of agetty
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-80367616.squashfs_v4_le_extract/usr/sbin/agetty @ 0x63a4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000063a4 () | void fcn_000063a4 (int16_t arg_1h, int16_t arg1, int16_t arg2) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_1ch;
| int16_t var_24h;
| int16_t var_28h;
| int16_t var_2ch;
| r0 = arg1;
| r1 = arg2;
| label_23:
0x00005e98 push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00005e9c sub sp, 0x34 |
0x00005e9e str r2, [sp, 8] | var_8h = r2;
0x00005ea0 mov r6, r0 | r6 = r0;
0x00005ea2 ldr.w r2, [pc, 0x4ec] |
0x00005ea6 vmov.i32 d16, 0 | __asm ("vmov.i32 d16, 0");
0x00005eaa ldr.w r3, [pc, 0x4e8] | r3 = *(0x6396);
0x00005eae add r2, pc | r2 = 0xc244;
0x00005eb0 str r1, [sp, 4] | var_4h = r1;
0x00005eb2 vstr d16, [r1] | __asm ("vstr d16, [r1]");
0x00005eb6 ldr r3, [r2, r3] |
0x00005eb8 ldr r3, [r3] | r3 = imp.__aeabi_unwind_cpp_pr0;
0x00005eba str r3, [sp, 0x2c] | var_2ch = r3;
0x00005ebc mov.w r3, 0 | r3 = 0;
0x00005ec0 blx 0x1df8 | vasprintf_chk ();
0x00005ec2 invalid |
0x00005ec6 cmp r6, 0 |
| if (r6 == 0) {
0x00005ec8 beq.w 0x6000 | goto label_7;
| }
0x00005ecc ldrsb.w r7, [r6] | r7 = *(r6);
0x00005ed0 cmp r7, 0 |
| if (r7 == 0) {
0x00005ed2 beq.w 0x6000 | goto label_7;
| }
0x00005ed6 blx 0x1d2c | r0 = getpid ();
0x00005eda ldr r1, [r0] | r1 = *(r0);
0x00005edc uxtb r3, r7 | r3 = (int8_t) r7;
0x00005ede mov sb, r0 | sb = r0;
0x00005ee0 ldrh.w r3, [r1, r3, lsl 1] | offset_0 = r3 << 1;
| r3 = *((r1 + offset_0));
0x00005ee2 adds r0, 0x13 | r0 += 0x13;
0x00005ee4 lsls r0, r3, 0x12 | r0 = r3 << 0x12;
| if (r0 >= r3) {
0x00005ee6 bpl 0x5ef8 | goto label_24;
| }
0x00005ee8 mov r3, r6 | r3 = r6;
| do {
0x00005eea ldrsb r7, [r3, 1]! | r7 = *((r3 += 1));
0x00005eee uxtb r2, r7 | r2 = (int8_t) r7;
0x00005ef0 ldrh.w r2, [r1, r2, lsl 1] | offset_1 = r2 << 1;
| r2 = *((r1 + offset_1));
0x00005ef2 movs r0, 0x12 | r0 = 0x12;
0x00005ef4 lsls r2, r2, 0x12 | r2 <<= 0x12;
0x00005ef6 bmi 0x5eea |
| } while (r2 < r2);
| label_24:
0x00005ef8 cmp r7, 0x2d |
| if (r7 == 0x2d) {
0x00005efa beq.w 0x6000 | goto label_7;
| }
0x00005efe ldr r4, [sp] | r4 = *(sp);
0x00005f00 movs r2, 0 | r2 = 0;
0x00005f02 add r1, sp, 0x28 | r1 += var_28h;
0x00005f04 mov r0, r6 | r0 = r6;
0x00005f06 str r2, [sp, 0x28] | var_28h = r2;
0x00005f08 str r2, [r4] | *(r4) = r2;
0x00005f0a str r1, [sp, 0xc] | var_ch = r1;
0x00005f0c blx 0x1e70 | fprintf_chk ()
0x00005f10 ldr.w r8, [sp, 0x28] | r8 = var_28h;
0x00005f14 mov r3, r0 | r3 = r0;
0x00005f16 mov sl, r1 | sl = r1;
0x00005f18 str r0, [sp, 0x10] | var_10h = r0;
0x00005f1a cmp r8, r6 |
| if (r8 == r6) {
0x00005f1c beq.w 0x60c8 | goto label_25;
| }
0x00005f20 ldr r0, [r4] | r0 = *(r4);
0x00005f22 cmp r0, 0 |
| if (r0 != 0) {
0x00005f24 bne 0x6026 | goto label_26;
| }
| label_1:
0x00005f26 cmp.w r8, 0 |
| if (r8 == 0) {
0x00005f2a beq.w 0x60da | goto label_21;
| }
0x00005f2e ldrsb.w r3, [r8] | r3 = *(r8);
0x00005f32 cmp r3, 0 |
| if (r3 == 0) {
0x00005f34 beq.w 0x60da | goto label_21;
| }
0x00005f38 movs r6, 0 | r6 = 0;
0x00005f3a mov fp, r6 |
0x00005f3c mov r7, r6 | r7 = r6;
| label_0:
0x00005f3e ldrsb.w r3, [r8, 1] | r3 = *((r8 + 1));
0x00005f42 cmp r3, 0x69 |
| if (r3 == 0x69) {
0x00005f44 beq 0x6040 | goto label_27;
| }
0x00005f46 bic r2, r3, 0x20 | r2 = BIT_MASK (r3, 0x20);
0x00005f4a cmp r2, 0x42 |
| if (r2 != 0x42) {
0x00005f4c bne.w 0x60c2 | goto label_28;
| }
0x00005f50 ldrsb.w r3, [r8, 2] | r3 = *((r8 + 2));
0x00005f54 cmp r3, 0 |
| if (r3 == 0) {
0x00005f56 beq.w 0x6364 | goto label_29;
| }
| label_4:
0x00005f5a blx 0x1f34 | r0 = fcn_00001f34 ();
0x00005f5e cmp r0, 0 |
| if (r0 == 0) {
0x00005f60 beq 0x6000 | goto label_7;
| }
0x00005f62 ldr r5, [r0] | r5 = *(r0);
0x00005f64 cmp r5, 0 |
| if (r5 == 0) {
0x00005f66 beq 0x6000 | goto label_7;
| }
0x00005f68 mov r0, r5 | r0 = r5;
0x00005f6a blx 0x1d68 | strchr (r0, r1);
0x00005f6e orrs.w r3, fp, r7 | r3 = fp | r7;
0x00005f72 mov r4, r0 | r4 = r0;
| if (r3 != fp) {
0x00005f74 bne 0x6000 | goto label_7;
| }
0x00005f76 ldrsb.w r3, [r8] | r3 = *(r8);
0x00005f7a cmp r3, 0 |
| if (r3 == 0) {
0x00005f7c beq 0x6000 | goto label_7;
| }
0x00005f7e mov r0, r5 | r0 = r5;
0x00005f80 mov r2, r4 | r2 = r4;
0x00005f82 mov r1, r8 | r1 = r8;
0x00005f84 blx 0x1fe8 | r0 = fcn_00001fe8 ();
0x00005f88 cmp r0, 0 |
| if (r0 != 0) {
0x00005f8a bne 0x6000 | goto label_7;
| }
0x00005f8c ldrsb.w r3, [r8, r4] | r3 = *((r8 + r4));
0x00005f90 add.w r2, r8, r4 | r2 = r8 + r4;
0x00005f92 lsls r4, r0, 8 | r4 = r0 << 8;
0x00005f94 mov r4, r2 | r4 = r2;
0x00005f96 cmp r3, 0x30 |
| if (r3 != 0x30) {
0x00005f98 bne 0x5faa | goto label_30;
| }
| do {
0x00005f9a mov r5, r4 | r5 = r4;
0x00005f9c ldrsb r3, [r4, 1]! | r3 = *((r4 += 1));
0x00005fa0 cmp r3, 0x30 |
0x00005fa2 beq 0x5f9a |
| } while (r3 == 0x30);
0x00005fa4 adds r6, 1 | r6++;
0x00005fa6 subs r6, r6, r2 | r6 -= r2;
0x00005fa8 add r6, r5 | r6 += r5;
| label_30:
0x00005faa ldr.w r2, [sb] | r2 = *(sb);
0x00005fae ldrh.w r3, [r2, r3, lsl 1] | offset_2 = r3 << 1;
| r3 = *((r2 + offset_2));
0x00005fb2 lsls r3, r3, 0x14 | r3 <<= 0x14;
0x00005fb4 itt pl |
| if (r3 < r3) {
0x00005fb6 movpl r8, r4 | r8 = r4;
| }
| if (r3 >= r3) {
0x00005fb8 strpl r4, [sp, 0x28] | var_28h = r4;
| goto label_31;
| }
| if (r3 >= r3) {
| label_31:
0x00005fba bpl 0x5f3e | goto label_0;
| }
0x00005fbc ldr r3, [sp] | r3 = *(sp);
0x00005fbe movs r2, 0 | r2 = 0;
0x00005fc0 ldr r1, [sp, 0xc] | r1 = var_ch;
0x00005fc2 mov r0, r4 | r0 = r4;
0x00005fc4 str r2, [sp, 0x28] | var_28h = r2;
0x00005fc6 str r2, [r3] | *(r3) = r2;
0x00005fc8 blx 0x1e70 | fprintf_chk ()
0x00005fcc ldr.w r8, [sp, 0x28] | r8 = var_28h;
0x00005fd0 mov fp, r0 |
0x00005fd2 ldr r3, [sp] | r3 = *(sp);
0x00005fd4 mov r7, r1 | r7 = r1;
0x00005fd6 cmp r8, r4 |
0x00005fd8 ldr r0, [r3] | r0 = *(r3);
| if (r8 == r4) {
0x00005fda beq.w 0x636a | goto label_32;
| }
0x00005fde cmp r0, 0 |
| if (r0 == 0) {
0x00005fe0 beq 0x60d2 | goto label_33;
| }
0x00005fe2 adds.w r2, fp, -1 | r2 = fp + -1;
0x00005fe6 adc r3, r1, -1 | __asm ("adc r3, r1, -1");
0x00005fea adds r2, 2 | r2 += 2;
0x00005fec sbcs r3, r3, -1 | __asm ("sbcs r3, r3, -1");
| if (r2 >= 2) {
0x00005ff0 bhs 0x6036 | goto label_8;
| }
| label_9:
0x00005ff2 cmp.w r8, 0 |
| if (r8 == 0) {
0x00005ff6 beq 0x6000 | goto label_7;
| }
0x00005ff8 ldrsb.w r3, [r8] | r3 = *(r8);
0x00005ffc cmp r3, 0 |
| if (r3 != 0) {
0x00005ffe bne 0x5f3e | goto label_0;
| }
| label_7:
0x00006000 movs r3, 0x16 | r3 = 0x16;
0x00006002 mvn r0, 0x15 | r0 = ~0x15;
| label_3:
0x00006006 ldr r2, [sp] | r2 = *(sp);
0x00006008 str r3, [r2] | *(r2) = r3;
| label_2:
0x0000600a ldr r2, [pc, 0x38c] |
0x0000600c ldr r3, [pc, 0x384] | r3 = *(0x6394);
0x0000600e add r2, pc | r2 = 0xc3ac;
0x00006010 ldr r3, [r2, r3] | r3 = imp.__aeabi_unwind_cpp_pr0;
0x00006012 ldr r2, [r3] | r2 = imp.__aeabi_unwind_cpp_pr0;
0x00006014 ldr r3, [sp, 0x2c] | r3 = var_2ch;
0x00006016 eors r2, r3 | r2 ^= r3;
0x00006018 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x0000601c bne.w 0x638c | goto label_34;
| }
0x00006020 add sp, 0x34 |
0x00006022 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_26:
0x00006026 subs r2, r3, 1 | r2 = r3 - 1;
0x00006028 adc r3, r1, -1 | __asm ("adc r3, r1, -1");
0x0000602c adds r2, 2 | r2 += 2;
0x0000602e sbcs r3, r3, -1 | __asm ("sbcs r3, r3, -1");
0x00006030 adds r3, 0xff | r3 += 0xff;
| if (r3 <= 0xff) {
0x00006032 blo.w 0x5f26 | goto label_1;
| }
| label_8:
0x00006036 rsbs r0, r0, 0 | r0 -= ;
| label_13:
0x00006038 cmp r0, 0 |
| if (r0 >= 0) {
0x0000603a bge 0x600a | goto label_2;
| }
0x0000603c rsbs r3, r0, 0 | r3 = r0 - ;
0x0000603e b 0x6006 | goto label_3;
| label_27:
0x00006040 ldrsb.w r3, [r8, 2] | r3 = *((r8 + 2));
0x00006044 bic r3, r3, 0x20 | r3 = BIT_MASK (r3, 0x20);
0x00006048 cmp r3, 0x42 |
| if (r3 != 0x42) {
0x0000604a bne 0x5f5a | goto label_4;
| }
0x0000604c ldrsb.w r3, [r8, 3] | r3 = *((r8 + 3));
0x00006050 cmp r3, 0 |
| if (r3 != 0) {
0x00006052 bne 0x5f5a | goto label_4;
| }
| label_6:
0x00006054 mov.w sb, 0x400 | sb = 0x400;
| label_20:
0x00006058 ldr r5, [pc, 0x340] |
0x0000605a ldrsb.w r4, [r8] | r4 = *(r8);
0x0000605e add r5, pc | r5 = 0xc3fe;
0x00006060 mov r1, r4 | r1 = r4;
0x00006062 mov r0, r5 | r0 = r5;
0x00006064 blx 0x1d74 | r0 = setenv (r0, r1, r2);
0x00006068 cmp r0, 0 |
| if (r0 == 0) {
0x0000606a beq 0x60e6 | goto label_35;
| }
0x0000606c subs r1, r0, r5 | r1 = r0 - r5;
0x0000606e add.w ip, r1, 1 |
| label_10:
0x00006072 cmp.w ip, 0 |
| if (ip == 0) {
0x00006076 beq.w 0x6372 | goto label_36;
| }
0x0000607a movs r3, 0 | r3 = 0;
0x0000607c cmp.w sl, 0 |
| if (sl != 0) {
0x00006080 bne 0x60fe | goto label_37;
| }
| label_11:
0x00006082 cmp r3, 0 |
| if (r3 != 0) {
0x00006084 bne 0x611a | goto label_38;
| }
0x00006086 ldr r0, [sp, 0x10] | r0 = var_10h;
0x00006088 subs r3, r1, 1 | r3 = r1 - 1;
0x0000608a mov r2, sl | r2 = sl;
0x0000608c b 0x6094 |
| while (r2 == 0) {
| label_5:
0x0000608e subs r3, 1 | r3--;
0x00006090 cmp r4, 0 |
| if (r4 != 0) {
0x00006092 bne 0x6116 | goto label_39;
| }
0x00006094 mul r4, sb, r2 | r4 = sb * r2;
0x00006098 adds r5, r3, 1 | r5 = r3 + 1;
0x0000609a umull r0, r2, r0, sb | r0:r2 = r0 * sb;
0x0000609e add r2, r4 | r2 += r4;
| if (r5 == r3) {
0x000060a0 beq.w 0x635c | goto label_40;
| }
0x000060a4 movs r4, 0 | r4 = 0;
0x000060a6 cmp r2, 0 |
0x000060a8 beq 0x608e |
| }
0x000060aa umull r4, lr, r0, sb | r4:lr = r0 * sb;
0x000060ae umull r5, r4, sb, r2 | r5:r4 = sb * r2;
0x000060b2 adds.w r5, r5, lr | r5 += lr;
0x000060b6 adc r4, r4, 0 | __asm ("adc r4, r4, 0");
0x000060ba subs r4, 0 |
0x000060bc it ne |
| if (r4 == 0) {
0x000060be movne r4, 1 | r4 = 1;
| }
0x000060c0 b 0x608e | goto label_5;
| label_28:
0x000060c2 cmp r3, 0 |
| if (r3 == 0) {
0x000060c4 beq 0x6054 | goto label_6;
| }
0x000060c6 b 0x5f5a | goto label_4;
| label_25:
0x000060c8 ldr r3, [sp] | r3 = *(sp);
0x000060ca ldr r0, [r3] | r0 = *(r3);
0x000060cc cmp r0, 0 |
| if (r0 == 0) {
0x000060ce beq 0x6000 | goto label_7;
| }
0x000060d0 b 0x6036 | goto label_8;
| label_33:
0x000060d2 orrs.w r3, fp, r1 | r3 = fp | r1;
| if (r3 != fp) {
0x000060d6 bne 0x5ff2 | goto label_9;
| }
0x000060d8 b 0x5f3e | goto label_0;
| label_21:
0x000060da ldr r3, [sp, 4] | r3 = var_4h;
0x000060dc movs r0, 0 | r0 = 0;
0x000060de ldr r2, [sp, 0x10] | r2 = var_10h;
0x000060e0 strd r2, sl, [r3] | __asm ("strd r2, sl, [r3]");
0x000060e4 b 0x600a | goto label_2;
| label_35:
0x000060e6 mov r1, r4 | r1 = r4;
0x000060e8 ldr r4, [pc, 0x2b4] |
0x000060ea add r4, pc | r4 = 0xc48e;
0x000060ec mov r0, r4 | r0 = r4;
0x000060ee blx 0x1d74 | r0 = setenv (r0, r1, r2);
0x000060f2 cmp r0, 0 |
| if (r0 == 0) {
0x000060f4 beq 0x6000 | goto label_7;
| }
0x000060f6 subs r1, r0, r4 | r1 = r0 - r4;
0x000060f8 add.w ip, r1, 1 |
0x000060fc b 0x6072 | goto label_10;
| label_37:
0x000060fe ldr r3, [sp, 0x10] | r3 = var_10h;
0x00006100 umull r3, r0, r3, sb | r3:r0 = r3 * sb;
0x00006104 umull r2, r3, sb, sl | r2:r3 = sb * sl;
0x00006108 adds r2, r2, r0 | r2 += r0;
0x0000610a adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x0000610e subs r3, 0 |
0x00006110 it ne |
| if (r3 == 0) {
0x00006112 movne r3, 1 | r3 = 1;
| }
0x00006114 b 0x6082 | goto label_11;
| label_39:
0x00006116 mov sl, r2 | sl = r2;
0x00006118 str r0, [sp, 0x10] | var_10h = r0;
| label_38:
0x0000611a mvn r0, 0x21 | r0 = ~0x21;
| label_19:
0x0000611e ldr r3, [sp, 8] | r3 = var_8h;
| if (r3 != 0) {
0x00006120 cbz r3, 0x6126 |
0x00006122 str.w ip, [r3] | __asm ("str.w ip, [r3]");
| }
0x00006126 orrs.w r3, fp, r7 | r3 = fp | r7;
| if (r3 == fp) {
0x0000612a beq 0x616a | goto label_22;
| }
0x0000612c subs r1, 1 | r1--;
0x0000612e movs r2, 1 | r2 = 1;
0x00006130 movs r3, 0 | r3 = 0;
0x00006132 b 0x6138 |
| while (r3 == 0) {
| label_12:
0x00006134 subs r1, 1 | r1--;
| if (r4 != 0) {
0x00006136 cbnz r4, 0x6174 | goto label_41;
| }
0x00006138 mul r4, sb, r3 | r4 = sb * r3;
0x0000613c umull r2, r3, r2, sb | r2:r3 = r2 * sb;
0x00006140 add r3, r4 | r3 += r4;
0x00006142 adds r4, r1, 1 | r4 = r1 + 1;
| if (r4 == r1) {
0x00006144 beq 0x6174 | goto label_41;
| }
0x00006146 movs r4, 0 | r4 = 0;
0x00006148 cmp r3, 0 |
0x0000614a beq 0x6134 |
| }
0x0000614c umull r4, ip, r2, sb | r4:ip = r2 * sb;
0x00006150 umull r5, r4, sb, r3 | r5:r4 = sb * r3;
0x00006154 adds.w r5, r5, ip | r5 += ip;
0x00006158 adc r4, r4, 0 | __asm ("adc r4, r4, 0");
0x0000615c subs r4, 0 |
0x0000615e it ne |
| if (r4 == 0) {
0x00006160 movne r4, 1 | r4 = 1;
| }
0x00006162 b 0x6134 | goto label_12;
| label_17:
0x00006164 ldr r0, [sp, 0x24] | r0 = var_24h;
0x00006166 ldr.w sl, [sp, 0x18] | sl = var_18h;
| label_22:
0x0000616a ldr r3, [sp, 4] | r3 = var_4h;
0x0000616c ldr r2, [sp, 0x10] | r2 = var_10h;
0x0000616e strd r2, sl, [r3] | __asm ("strd r2, sl, [r3]");
0x00006172 b 0x6038 | goto label_13;
| label_41:
0x00006174 cmp.w fp, 0xb |
0x00006178 strd r2, r3, [sp, 0x1c] | __asm ("strd r2, r3, [sp, 0x1c]");
0x0000617c sbcs r3, r7, 0 | __asm ("sbcs r3, r7, 0");
| if (fp <= 0xb) {
0x00006180 blo.w 0x6382 | goto label_42;
| }
0x00006184 movs r1, 0x13 | r1 = 0x13;
0x00006186 movs r3, 0xa | r3 = 0xa;
0x00006188 mov.w r8, 0 | r8 = 0;
| label_15:
0x0000618c subs r1, 1 | r1--;
| if (r1 != 1) {
0x0000618e bne 0x6254 | goto label_43;
| }
0x00006190 movw r1, 0xcccd |
0x00006194 str r3, [sp, 0xc] | var_ch = r3;
0x00006196 adds.w r3, fp, r7 | r3 = fp + r7;
0x0000619a movt r1, 0xcccc | r1 = 0xcccccccd;
0x0000619e adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x000061a2 mov.w r2, -0x33333334 | r2 = -0x33333334;
0x000061a6 umull ip, lr, r1, r3 | ip:lr = r1 * r3;
0x000061aa bic ip, lr, 3 | ip = BIT_MASK (lr, 3);
0x000061ae add.w ip, ip, lr, lsr 2 |
0x000061b2 sub.w r3, r3, ip | r3 -= ip;
0x000061b6 subs.w r3, fp, r3 | r3 = fp - r3;
0x000061ba mul r2, r3, r2 | r2 = r3 * r2;
0x000061be sbc r7, r7, 0 | __asm ("sbc r7, r7, 0");
0x000061c2 mla r2, r1, r7, r2 | __asm ("mla r2, r1, r7, r2");
0x000061c6 umull r3, r1, r3, r1 | r3:r1 = r3 * r1;
0x000061ca lsrs r3, r3, 1 | r3 >>= 1;
0x000061cc add r2, r1 | r2 += r1;
0x000061ce lsrs r7, r2, 1 | r7 = r2 >> 1;
0x000061d0 orr.w fp, r3, r2, lsl 31 |
| label_16:
0x000061d4 cmp r6, 0 |
| if (r6 == 0) {
0x000061d6 beq 0x627a | goto label_44;
| }
0x000061d8 movw sb, 0x9999 |
0x000061dc movw lr, 0xcccd |
0x000061e0 ldr r1, [sp, 0xc] | r1 = var_ch;
0x000061e2 movt sb, 0x1999 | sb = 0x19999999;
0x000061e6 movt lr, 0xcccc | lr = 0xcccccccd;
0x000061ea movs r2, 0 | r2 = 0;
0x000061ec mov.w r5, -0x66666667 | r5 = -0x66666667;
0x000061f0 mov.w r4, -0x33333334 | r4 = -0x33333334;
0x000061f4 str r0, [sp, 8] | var_8h = r0;
0x000061f6 b 0x6232 |
| while (r5 <= r1) {
0x000061f8 adds.w r3, fp, r7 | r3 = fp + r7;
0x000061fc adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x00006200 umull r0, ip, lr, r3 | r0:ip = lr * r3;
0x00006204 bic r0, ip, 3 | r0 = BIT_MASK (ip, 3);
0x00006208 add.w r0, r0, ip, lsr 2 | r0 += (ip >> 2);
0x0000620c subs r3, r3, r0 | r3 -= r0;
0x0000620e subs.w r3, fp, r3 | r3 = fp - r3;
0x00006212 mul r0, r4, r3 | r0 = r4 * r3;
0x00006216 sbc r7, r7, 0 | __asm ("sbc r7, r7, 0");
0x0000621a mla r0, lr, r7, r0 | __asm ("mla r0, lr, r7, r0");
0x0000621e umull r3, r7, r3, lr | r3:r7 = r3 * lr;
0x00006222 lsrs r3, r3, 1 | r3 >>= 1;
0x00006224 add r0, r7 | r0 += r7;
0x00006226 lsrs r7, r0, 1 | r7 = r0 >> 1;
0x00006228 orr.w fp, r3, r0, lsl 31 |
| label_14:
0x0000622c adds r2, 1 | r2++;
0x0000622e cmp r2, r6 |
| if (r2 == r6) {
0x00006230 beq 0x6276 | goto label_45;
| }
0x00006232 cmp r5, r1 |
0x00006234 sbcs.w r3, sb, r8 | __asm ("sbcs.w r3, sb, r8");
0x00006238 blo 0x61f8 |
| }
0x0000623a lsl.w r0, r8, 2 | r0 = r8 << 2;
0x0000623e lsls r3, r1, 2 | r3 = r1 << 2;
0x00006240 orr.w r0, r0, r1, lsr 30 | r0 |= (r1 >> 30);
0x00006244 adds r3, r3, r1 | r3 += r1;
0x00006246 adc.w r0, r8, r0 | __asm ("adc.w r0, r8, r0");
0x0000624a adds r3, r3, r3 | r3 += r3;
0x0000624c adcs r0, r0 | __asm ("adcs r0, r0");
0x0000624e mov r1, r3 | r1 = r3;
0x00006250 mov r8, r0 | r8 = r0;
0x00006252 b 0x622c | goto label_14;
| label_43:
0x00006254 lsl.w r2, r8, 2 | r2 = r8 << 2;
0x00006258 lsls r4, r3, 2 | r4 = r3 << 2;
0x0000625a orr.w r2, r2, r3, lsr 30 | r2 |= (r3 >> 30);
0x0000625e adds r3, r4, r3 | r3 = r4 + r3;
0x00006260 adc.w r8, r8, r2 | __asm ("adc.w r8, r8, r2");
0x00006264 adds r3, r3, r3 | r3 += r3;
0x00006266 adc.w r8, r8, r8 | __asm ("adc.w r8, r8, r8");
0x0000626a cmp r3, fp |
0x0000626c sbcs.w r2, r8, r7 | __asm ("sbcs.w r2, r8, r7");
| if (r3 <= fp) {
0x00006270 blo 0x618c | goto label_15;
| }
0x00006272 str r3, [sp, 0xc] | var_ch = r3;
0x00006274 b 0x61d4 | goto label_16;
| label_45:
0x00006276 ldr r0, [sp, 8] | r0 = var_8h;
0x00006278 str r1, [sp, 0xc] | var_ch = r1;
| label_44:
0x0000627a movw r6, 0xcccd |
0x0000627e movs r3, 0 | r3 = 0;
0x00006280 str.w r8, [sp, 0x14] | __asm ("str.w r8, [var_14h]");
0x00006284 movt r6, 0xcccc | r6 = 0xcccccccd;
0x00006288 mov.w sb, 1 | sb = 1;
0x0000628c mov r8, r3 | r8 = r3;
0x0000628e str r0, [sp, 0x24] | var_24h = r0;
0x00006290 str.w sl, [sp, 0x18] | __asm ("str.w sl, [var_18h]");
0x00006294 b 0x62a4 | goto label_46;
| label_18:
0x00006296 ldr r3, [sp, 8] | r3 = var_8h;
0x00006298 cmp.w sl, 0xa |
0x0000629c sbcs r3, r3, 0 | __asm ("sbcs r3, r3, 0");
| if (sl <= 0xa) {
0x000062a0 blo.w 0x6164 | goto label_17;
| }
| label_46:
0x000062a4 adds.w r4, fp, r7 | r4 = fp + r7;
0x000062a8 str r7, [sp, 8] | var_8h = r7;
0x000062aa adc r4, r4, 0 | __asm ("adc r4, r4, 0");
0x000062ae mov sl, fp | sl = fp;
0x000062b0 umull r3, r5, r6, r4 | r3:r5 = r6 * r4;
0x000062b4 mov r2, sb | r2 = sb;
0x000062b6 mov r3, r8 | r3 = r8;
0x000062b8 ldr r0, [sp, 0xc] | r0 = var_ch;
0x000062ba ldr r1, [sp, 0x14] | r1 = var_14h;
0x000062bc bic ip, r5, 3 | ip = BIT_MASK (r5, 3);
0x000062c0 add.w ip, ip, r5, lsr 2 |
0x000062c4 sub.w ip, r4, ip |
0x000062c8 subs.w r4, fp, ip | r4 = fp - ip;
0x000062cc sbc r5, r7, 0 | __asm ("sbc r5, r7, 0");
0x000062d0 mov.w r7, -0x33333334 | r7 = -0x33333334;
0x000062d4 mul r7, r7, r4 | r7 *= r4;
0x000062d8 umull fp, r4, r4, r6 | fp:r4 = r4 * r6;
0x000062dc mla r7, r6, r5, r7 | __asm ("mla r7, r6, r5, r7");
0x000062e0 movs r5, 5 | r5 = 5;
0x000062e2 add r7, r4 | r7 += r4;
0x000062e4 and r4, fp, 1 | r4 = fp & 1;
0x000062e8 umull r4, r5, r4, r5 | r4:r5 = r4 * r5;
0x000062ec lsr.w fp, fp, 1 |
0x000062f0 orr.w fp, fp, r7, lsl 31 |
0x000062f4 lsrs r7, r7, 1 | r7 >>= 1;
0x000062f6 adds.w r4, r4, ip | r4 += ip;
0x000062fa adc r5, r5, 0 | __asm ("adc r5, r5, 0");
0x000062fe bl 0x7d68 | fcn_00007d68 (r0, r1, r2, r3);
0x00006302 lsl.w r2, r8, 2 | r2 = r8 << 2;
0x00006306 lsl.w r3, sb, 2 | r3 = sb << 2;
0x0000630a orr.w r2, r2, sb, lsr 30 | r2 |= (sb >> 30);
0x0000630e adds.w r3, r3, sb | r3 += sb;
0x00006312 adc.w r2, r8, r2 | __asm ("adc.w r2, r8, r2");
0x00006316 adds r3, r3, r3 | r3 += r3;
0x00006318 adcs r2, r2 | __asm ("adcs r2, r2");
0x0000631a cmp r0, r4 |
0x0000631c sbcs.w ip, r1, r5 | __asm ("sbcs.w ip, r1, r5");
0x00006320 mov sb, r3 | sb = r3;
0x00006322 ite hs |
| if (r0 < r4) {
0x00006324 movhs r3, 1 | r3 = 1;
| }
| if (r0 >= r4) {
0x00006326 movlo r3, 0 | r3 = 0;
| }
0x00006328 cmp r4, 0 |
0x0000632a ite eq |
| if (r4 != 0) {
0x0000632c moveq r3, 0 | r3 = 0;
| }
| if (r4 == 0) {
0x0000632e andne r3, r3, 1 | r3 &= 1;
| }
0x00006332 mov r8, r2 | r8 = r2;
0x00006334 cmp r3, 0 |
| if (r3 == 0) {
0x00006336 beq 0x6296 | goto label_18;
| }
0x00006338 mov r2, r4 | r2 = r4;
0x0000633a mov r3, r5 | r3 = r5;
0x0000633c bl 0x7d68 | fcn_00007d68 (r0, r1, r2, r3);
0x00006340 mov r3, r1 | r3 = r1;
0x00006342 mov r2, r0 | r2 = r0;
0x00006344 ldrd r0, r1, [sp, 0x1c] | __asm ("ldrd r0, r1, [var_1ch]");
0x00006348 bl 0x7d68 | fcn_00007d68 (r0, r1, r2, r3);
0x0000634c ldr r3, [sp, 0x10] | r3 = var_10h;
0x0000634e adds r0, r0, r3 | r0 += r3;
0x00006350 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00006352 str r0, [sp, 0x10] | var_10h = r0;
0x00006354 adc.w r3, r3, r1 | __asm ("adc.w r3, r3, r1");
0x00006358 str r3, [sp, 0x18] | var_18h = r3;
0x0000635a b 0x6296 | goto label_18;
| label_40:
0x0000635c str r0, [sp, 0x10] | var_10h = r0;
0x0000635e mov sl, r2 | sl = r2;
0x00006360 movs r0, 0 | r0 = 0;
0x00006362 b 0x611e | goto label_19;
| label_29:
0x00006364 mov.w sb, 0x3e8 | sb = 0x3e8;
0x00006368 b 0x6058 | goto label_20;
| label_32:
0x0000636a cmp r0, 0 |
| if (r0 == 0) {
0x0000636c beq.w 0x6000 | goto label_7;
| }
0x00006370 b 0x6036 | goto label_8;
| label_36:
0x00006372 ldr r3, [sp, 8] | r3 = var_8h;
0x00006374 cmp r3, 0 |
| if (r3 == 0) {
0x00006376 beq.w 0x60da | goto label_21;
| }
0x0000637a mov r0, ip | r0 = ip;
0x0000637c str.w ip, [r3] | __asm ("str.w ip, [r3]");
0x00006380 b 0x616a | goto label_22;
| label_42:
0x00006382 movs r3, 0xa | r3 = 0xa;
0x00006384 mov.w r8, 0 | r8 = 0;
0x00006388 str r3, [sp, 0xc] | var_ch = r3;
0x0000638a b 0x61d4 | goto label_16;
| label_34:
0x0000638c blx 0x1bac | cfgetispeed ();
0x00006390 ldr r6, [pc, 0x3f8] | r6 = *(0x678c);
0x00006392 movs r0, r0 |
0x00006394 lsls r0, r4, 8 | r0 = r4 << 8;
0x00006396 movs r0, r0 |
0x00006398 ldr r5, [pc, 0x278] | r5 = *(0x6614);
0x0000639a movs r0, r0 |
0x0000639c adds r4, 0x5e | r4 += 0x5e;
0x0000639e movs r0, r0 |
0x000063a0 adds r3, 0xde | r3 += 0xde;
0x000063a2 movs r0, r0 |
0x000063a4 movs r2, 0 | r2 = 0;
0x000063a6 b.w 0x5e98 | goto label_23;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-80367616.squashfs_v4_le_extract/usr/sbin/agetty @ 0x6588 */
| #include <stdint.h>
|
; (fcn) fcn.00006588 () | void fcn_00006588 (int16_t arg1, int16_t arg2, int16_t arg3) {
| int16_t var_0h_2;
| int16_t var_4h_2;
| int16_t var_0h_3;
| int16_t var_ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00006588 push.w {r4, r5, r6, r7, r8, sb, lr} |
0x0000658c mov.w sb, 0 | sb = 0;
0x00006590 ldr r4, [pc, 0x94] |
0x00006592 sub sp, 0xc |
0x00006594 mov r8, r1 | r8 = r1;
0x00006596 mov r7, r2 | r7 = r2;
0x00006598 ldr r3, [pc, 0x90] | r3 = *(0x662c);
0x0000659a add r4, pc | r4 = 0xcbc6;
0x0000659c ldr r3, [r4, r3] |
0x0000659e mov r4, r0 | r4 = r0;
0x000065a0 ldr r3, [r3] | r3 = imp.__aeabi_unwind_cpp_pr0;
0x000065a2 str r3, [sp, 4] | var_4h_2 = r3;
0x000065a4 mov.w r3, 0 | r3 = 0;
0x000065a8 str.w sb, [sp] | __asm ("str.w sb, [sp]");
0x000065ac blx 0x1df8 | r0 = vasprintf_chk ();
0x000065b0 str.w sb, [r0] | __asm ("str.w sb, [r0]");
| if (r4 == 0) {
0x000065b4 cbz r4, 0x65d4 | goto label_0;
| }
0x000065b6 ldrsb.w r3, [r4] | r3 = *(r4);
| if (r3 == 0) {
0x000065ba cbz r3, 0x65d4 | goto label_0;
| }
0x000065bc mov r6, sp | r6 = sp;
0x000065be mov r5, r0 | r5 = r0;
0x000065c0 mov r2, r7 | r2 = r7;
0x000065c2 mov r1, r6 | r1 = r6;
0x000065c4 mov r0, r4 | r0 = r4;
0x000065c6 blx 0x1e94 | fclose (r0);
0x000065ca cmp r1, 0 |
0x000065cc itt lt |
| if (r1 >= 0) {
0x000065ce movlt r3, 0x22 | r3 = 0x22;
| }
| if (r1 >= 0) {
0x000065d0 strlt r3, [r5] | *(r5) = r3;
| }
0x000065d2 bge 0x65f2 |
| while (r0 != 0) {
| label_0:
0x000065d4 mvn r0, 0x15 | r0 = ~0x15;
| label_1:
0x000065d8 ldr r2, [pc, 0x54] |
0x000065da ldr r3, [pc, 0x50] | r3 = *(0x662e);
0x000065dc add r2, pc | r2 = 0xcc10;
0x000065de ldr r3, [r2, r3] | r3 = imp.__aeabi_unwind_cpp_pr0;
0x000065e0 ldr r2, [r3] | r2 = imp.__aeabi_unwind_cpp_pr0;
0x000065e2 ldr r3, [sp, 4] | r3 = var_4h_2;
0x000065e4 eors r2, r3 | r2 ^= r3;
0x000065e6 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x000065ea bne 0x6622 | goto label_2;
| }
0x000065ec add sp, 0xc |
0x000065ee pop.w {r4, r5, r6, r7, r8, sb, pc} |
0x000065f2 mov r2, r7 | r2 = r7;
0x000065f4 mov r1, r6 | r1 = r6;
0x000065f6 mov r0, r4 | r0 = r4;
0x000065f8 str.w sb, [r5] | __asm ("str.w sb, [r5]");
0x000065fc blx 0x1e70 | r0 = fprintf_chk ()
0x00006600 mov r2, r0 | r2 = r0;
0x00006602 ldr r0, [r5] | r0 = *(r5);
0x00006604 mov r3, r1 | r3 = r1;
0x00006606 strd r2, r3, [r8] | __asm ("strd r2, r3, [r8]");
0x0000660a cmp r0, 0 |
0x0000660c bne 0x65d4 |
| }
0x0000660e ldr r3, [sp] | r3 = *(sp);
0x00006610 cmp r3, r4 |
| if (r3 == r4) {
0x00006612 beq 0x65d4 | goto label_0;
| }
0x00006614 cmp r3, 0 |
| if (r3 == 0) {
0x00006616 beq 0x65d8 | goto label_1;
| }
0x00006618 ldrsb.w r3, [r3] | r3 = *(r3);
0x0000661c cmp r3, 0 |
| if (r3 == 0) {
0x0000661e beq 0x65d8 | goto label_1;
| }
0x00006620 b 0x65d4 | goto label_0;
| label_2:
0x00006622 blx 0x1bac | cfgetispeed ();
0x00006626 nop |
0x00006628 ldr r0, [pc, 0x48] | r0 = *(0x6674);
0x0000662a movs r0, r0 |
0x0000662c lsls r0, r4, 8 | r0 = r4 << 8;
0x0000662e movs r0, r0 |
0x00006630 blx sl | r0 = sl (r0);
0x00006632 movs r0, r0 |
0x00006634 ldr.w ip, [pc, 0x68] |
0x00006638 ldr r3, [pc, 0x68] | r3 = *(0x66a4);
0x0000663a push {r4, lr} |
0x0000663c sub sp, 0x10 |
0x0000663e add ip, pc | ip = 0xcce2;
0x00006640 mov r4, r1 | r4 = r1;
0x00006642 mov r1, sp | r1 = sp;
0x00006644 ldr.w r3, [ip, r3] |
0x00006648 ldr r3, [r3] | r3 = imp.__aeabi_unwind_cpp_pr0;
0x0000664a str r3, [sp, 0xc] | var_ch = r3;
0x0000664c mov.w r3, 0 | r3 = 0;
0x00006650 bl 0x6504 | r0 = fcn_00006504 (r0, r1, r2);
| if (r0 != 0) {
0x00006654 cbnz r0, 0x6672 | goto label_3;
| }
0x00006656 ldrd r2, r3, [sp] | __asm ("ldrd r2, r3, [sp]");
0x0000665a mov.w ip, -1 |
0x0000665e adds.w r1, r2, -0x80000000 | r1 = r2 + -0x80000000;
0x00006662 adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x00006666 cmp ip, r1 |
0x00006668 sbcs.w r3, r0, r3 | __asm ("sbcs.w r3, r0, r3");
0x0000666c it hs |
| if (ip < r1) {
0x0000666e strhs r2, [r4] | *(r4) = r2;
| }
0x00006670 blo 0x668a |
| while (1) {
| label_3:
0x00006672 ldr r2, [pc, 0x34] |
0x00006674 ldr r3, [pc, 0x2c] | r3 = *(0x66a4);
0x00006676 add r2, pc | r2 = 0xcd24;
0x00006678 ldr r3, [r2, r3] | r3 = imp.__aeabi_unwind_cpp_pr0;
0x0000667a ldr r2, [r3] | r2 = imp.__aeabi_unwind_cpp_pr0;
0x0000667c ldr r3, [sp, 0xc] | r3 = var_ch;
0x0000667e eors r2, r3 | r2 ^= r3;
0x00006680 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x00006684 bne 0x669a | goto label_4;
| }
0x00006686 add sp, 0x10 |
0x00006688 pop {r4, pc} |
0x0000668a blx 0x1df8 | vasprintf_chk ();
0x0000668e movs r2, 0x22 | r2 = 0x22;
0x00006690 mov r3, r0 | r3 = r0;
0x00006692 str r2, [r3] | *(r3) = r2;
0x00006694 mvn r0, 0x21 | r0 = ~0x21;
0x00006698 b 0x6672 |
| }
| label_4:
0x0000669a blx 0x1bac | cfgetispeed ();
0x0000669e nop |
0x000066a0 bx sp | return uint32_t (*sp)() ();
| }
[*] Function fprintf used 4 times agetty