[*] Binary protection state of libffi.so.8.1.0
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols
[*] Function printf tear down of libffi.so.8.1.0
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libffi.so.8.1.0 @ 0x47f0 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000047f0 () | void fcn_000047f0 (int16_t arg_1ch, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_4h;
| int16_t var_0h_2;
| int16_t var_0h;
| int32_t var_sp_4h;
| int32_t var_ch;
| int32_t var_14h;
| int32_t var_3ch;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x000047f0 svcmi 0xf0e92d | __asm ("svcmi 0xf0e92d");
0x000047f4 sub sp, 0x44 |
0x000047f6 add r7, sp, 0 | r7 += var_0h;
0x000047f8 mov fp, r3 |
0x000047fa mov r6, r0 | r6 = r0;
0x000047fc str r1, [r7, 0xc] | var_ch = r1;
0x000047fe ldr.w r1, [pc, 0x484] | r1 = *(0x00004c84);
0x00004802 ldr.w r3, [pc, 0x484] |
0x00004806 ldr r4, [r7, 0x68] | r4 = *((r7 + 0x68));
0x00004808 add r1, pc | r1 += pc;
0x0000480a ldr r0, [r0, 0x14] | r0 = *((r0 + 0x14));
0x0000480c ldr r3, [r1, r3] | r3 = *((r1 + r3));
0x0000480e ldr r5, [r6, 0x10] | r5 = *((r6 + 0x10));
0x00004810 ldr r3, [r3] | r3 = *(0x4c8a);
0x00004812 str r3, [r7, 0x3c] | var_3ch = r3;
0x00004814 mov.w r3, 0 | r3 = 0;
0x00004818 ldr r3, [r6, 0xc] | r3 = *((r6 + 0xc));
0x0000481a str r2, [r7, 0x14] | var_14h = r2;
0x0000481c str r3, [r7, 4] | var_sp_4h = r3;
0x0000481e ldr r3, [r6] | r3 = *(r6);
0x00004820 cmp r2, 0 |
| if (r2 == 0) {
0x00004822 beq.w 0x4a66 | goto label_16;
| }
0x00004826 cmp r0, 2 |
| if (r0 == 2) {
0x00004828 beq.w 0x4a32 | goto label_17;
| }
0x0000482c cmp r0, 4 |
| if (r0 == 4) {
0x0000482e beq.w 0x4c3a | goto label_18;
| }
| label_1:
0x00004832 cmp r3, 2 |
| if (r3 == 2) {
0x00004834 beq.w 0x4a9e | goto label_19;
| }
| label_5:
0x00004838 add.w r3, r5, 0x1b | r3 = r5 + 0x1b;
0x0000483c bic r3, r3, 7 | r3 = BIT_MASK (r3, 7);
0x00004840 sub.w sp, sp, r3 |
0x00004844 mov sb, sp | sb = sp;
0x00004846 add r5, sb | r5 += sb;
| label_3:
0x00004848 ldr r3, [r7, 0x14] | r3 = *((r7 + 0x14));
0x0000484a str r4, [r5, 0x10] | *((r5 + 0x10)) = r4;
0x0000484c strd r3, r0, [r5, 8] | __asm ("strd r3, r0, [r5, 8]");
0x00004850 str r3, [r7, 0x1c] | *((r7 + 0x1c)) = r3;
0x00004852 movs r3, 0 | r3 = 0;
0x00004854 str r3, [r7, 0x10] | *((r7 + 0x10)) = r3;
| label_0:
0x00004856 ldrd r8, r3, [r6, 4] | __asm ("ldrd r8, r3, [r6, 4]");
0x0000485a cmp r0, 6 |
0x0000485c mov r0, sb | r0 = sb;
0x0000485e str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x00004860 itt eq |
| if (r0 != 6) {
0x00004862 ldreq r3, [r7, 0x1c] | r3 = *((r7 + 0x1c));
| }
| if (r0 != 6) {
0x00004864 streq r3, [r0], 4 | *(r0) = r3;
| r0 += 4;
| }
0x00004868 cmp.w r8, 0 |
| if (r8 <= 0) {
0x0000486c ble.w 0x4a04 | goto label_20;
| }
0x00004870 cmp.w r8, 8 |
0x00004874 sub.w r3, r8, 7 | r3 = r8 - 7;
0x00004878 str r3, [r7, 0x30] | *((r7 + 0x30)) = r3;
| if (r8 <= 8) {
0x0000487a ble.w 0x4c7a | goto label_21;
| }
0x0000487e ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x00004880 add.w sl, fp, 0x1c | sl += arg_1ch;
0x00004884 movs r4, 0 | r4 = 0;
0x00004886 str r5, [r7, 0x2c] | *((r7 + 0x2c)) = r5;
0x00004888 add.w r6, r3, 0x1c | r6 = r3 + 0x1c;
| do {
0x0000488c add.w ip, r0, -1 |
0x00004890 ldr r0, [r6, -0x1c] | r0 = *((r6 - 0x1c));
0x00004894 ldr r2, [sl, -0x1c] | r2 = *((sl - 0x1c));
0x00004898 pld [r6] | __asm ("pld [r6]");
0x0000489c ldrh r1, [r0, 4] | r1 = *((r0 + 4));
0x0000489e pld [sl] | __asm ("pld [sl]");
0x000048a2 cmp r1, 4 |
0x000048a4 it lo |
| if (r1 >= 4) {
0x000048a6 movlo r1, 4 | r1 = 4;
| }
0x000048a8 subs r3, r1, 1 | r3 = r1 - 1;
0x000048aa ldrh r1, [r0, 6] | r1 = *((r0 + 6));
0x000048ac orr.w r3, r3, ip | r3 |= ip;
0x000048b0 ldr r0, [r0] | r0 = *(r0);
0x000048b2 adds r5, r3, 1 | r5 = r3 + 1;
0x000048b4 mov r3, r5 | r3 = r5;
0x000048b6 bl 0x42d8 | r0 = fcn_000042d8 (r0, r1, r2, r3);
0x000048ba adds r3, r5, r0 | r3 = r5 + r0;
0x000048bc ldr r0, [r6, -0x18] | r0 = *((r6 - 0x18));
0x000048c0 subs r1, r3, 1 | r1 = r3 - 1;
0x000048c2 ldr r2, [sl, -0x18] | r2 = *((sl - 0x18));
0x000048c6 ldrh r3, [r0, 4] | r3 = *((r0 + 4));
0x000048c8 cmp r3, 4 |
0x000048ca it lo |
| if (r3 >= 4) {
0x000048cc movlo r3, 4 | r3 = 4;
| }
0x000048ce subs r3, 1 | r3--;
0x000048d0 orrs r3, r1 | r3 |= r1;
0x000048d2 ldrh r1, [r0, 6] | r1 = *((r0 + 6));
0x000048d4 adds r5, r3, 1 | r5 = r3 + 1;
0x000048d6 ldr r0, [r0] | r0 = *(r0);
0x000048d8 mov r3, r5 | r3 = r5;
0x000048da bl 0x42d8 | r0 = fcn_000042d8 (r0, r1, r2, r3);
0x000048de adds r3, r5, r0 | r3 = r5 + r0;
0x000048e0 ldr r0, [r6, -0x14] | r0 = *((r6 - 0x14));
0x000048e4 subs r1, r3, 1 | r1 = r3 - 1;
0x000048e6 ldr r2, [sl, -0x14] | r2 = *((sl - 0x14));
0x000048ea ldrh r3, [r0, 4] | r3 = *((r0 + 4));
0x000048ec cmp r3, 4 |
0x000048ee it lo |
| if (r3 >= 4) {
0x000048f0 movlo r3, 4 | r3 = 4;
| }
0x000048f2 subs r3, 1 | r3--;
0x000048f4 orrs r3, r1 | r3 |= r1;
0x000048f6 ldrh r1, [r0, 6] | r1 = *((r0 + 6));
0x000048f8 adds r5, r3, 1 | r5 = r3 + 1;
0x000048fa ldr r0, [r0] | r0 = *(r0);
0x000048fc mov r3, r5 | r3 = r5;
0x000048fe bl 0x42d8 | r0 = fcn_000042d8 (r0, r1, r2, r3);
0x00004902 adds r3, r5, r0 | r3 = r5 + r0;
0x00004904 ldr r0, [r6, -0x10] | r0 = *((r6 - 0x10));
0x00004908 subs r1, r3, 1 | r1 = r3 - 1;
0x0000490a ldr r2, [sl, -0x10] | r2 = *((sl - 0x10));
0x0000490e ldrh r3, [r0, 4] | r3 = *((r0 + 4));
0x00004910 cmp r3, 4 |
0x00004912 it lo |
| if (r3 >= 4) {
0x00004914 movlo r3, 4 | r3 = 4;
| }
0x00004916 subs r3, 1 | r3--;
0x00004918 orrs r3, r1 | r3 |= r1;
0x0000491a ldrh r1, [r0, 6] | r1 = *((r0 + 6));
0x0000491c adds r5, r3, 1 | r5 = r3 + 1;
0x0000491e ldr r0, [r0] | r0 = *(r0);
0x00004920 mov r3, r5 | r3 = r5;
0x00004922 bl 0x42d8 | r0 = fcn_000042d8 (r0, r1, r2, r3);
0x00004926 adds r3, r5, r0 | r3 = r5 + r0;
0x00004928 ldr r0, [r6, -0xc] | r0 = *((r6 - 0xc));
0x0000492c subs r1, r3, 1 | r1 = r3 - 1;
0x0000492e ldr r2, [sl, -0xc] | r2 = *((sl - 0xc));
0x00004932 ldrh r3, [r0, 4] | r3 = *((r0 + 4));
0x00004934 cmp r3, 4 |
0x00004936 it lo |
| if (r3 >= 4) {
0x00004938 movlo r3, 4 | r3 = 4;
| }
0x0000493a subs r3, 1 | r3--;
0x0000493c orrs r3, r1 | r3 |= r1;
0x0000493e ldrh r1, [r0, 6] | r1 = *((r0 + 6));
0x00004940 adds r5, r3, 1 | r5 = r3 + 1;
0x00004942 ldr r0, [r0] | r0 = *(r0);
0x00004944 mov r3, r5 | r3 = r5;
0x00004946 bl 0x42d8 | r0 = fcn_000042d8 (r0, r1, r2, r3);
0x0000494a adds r3, r5, r0 | r3 = r5 + r0;
0x0000494c ldr r0, [r6, -0x8] | r0 = *((r6 - 0x8));
0x00004950 subs r1, r3, 1 | r1 = r3 - 1;
0x00004952 ldr r2, [sl, -0x8] | r2 = *((sl - 0x8));
0x00004956 ldrh r3, [r0, 4] | r3 = *((r0 + 4));
0x00004958 cmp r3, 4 |
0x0000495a it lo |
| if (r3 >= 4) {
0x0000495c movlo r3, 4 | r3 = 4;
| }
0x0000495e subs r3, 1 | r3--;
0x00004960 orrs r3, r1 | r3 |= r1;
0x00004962 ldrh r1, [r0, 6] | r1 = *((r0 + 6));
0x00004964 adds r5, r3, 1 | r5 = r3 + 1;
0x00004966 ldr r0, [r0] | r0 = *(r0);
0x00004968 mov r3, r5 | r3 = r5;
0x0000496a bl 0x42d8 | r0 = fcn_000042d8 (r0, r1, r2, r3);
0x0000496e adds r3, r5, r0 | r3 = r5 + r0;
0x00004970 ldr r0, [r6, -0x4] | r0 = *((r6 - 0x4));
0x00004974 subs r1, r3, 1 | r1 = r3 - 1;
0x00004976 ldr r2, [sl, -0x4] | r2 = *((sl - 0x4));
0x0000497a ldrh r3, [r0, 4] | r3 = *((r0 + 4));
0x0000497c cmp r3, 4 |
0x0000497e it lo |
| if (r3 >= 4) {
0x00004980 movlo r3, 4 | r3 = 4;
| }
0x00004982 subs r3, 1 | r3--;
0x00004984 orrs r3, r1 | r3 |= r1;
0x00004986 ldrh r1, [r0, 6] | r1 = *((r0 + 6));
0x00004988 adds r5, r3, 1 | r5 = r3 + 1;
0x0000498a ldr r0, [r0] | r0 = *(r0);
0x0000498c mov r3, r5 | r3 = r5;
0x0000498e bl 0x42d8 | r0 = fcn_000042d8 (r0, r1, r2, r3);
0x00004992 adds r3, r5, r0 | r3 = r5 + r0;
0x00004994 ldr r0, [r6], 0x20 | r0 = *(r6);
| r6 += 0x20;
0x00004998 subs r1, r3, 1 | r1 = r3 - 1;
0x0000499a ldr r2, [sl], 0x20 | r2 = *(sl);
| sl += 0x20;
0x0000499e ldrh r3, [r0, 4] | r3 = *((r0 + 4));
0x000049a0 cmp r3, 4 |
0x000049a2 it lo |
| if (r3 >= 4) {
0x000049a4 movlo r3, 4 | r3 = 4;
| }
0x000049a6 subs r3, 1 | r3--;
0x000049a8 orrs r3, r1 | r3 |= r1;
0x000049aa ldrh r1, [r0, 6] | r1 = *((r0 + 6));
0x000049ac adds r5, r3, 1 | r5 = r3 + 1;
0x000049ae ldr r0, [r0] | r0 = *(r0);
0x000049b0 mov r3, r5 | r3 = r5;
0x000049b2 bl 0x42d8 | fcn_000042d8 (r0, r1, r2, r3);
0x000049b6 ldr r2, [r7, 0x30] | r2 = *((r7 + 0x30));
0x000049b8 mov r3, r4 | r3 = r4;
0x000049ba adds r3, 9 | r3 += 9;
0x000049bc add r0, r5 | r0 += r5;
0x000049be adds r4, 8 | r4 += 8;
0x000049c0 cmp r2, r3 |
0x000049c2 bgt.w 0x488c |
| } while (r2 > r3);
0x000049c6 ldr r5, [r7, 0x2c] | r5 = *((r7 + 0x2c));
| label_15:
0x000049c8 ldr r6, [r7, 0x34] | r6 = *((r7 + 0x34));
0x000049ca lsl.w sl, r4, 2 | sl = r4 << 2;
0x000049ce add r6, sl | r6 += sl;
0x000049d0 add sl, fp | sl += fp;
0x000049d2 mov fp, r0 |
| do {
0x000049d4 ldr r3, [r6], 4 | r3 = *(r6);
| r6 += 4;
0x000049d8 add.w fp, fp, -1 |
0x000049dc ldr r2, [sl], 4 | r2 = *(sl);
| sl += 4;
0x000049e0 adds r4, 1 | r4++;
0x000049e2 ldrh r1, [r3, 4] | r1 = *((r3 + 4));
0x000049e4 ldr r0, [r3] | r0 = *(r3);
0x000049e6 cmp r1, 4 |
0x000049e8 it lo |
| if (r1 >= 4) {
0x000049ea movlo r1, 4 | r1 = 4;
| }
0x000049ec subs r1, 1 | r1--;
0x000049ee orr.w r1, r1, fp | r1 |= fp;
0x000049f2 add.w fp, r1, 1 |
0x000049f6 ldrh r1, [r3, 6] | r1 = *((r3 + 6));
0x000049f8 mov r3, fp | r3 = fp;
0x000049fa bl 0x42d8 | fcn_000042d8 (r0, r1, r2, r3);
0x000049fe cmp r8, r4 |
0x00004a00 add fp, r0 |
0x00004a02 bgt 0x49d4 |
| } while (r8 > r4);
| label_20:
0x00004a04 ldr r2, [r7, 0xc] | r2 = *((r7 + 0xc));
0x00004a06 mov r1, r5 | r1 = r5;
0x00004a08 mov r0, sb | r0 = sb;
0x00004a0a blx 0x5488 | fcn_00005488 (r0, r1, r2, r3, r4);
| label_8:
0x00004a0e ldr r3, [r7, 0x10] | r3 = *((r7 + 0x10));
0x00004a10 cmp r3, 0 |
| if (r3 != 0) {
0x00004a12 bne 0x4a90 | goto label_22;
| }
| label_4:
0x00004a14 ldr r2, [pc, 0x274] |
0x00004a16 ldr r3, [pc, 0x270] | r3 = *(0x4c8a);
0x00004a18 add r2, pc | r2 = 0x96a8;
0x00004a1a ldr r3, [r2, r3] | r3 = *(0x96a8);
0x00004a1c ldr r2, [r3] | r2 = *(0x96a8);
0x00004a1e ldr r3, [r7, 0x3c] | r3 = *((r7 + 0x3c));
0x00004a20 eors r2, r3 | r2 ^= r3;
0x00004a22 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x00004a26 bne.w 0x4c7e | goto label_23;
| }
0x00004a2a adds r7, 0x44 | r7 += 0x44;
0x00004a2c mov sp, r7 |
0x00004a2e pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_17:
0x00004a32 cmp r3, 2 |
| if (r3 == 2) {
0x00004a34 beq.w 0x4c00 | goto label_24;
| }
| label_10:
0x00004a38 add.w r3, r5, 0x3b | r3 = r5 + 0x3b;
0x00004a3c bic r3, r3, 7 | r3 = BIT_MASK (r3, 7);
0x00004a40 sub.w sp, sp, r3 |
0x00004a44 mov sb, sp | sb = sp;
0x00004a46 add r5, sb | r5 += sb;
| label_2:
0x00004a48 ldr r2, [r7, 0x14] | r2 = *((r7 + 0x14));
0x00004a4a add.w r3, r5, 0x14 | r3 = r5 + 0x14;
0x00004a4e str r3, [r7, 0x1c] | *((r7 + 0x1c)) = r3;
0x00004a50 str r3, [r5, 8] | *((r5 + 8)) = r3;
0x00004a52 cmp r2, r3 |
0x00004a54 it ne |
| if (r2 != r3) {
0x00004a56 cmpne r2, 0 | __asm ("cmpne r2, 0");
| }
0x00004a58 strd r0, r4, [r5, 0xc] | __asm ("strd r0, r4, [r5, 0xc]");
0x00004a5c ite ne |
| if (r2 == r3) {
0x00004a5e movne r3, 1 | r3 = 1;
| }
| if (r2 != r3) {
0x00004a60 moveq r3, 0 | r3 = 0;
| }
0x00004a62 str r3, [r7, 0x10] | *((r7 + 0x10)) = r3;
0x00004a64 b 0x4856 | goto label_0;
| label_16:
0x00004a66 cmp r0, 6 |
0x00004a68 it ne |
| if (r0 != 6) {
0x00004a6a movne r0, 5 | r0 = 5;
| goto label_25;
| }
| if (r0 != 6) {
| label_25:
0x00004a6c bne.w 0x4832 | goto label_1;
| }
0x00004a70 ldr r2, [r7, 4] | r2 = var_sp_4h;
0x00004a72 ldr r2, [r2] | r2 = *(r2);
| label_12:
0x00004a74 cmp r3, 2 |
| if (r3 == 2) {
0x00004a76 beq.w 0x4c4c | goto label_26;
| }
| label_13:
0x00004a7a adds r3, r2, r5 | r3 = r2 + r5;
0x00004a7c adds r3, 0x1b | r3 += 0x1b;
0x00004a7e bic r3, r3, 7 | r3 = BIT_MASK (r3, 7);
0x00004a82 sub.w sp, sp, r3 |
0x00004a86 mov sb, sp | sb = sp;
0x00004a88 add r5, sb | r5 += sb;
0x00004a8a cmp r2, 0 |
| if (r2 != 0) {
0x00004a8c bne 0x4a48 | goto label_2;
| }
0x00004a8e b 0x4848 | goto label_3;
| label_22:
0x00004a90 ldr r3, [r7, 4] | r3 = *((r7 + 4));
0x00004a92 ldr r1, [r7, 0x1c] | r1 = *((r7 + 0x1c));
0x00004a94 ldr r0, [r7, 0x14] | r0 = *((r7 + 0x14));
0x00004a96 ldr r2, [r3] | r2 = *(r3);
0x00004a98 blx 0x122c | fcn_0000122c ();
0x00004a9c b 0x4a14 | goto label_4;
| label_19:
0x00004a9e ldr r3, [r6, 0x18] | r3 = *((r6 + 0x18));
0x00004aa0 cmp r3, 0 |
| if (r3 == 0) {
0x00004aa2 beq.w 0x4838 | goto label_5;
| }
0x00004aa6 add.w r2, r5, 0x5b | r2 = r5 + 0x5b;
0x00004aaa bic r2, r2, 7 | r2 = BIT_MASK (r2, 7);
0x00004aae sub.w sp, sp, r2 |
0x00004ab2 ldr r2, [r7, 0x14] | r2 = *((r7 + 0x14));
0x00004ab4 mov r1, sp | r1 = sp;
0x00004ab6 str r1, [r7, 0x18] | *((r7 + 0x18)) = r1;
0x00004ab8 str r2, [r7, 0x1c] | *((r7 + 0x1c)) = r2;
0x00004aba movs r2, 0 | r2 = 0;
0x00004abc str r2, [r7, 0x10] | *((r7 + 0x10)) = r2;
0x00004abe mov r2, r1 | r2 = r1;
0x00004ac0 adds r2, 0x40 | r2 += 0x40;
0x00004ac2 str r2, [r7, 0x24] | *((r7 + 0x24)) = r2;
0x00004ac4 add r2, r5 | r2 += r5;
0x00004ac6 str r2, [r7, 8] | *((r7 + 8)) = r2;
| label_11:
0x00004ac8 ldr r1, [r7, 0x1c] | r1 = *((r7 + 0x1c));
0x00004aca cmp r0, 6 |
0x00004acc str r4, [r2, 0x10] | *((r2 + 0x10)) = r4;
0x00004ace strd r1, r0, [r2, 8] | __asm ("strd r1, r0, [r2, 8]");
0x00004ad2 ldr r1, [r7, 0x18] | r1 = *((r7 + 0x18));
0x00004ad4 ldr r2, [r6, 8] | r2 = *((r6 + 8));
0x00004ad6 add.w r1, r1, 0x50 | r1 += 0x50;
0x00004ada str r1, [r7, 0x20] | *((r7 + 0x20)) = r1;
0x00004adc itttt eq |
| if (r0 == 6) {
0x00004ade ldrdeq r1, r0, [r7, 0x18] | __asm ("ldrdeq r1, r0, [r7, 0x18]");
| }
| if (r0 != 6) {
0x00004ae2 streq r0, [r1, 0x40] | *((r1 + 0x40)) = r0;
| }
| if (r0 != 6) {
0x00004ae4 addeq r1, 0x44 | r1 += 0x44;
| }
| if (r0 == 6) {
0x00004ae6 str r1, [r7, 0x24] | *((r7 + 0x24)) = r1;
| }
0x00004ae8 ldr r1, [r6, 4] | r1 = *((r6 + 4));
0x00004aea cmp r1, 0 |
0x00004aec str r1, [r7, 0x28] | *((r7 + 0x28)) = r1;
| if (r1 <= 0) {
0x00004aee ble 0x4bc4 | goto label_27;
| }
0x00004af0 ldr r3, [r7, 0x20] | r3 = *((r7 + 0x20));
0x00004af2 mov.w sl, 0 | sl = 0;
0x00004af6 sub.w sb, fp, 4 | sb = fp - 4;
0x00004afa mov r5, sl | r5 = sl;
0x00004afc mov fp, sl |
0x00004afe str.w sl, [r7, 0x2c] | __asm ("str.w sl, [r7, 0x2c]");
0x00004b02 str.w sl, [r7, 0x30] | __asm ("str.w sl, [r7, 0x30]");
0x00004b06 sub.w r8, r2, 4 | r8 = r2 - 4;
0x00004b0a mov sl, r6 | sl = r6;
0x00004b0c str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x00004b0e b 0x4b38 | goto label_7;
| label_6:
0x00004b10 ldr r2, [r7, 0x30] | r2 = *((r7 + 0x30));
0x00004b12 cmp r2, 0 |
| if (r2 == 0) {
0x00004b14 beq 0x4bea | goto label_28;
| }
| do {
0x00004b16 ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x00004b18 mov r2, r6 | r2 = r6;
0x00004b1a subs r4, r3, 1 | r4 = r3 - 1;
0x00004b1c orr.w r4, r4, ip | r4 |= ip;
0x00004b20 adds r4, 1 | r4++;
0x00004b22 mov r3, r4 | r3 = r4;
0x00004b24 bl 0x42d8 | r0 = fcn_000042d8 (r0, r1, r2, r3);
0x00004b28 adds r3, r4, r0 | r3 = r4 + r0;
0x00004b2a str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x00004b2c movs r3, 1 | r3 = 1;
0x00004b2e str r3, [r7, 0x30] | *((r7 + 0x30)) = r3;
| label_9:
0x00004b30 ldr r3, [r7, 0x28] | r3 = *((r7 + 0x28));
0x00004b32 adds r5, 1 | r5++;
0x00004b34 cmp r3, r5 |
| if (r3 == r5) {
0x00004b36 beq 0x4bc0 | goto label_29;
| }
| label_7:
0x00004b38 ldr r4, [r8, 4]! | r4 = *((r8 += 4));
0x00004b3c ldr r6, [sb, 4]! | r6 = *((sb += 4));
0x00004b40 mov r0, r4 | r0 = r4;
0x00004b42 bl 0x46d0 | fcn_000046d0 (r0);
0x00004b46 ldrh.w ip, [sl, 0x1e] | ip = *((sl + 0x1e));
0x00004b4a mov lr, r0 | lr = r0;
0x00004b4c ldrh r1, [r4, 6] | r1 = *((r4 + 6));
0x00004b4e ldr r0, [r4] | r0 = *(r4);
0x00004b50 cmp.w lr, 0 |
0x00004b54 it ne |
| if (lr != 0) {
0x00004b56 cmpne fp, ip | __asm ("cmpne fp, ip");
| }
| if (lr < 0) {
0x00004b58 blt 0x4bd0 | goto label_30;
| }
0x00004b5a ldrh.w ip, [r4, 4] | ip = *((r4 + 4));
0x00004b5e ldr r3, [r7, 0x2c] | r3 = *((r7 + 0x2c));
0x00004b60 cmp.w ip, 4 |
0x00004b64 eor r3, r3, 1 | r3 ^= 1;
0x00004b68 it lo |
| if (ip >= 4) {
0x00004b6a movlo ip, 4 |
| }
0x00004b6e cmp.w lr, 0 |
0x00004b72 ite ne |
| if (lr == 0) {
0x00004b74 movne r3, 0 | r3 = 0;
| }
| if (lr != 0) {
0x00004b76 andeq r3, r3, 1 | r3 &= 1;
| }
0x00004b7a add.w ip, ip, -1 |
0x00004b7e cmp r3, 0 |
0x00004b80 beq 0x4b16 |
| } while (r3 == 0);
0x00004b82 ldr r3, [r7, 0x24] | r3 = *((r7 + 0x24));
0x00004b84 ldr r2, [r7, 0x20] | r2 = *((r7 + 0x20));
0x00004b86 subs r3, 1 | r3--;
0x00004b88 orr.w r3, r3, ip | r3 |= ip;
0x00004b8c adds r3, 1 | r3++;
0x00004b8e cmp r0, 4 |
0x00004b90 ite hs |
| if (r0 < 4) {
0x00004b92 addhs lr, r3, r0 | lr = r3 + r0;
| }
| if (r0 < 4) {
0x00004b96 add.w lr, r3, 4 | lr = r3 + 4;
| }
0x00004b9a cmp r2, lr |
| if (r2 <= lr) {
0x00004b9c blo 0x4b10 | goto label_6;
| }
0x00004b9e mov r2, r6 | r2 = r6;
0x00004ba0 str r3, [r7, 0x2c] | *((r7 + 0x2c)) = r3;
0x00004ba2 bl 0x42d8 | fcn_000042d8 (r0, r1, r2, r3);
0x00004ba6 ldr r3, [r7, 0x2c] | r3 = *((r7 + 0x2c));
0x00004ba8 adds r5, 1 | r5++;
0x00004baa ldr r2, [r7, 0x34] | r2 = *((r7 + 0x34));
0x00004bac add r3, r0 | r3 += r0;
0x00004bae str r3, [r7, 0x24] | *((r7 + 0x24)) = r3;
0x00004bb0 subs r3, r2, r3 | r3 = r2 - r3;
0x00004bb2 clz r3, r3 | r3 &= r3;
0x00004bb6 lsrs r3, r3, 5 | r3 >>= 5;
0x00004bb8 str r3, [r7, 0x2c] | *((r7 + 0x2c)) = r3;
0x00004bba ldr r3, [r7, 0x28] | r3 = *((r7 + 0x28));
0x00004bbc cmp r3, r5 |
| if (r3 != r5) {
0x00004bbe bne 0x4b38 | goto label_7;
| }
| label_29:
0x00004bc0 ldr.w r3, [sl, 0x18] | r3 = *((sl + 0x18));
| label_27:
0x00004bc4 ldrd r1, r2, [r7, 8] | __asm ("ldrd r1, r2, [r7, 8]");
0x00004bc8 ldr r0, [r7, 0x18] | r0 = *((r7 + 0x18));
0x00004bca blx 0x5478 | fcn_00005478 (r0, r1, r2, r3, r4);
0x00004bce b 0x4a0e | goto label_8;
| label_30:
0x00004bd0 add.w r3, sl, fp | r3 = sl + fp;
0x00004bd4 ldr r4, [r7, 0x18] | r4 = *((r7 + 0x18));
0x00004bd6 ldrsb.w r3, [r3, 0x20] | r3 = *((r3 + 0x20));
0x00004bda mov r2, r6 | r2 = r6;
0x00004bdc add.w fp, fp, 1 |
0x00004be0 add.w r3, r4, r3, lsl 2 | r3 = r4 + (r3 << 2);
0x00004be4 bl 0x42d8 | fcn_000042d8 (r0, r1, r2, r3);
0x00004be8 b 0x4b30 | goto label_9;
| label_28:
0x00004bea mov r2, r6 | r2 = r6;
0x00004bec str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x00004bee bl 0x42d8 | fcn_000042d8 (r0, r1, r2, r3);
0x00004bf2 ldr r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x00004bf4 add r3, r0 | r3 += r0;
0x00004bf6 str r3, [r7, 0x34] | *((r7 + 0x34)) = r3;
0x00004bf8 movs r3, 1 | r3 = 1;
0x00004bfa strd r3, r3, [r7, 0x2c] | __asm ("strd r3, r3, [r7, 0x2c]");
0x00004bfe b 0x4b30 | goto label_9;
| label_24:
0x00004c00 ldr r3, [r6, 0x18] | r3 = *((r6 + 0x18));
0x00004c02 cmp r3, 0 |
| if (r3 == 0) {
0x00004c04 beq.w 0x4a38 | goto label_10;
| }
0x00004c08 add.w r2, r5, 0x7b | r2 = r5 + 0x7b;
0x00004c0c bic r2, r2, 7 | r2 = BIT_MASK (r2, 7);
0x00004c10 sub.w sp, sp, r2 |
0x00004c14 mov r2, sp | r2 = sp;
0x00004c16 str r2, [r7, 0x18] | *((r7 + 0x18)) = r2;
0x00004c18 adds r2, 0x40 | r2 += 0x40;
0x00004c1a str r2, [r7, 0x24] | *((r7 + 0x24)) = r2;
0x00004c1c add r2, r5 | r2 += r5;
0x00004c1e str r2, [r7, 8] | *((r7 + 8)) = r2;
| label_14:
0x00004c20 ldr r2, [r7, 8] | r2 = *((r7 + 8));
0x00004c22 ldr r1, [r7, 0x14] | r1 = *((r7 + 0x14));
0x00004c24 adds r2, 0x14 | r2 += 0x14;
0x00004c26 cmp r1, r2 |
0x00004c28 it ne |
| if (r1 != r2) {
0x00004c2a cmpne r1, 0 | __asm ("cmpne r1, 0");
| }
0x00004c2c str r2, [r7, 0x1c] | *((r7 + 0x1c)) = r2;
0x00004c2e ite ne |
| if (r1 == r2) {
0x00004c30 movne r2, 1 | r2 = 1;
| }
| if (r1 != r2) {
0x00004c32 moveq r2, 0 | r2 = 0;
| }
0x00004c34 str r2, [r7, 0x10] | *((r7 + 0x10)) = r2;
0x00004c36 ldr r2, [r7, 8] | r2 = *((r7 + 8));
0x00004c38 b 0x4ac8 | goto label_11;
| label_18:
0x00004c3a ldr r2, [r7, 4] | r2 = var_sp_4h;
0x00004c3c ldrh r2, [r2, 6] | r2 = *((r2 + 6));
0x00004c3e sub.w r2, r2, 0xd | r2 -= 0xd;
0x00004c42 clz r2, r2 | r2 &= r2;
0x00004c46 lsrs r2, r2, 5 | r2 >>= 5;
0x00004c48 lsls r2, r2, 2 | r2 <<= 2;
0x00004c4a b 0x4a74 | goto label_12;
| label_26:
0x00004c4c ldr r3, [r6, 0x18] | r3 = *((r6 + 0x18));
0x00004c4e cmp r3, 0 |
| if (r3 == 0) {
0x00004c50 beq.w 0x4a7a | goto label_13;
| }
0x00004c54 adds r1, r2, r5 | r1 = r2 + r5;
0x00004c56 adds r1, 0x5b | r1 += 0x5b;
0x00004c58 bic r1, r1, 7 | r1 = BIT_MASK (r1, 7);
0x00004c5c sub.w sp, sp, r1 |
0x00004c60 mov r1, sp | r1 = sp;
0x00004c62 str r1, [r7, 0x18] | *((r7 + 0x18)) = r1;
0x00004c64 adds r1, 0x40 | r1 += 0x40;
0x00004c66 str r1, [r7, 0x24] | *((r7 + 0x24)) = r1;
0x00004c68 add r1, r5 | r1 += r5;
0x00004c6a str r1, [r7, 8] | *((r7 + 8)) = r1;
0x00004c6c cmp r2, 0 |
| if (r2 != 0) {
0x00004c6e bne 0x4c20 | goto label_14;
| }
0x00004c70 str r2, [r7, 0x10] | *((r7 + 0x10)) = r2;
0x00004c72 ldr r2, [r7, 0x14] | r2 = *((r7 + 0x14));
0x00004c74 str r2, [r7, 0x1c] | *((r7 + 0x1c)) = r2;
0x00004c76 mov r2, r1 | r2 = r1;
0x00004c78 b 0x4ac8 | goto label_11;
| label_21:
0x00004c7a movs r4, 0 | r4 = 0;
0x00004c7c b 0x49c8 | goto label_15;
| label_23:
0x00004c7e blx 0x1244 | fcn_00001244 ();
0x00004c82 nop |
0x00004c84 asrs r0, r3, 0x1c | r0 = r3 >> 0x1c;
0x00004c86 movs r1, r0 | r1 = r0;
0x00004c88 lsls r0, r1, 3 | r0 = r1 << 3;
0x00004c8a movs r0, r0 |
0x00004c8c asrs r0, r1, 0x14 | r0 = r1 >> 0x14;
0x00004c8e movs r1, r0 | r1 = r0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/lib/libffi.so.8.1.0 @ 0x1ab8 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) sym.ffi_java_raw_to_ptrarray () | void ffi_java_raw_to_ptrarray (int16_t arg1, int16_t arg2, int16_t arg3) {
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
0x00001ab8 ldmib r0, {r4, r5, r6, r7, r8, sl, ip, sp, pc} ^ | __asm ("ldmib r0, {r4, r5, r6, r7, r8, sl, ip, sp, pc} ^");
0x00001abc bx r0 | return uint32_t (*r0)() ();
0x00001abe cmp r4, 0 |
| if (r4 == 0) {
0x00001ac0 beq.w 0x1bdc | goto label_1;
| }
0x00001ac4 cmp r4, 8 |
| if (r4 < 8) {
0x00001ac6 bls.w 0x1bde | goto label_2;
| }
0x00001aca sub.w r5, r4, 9 | r5 = r4 - 9;
0x00001ace add.w lr, r7, 0x20 | lr = r7 + 0x20;
0x00001ad2 bic r5, r5, 7 | r5 = BIT_MASK (r5, 7);
0x00001ad6 add.w ip, r2, 0x20 |
0x00001ada add.w r0, r5, 8 | r0 = r5 + 8;
0x00001ade movs r6, 0 | r6 = 0;
| do {
0x00001ae0 str r1, [ip, -0x20] | *((ip - 0x20)) = r1;
0x00001ae4 cmp r6, r5 |
0x00001ae6 ldr r3, [lr, -0x20] | r3 = *((lr - 0x20));
0x00001aea mov r7, lr | r7 = lr;
0x00001aec pld [lr, 0x24] | __asm ("pld [lr, 0x24]");
0x00001af0 add.w r6, r6, 8 | r6 += 8;
0x00001af4 pld [ip, 0x24] | __asm ("pld [ip, 0x24]");
0x00001af8 add.w lr, lr, 0x20 | lr += 0x20;
0x00001afc ldr r3, [r3] | r3 = *(r3);
0x00001afe add.w r3, r3, -1 | r3 += -1;
0x00001b02 orr r3, r3, 3 | r3 |= 3;
0x00001b06 add.w r3, r3, 1 | r3++;
0x00001b0a add r3, r1 | r3 += r1;
0x00001b0c str r3, [ip, -0x1c] | *((ip - 0x1c)) = r3;
0x00001b10 ldr r2, [lr, -0x3c] | r2 = *((lr - 0x3c));
0x00001b14 ldr r2, [r2] | r2 = *(r2);
0x00001b16 add.w r2, r2, -1 | r2 += -1;
0x00001b1a orr r2, r2, 3 | r2 |= 3;
0x00001b1e add.w r2, r2, 1 | r2++;
0x00001b22 add r3, r2 | r3 += r2;
0x00001b24 str r3, [ip, -0x18] | *((ip - 0x18)) = r3;
0x00001b28 ldr r2, [lr, -0x38] | r2 = *((lr - 0x38));
0x00001b2c ldr r2, [r2] | r2 = *(r2);
0x00001b2e add.w r2, r2, -1 | r2 += -1;
0x00001b32 orr r2, r2, 3 | r2 |= 3;
0x00001b36 add.w r2, r2, 1 | r2++;
0x00001b3a add r3, r2 | r3 += r2;
0x00001b3c str r3, [ip, -0x14] | *((ip - 0x14)) = r3;
0x00001b40 ldr r2, [lr, -0x34] | r2 = *((lr - 0x34));
0x00001b44 ldr r2, [r2] | r2 = *(r2);
0x00001b46 add.w r2, r2, -1 | r2 += -1;
0x00001b4a orr r2, r2, 3 | r2 |= 3;
0x00001b4e add.w r2, r2, 1 | r2++;
0x00001b52 add r3, r2 | r3 += r2;
0x00001b54 str r3, [ip, -0x10] | *((ip - 0x10)) = r3;
0x00001b58 ldr r2, [lr, -0x30] | r2 = *((lr - 0x30));
0x00001b5c ldr r2, [r2] | r2 = *(r2);
0x00001b5e add.w r2, r2, -1 | r2 += -1;
0x00001b62 orr r2, r2, 3 | r2 |= 3;
0x00001b66 add.w r2, r2, 1 | r2++;
0x00001b6a add r3, r2 | r3 += r2;
0x00001b6c str r3, [ip, -0xc] | *((ip - 0xc)) = r3;
0x00001b70 ldr r2, [lr, -0x2c] | r2 = *((lr - 0x2c));
0x00001b74 ldr r2, [r2] | r2 = *(r2);
0x00001b76 add.w r2, r2, -1 | r2 += -1;
0x00001b7a orr r2, r2, 3 | r2 |= 3;
0x00001b7e add.w r2, r2, 1 | r2++;
0x00001b82 add r3, r2 | r3 += r2;
0x00001b84 str r3, [ip, -0x8] | *((ip - 0x8)) = r3;
0x00001b88 ldr r2, [lr, -0x28] | r2 = *((lr - 0x28));
0x00001b8c ldr r2, [r2] | r2 = *(r2);
0x00001b8e add.w r2, r2, -1 | r2 += -1;
0x00001b92 orr r2, r2, 3 | r2 |= 3;
0x00001b96 add.w r2, r2, 1 | r2++;
0x00001b9a add r3, r2 | r3 += r2;
0x00001b9c str r3, [ip, -0x4] | *((ip - 0x4)) = r3;
0x00001ba0 ldr r2, [lr, -0x24] | r2 = *((lr - 0x24));
0x00001ba4 ldr r1, [r2] | r1 = *(r2);
0x00001ba6 mov r2, ip | r2 = ip;
0x00001ba8 add.w ip, ip, 0x20 |
0x00001bac add.w r1, r1, -1 | r1 += -1;
0x00001bb0 orr r1, r1, 3 | r1 |= 3;
0x00001bb4 add.w r1, r1, 1 | r1++;
0x00001bb8 add r1, r3 | r1 += r3;
0x00001bba bne 0x1ae0 |
| } while (r6 != r5);
| label_0:
0x00001bbc subs r2, 4 | r2 -= 4;
| do {
0x00001bbe str r1, [r2, 4]! | *((r2 += 4)) = r1;
0x00001bc2 adds r0, 1 | r0++;
0x00001bc4 ldr r3, [r7], 4 | r3 = *(r7);
| r7 += 4;
0x00001bc8 cmp r4, r0 |
0x00001bca ldr r3, [r3] | r3 = *(r3);
0x00001bcc add.w r3, r3, -1 | r3 += -1;
0x00001bd0 orr r3, r3, 3 | r3 |= 3;
0x00001bd4 add.w r3, r3, 1 | r3++;
0x00001bd8 add r1, r3 | r1 += r3;
0x00001bda bhi 0x1bbe |
| } while (r4 > r0);
| label_1:
0x00001bdc pop {r4, r5, r6, r7, pc} |
| label_2:
0x00001bde movs r0, 0 | r0 = 0;
0x00001be0 b 0x1bbc | goto label_0;
| }
[*] Function printf used 1 times libffi.so.8.1.0