[*] Binary protection state of libSSS_APIs.so

  
  	Full RELRO     Canary found      NX enabled   DSO          No RPATH     No RUNPATH   No Symbols


[*] Function printf tear down of libSSS_APIs.so

    ; assembly                                                   | /* r2dec pseudo code output */
                                                                 | /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-80367616.squashfs_v4_le_extract/usr/lib/libSSS_APIs.so @ 0xc49c */
                                                                 | #include <stdint.h>
                                                                 |  
    ; (fcn) sym.emsa_decode_and_compare ()                       | void emsa_decode_and_compare (int16_t arg_28h, int16_t arg_308h, int16_t arg_6b4h, int16_t arg_6e0h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
                                                                 |     int16_t var_0h_3;
                                                                 |     int16_t var_4h_2;
                                                                 |     int16_t var_8h;
                                                                 |     int16_t var_ch_2;
                                                                 |     int16_t var_14h_2;
                                                                 |     int16_t var_18h;
                                                                 |     int16_t var_60h;
                                                                 |     int16_t var_ach_2;
                                                                 |     int16_t var_b4h;
                                                                 |     int16_t var_b8h;
                                                                 |     r0 = arg1;
                                                                 |     r1 = arg2;
                                                                 |     r2 = arg3;
                                                                 |     r3 = arg4;
    0x0000c49c svcmi 0xf0e92d                                    |     __asm ("svcmi 0xf0e92d");
    0x0000c4a0 mov r5, r2                                        |     r5 = r2;
    0x0000c4a2 ldr r2, [pc, 0x1dc]                               |     
    0x0000c4a4 mov r6, r3                                        |     r6 = r3;
    0x0000c4a6 subw sp, sp, 0x6bc                                |     __asm ("subw sp, sp, 0x6bc");
    0x0000c4aa movs r4, 0                                        |     r4 = 0;
    0x0000c4ac ldr r3, [pc, 0x1d4]                               |     r3 = *(0xc684);
    0x0000c4ae mov fp, r1                                        |     
    0x0000c4b0 add r2, pc                                        |     r2 = 0x18b36;
    0x0000c4b2 mov r1, r4                                        |     r1 = r4;
    0x0000c4b4 add.w sb, sp, 0xb4                                |     sb += var_b4h;
    0x0000c4b8 mov r8, r0                                        |     r8 = r0;
    0x0000c4ba ldr r3, [r2, r3]                                  |     
    0x0000c4bc add r0, sp, 0xb8                                  |     r0 += var_b8h;
    0x0000c4be add r7, sp, 0x60                                  |     r7 += var_60h;
    0x0000c4c0 mov.w r2, 0x1fc                                   |     r2 = 0x1fc;
    0x0000c4c4 add.w sl, sp, 0x14                                |     sl += var_14h_2;
    0x0000c4c8 ldr r3, [r3]                                      |     r3 = *(0x18b36);
    0x0000c4ca str.w r3, [sp, 0x6b4]                             |     __asm ("str.w r3, [arg_6b4h]");
    0x0000c4ce mov.w r3, 0                                       |     r3 = 0;
    0x0000c4d2 str.w r4, [sb]                                    |     __asm ("str.w r4, [sb]");
    0x0000c4d4 ands r0, r0                                       |     r0 &= r0;
    0x0000c4d6 blx 0x85f0                                        |     fcn_000085f0 ();
    0x0000c4da mov r1, r4                                        |     r1 = r4;
    0x0000c4dc mov.w r3, 0x200                                   |     r3 = 0x200;
    0x0000c4e0 movs r2, 0x4c                                     |     r2 = 0x4c;
    0x0000c4e2 mov r0, r7                                        |     r0 = r7;
    0x0000c4e4 str.w r3, [sl]                                    |     __asm ("str.w r3, [sl]");
    0x0000c4e8 blx 0x85f0                                        |     fcn_000085f0 ();
    0x0000c4ec cmp r6, r4                                        |     
    0x0000c4ee it ne                                             |     
                                                                 |     if (r6 != r4) {
    0x0000c4f0 cmpne r5, r4                                      |         __asm ("cmpne r5, r4");
                                                                 |     }
    0x0000c4f2 ite eq                                            |     
                                                                 |     if (r6 != r4) {
    0x0000c4f4 moveq r4, 1                                       |         r4 = 1;
                                                                 |     }
                                                                 |     if (r6 == r4) {
    0x0000c4f6 movne r4, 0                                       |         r4 = 0;
                                                                 |     }
    0x0000c4f8 cmp.w fp, 0                                       |     
    0x0000c4fc it eq                                             |     
                                                                 |     if (fp != 0) {
    0x0000c4fe orreq r4, r4, 1                                   |         r4 |= 1;
                                                                 |     }
    0x0000c502 cbz r4, 0xc52e                                    |     
                                                                 |     while (r0 != 0x5a5a5a5a) {
                                                                 | label_0:
    0x0000c504 movs r4, 1                                        |         r4 = 1;
                                                                 | label_1:
    0x0000c506 mov r0, r7                                        |         r0 = r7;
    0x0000c508 blx 0x84f8                                        |         fcn_000084f8 ();
    0x0000c50c ldr r2, [pc, 0x178]                               |         
    0x0000c50e ldr r3, [pc, 0x174]                               |         r3 = *(0xc686);
    0x0000c510 add r2, pc                                        |         r2 = 0x18b9c;
    0x0000c512 ldr r3, [r2, r3]                                  |         r3 = *(0x18b9c);
    0x0000c514 ldr r2, [r3]                                      |         r2 = *(0x18b9c);
    0x0000c516 ldr.w r3, [sp, 0x6b4]                             |         r3 = *(arg_6b4h);
    0x0000c51a eors r2, r3                                       |         r2 ^= r3;
    0x0000c51c mov.w r3, 0                                       |         r3 = 0;
                                                                 |         if (r2 != r3) {
    0x0000c520 bne.w 0xc67c                                      |             goto label_3;
                                                                 |         }
    0x0000c524 mov r0, r4                                        |         r0 = r4;
    0x0000c526 addw sp, sp, 0x6bc                                |         __asm ("addw sp, sp, 0x6bc");
    0x0000c52a pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc}        |         
    0x0000c52e mov r1, fp                                        |         r1 = fp;
    0x0000c530 add.w fp, sp, 0x2b4                               |         
    0x0000c534 mov.w r3, 0x400                                   |         r3 = 0x400;
    0x0000c538 mov r2, r5                                        |         r2 = r5;
    0x0000c53a mov r0, fp                                        |         r0 = fp;
    0x0000c53c blx 0x8028                                        |         fcn_00008028 ();
    0x0000c540 mov r3, r4                                        |         r3 = r4;
    0x0000c542 mov r2, r4                                        |         r2 = r4;
    0x0000c544 mov.w r1, 0x102                                   |         r1 = 0x102;
    0x0000c548 mov r0, r7                                        |         r0 = r7;
    0x0000c54a str r4, [sp]                                      |         *(sp) = r4;
    0x0000c54c blx 0x9318                                        |         r0 = fcn_00009318 ();
    0x0000c550 cmp.w r0, 0x5a5a5a5a                              |         
    0x0000c554 bne 0xc504                                        |         
                                                                 |     }
    0x0000c556 ldr.w r0, [r8, 8]                                 |     r0 = *((r8 + 8));
    0x0000c55a mvn r3, 0x800                                     |     r3 = ~0x800;
    0x0000c55e adds r3, r0, r3                                   |     r3 = r0 + r3;
    0x0000c560 cmp r3, 4                                         |     
                                                                 |     if (r3 > 4) {
    0x0000c562 bhi 0xc504                                        |         goto label_0;
                                                                 |     }
    0x0000c564 ldr r2, [pc, 0x124]                               |     
    0x0000c566 add r2, pc                                        |     r2 = 0x18bf6;
    0x0000c568 add.w r3, r2, r3, lsl 2                           |     r3 = r2 + (r3 << 2);
    0x0000c56c ldr r3, [r3, 0x10]                                |     r3 = *((r3 + 0x10));
    0x0000c56e str r3, [sp, 8]                                   |     var_8h = r3;
    0x0000c570 subs r3, r5, 1                                    |     r3 = r5 - 1;
    0x0000c572 ldrb.w r2, [fp, r3]                               |     r2 = *((fp + r3));
    0x0000c576 cmp r2, 0xbc                                      |     
                                                                 |     if (r2 != 0xbc) {
    0x0000c578 bne 0xc504                                        |         goto label_0;
                                                                 |     }
    0x0000c57a ldr r1, [sp, 8]                                   |     r1 = var_8h;
    0x0000c57c strd r4, r4, [sp, 0xac]                           |     __asm ("strd r4, r4, [sp, 0xac]");
    0x0000c580 lsls r2, r1, 3                                    |     r2 = r1 << 3;
    0x0000c582 rsb.w r1, r5, 1                                   |     r1 = 1 - r5;
    0x0000c586 subs r2, 1                                        |     r2--;
    0x0000c588 add.w ip, r2, r1, lsl 3                           |     
    0x0000c58c ldrb.w r1, [fp]                                   |     r1 = *(fp);
    0x0000c590 add r2, sp, 0xac                                  |     r2 += var_ach_2;
    0x0000c592 str r2, [sp, 0xc]                                 |     var_ch_2 = r2;
    0x0000c594 asrs.w r1, r1, ip                                 |     r1 >>= ip;
                                                                 |     if (r2 != 1) {
    0x0000c598 bne 0xc504                                        |         goto label_0;
                                                                 |     }
    0x0000c59a ldr r1, [sp, 8]                                   |     r1 = var_8h;
    0x0000c59c adds r2, r1, 2                                    |     r2 = r1 + 2;
    0x0000c59e cmp r2, r5                                        |     
                                                                 |     if (r2 > r5) {
    0x0000c5a0 bhi 0xc504                                        |         goto label_0;
                                                                 |     }
    0x0000c5a2 mov r2, r1                                        |     r2 = r1;
    0x0000c5a4 subs r1, r3, r1                                   |     r1 = r3 - r1;
    0x0000c5a6 sub.w r4, r0, 0x500                               |     r4 = r0 - 0x500;
    0x0000c5aa str.w r8, [sp, 4]                                 |     __asm ("str.w r8, [var_4h_2]");
    0x0000c5ae add.w r8, fp, r1                                  |     r8 = fp + r1;
    0x0000c5b2 mov r3, r2                                        |     r3 = r2;
    0x0000c5b4 mov r0, fp                                        |     r0 = fp;
    0x0000c5b6 mov r2, r8                                        |     r2 = r8;
    0x0000c5b8 str r4, [sp]                                      |     *(sp) = r4;
    0x0000c5ba blx 0x8d50                                        |     r0 = fcn_00008d50 ();
    0x0000c5be cmp r0, 0                                         |     
                                                                 |     if (r0 != 0) {
    0x0000c5c0 bne 0xc504                                        |         goto label_0;
                                                                 |     }
    0x0000c5c2 ldrb.w r3, [fp]                                   |     r3 = *(fp);
    0x0000c5c6 add.w r2, r8, -1                                  |     r2 = r8 + -1;
    0x0000c5ca cmp r2, fp                                        |     
    0x0000c5cc it ls                                             |     
                                                                 |     if (r2 > fp) {
    0x0000c5ce movls r5, fp                                      |         r5 = fp;
                                                                 |     }
    0x0000c5d0 and r3, r3, 0x7f                                  |     r3 &= 0x7f;
    0x0000c5d4 strb.w r3, [fp]                                   |     *(fp) = r3;
                                                                 |     if (r2 > fp) {
    0x0000c5d8 bhi 0xc5e2                                        |         goto label_4;
                                                                 |     }
    0x0000c5da b 0xc5ec                                          |     goto label_2;
                                                                 |     do {
    0x0000c5dc cmp r2, fp                                        |         
    0x0000c5de ldrb r3, [r5, 1]                                  |         r3 = *((r5 + 1));
                                                                 |         if (r2 == fp) {
    0x0000c5e0 beq 0xc678                                        |             goto label_5;
                                                                 |         }
                                                                 | label_4:
    0x0000c5e2 mov r5, fp                                        |         r5 = fp;
    0x0000c5e4 add.w fp, fp, 1                                   |         
    0x0000c5e8 cmp r3, 0                                         |         
    0x0000c5ea beq 0xc5dc                                        |         
                                                                 |     } while (r3 == 0);
                                                                 | label_2:
    0x0000c5ec cmp r3, 1                                         |     
                                                                 |     if (r3 != 1) {
    0x0000c5ee bne 0xc504                                        |         goto label_0;
                                                                 |     }
    0x0000c5f0 mov r2, r4                                        |     r2 = r4;
    0x0000c5f2 add r4, sp, 0x18                                  |     r4 += var_18h;
    0x0000c5f4 movs r3, 6                                        |     r3 = 6;
    0x0000c5f6 mov r1, r7                                        |     r1 = r7;
    0x0000c5f8 mov r0, r4                                        |     r0 = r4;
    0x0000c5fa blx 0x8644                                        |     r0 = fcn_00008644 ();
    0x0000c5fe cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c602 bne.w 0xc504                                      |         goto label_0;
                                                                 |     }
    0x0000c606 mov r0, r4                                        |     r0 = r4;
    0x0000c608 blx 0x8c88                                        |     r0 = fcn_00008c88 ();
    0x0000c60c cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c610 bne.w 0xc504                                      |         goto label_0;
                                                                 |     }
    0x0000c614 ldr r1, [sp, 0xc]                                 |     r1 = var_ch_2;
    0x0000c616 movs r2, 8                                        |     r2 = 8;
    0x0000c618 mov r0, r4                                        |     r0 = r4;
    0x0000c61a blx 0x8e00                                        |     r0 = snprintf_chk ()
    0x0000c61e cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c622 bne.w 0xc504                                      |         goto label_0;
                                                                 |     }
    0x0000c624 add r7, sp, 0x1bc                                 |     r7 = sp + 0x1bc;
    0x0000c626 ldr.w r2, [sp, 0x6e0]                             |     r2 = *(arg_6e0h);
    0x0000c62a mov r1, r6                                        |     r1 = r6;
    0x0000c62c mov r0, r4                                        |     r0 = r4;
    0x0000c62e blx 0x8e00                                        |     r0 = snprintf_chk ()
    0x0000c632 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c636 bne.w 0xc504                                      |         goto label_0;
                                                                 |     }
    0x0000c63a adds r1, r5, 1                                    |     r1 = r5 + 1;
    0x0000c63c mov r0, r4                                        |     r0 = r4;
    0x0000c63e sub.w r2, r8, r1                                  |     r2 = r8 - r1;
    0x0000c642 blx 0x8e00                                        |     r0 = snprintf_chk ()
    0x0000c646 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c64a bne.w 0xc504                                      |         goto label_0;
                                                                 |     }
    0x0000c64e mov r2, sl                                        |     r2 = sl;
    0x0000c650 mov r1, sb                                        |     r1 = sb;
    0x0000c652 mov r0, r4                                        |     r0 = r4;
    0x0000c654 blx 0x9134                                        |     r0 = fcn_00009134 ();
    0x0000c658 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c65c bne.w 0xc504                                      |         goto label_0;
                                                                 |     }
    0x0000c660 mov r0, r4                                        |     r0 = r4;
    0x0000c662 blx 0x8e7c                                        |     fcn_00008e7c ();
    0x0000c664 invalid                                           |     
    0x0000c668 mov r1, sb                                        |     r1 = sb;
    0x0000c66a mov r0, r8                                        |     r0 = r8;
    0x0000c66c blx 0x92b8                                        |     r0 = fcn_000092b8 ();
    0x0000c670 subs r4, r0, 0                                    |     r4 = r0 - 0;
    0x0000c672 it ne                                             |     
                                                                 |     if (r4 == r0) {
    0x0000c674 movne r4, 1                                       |         r4 = 1;
                                                                 |     }
    0x0000c676 b 0xc506                                          |     goto label_1;
                                                                 | label_5:
    0x0000c678 mov r5, r2                                        |     r5 = r2;
    0x0000c67a b 0xc5ec                                          |     goto label_2;
                                                                 | label_3:
    0x0000c67c blx 0x8ad4                                        |     fcn_00008ad4 ();
    0x0000c680 stm r3!, {r2, r6, r7}                             |     *(r3!) = r2;
                                                                 |     *((r3! + 4)) = r6;
                                                                 |     *((r3! + 8)) = r7;
    0x0000c682 movs r0, r0                                       |     
    0x0000c684 lsls r4, r5, 0x1b                                 |     r4 = r5 << 0x1b;
    0x0000c686 movs r0, r0                                       |     
    0x0000c688 stm r3!, {r2, r5, r6}                             |     *(r3!) = r2;
                                                                 |     *((r3! + 4)) = r5;
                                                                 |     *((r3! + 8)) = r6;
    0x0000c68a movs r0, r0                                       |     
    0x0000c68c add r1, sp, 0x308                                 |     r1 += arg_308h;
    0x0000c68e movs r0, r0                                       |     
                                                                 | }
    ; assembly                                                   | /* r2dec pseudo code output */
                                                                 | /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-80367616.squashfs_v4_le_extract/usr/lib/libSSS_APIs.so @ 0xc290 */
                                                                 | #include <stdint.h>
                                                                 |  
    ; (fcn) sym.emsa_encode ()                                   | void emsa_encode (int16_t arg_1h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
                                                                 |     int16_t var_bp_2h;
                                                                 |     int16_t var_0h_2;
                                                                 |     int16_t var_4h_3;
                                                                 |     int16_t var_ch;
                                                                 |     int16_t var_10h_2;
                                                                 |     int16_t var_14h_3;
                                                                 |     int16_t var_1ah;
                                                                 |     int16_t var_1ch;
                                                                 |     int16_t var_20h;
                                                                 |     int16_t var_50h;
                                                                 |     int16_t var_98h;
                                                                 |     int16_t var_e4h;
                                                                 |     int16_t var_e8h;
                                                                 |     int16_t var_124h;
                                                                 |     int16_t var_0h;
                                                                 |     r0 = arg1;
                                                                 |     r1 = arg2;
                                                                 |     r2 = arg3;
                                                                 |     r3 = arg4;
    0x0000c290 svcmi 0xf0e92d                                    |     __asm ("svcmi 0xf0e92d");
    0x0000c294 mov r6, r2                                        |     r6 = r2;
    0x0000c296 sub sp, 0x12c                                     |     
    0x0000c298 ldr r2, [pc, 0x1f4]                               |     
    0x0000c29a movs r7, 0                                        |     r7 = 0;
    0x0000c29c mov r5, r0                                        |     r5 = r0;
    0x0000c29e str r3, [sp, 0xc]                                 |     var_ch = r3;
    0x0000c2a0 mov r8, r1                                        |     r8 = r1;
    0x0000c2a2 ldr r3, [pc, 0x1f0]                               |     r3 = *(0xc496);
    0x0000c2a4 add r2, pc                                        |     r2 = 0x18738;
    0x0000c2a6 mov r1, r7                                        |     r1 = r7;
    0x0000c2a8 add r0, sp, 0xe8                                  |     r0 += var_e8h;
    0x0000c2aa add r4, sp, 0x98                                  |     r4 += var_98h;
    0x0000c2ac ldr.w sl, [sp, 0x150]                             |     sl = var_0h;
    0x0000c2b0 ldr r3, [r2, r3]                                  |     
    0x0000c2b2 movs r2, 0x3c                                     |     r2 = 0x3c;
    0x0000c2b4 add.w sb, sp, 0x1c                                |     sb += var_1ch;
    0x0000c2b8 ldr r3, [r3]                                      |     r3 = *(0x18738);
    0x0000c2ba str r3, [sp, 0x124]                               |     var_124h = r3;
    0x0000c2bc mov.w r3, 0                                       |     r3 = 0;
    0x0000c2c0 str r7, [sp, 0xe4]                                |     var_e4h = r7;
    0x0000c2c2 blx 0x85f0                                        |     fcn_000085f0 ();
    0x0000c2c6 mov.w r0, 0x200                                   |     r0 = 0x200;
    0x0000c2ca movs r2, 0x4c                                     |     r2 = 0x4c;
    0x0000c2cc mov r1, r7                                        |     r1 = r7;
    0x0000c2ce str.w r0, [sb]                                    |     __asm ("str.w r0, [sb]");
    0x0000c2d2 mov r0, r4                                        |     r0 = r4;
    0x0000c2d4 strh.w r7, [sp, 0x1a]                             |     var_1ah = r7;
    0x0000c2d8 blx 0x85f0                                        |     fcn_000085f0 ();
    0x0000c2dc mov r3, r7                                        |     r3 = r7;
    0x0000c2de mov r2, r7                                        |     r2 = r7;
    0x0000c2e0 mov.w r1, 0x102                                   |     r1 = 0x102;
    0x0000c2e4 mov r0, r4                                        |     r0 = r4;
    0x0000c2e6 str r7, [sp]                                      |     *(sp) = r7;
    0x0000c2e8 blx 0x9318                                        |     r0 = fcn_00009318 ();
    0x0000c2ec cmp.w r0, 0x5a5a5a5a                              |     
    0x0000c2f0 beq 0xc318                                        |     
                                                                 |     while (r0 != 0x9000) {
                                                                 | label_0:
    0x0000c2f2 movs r5, 1                                        |         r5 = 1;
                                                                 | label_1:
    0x0000c2f4 mov r0, r4                                        |         r0 = r4;
    0x0000c2f6 blx 0x84f8                                        |         fcn_000084f8 ();
    0x0000c2fa ldr r2, [pc, 0x19c]                               |         
    0x0000c2fc ldr r3, [pc, 0x194]                               |         r3 = *(0xc494);
    0x0000c2fe add r2, pc                                        |         r2 = 0x1879c;
    0x0000c300 ldr r3, [r2, r3]                                  |         r3 = *(0x1879c);
    0x0000c302 ldr r2, [r3]                                      |         r2 = *(0x1879c);
    0x0000c304 ldr r3, [sp, 0x124]                               |         r3 = var_124h;
    0x0000c306 eors r2, r3                                       |         r2 ^= r3;
    0x0000c308 mov.w r3, 0                                       |         r3 = 0;
                                                                 |         if (r2 != r3) {
    0x0000c30c bne.w 0xc48c                                      |             goto label_3;
                                                                 |         }
    0x0000c310 mov r0, r5                                        |         r0 = r5;
    0x0000c312 add sp, 0x12c                                     |         
    0x0000c314 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc}        |         
    0x0000c318 ldr r3, [r5, 4]                                   |         r3 = *((r5 + 4));
    0x0000c31a add.w fp, sp, 0x1a                                |         
    0x0000c31e ldr r0, [r5]                                      |         r0 = *(r5);
    0x0000c320 mov r2, fp                                        |         r2 = fp;
    0x0000c322 ldr r1, [r3, 0xc]                                 |         r1 = *((r3 + 0xc));
    0x0000c324 adds r0, 4                                        |         r0 += 4;
    0x0000c326 blx 0x9360                                        |         r0 = fcn_00009360 ();
    0x0000c32a cmp.w r0, 0x9000                                  |         
    0x0000c32e bne 0xc2f2                                        |         
                                                                 |     }
    0x0000c330 ldrh.w fp, [sp, 0x1a]                             |     fp = var_1ah;
    0x0000c334 ldr.w r3, [sl]                                    |     r3 = *(sl);
    0x0000c338 cmp r3, fp                                        |     
                                                                 |     if (r3 <= fp) {
    0x0000c33a blo 0xc2f2                                        |         goto label_0;
                                                                 |     }
    0x0000c33c ldr r3, [r5, 8]                                   |     r3 = *((r5 + 8));
    0x0000c33e mvn r2, 0x800                                     |     r2 = ~0x800;
    0x0000c342 add r3, r2                                        |     r3 += r2;
    0x0000c344 cmp r3, 4                                         |     
                                                                 |     if (r3 > 4) {
    0x0000c346 bhi 0xc2f2                                        |         goto label_0;
                                                                 |     }
                                                                 |     /* switch table (5 cases) at 0xc34c */
    0x0000c348 tbb [pc, r3]                                      |     __asm ("tbb [0x0000c350]");
    0x0000c352 movw r3, 0x302                                    |     r3 = 0x302;
    0x0000c356 str r3, [sp, 0x10]                                |     var_10h_2 = r3;
    0x0000c358 movs r3, 0x1c                                     |     r3 = 0x1c;
    0x0000c35a mov r7, r3                                        |     r7 = r3;
                                                                 | label_2:
    0x0000c35c cmp r7, r6                                        |     
                                                                 |     if (r7 != r6) {
    0x0000c35e bne 0xc2f2                                        |         goto label_0;
                                                                 |     }
    0x0000c360 add r6, sp, 0x20                                  |     r6 += var_20h;
    0x0000c362 mov r1, r4                                        |     r1 = r4;
    0x0000c364 mov r0, r6                                        |     r0 = r6;
    0x0000c366 str.w fp, [sl]                                    |     __asm ("str.w fp, [sl]");
    0x0000c36a blx 0x80a0                                        |     r0 = fcn_000080a0 ();
    0x0000c36e cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c372 bne 0xc2f2                                        |         goto label_0;
                                                                 |     }
    0x0000c374 add.w sl, sp, 0xe4                                |     sl += var_e4h;
    0x0000c378 mov r0, r6                                        |     r0 = r6;
    0x0000c37a mov r2, r7                                        |     r2 = r7;
    0x0000c37c mov r1, sl                                        |     r1 = sl;
    0x0000c37e blx 0x8504                                        |     r0 = fcn_00008504 ();
    0x0000c382 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c386 bne 0xc2f2                                        |         goto label_0;
                                                                 |     }
    0x0000c388 ldr r0, [sp, 0xc]                                 |     r0 = var_ch;
    0x0000c38a sub.w r3, fp, 2                                   |     r3 = fp - 2;
    0x0000c38e sub.w r3, r3, r7, lsl 1                           |     r3 -= (r7 << 1);
    0x0000c392 movs r2, 1                                        |     r2 = 1;
    0x0000c394 mov r1, sl                                        |     r1 = sl;
    0x0000c396 strb r2, [r0, r3]                                 |     *((r0 + r3)) = r2;
    0x0000c398 add r3, r0                                        |     r3 += r0;
    0x0000c39a adds r6, r3, r2                                   |     r6 = r3 + r2;
    0x0000c39c mov r2, r7                                        |     r2 = r7;
    0x0000c39e mov r0, r6                                        |     r0 = r6;
    0x0000c3a0 blx 0x8f00                                        |     fcn_00008f00 ();
    0x0000c3a4 add r3, sp, 0x50                                  |     r3 += var_50h;
    0x0000c3a6 ldr r2, [sp, 0x10]                                |     r2 = var_10h_2;
    0x0000c3a8 mov r0, r3                                        |     r0 = r3;
    0x0000c3aa str r3, [sp, 0x14]                                |     var_14h_3 = r3;
    0x0000c3ac mov r1, r4                                        |     r1 = r4;
    0x0000c3ae movs r3, 6                                        |     r3 = 6;
    0x0000c3b0 blx 0x8644                                        |     r0 = fcn_00008644 ();
    0x0000c3b4 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c3b8 bne 0xc2f2                                        |         goto label_0;
                                                                 |     }
    0x0000c3ba ldr r0, [sp, 0x14]                                |     r0 = var_14h_3;
    0x0000c3bc blx 0x8c88                                        |     r0 = fcn_00008c88 ();
    0x0000c3c0 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c3c4 bne 0xc2f2                                        |         goto label_0;
                                                                 |     }
    0x0000c3c6 add r6, r7                                        |     r6 += r7;
    0x0000c3c8 ldr r0, [sp, 0x14]                                |     r0 = var_14h_3;
    0x0000c3ca movs r2, 8                                        |     r2 = 8;
    0x0000c3cc mov r1, r6                                        |     r1 = r6;
    0x0000c3ce blx 0x8e00                                        |     r0 = snprintf_chk ()
    0x0000c3d2 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c3d6 bne 0xc2f2                                        |         goto label_0;
                                                                 |     }
    0x0000c3d8 ldr r0, [sp, 0x14]                                |     r0 = var_14h_3;
    0x0000c3da mov r1, r8                                        |     r1 = r8;
    0x0000c3dc mov r2, r7                                        |     r2 = r7;
    0x0000c3de blx 0x8e00                                        |     r0 = snprintf_chk ()
    0x0000c3e2 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c3e6 bne 0xc2f2                                        |         goto label_0;
                                                                 |     }
    0x0000c3e8 ldr r0, [sp, 0x14]                                |     r0 = var_14h_3;
    0x0000c3ea mov r1, sl                                        |     r1 = sl;
    0x0000c3ec mov r2, r7                                        |     r2 = r7;
    0x0000c3ee blx 0x8e00                                        |     r0 = snprintf_chk ()
    0x0000c3f2 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c3f6 bne.w 0xc2f2                                      |         goto label_0;
                                                                 |     }
    0x0000c3fa ldr r0, [sp, 0x14]                                |     r0 = var_14h_3;
    0x0000c3fc mov r2, sb                                        |     r2 = sb;
    0x0000c3fe mov r1, r6                                        |     r1 = r6;
    0x0000c400 blx 0x9134                                        |     r0 = fcn_00009134 ();
    0x0000c404 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c408 bne.w 0xc2f2                                      |         goto label_0;
                                                                 |     }
    0x0000c40c ldr r0, [sp, 0x14]                                |     r0 = var_14h_3;
    0x0000c40e mov r8, r7                                        |     r8 = r7;
    0x0000c410 blx 0x8e7c                                        |     fcn_00008e7c ();
    0x0000c414 ldr r3, [sp, 0x10]                                |     r3 = var_10h_2;
    0x0000c416 add.w r1, fp, -1                                  |     r1 = fp + -1;
    0x0000c41a subs r1, r1, r7                                   |     r1 -= r7;
    0x0000c41c str r5, [sp, 4]                                   |     var_4h_3 = r5;
    0x0000c41e mov r2, r6                                        |     r2 = r6;
    0x0000c420 str r3, [sp]                                      |     *(sp) = r3;
    0x0000c422 mov r3, r7                                        |     r3 = r7;
    0x0000c424 ldr r7, [sp, 0xc]                                 |     r7 = var_ch;
    0x0000c426 mov r0, r7                                        |     r0 = r7;
    0x0000c428 blx 0x8d50                                        |     r0 = fcn_00008d50 ();
    0x0000c42c mov r5, r0                                        |     r5 = r0;
    0x0000c42e cmp r0, 0                                         |     
                                                                 |     if (r0 != 0) {
    0x0000c430 bne.w 0xc2f2                                      |         goto label_0;
                                                                 |     }
    0x0000c434 ldrb r3, [r7]                                     |     r3 = *(r7);
    0x0000c436 and r3, r3, 0x7f                                  |     r3 &= 0x7f;
    0x0000c43a strb r3, [r7]                                     |     *(r7) = r3;
    0x0000c43c movs r3, 0xbc                                     |     r3 = 0xbc;
    0x0000c43e strb.w r3, [r6, r8]                               |     *((r6 + r8)) = r3;
    0x0000c440 adds r0, 8                                        |     r0 += 8;
    0x0000c442 b 0xc2f4                                          |     goto label_1;
    0x0000c444 movw r3, 0x301                                    |     r3 = 0x301;
    0x0000c448 str r3, [sp, 0x10]                                |     var_10h_2 = r3;
    0x0000c44a movs r3, 0x14                                     |     r3 = 0x14;
    0x0000c44c mov r7, r3                                        |     r7 = r3;
    0x0000c44e b 0xc35c                                          |     goto label_2;
    0x0000c450 cmp.w fp, 0x80                                    |     
                                                                 |     if (fp < 0x80) {
    0x0000c454 bls.w 0xc2f2                                      |         goto label_0;
                                                                 |     }
    0x0000c458 movw r3, 0x305                                    |     r3 = 0x305;
    0x0000c45c str r3, [sp, 0x10]                                |     var_10h_2 = r3;
    0x0000c45e movs r3, 0x40                                     |     r3 = 0x40;
    0x0000c460 mov r7, r3                                        |     r7 = r3;
    0x0000c462 b 0xc35c                                          |     goto label_2;
    0x0000c464 cmp.w fp, 0x40                                    |     
                                                                 |     if (fp < 0x40) {
    0x0000c468 bls.w 0xc2f2                                      |         goto label_0;
                                                                 |     }
    0x0000c46c mov.w r3, 0x304                                   |     r3 = 0x304;
    0x0000c470 str r3, [sp, 0x10]                                |     var_10h_2 = r3;
    0x0000c472 movs r3, 0x30                                     |     r3 = 0x30;
    0x0000c474 mov r7, r3                                        |     r7 = r3;
    0x0000c476 b 0xc35c                                          |     goto label_2;
    0x0000c478 cmp.w fp, 0x40                                    |     
                                                                 |     if (fp < 0x40) {
    0x0000c47c bls.w 0xc2f2                                      |         goto label_0;
                                                                 |     }
    0x0000c480 movw r3, 0x303                                    |     r3 = 0x303;
    0x0000c484 str r3, [sp, 0x10]                                |     var_10h_2 = r3;
    0x0000c486 movs r3, 0x20                                     |     r3 = 0x20;
    0x0000c488 mov r7, r3                                        |     r7 = r3;
    0x0000c48a b 0xc35c                                          |     goto label_2;
                                                                 | label_3:
    0x0000c48c blx 0x8ad4                                        |     fcn_00008ad4 ();
    0x0000c490 stm r5!, {r4, r6, r7}                             |     *(r5!) = r4;
                                                                 |     *((r5! + 4)) = r6;
                                                                 |     *((r5! + 8)) = r7;
    0x0000c492 movs r0, r0                                       |     
    0x0000c494 lsls r4, r5, 0x1b                                 |     r4 = r5 << 0x1b;
    0x0000c496 movs r0, r0                                       |     
    0x0000c498 stm r5!, {r1, r2, r4, r5, r6}                     |     *(r5!) = r1;
                                                                 |     *((r5! + 4)) = r2;
                                                                 |     *((r5! + 8)) = r4;
                                                                 |     *((r5! + 12)) = r5;
                                                                 |     *((r5! + 16)) = r6;
    0x0000c49a movs r0, r0                                       |     
                                                                 | }
    ; assembly                                                   | /* r2dec pseudo code output */
                                                                 | /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-80367616.squashfs_v4_le_extract/usr/lib/libSSS_APIs.so @ 0xc148 */
                                                                 | #include <stdint.h>
                                                                 |  
    ; (fcn) sym.sss_mgf_mask_func ()                             | void sss_mgf_mask_func (int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
                                                                 |     int16_t var_0h;
                                                                 |     int16_t var_8h_2;
                                                                 |     int16_t var_ch_3;
                                                                 |     int16_t var_10h;
                                                                 |     int16_t var_14h;
                                                                 |     int16_t var_a8h;
                                                                 |     int16_t var_abh;
                                                                 |     int16_t var_ach;
                                                                 |     int16_t var_ech;
                                                                 |     int16_t var_118h;
                                                                 |     r0 = arg1;
                                                                 |     r1 = arg2;
                                                                 |     r2 = arg3;
                                                                 |     r3 = arg4;
    0x0000c148 svcmi 0xf0e92d                                    |     __asm ("svcmi 0xf0e92d");
    0x0000c14c mov sl, r2                                        |     sl = r2;
    0x0000c14e ldr r2, [pc, 0x134]                               |     
    0x0000c150 mov r8, r3                                        |     r8 = r3;
    0x0000c152 sub sp, 0xf4                                      |     
    0x0000c154 mov.w r6, 0x200                                   |     r6 = 0x200;
    0x0000c158 ldr r3, [pc, 0x12c]                               |     r3 = *(0xc288);
    0x0000c15a add.w fp, sp, 0x5c                                |     
    0x0000c15e add r2, pc                                        |     r2 = 0x183e8;
    0x0000c160 mov r4, r0                                        |     r4 = r0;
    0x0000c162 mov r5, r1                                        |     r5 = r1;
    0x0000c164 mov r0, fp                                        |     r0 = fp;
    0x0000c166 ldr r3, [r2, r3]                                  |     
    0x0000c168 movs r1, 0                                        |     r1 = 0;
    0x0000c16a add.w sb, sp, 0xac                                |     sb += var_ach;
    0x0000c16e movs r2, 0x4c                                     |     r2 = 0x4c;
    0x0000c170 ldr r3, [r3]                                      |     r3 = *(0x183e8);
    0x0000c172 str r3, [sp, 0xec]                                |     var_ech = r3;
    0x0000c174 mov.w r3, 0                                       |     r3 = 0;
    0x0000c178 str r6, [sp, 0x10]                                |     var_10h = r6;
    0x0000c17a blx 0x85f0                                        |     fcn_000085f0 ();
    0x0000c17e movs r2, 0x40                                     |     r2 = 0x40;
    0x0000c180 movs r1, 0                                        |     r1 = 0;
    0x0000c182 mov r0, sb                                        |     r0 = sb;
    0x0000c184 blx 0x85f0                                        |     fcn_000085f0 ();
    0x0000c188 movs r3, 0                                        |     r3 = 0;
    0x0000c18a mov.w r1, 0x102                                   |     r1 = 0x102;
    0x0000c18e mov r2, r3                                        |     r2 = r3;
    0x0000c190 mov r0, fp                                        |     r0 = fp;
    0x0000c192 str r3, [sp]                                      |     *(sp) = r3;
    0x0000c194 str r3, [sp, 0xa8]                                |     var_a8h = r3;
    0x0000c196 blx 0x9318                                        |     r0 = fcn_00009318 ();
    0x0000c19a cmp.w r0, 0x5a5a5a5a                              |     
    0x0000c19e beq 0xc1c4                                        |     
                                                                 |     while (r0 != 0x5a5a5a5a) {
                                                                 | label_1:
    0x0000c1a0 movs r4, 1                                        |         r4 = 1;
                                                                 | label_2:
    0x0000c1a2 mov r0, fp                                        |         r0 = fp;
    0x0000c1a4 blx 0x84f8                                        |         fcn_000084f8 ();
    0x0000c1a8 ldr r2, [pc, 0xe0]                                |         
    0x0000c1aa ldr r3, [pc, 0xdc]                                |         r3 = *(0xc28a);
    0x0000c1ac add r2, pc                                        |         r2 = 0x1843c;
    0x0000c1ae ldr r3, [r2, r3]                                  |         r3 = *(0x1843c);
    0x0000c1b0 ldr r2, [r3]                                      |         r2 = *(0x1843c);
    0x0000c1b2 ldr r3, [sp, 0xec]                                |         r3 = var_ech;
    0x0000c1b4 eors r2, r3                                       |         r2 ^= r3;
    0x0000c1b6 mov.w r3, 0                                       |         r3 = 0;
                                                                 |         if (r2 != r3) {
    0x0000c1ba bne 0xc27e                                        |             goto label_3;
                                                                 |         }
    0x0000c1bc mov r0, r4                                        |         r0 = r4;
    0x0000c1be add sp, 0xf4                                      |         
    0x0000c1c0 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc}        |         
    0x0000c1c4 add r7, sp, 0x14                                  |         r7 += var_14h;
    0x0000c1c6 ldr r2, [sp, 0x118]                               |         r2 = var_118h;
    0x0000c1c8 movs r3, 6                                        |         r3 = 6;
    0x0000c1ca mov r1, fp                                        |         r1 = fp;
    0x0000c1cc mov r0, r7                                        |         r0 = r7;
    0x0000c1ce blx 0x8644                                        |         r0 = fcn_00008644 ();
    0x0000c1d2 cmp.w r0, 0x5a5a5a5a                              |         
    0x0000c1d6 bne 0xc1a0                                        |         
                                                                 |     }
    0x0000c1d8 cmp r5, 0                                         |     
                                                                 |     if (r5 == 0) {
    0x0000c1da beq 0xc274                                        |         goto label_4;
                                                                 |     }
    0x0000c1dc add r3, sp, 0xa8                                  |     r3 += var_a8h;
    0x0000c1de add r2, sp, 0x10                                  |     r2 += var_10h;
    0x0000c1e0 strd r2, fp, [sp, 8]                              |     __asm ("strd r2, fp, [sp, 8]");
    0x0000c1e4 mov fp, r3                                        |     
                                                                 | label_0:
    0x0000c1e6 mov r0, r7                                        |     r0 = r7;
    0x0000c1e8 mov r6, r8                                        |     r6 = r8;
    0x0000c1ea blx 0x8c88                                        |     fcn_00008c88 ();
    0x0000c1ee cmp r8, r5                                        |     
    0x0000c1f0 it hs                                             |     
                                                                 |     if (r8 < r5) {
    0x0000c1f2 movhs r6, r5                                      |         r6 = r5;
                                                                 |     }
    0x0000c1f4 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c1f8 bne 0xc26a                                        |         goto label_5;
                                                                 |     }
    0x0000c1fa mov r2, r8                                        |     r2 = r8;
    0x0000c1fc mov r1, sl                                        |     r1 = sl;
    0x0000c1fe mov r0, r7                                        |     r0 = r7;
    0x0000c200 blx 0x8e00                                        |     r0 = snprintf_chk ()
    0x0000c204 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c208 bne 0xc26a                                        |         goto label_5;
                                                                 |     }
    0x0000c20a movs r2, 4                                        |     r2 = 4;
    0x0000c20c mov r1, fp                                        |     r1 = fp;
    0x0000c20e mov r0, r7                                        |     r0 = r7;
    0x0000c210 blx 0x8e00                                        |     r0 = snprintf_chk ()
    0x0000c214 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c218 bne 0xc26a                                        |         goto label_5;
                                                                 |     }
    0x0000c21a ldr r2, [sp, 8]                                   |     r2 = var_8h_2;
    0x0000c21c mov r1, sb                                        |     r1 = sb;
    0x0000c21e mov r0, r7                                        |     r0 = r7;
    0x0000c220 blx 0x9134                                        |     r0 = fcn_00009134 ();
    0x0000c224 cmp.w r0, 0x5a5a5a5a                              |     
                                                                 |     if (r0 != 0x5a5a5a5a) {
    0x0000c228 bne 0xc26a                                        |         goto label_5;
                                                                 |     }
                                                                 |     if (r6 == 0) {
    0x0000c22a cbz r6, 0xc25a                                    |         goto label_6;
                                                                 |     }
    0x0000c22c mov r1, sb                                        |     r1 = sb;
    0x0000c22e add.w ip, r4, r6                                  |     
                                                                 |     do {
    0x0000c232 ldrb r2, [r4], 1                                  |         r2 = *(r4);
                                                                 |         r4++;
    0x0000c236 ldrb r3, [r1], 1                                  |         r3 = *(r1);
                                                                 |         r1++;
    0x0000c23a cmp ip, r4                                        |         
    0x0000c23c eor.w r3, r3, r2                                  |         r3 ^= r2;
    0x0000c240 strb r3, [r4, -0x1]                               |         *((r4 - 0x1)) = r3;
    0x0000c244 bne 0xc232                                        |         
                                                                 |     } while (ip != r4);
    0x0000c246 ldrb.w r3, [sp, 0xab]                             |     r3 = var_abh;
    0x0000c24a subs r5, r5, r6                                   |     r5 -= r6;
    0x0000c24c add.w r3, r3, 1                                   |     r3++;
    0x0000c250 strb.w r3, [sp, 0xab]                             |     var_abh = r3;
                                                                 |     if (r5 != r5) {
    0x0000c254 beq 0xc270                                        |         
    0x0000c256 mov r4, ip                                        |         r4 = ip;
    0x0000c258 b 0xc1e6                                          |         goto label_0;
                                                                 | label_6:
    0x0000c25a ldrb.w r3, [sp, 0xab]                             |         r3 = var_abh;
    0x0000c25e mov ip, r4                                        |         
    0x0000c260 mov r4, ip                                        |         r4 = ip;
    0x0000c262 adds r3, 1                                        |         r3++;
    0x0000c264 strb.w r3, [sp, 0xab]                             |         var_abh = r3;
    0x0000c268 b 0xc1e6                                          |         goto label_0;
                                                                 | label_5:
    0x0000c26a ldr.w fp, [sp, 0xc]                               |         fp = var_ch_3;
    0x0000c26e b 0xc1a0                                          |         goto label_1;
                                                                 |     }
    0x0000c270 ldr.w fp, [sp, 0xc]                               |     fp = var_ch_3;
                                                                 | label_4:
    0x0000c274 mov r0, r7                                        |     r0 = r7;
    0x0000c276 movs r4, 0                                        |     r4 = 0;
    0x0000c278 blx 0x8e7c                                        |     fcn_00008e7c ();
    0x0000c27c b 0xc1a2                                          |     goto label_2;
                                                                 | label_3:
    0x0000c27e blx 0x8ad4                                        |     fcn_00008ad4 ();
    0x0000c282 nop                                               |     
    0x0000c284 stm r7!, {r1, r2, r4}                             |     *(r7!) = r1;
                                                                 |     *((r7! + 4)) = r2;
                                                                 |     *((r7! + 8)) = r4;
    0x0000c286 movs r0, r0                                       |     
    0x0000c288 lsls r4, r5, 0x1b                                 |     r4 = r5 << 0x1b;
    0x0000c28a movs r0, r0                                       |     
    0x0000c28c stm r6!, {r3, r6, r7}                             |     *(r6!) = r3;
                                                                 |     *((r6! + 4)) = r6;
                                                                 |     *((r6! + 8)) = r7;
    0x0000c28e movs r0, r0                                       |     
                                                                 | }

[*] Function printf used 9 times libSSS_APIs.so