[*] Binary protection state of ubirsvol
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of ubirsvol
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x112a8 */
| #include <stdint.h>
|
; (fcn) fcn.000112a8 () | void fcn_000112a8 (int32_t arg1) {
| char * * endptr;
| int32_t var_ch;
| r0 = arg1;
0x000112a8 push {r0, r1, r2, r4, r5, r6, r7, lr} |
0x000112ac mov r2, 0 | r2 = 0;
0x000112b0 add r1, sp, 4 | r1 += endptr;
0x000112b4 mov r7, r0 | r7 = r0;
0x000112b8 bl 0x10ac4 | strtoull (r0, r1, r2);
0x000112bc ldr r6, [sp, 4] | r6 = endptr;
0x000112c0 sub r3, r6, r7 | r3 = r6 - r7;
0x000112c4 clz r3, r3 | r3 &= r3;
0x000112c8 lsr r3, r3, 5 | r3 >>= 5;
0x000112cc orrs r3, r3, r1, lsr 31 | r3 |= (r1 >> 31);
| if (r3 == r3) {
0x000112d0 movne r2, r7 | r2 = r7;
| }
| if (r3 == r3) {
0x000112d4 ldrne r1, [pc, 0xc0] | r1 = "incorrect_amount_of_bytes:___s_";
| }
| if (r3 != r3) {
0x000112d8 bne 0x11350 | goto label_1;
| }
0x000112dc ldrb r3, [r6] | r3 = *(r6);
0x000112e0 mov r4, r0 | r4 = r0;
0x000112e4 cmp r3, 0 |
0x000112e8 mov r5, r1 | r5 = r1;
| if (r3 == 0) {
0x000112ec beq 0x11364 | goto label_2;
| }
0x000112f0 mov r3, r6 | r3 = r6;
| do {
0x000112f4 mov r7, r3 | r7 = r3;
0x000112f8 ldrb r2, [r3], 1 | r2 = *(r3);
| r3++;
0x000112fc cmp r2, 9 |
0x00011300 cmpne r2, 0x20 | __asm ("cmpne r2, 0x20");
0x00011304 beq 0x112f4 |
| } while (r2 == 9);
0x00011308 ldr r1, [pc, 0x90] | r1 = "incorrect_amount_of_bytes:___s_";
0x0001130c mov r0, r7 | r0 = r7;
0x00011310 bl 0x10b0c | r0 = strcmp (r0, "incorrect_amount_of_bytes:___s_");
0x00011314 cmp r0, 0 |
| if (r0 == 0) {
0x00011318 beq 0x11374 | goto label_3;
| }
0x0001131c ldr r1, [pc, 0x80] | r1 = "KiB";
0x00011320 mov r0, r7 | r0 = r7;
0x00011324 bl 0x10b0c | r0 = strcmp (r0, "KiB");
0x00011328 cmp r0, 0 |
| if (r0 == 0) {
0x0001132c beq 0x11394 | goto label_4;
| }
0x00011330 ldr r1, [pc, 0x70] | r1 = "MiB";
0x00011334 mov r0, r7 | r0 = r7;
0x00011338 bl 0x10b0c | r0 = strcmp (r0, "MiB");
0x0001133c cmp r0, 0 |
| if (r0 != 0) {
0x00011340 moveq r3, 0x40000000 | r3 = 0x40000000;
| }
| if (r0 == 0) {
0x00011344 beq 0x11378 | goto label_0;
| }
0x00011348 ldr r1, [pc, 0x5c] | r1 = "GiB";
0x0001134c mov r2, r6 | r2 = r6;
| label_1:
0x00011350 ldr r3, [pc, 0x58] | r3 = "bad size specifier: \"%s\" - should be 'KiB', 'MiB' or 'GiB'\n";
0x00011354 mvn r4, 0 | r4 = ~0;
0x00011358 ldr r0, [r3] | r0 = "bad size specifier: \"%s\" - should be 'KiB', 'MiB' or 'GiB'\n";
0x0001135c bl 0x10a64 | fprintf ("bad size specifier: \"%s\" - should be 'KiB', 'MiB' or 'GiB'\n", "GiB", r2, "bad size specifier: \"%s\" - should be 'KiB', 'MiB' or 'GiB'\n", r4)
0x00011360 mvn r5, 0 | r5 = ~0;
| do {
| label_2:
0x00011364 mov r0, r4 | r0 = r4;
0x00011368 mov r1, r5 | r1 = r5;
0x0001136c add sp, sp, 0xc |
0x00011370 pop {r4, r5, r6, r7, pc} |
| label_3:
0x00011374 mov r3, 0x400 | r3 = 0x400;
| label_0:
0x00011378 asr r1, r3, 0x1f | r1 = r3 >> 0x1f;
0x0001137c mul ip, r4, r1 |
0x00011380 mov r1, r4 | r1 = r4;
0x00011384 mla r2, r3, r5, ip | __asm ("mla r2, r3, r5, ip");
0x00011388 umull r4, r5, r1, r3 | r4:r5 = r1 * r3;
0x0001138c add r5, r2, r5 | r5 = r2 + r5;
0x00011390 b 0x11364 |
| } while (1);
| label_4:
0x00011394 mov r3, 0x100000 | r3 = 0x100000;
0x00011398 b 0x11378 | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x1156c */
| #include <stdint.h>
|
; (fcn) fcn.0001156c () | void fcn_0001156c (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| char * buf;
| char * s;
| int32_t var_4ch;
| r0 = arg1;
| r1 = arg2;
0x0001156c push {r4, r5, r6, r7, lr} |
0x00011570 mov r6, r1 | r6 = r1;
0x00011574 sub sp, sp, 0x4c |
0x00011578 mov r1, 0 | r1 = 0;
0x0001157c mov r5, r0 | r5 = r0;
0x00011580 bl 0x10af4 | r0 = open64 ();
0x00011584 cmn r0, 1 |
0x00011588 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x0001158c beq 0x116e8 | goto label_2;
| }
0x00011590 mov r2, 0x32 | r2 = 0x32;
0x00011594 add r1, sp, 0x14 | r1 += buf;
0x00011598 bl 0x10a7c | r0 = read (r0, r1, r2);
0x0001159c cmn r0, 1 |
| if (r0 != 1) {
0x000115a0 bne 0x115f8 | goto label_3;
| }
0x000115a4 bl 0x10b24 | errno_location ();
0x000115a8 ldr r7, [pc, 0x144] | r7 = *(0x116f0);
0x000115ac mov r3, r5 | r3 = r5;
0x000115b0 ldr r2, [pc, 0x140] | r2 = stderr;
0x000115b4 ldr r1, [pc, 0x140] | r1 = "libubi";
0x000115b8 ldr r6, [r0] | r6 = *(r0);
0x000115bc ldr r0, [r7] | r0 = *(0x116f0);
0x000115c0 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000115c4 mov r0, r6 | r0 = r6;
0x000115c8 ldr r5, [r7] | r5 = *(0x116f0);
0x000115cc bl 0x109d4 | strerror (r0);
0x000115d0 str r6, [sp] | *(sp) = r6;
0x000115d4 ldr r3, [pc, 0x124] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000115d8 mov r2, 8 | r2 = 8;
0x000115dc ldr r1, [pc, 0x120] | r1 = *(0x11700);
0x000115e0 str r0, [sp, 4] | var_4h = r0;
0x000115e4 mov r0, r5 | r0 = r5;
0x000115e8 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x000115ec mov r0, r4 | r0 = r4;
0x000115f0 bl 0x10b6c | close (r0);
0x000115f4 b 0x116e4 | goto label_4;
| label_3:
0x000115f8 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x000115fc bne 0x11628 | goto label_5;
| }
0x00011600 ldr r2, [pc, 0xf0] | r2 = stderr;
0x00011604 ldr r1, [pc, 0xfc] | r1 = "%*serror %d (%s)\n";
0x00011608 mov r3, r5 | r3 = r5;
| label_0:
0x0001160c ldr r0, [pc, 0xe0] |
0x00011610 ldr r0, [r0] | r0 = *(0x116f0);
0x00011614 bl 0x10a64 | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x00011618 bl 0x10b24 | errno_location ();
0x0001161c mov r3, 0x16 | r3 = 0x16;
0x00011620 str r3, [r0] | *(r0) = r3;
0x00011624 b 0x115ec |
| } while (1);
| label_5:
0x00011628 add r3, sp, 0x48 | r3 += s;
0x0001162c add r0, r3, r0 | r0 = r3 + r0;
0x00011630 mov r3, 0 | r3 = 0;
0x00011634 strb r3, [r0, -0x34] | buf = r3;
0x00011638 mov r2, r6 | r2 = r6;
0x0001163c ldr r1, [pc, 0xc8] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x00011640 add r0, sp, 0x14 | r0 += buf;
0x00011644 bl 0x10aac | r0 = sscanf (r0, "%s: error!: contents of \"%s\" is too long\n", r2);
0x00011648 cmp r0, 1 |
| if (r0 == 1) {
0x0001164c movne r3, r5 | r3 = r5;
| }
| if (r0 == 1) {
0x00011650 ldrne r2, [pc, 0xa0] | r2 = "libubi";
| }
| if (r0 != 1) {
0x00011654 ldrne r1, [pc, 0xb4] | r1 = "%s: error!: cannot read integer from \"%s\"\n\n";
| goto label_6;
| }
| if (r0 != 1) {
| label_6:
0x00011658 bne 0x1160c | goto label_0;
| }
0x0001165c ldrd r2, r3, [r6] | __asm ("ldrd r2, r3, [r6]");
0x00011660 cmp r2, 0 |
0x00011664 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x00011668 bge 0x1168c |
0x0001166c strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011670 ldr r3, [pc, 0x7c] | r3 = *(0x116f0);
0x00011674 str r5, [sp, 8] | var_8h = r5;
0x00011678 ldr r2, [pc, 0x78] | r2 = stderr;
0x0001167c ldr r1, [pc, 0x90] | r1 = "%s: error!: cannot read integer from \"%s\"\n\n";
0x00011680 ldr r0, [r3] | r0 = *(0x116f0);
0x00011684 bl 0x10a64 | fprintf (r0, "%s: error!: cannot read integer from \"%s\"\n\n", r2, r3, r4, r5)
0x00011688 b 0x11618 | goto label_1;
| }
0x0001168c mov r0, r4 | r0 = r4;
0x00011690 bl 0x10b6c | r0 = close (r0);
0x00011694 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00011698 beq 0x116e8 |
0x0001169c bl 0x10b24 | errno_location ();
0x000116a0 ldr r6, [pc, 0x4c] | r6 = *(0x116f0);
0x000116a4 mov r3, r5 | r3 = r5;
0x000116a8 ldr r2, [pc, 0x48] | r2 = stderr;
0x000116ac ldr r1, [pc, 0x64] | r1 = "%s: error!: negative value %lld in \"%s\"\n";
0x000116b0 ldr r4, [r0] | r4 = *(r0);
0x000116b4 ldr r0, [r6] | r0 = *(0x116f0);
0x000116b8 bl 0x10a64 | fprintf (r0, "%s: error!: negative value %lld in \"%s\"\n", r2, r3, r4, r5, r6)
0x000116bc mov r0, r4 | r0 = r4;
0x000116c0 ldr r5, [r6] | r5 = *(0x116f0);
0x000116c4 bl 0x109d4 | strerror (r0);
0x000116c8 str r4, [sp] | *(sp) = r4;
0x000116cc ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000116d0 mov r2, 8 | r2 = 8;
0x000116d4 ldr r1, [pc, 0x28] | r1 = *(0x11700);
0x000116d8 str r0, [sp, 4] | var_4h = r0;
0x000116dc mov r0, r5 | r0 = r5;
0x000116e0 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x000116e4 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x000116e8 mov r0, r4 | r0 = r4;
0x000116ec add sp, sp, 0x4c |
0x000116f0 pop {r4, r5, r6, r7, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x1171c */
| #include <stdint.h>
|
; (fcn) fcn.0001171c () | void fcn_0001171c (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_0h_2;
| int32_t var_8h;
| int32_t var_10h;
| int32_t var_10h_2;
| int32_t var_1ch;
| r0 = arg1;
| r1 = arg2;
0x0001171c push {r4, r5, lr} |
0x00011720 sub sp, sp, 0x1c |
0x00011724 mov r4, r1 | r4 = r1;
0x00011728 add r1, sp, 0x10 | r1 += var_10h;
0x0001172c mov r5, r0 | r5 = r0;
0x00011730 bl 0x1156c | r0 = fcn_0001156c (r0, r1);
0x00011734 cmp r0, 0 |
| if (r0 == 0) {
0x00011738 bne 0x11778 |
0x0001173c ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [var_10h]");
0x00011740 cmp r2, 0x80000000 |
0x00011744 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 >= 0x80000000) {
0x00011748 strlt r2, [r4] | *(r4) = r2;
| }
| if (r2 < 0x80000000) {
0x0001174c blt 0x1177c | goto label_0;
| }
0x00011750 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011754 ldr r3, [pc, 0x28] | r3 = *(0x11780);
0x00011758 str r5, [sp, 8] | var_8h = r5;
0x0001175c ldr r2, [pc, 0x24] | r2 = stderr;
0x00011760 ldr r0, [r3] | r0 = *(0x11780);
0x00011764 ldr r1, [pc, 0x20] | r1 = "libubi";
0x00011768 bl 0x10a64 | r0 = fprintf (r0, "libubi", r2, r3, r4, r5)
0x0001176c bl 0x10b24 | errno_location ();
0x00011770 mov r3, 0x16 | r3 = 0x16;
0x00011774 str r3, [r0] | *(r0) = r3;
| }
0x00011778 mvn r0, 0 | r0 = ~0;
| label_0:
0x0001177c add sp, sp, 0x1c |
0x00011780 pop {r4, r5, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x11828 */
| #include <stdint.h>
|
; (fcn) fcn.00011828 () | void fcn_00011828 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| void * buf;
| int32_t var_10h;
| r0 = arg1;
| r1 = arg2;
0x00011828 push {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr} |
0x0001182c mov r8, r1 | r8 = r1;
0x00011830 mov r1, 0 | r1 = 0;
0x00011834 mov r5, r0 | r5 = r0;
0x00011838 mov r7, r2 | r7 = r2;
0x0001183c bl 0x10af4 | r0 = open64 ();
0x00011840 cmn r0, 1 |
0x00011844 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00011848 beq 0x11990 | goto label_2;
| }
0x0001184c mov r2, r7 | r2 = r7;
0x00011850 mov r1, r8 | r1 = r8;
0x00011854 bl 0x10a7c | r0 = read (r0, r1, r2);
0x00011858 cmn r0, 1 |
0x0001185c mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x00011860 bne 0x118b8 | goto label_3;
| }
| label_0:
0x00011864 bl 0x10b24 | errno_location ();
0x00011868 ldr r7, [pc, 0x12c] | r7 = *(0x11998);
0x0001186c mov r3, r5 | r3 = r5;
0x00011870 ldr r2, [pc, 0x128] | r2 = stderr;
0x00011874 ldr r1, [pc, 0x128] | r1 = "libubi";
0x00011878 ldr r6, [r0] | r6 = *(r0);
0x0001187c ldr r0, [r7] | r0 = *(0x11998);
0x00011880 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00011884 mov r0, r6 | r0 = r6;
0x00011888 ldr r5, [r7] | r5 = *(0x11998);
0x0001188c bl 0x109d4 | strerror (r0);
0x00011890 str r6, [sp] | *(sp) = r6;
0x00011894 ldr r3, [pc, 0x10c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00011898 mov r2, 8 | r2 = 8;
0x0001189c ldr r1, [pc, 0x108] | r1 = *(0x119a8);
0x000118a0 str r0, [sp, 4] | var_4h = r0;
0x000118a4 mov r0, r5 | r0 = r5;
0x000118a8 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x000118ac mov r0, r4 | r0 = r4;
0x000118b0 bl 0x10b6c | close (r0);
0x000118b4 b 0x1198c | goto label_4;
| label_3:
0x000118b8 cmp r7, r0 |
| if (r7 != r0) {
0x000118bc bne 0x118e8 | goto label_5;
| }
0x000118c0 ldr r0, [pc, 0xd4] |
0x000118c4 mov r3, r5 | r3 = r5;
0x000118c8 ldr r2, [pc, 0xd0] | r2 = stderr;
0x000118cc ldr r1, [pc, 0xdc] | r1 = "%*serror %d (%s)\n";
0x000118d0 ldr r0, [r0] | r0 = *(0x11998);
0x000118d4 bl 0x10a64 | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x000118d8 bl 0x10b24 | errno_location ();
0x000118dc mov r3, 0x16 | r3 = 0x16;
0x000118e0 str r3, [r0] | *(r0) = r3;
0x000118e4 b 0x118ac |
| } while (1);
| label_5:
0x000118e8 mov r3, 0 | r3 = 0;
0x000118ec strb r3, [r8, r0] | *((r8 + r0)) = r3;
0x000118f0 mov r2, 1 | r2 = 1;
0x000118f4 add r1, sp, 0xc | r1 += buf;
0x000118f8 mov r0, r4 | r0 = r4;
0x000118fc bl 0x10a7c | r0 = read (r0, r1, r2);
0x00011900 cmp r0, 1 |
| if (r0 == 1) {
0x00011904 beq 0x11864 | goto label_0;
| }
0x00011908 cmp r0, 0 |
| if (r0 != 0) {
0x0001190c beq 0x11930 |
0x00011910 ldr r0, [pc, 0x84] |
0x00011914 str r7, [sp] | *(sp) = r7;
0x00011918 mov r3, r5 | r3 = r5;
0x0001191c ldr r2, [pc, 0x7c] | r2 = stderr;
0x00011920 ldr r1, [pc, 0x8c] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x00011924 ldr r0, [r0] | r0 = *(0x11998);
0x00011928 bl 0x10a64 | fprintf (r0, "%s: error!: contents of \"%s\" is too long\n", r2, r3)
0x0001192c b 0x118d8 | goto label_1;
| }
0x00011930 mov r0, r4 | r0 = r4;
0x00011934 bl 0x10b6c | r0 = close (r0);
0x00011938 cmp r0, 0 |
| if (r0 != 0) {
0x0001193c moveq r4, r6 | r4 = r6;
| }
| if (r0 != 0) {
0x00011940 beq 0x11990 |
0x00011944 bl 0x10b24 | errno_location ();
0x00011948 ldr r6, [pc, 0x4c] | r6 = *(0x11998);
0x0001194c mov r3, r5 | r3 = r5;
0x00011950 ldr r2, [pc, 0x48] | r2 = stderr;
0x00011954 ldr r1, [pc, 0x5c] | r1 = "_s:_error_:_file___s__contains_too_much_data_____d_bytes_";
0x00011958 ldr r4, [r0] | r4 = *(r0);
0x0001195c ldr r0, [r6] | r0 = *(0x11998);
0x00011960 bl 0x10a64 | fprintf (r0, "_s:_error_:_file___s__contains_too_much_data_____d_bytes_", r2, r3, r4, r5, r6)
0x00011964 mov r0, r4 | r0 = r4;
0x00011968 ldr r5, [r6] | r5 = *(0x11998);
0x0001196c bl 0x109d4 | strerror (r0);
0x00011970 str r4, [sp] | *(sp) = r4;
0x00011974 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00011978 mov r2, 8 | r2 = 8;
0x0001197c ldr r1, [pc, 0x28] | r1 = *(0x119a8);
0x00011980 str r0, [sp, 4] | var_4h = r0;
0x00011984 mov r0, r5 | r0 = r5;
0x00011988 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x0001198c mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00011990 mov r0, r4 | r0 = r4;
0x00011994 add sp, sp, 0x10 |
0x00011998 pop {r4, r5, r6, r7, r8, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x119bc */
| #include <stdint.h>
|
; (fcn) fcn.000119bc () | void fcn_000119bc (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
| r1 = arg2;
0x000119bc push {r0, r1, r4, r5, r6, r7, r8, sb, sl, lr} |
0x000119c0 mov r7, r1 | r7 = r1;
0x000119c4 mov sl, r0 | sl = r0;
0x000119c8 bl 0x10b3c | r0 = strlen (r0);
0x000119cc mov r4, r0 | r4 = r0;
0x000119d0 mov sb, r0 | sb = r0;
0x000119d4 mov r0, r7 | r0 = r7;
0x000119d8 bl 0x10b3c | r0 = strlen (r0);
0x000119dc add r6, r4, r0 | r6 = r4 + r0;
0x000119e0 add r6, r6, 2 | r6 += 2;
0x000119e4 mov r8, r0 | r8 = r0;
0x000119e8 mov r0, r6 | r0 = r6;
0x000119ec bl 0x10a28 | r0 = malloc (r0);
0x000119f0 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x000119f4 bne 0x11a4c | goto label_0;
| }
0x000119f8 bl 0x10b24 | errno_location ();
0x000119fc ldr r7, [pc, 0x80] | r7 = *(0x11a80);
0x00011a00 mov r3, r6 | r3 = r6;
0x00011a04 ldr r2, [pc, 0x7c] | r2 = stderr;
0x00011a08 ldr r1, [pc, 0x7c] | r1 = "libubi";
0x00011a0c ldr r4, [r0] | r4 = *(r0);
0x00011a10 ldr r0, [r7] | r0 = *(0x11a80);
0x00011a14 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4)
0x00011a18 mov r0, r4 | r0 = r4;
0x00011a1c ldr r6, [r7] | r6 = *(0x11a80);
0x00011a20 bl 0x109d4 | strerror (r0);
0x00011a24 str r4, [sp] | *(sp) = r4;
0x00011a28 ldr r3, [pc, 0x60] | r3 = "%s: error!: cannot allocate %d bytes\n";
0x00011a2c mov r2, 8 | r2 = 8;
0x00011a30 ldr r1, [pc, 0x5c] | r1 = *(0x11a90);
0x00011a34 str r0, [sp, 4] | var_4h = r0;
0x00011a38 mov r0, r6 | r0 = r6;
0x00011a3c bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot allocate %d bytes\n", r4)
| do {
0x00011a40 mov r0, r5 | r0 = r5;
0x00011a44 add sp, sp, 8 |
0x00011a48 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_0:
0x00011a4c mov r2, r4 | r2 = r4;
0x00011a50 mov r1, sl | r1 = sl;
0x00011a54 bl 0x10a10 | memcpy (r0, r1, r2);
0x00011a58 add r3, r5, r4 | r3 = r5 + r4;
0x00011a5c ldrb r3, [r3, -1] | r3 = *((r3 - 1));
0x00011a60 add r2, r8, 1 | r2 = r8 + 1;
0x00011a64 cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x00011a68 addne r4, r4, 1 | r4++;
| }
| if (r3 == 0x2f) {
0x00011a6c movne r3, 0x2f | r3 = 0x2f;
| }
| if (r3 == 0x2f) {
0x00011a70 strbne r3, [r5, sb] | *((r5 + sb)) = r3;
| }
0x00011a74 mov r1, r7 | r1 = r7;
0x00011a78 add r0, r5, r4 | r0 = r5 + r4;
0x00011a7c bl 0x10a10 | memcpy (r0, r1, r2);
0x00011a80 b 0x11a40 |
| } while (1);
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x11a98 */
| #include <stdint.h>
|
; (fcn) fcn.00011a98 () | void fcn_00011a98 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_18h;
| int32_t var_28h;
| int32_t var_28h_2;
| int32_t var_74h;
| r0 = arg1;
0x00011a98 push {r4, r5, r6, r7, lr} |
0x00011a9c sub sp, sp, 0x74 |
0x00011aa0 add r1, sp, 8 | r1 += var_8h;
0x00011aa4 mov r5, r0 | r5 = r0;
0x00011aa8 bl 0x109e0 | r0 = stat64 ();
0x00011aac cmp r0, 0 |
| if (r0 >= 0) {
0x00011ab0 bge 0x11b08 | goto label_2;
| }
0x00011ab4 bl 0x10b24 | errno_location ();
0x00011ab8 ldr r6, [pc, 0xc8] | r6 = *(0x11b84);
0x00011abc ldr r2, [pc, 0xc8] | r2 = stderr;
0x00011ac0 ldr r1, [pc, 0xc8] | r1 = "libubi";
0x00011ac4 mov r3, r5 | r3 = r5;
0x00011ac8 ldr r4, [r0] | r4 = *(r0);
| do {
| label_1:
0x00011acc ldr r0, [r6] | r0 = *(r6);
0x00011ad0 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00011ad4 mov r0, r4 | r0 = r4;
0x00011ad8 ldr r5, [r6] | r5 = *(r6);
0x00011adc bl 0x109d4 | strerror (r0);
0x00011ae0 str r4, [sp] | *(sp) = r4;
0x00011ae4 ldr r3, [pc, 0xa8] | r3 = "%s: error!: cannot stat \"%s\"\n";
0x00011ae8 mov r2, 8 | r2 = 8;
0x00011aec ldr r1, [pc, 0xa4] | r1 = *(0x11b94);
0x00011af0 str r0, [sp, 4] | var_4h = r0;
0x00011af4 mov r0, r5 | r0 = r5;
0x00011af8 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot stat \"%s\"\n", r4)
0x00011afc mvn r0, 0 | r0 = ~0;
| label_0:
0x00011b00 add sp, sp, 0x74 |
0x00011b04 pop {r4, r5, r6, r7, pc} |
| label_2:
0x00011b08 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00011b0c and r3, r3, 0xf000 | r3 &= 0xf000;
0x00011b10 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00011b14 beq 0x11b38 | goto label_3;
| }
0x00011b18 bl 0x10b24 | errno_location ();
0x00011b1c mov r4, 0x16 | r4 = 0x16;
0x00011b20 ldr r6, [pc, 0x60] | r6 = *(0x11b84);
0x00011b24 mov r3, r5 | r3 = r5;
0x00011b28 ldr r2, [pc, 0x5c] | r2 = stderr;
0x00011b2c ldr r1, [pc, 0x68] | r1 = "%*serror %d (%s)\n";
0x00011b30 str r4, [r0] | *(r0) = r4;
0x00011b34 b 0x11acc |
| } while (1);
| label_3:
0x00011b38 ldrd r6, r7, [sp, 0x28] | __asm ("ldrd r6, r7, [var_28h]");
0x00011b3c mov r1, r7 | r1 = r7;
0x00011b40 mov r0, r6 | r0 = r6;
0x00011b44 bl 0x10a04 | gnu_dev_major ();
0x00011b48 mov r1, r7 | r1 = r7;
0x00011b4c mov r4, r0 | r4 = r0;
0x00011b50 mov r0, r6 | r0 = r6;
0x00011b54 bl 0x10a40 | gnu_dev_minor ();
0x00011b58 cmp r4, 0x5a |
| if (r4 != 0x5a) {
0x00011b5c addeq r0, r0, r0, lsr 31 | r0 += (r0 >> 31);
| }
0x00011b60 asreq r0, r0, 1 | __asm ("asreq r0, r0, 1");
| if (r4 == 0x5a) {
0x00011b64 beq 0x11b00 | goto label_0;
| }
0x00011b68 bl 0x10b24 | errno_location ();
0x00011b6c mov r4, 0x16 | r4 = 0x16;
0x00011b70 ldr r6, [pc, 0x10] | r6 = *(0x11b84);
0x00011b74 mov r3, r5 | r3 = r5;
0x00011b78 ldr r2, [pc, 0xc] | r2 = stderr;
0x00011b7c ldr r1, [pc, 0x1c] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x00011b80 str r4, [r0] | *(r0) = r4;
0x00011b84 b 0x11acc | goto label_1;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x11ba4 */
| #include <stdint.h>
|
; (fcn) fcn.00011ba4 () | void fcn_00011ba4 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| char * s;
| int32_t var_40h;
| r0 = arg1;
| r1 = arg2;
0x00011ba4 push {r4, r5, r6, lr} |
0x00011ba8 sub sp, sp, 0x40 |
0x00011bac mov r4, r1 | r4 = r1;
0x00011bb0 mov r5, r2 | r5 = r2;
0x00011bb4 add r1, sp, 0xc | r1 += s;
0x00011bb8 mov r2, 0x32 | r2 = 0x32;
0x00011bbc mov r6, r0 | r6 = r0;
0x00011bc0 bl 0x11828 | r0 = fcn_00011828 (r0, r1);
0x00011bc4 cmp r0, 0 |
| if (r0 < 0) {
0x00011bc8 blt 0x11c10 | goto label_1;
| }
0x00011bcc mov r3, r5 | r3 = r5;
0x00011bd0 mov r2, r4 | r2 = r4;
0x00011bd4 ldr r1, [pc, 0x8c] | r1 = *(0x11c64);
0x00011bd8 add r0, sp, 0xc | r0 += s;
0x00011bdc bl 0x10aac | r0 = sscanf (r0, r1, r2);
0x00011be0 cmp r0, 2 |
| if (r0 == 2) {
0x00011be4 beq 0x11c18 | goto label_2;
| }
0x00011be8 bl 0x10b24 | errno_location ();
0x00011bec mov r3, 0x16 | r3 = 0x16;
0x00011bf0 ldr r2, [pc, 0x74] | r2 = "_d:_d";
0x00011bf4 ldr r1, [pc, 0x74] | r1 = "libubi";
0x00011bf8 str r3, [r0] | *(r0) = r3;
0x00011bfc ldr r0, [pc, 0x70] |
0x00011c00 mov r3, r6 | r3 = r6;
0x00011c04 ldr r0, [r0] | r0 = "%s: error!: \"%s\" does not have major:minor format\n";
0x00011c08 bl 0x10a64 | fprintf ("%s: error!: \"%s\" does not have major:minor format\n", "libubi", "_d:_d", r3)
| label_0:
0x00011c0c mvn r0, 0 | r0 = ~0;
| do {
| label_1:
0x00011c10 add sp, sp, 0x40 |
0x00011c14 pop {r4, r5, r6, pc} |
| label_2:
0x00011c18 ldr r3, [r4] | r3 = *(r4);
0x00011c1c cmp r3, 0 |
| if (r3 < 0) {
0x00011c20 blt 0x11c34 | goto label_3;
| }
0x00011c24 ldr r3, [r5] | r3 = *(r5);
0x00011c28 cmp r3, 0 |
| if (r3 < 0) {
0x00011c2c movge r0, 0 | r0 = 0;
| }
0x00011c30 bge 0x11c10 |
| } while (r3 >= 0);
| label_3:
0x00011c34 bl 0x10b24 | errno_location ();
0x00011c38 mov r3, 0x16 | r3 = 0x16;
0x00011c3c ldr r2, [pc, 0x28] | r2 = "_d:_d";
0x00011c40 ldr r1, [pc, 0x30] | r1 = stderr;
0x00011c44 str r3, [r0] | *(r0) = r3;
0x00011c48 ldr r0, [pc, 0x24] |
0x00011c4c ldr r3, [r5] | r3 = *(r5);
0x00011c50 str r6, [sp, 4] | var_4h = r6;
0x00011c54 str r3, [sp] | *(sp) = r3;
0x00011c58 ldr r3, [r4] | r3 = *(r4);
0x00011c5c ldr r0, [r0] | r0 = "%s: error!: \"%s\" does not have major:minor format\n";
0x00011c60 bl 0x10a64 | fprintf ("%s: error!: \"%s\" does not have major:minor format\n", r1, "_d:_d", r3, r4, r5, r6)
0x00011c64 b 0x11c0c | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x11cd0 */
| #include <stdint.h>
|
; (fcn) fcn.00011cd0 () | void fcn_00011cd0 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| r0 = arg1;
0x00011cd0 push {r0, r1, r4, r5, r6, lr} |
0x00011cd4 ldr r5, [pc, 0x50] |
0x00011cd8 mov r6, r0 | r6 = r0;
0x00011cdc bl 0x10b24 | errno_location ();
0x00011ce0 mov r3, r6 | r3 = r6;
0x00011ce4 ldr r2, [pc, 0x44] | r2 = stderr;
0x00011ce8 ldr r1, [pc, 0x44] | r1 = "libubi";
0x00011cec ldr r4, [r0] | r4 = *(r0);
0x00011cf0 ldr r0, [r5] | r0 = *(0x11d28);
0x00011cf4 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4)
0x00011cf8 mov r0, r4 | r0 = r4;
0x00011cfc ldr r5, [r5] | r5 = *(0x11d28);
0x00011d00 bl 0x109d4 | strerror (r0);
0x00011d04 str r4, [sp] | *(sp) = r4;
0x00011d08 ldr r3, [pc, 0x28] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00011d0c mov r2, 8 | r2 = 8;
0x00011d10 ldr r1, [pc, 0x24] | r1 = *(0x11d38);
0x00011d14 str r0, [sp, 4] | var_4h = r0;
0x00011d18 mov r0, r5 | r0 = r5;
0x00011d1c bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
0x00011d20 mvn r0, 0 | r0 = ~0;
0x00011d24 add sp, sp, 8 |
0x00011d28 pop {r4, r5, r6, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x11e64 */
| #include <stdint.h>
|
; (fcn) fcn.00011e64 () | void fcn_00011e64 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
0x00011e64 push {r0, r1, r2, r3, r4, r5, r6, lr} |
0x00011e68 mov r1, 0x68 | r1 = 0x68;
0x00011e6c mov r0, 1 | r0 = 1;
0x00011e70 bl 0x10a58 | r0 = calloc (r0, r1);
0x00011e74 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00011e78 beq 0x11ee8 | goto label_1;
| }
0x00011e7c ldr r1, [pc, 0x2fc] | r1 = *(0x1217c);
0x00011e80 ldr r0, [pc, 0x2fc] | r0 = "class/misc/ubi_ctrl/";
0x00011e84 bl 0x119bc | r0 = fcn_000119bc ("class/misc/ubi_ctrl/", r1);
0x00011e88 cmp r0, 0 |
0x00011e8c str r0, [r4, 4] | *((r4 + 4)) = r0;
| if (r0 == 0) {
0x00011e90 beq 0x11edc | goto label_0;
| }
0x00011e94 ldr r1, [pc, 0x2ec] | r1 = "_sys";
0x00011e98 bl 0x119bc | r0 = fcn_000119bc (r0, "_sys");
0x00011e9c cmp r0, 0 |
0x00011ea0 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r0 == 0) {
0x00011ea4 beq 0x11edc | goto label_0;
| }
0x00011ea8 ldr r1, [pc, 0x2dc] | r1 = *(0x12188);
0x00011eac ldr r0, [pc, 0x2d0] | r0 = "class/misc/ubi_ctrl/";
0x00011eb0 bl 0x119bc | r0 = fcn_000119bc ("class/misc/ubi_ctrl/", r1);
0x00011eb4 cmp r0, 0 |
0x00011eb8 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| if (r0 == 0) {
0x00011ebc beq 0x11edc | goto label_0;
| }
0x00011ec0 mov r1, 0 | r1 = 0;
0x00011ec4 bl 0x10af4 | r0 = open64 ();
0x00011ec8 cmn r0, 1 |
| if (r0 != 1) {
0x00011ecc bne 0x11ef4 | goto label_2;
| }
0x00011ed0 bl 0x10b24 | errno_location ();
0x00011ed4 mov r3, 0 | r3 = 0;
0x00011ed8 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x00011edc mov r0, r4 | r0 = r4;
0x00011ee0 bl 0x11d90 | fcn_00011d90 (r0);
0x00011ee4 mov r4, 0 | r4 = 0;
| label_1:
0x00011ee8 mov r0, r4 | r0 = r4;
0x00011eec add sp, sp, 0x10 |
0x00011ef0 pop {r4, r5, r6, pc} |
| label_2:
0x00011ef4 bl 0x10b6c | r0 = close (r0);
0x00011ef8 cmp r0, 0 |
| if (r0 == 0) {
0x00011efc beq 0x11f4c | goto label_3;
| }
0x00011f00 bl 0x10b24 | errno_location ();
0x00011f04 ldr r6, [pc, 0x284] |
0x00011f08 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00011f0c ldr r2, [pc, 0x280] | r2 = stderr;
0x00011f10 ldr r1, [pc, 0x280] | r1 = "libubi";
0x00011f14 ldr r5, [r0] | r5 = *(r0);
0x00011f18 ldr r0, [r6] | r0 = "class/ubi";
0x00011f1c bl 0x10a64 | fprintf ("class/ubi", "libubi", r2, r3, r4, r5, "class/ubi")
0x00011f20 mov r0, r5 | r0 = r5;
0x00011f24 ldr r6, [r6] | r6 = "class/ubi";
0x00011f28 bl 0x109d4 | strerror (r0);
0x00011f2c str r5, [sp] | *(sp) = r5;
0x00011f30 ldr r3, [pc, 0x264] | r3 = "_s:_error_:_close_failed_on___s_";
0x00011f34 mov r2, 8 | r2 = 8;
0x00011f38 ldr r1, [pc, 0x260] | r1 = *(0x1219c);
0x00011f3c str r0, [sp, 4] | var_4h = r0;
0x00011f40 mov r0, r6 | r0 = r6;
0x00011f44 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_close_failed_on___s_", r4, r5)
0x00011f48 b 0x11edc |
| } while (1);
| label_3:
0x00011f4c ldr r1, [pc, 0x250] | r1 = "%*serror %d (%s)\n";
0x00011f50 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00011f54 bl 0x119bc | r0 = fcn_000119bc (r0, "%*serror %d (%s)\n");
0x00011f58 cmp r0, 0 |
0x00011f5c str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
| if (r0 == 0) {
0x00011f60 beq 0x11edc | goto label_0;
| }
0x00011f64 ldr r1, [pc, 0x23c] | r1 = "ubi%d";
0x00011f68 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00011f6c bl 0x119bc | r0 = fcn_000119bc (r0, "ubi%d");
0x00011f70 cmp r0, 0 |
0x00011f74 str r0, [r4, 0x14] | *((r4 + 0x14)) = r0;
| if (r0 == 0) {
0x00011f78 beq 0x11edc | goto label_0;
| }
0x00011f7c ldr r1, [pc, 0x204] | r1 = "_sys";
0x00011f80 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011f84 bl 0x119bc | r0 = fcn_000119bc (r0, "_sys");
0x00011f88 cmp r0, 0 |
0x00011f8c str r0, [r4, 0x18] | *((r4 + 0x18)) = r0;
| if (r0 == 0) {
0x00011f90 beq 0x11edc | goto label_0;
| }
0x00011f94 ldr r1, [pc, 0x210] | r1 = "version";
0x00011f98 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011f9c bl 0x119bc | r0 = fcn_000119bc (r0, "version");
0x00011fa0 cmp r0, 0 |
0x00011fa4 str r0, [r4, 0x1c] | *((r4 + 0x1c)) = r0;
| if (r0 == 0) {
0x00011fa8 beq 0x11edc | goto label_0;
| }
0x00011fac ldr r1, [pc, 0x1fc] | r1 = "avail_eraseblocks";
0x00011fb0 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011fb4 bl 0x119bc | r0 = fcn_000119bc (r0, "avail_eraseblocks");
0x00011fb8 cmp r0, 0 |
0x00011fbc str r0, [r4, 0x20] | *((r4 + 0x20)) = r0;
| if (r0 == 0) {
0x00011fc0 beq 0x11edc | goto label_0;
| }
0x00011fc4 ldr r1, [pc, 0x1e8] | r1 = "total_eraseblocks";
0x00011fc8 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011fcc bl 0x119bc | r0 = fcn_000119bc (r0, "total_eraseblocks");
0x00011fd0 cmp r0, 0 |
0x00011fd4 str r0, [r4, 0x24] | *((r4 + 0x24)) = r0;
| if (r0 == 0) {
0x00011fd8 beq 0x11edc | goto label_0;
| }
0x00011fdc ldr r1, [pc, 0x1d4] | r1 = "bad_peb_count";
0x00011fe0 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011fe4 bl 0x119bc | r0 = fcn_000119bc (r0, "bad_peb_count");
0x00011fe8 cmp r0, 0 |
0x00011fec str r0, [r4, 0x28] | *((r4 + 0x28)) = r0;
| if (r0 == 0) {
0x00011ff0 beq 0x11edc | goto label_0;
| }
0x00011ff4 ldr r1, [pc, 0x1c0] | r1 = "eraseblock_size";
0x00011ff8 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011ffc bl 0x119bc | r0 = fcn_000119bc (r0, "eraseblock_size");
0x00012000 cmp r0, 0 |
0x00012004 str r0, [r4, 0x2c] | *((r4 + 0x2c)) = r0;
| if (r0 == 0) {
0x00012008 beq 0x11edc | goto label_0;
| }
0x0001200c ldr r1, [pc, 0x1ac] | r1 = "max_ec";
0x00012010 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00012014 bl 0x119bc | r0 = fcn_000119bc (r0, "max_ec");
0x00012018 cmp r0, 0 |
0x0001201c str r0, [r4, 0x30] | *((r4 + 0x30)) = r0;
| if (r0 == 0) {
0x00012020 beq 0x11edc | goto label_0;
| }
0x00012024 ldr r1, [pc, 0x198] | r1 = "reserved_for_bad";
0x00012028 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x0001202c bl 0x119bc | r0 = fcn_000119bc (r0, "reserved_for_bad");
0x00012030 cmp r0, 0 |
0x00012034 str r0, [r4, 0x34] | *((r4 + 0x34)) = r0;
| if (r0 == 0) {
0x00012038 beq 0x11edc | goto label_0;
| }
0x0001203c ldr r1, [pc, 0x184] | r1 = "max_vol_count";
0x00012040 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00012044 bl 0x119bc | r0 = fcn_000119bc (r0, "max_vol_count");
0x00012048 cmp r0, 0 |
0x0001204c str r0, [r4, 0x38] | *((r4 + 0x38)) = r0;
| if (r0 == 0) {
0x00012050 beq 0x11edc | goto label_0;
| }
0x00012054 ldr r1, [pc, 0x170] | r1 = "min_io_size";
0x00012058 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x0001205c bl 0x119bc | r0 = fcn_000119bc (r0, "min_io_size");
0x00012060 cmp r0, 0 |
0x00012064 str r0, [r4, 0x3c] | *((r4 + 0x3c)) = r0;
| if (r0 == 0) {
0x00012068 beq 0x11edc | goto label_0;
| }
0x0001206c ldr r1, [pc, 0x15c] | r1 = "mtd_num";
0x00012070 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00012074 bl 0x119bc | r0 = fcn_000119bc (r0, "mtd_num");
0x00012078 cmp r0, 0 |
0x0001207c str r0, [r4, 0x40] | *((r4 + 0x40)) = r0;
| if (r0 == 0) {
0x00012080 beq 0x11edc | goto label_0;
| }
0x00012084 ldr r1, [pc, 0x148] | r1 = "ubi%d_%d";
0x00012088 bl 0x119bc | r0 = fcn_000119bc (r0, "ubi%d_%d");
0x0001208c cmp r0, 0 |
0x00012090 str r0, [r4, 0x44] | *((r4 + 0x44)) = r0;
| if (r0 == 0) {
0x00012094 beq 0x11edc | goto label_0;
| }
0x00012098 ldr r1, [pc, 0xe8] | r1 = "_sys";
0x0001209c ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000120a0 bl 0x119bc | r0 = fcn_000119bc (r0, "_sys");
0x000120a4 cmp r0, 0 |
0x000120a8 str r0, [r4, 0x48] | *((r4 + 0x48)) = r0;
| if (r0 == 0) {
0x000120ac beq 0x11edc | goto label_0;
| }
0x000120b0 ldr r1, [pc, 0x120] | r1 = "type";
0x000120b4 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000120b8 bl 0x119bc | r0 = fcn_000119bc (r0, "type");
0x000120bc cmp r0, 0 |
0x000120c0 str r0, [r4, 0x4c] | *((r4 + 0x4c)) = r0;
| if (r0 == 0) {
0x000120c4 beq 0x11edc | goto label_0;
| }
0x000120c8 ldr r1, [pc, 0x10c] | r1 = "alignment";
0x000120cc ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000120d0 bl 0x119bc | r0 = fcn_000119bc (r0, "alignment");
0x000120d4 cmp r0, 0 |
0x000120d8 str r0, [r4, 0x50] | *((r4 + 0x50)) = r0;
| if (r0 == 0) {
0x000120dc beq 0x11edc | goto label_0;
| }
0x000120e0 ldr r1, [pc, 0xf8] | r1 = "data_bytes";
0x000120e4 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000120e8 bl 0x119bc | r0 = fcn_000119bc (r0, "data_bytes");
0x000120ec cmp r0, 0 |
0x000120f0 str r0, [r4, 0x54] | *((r4 + 0x54)) = r0;
| if (r0 == 0) {
0x000120f4 beq 0x11edc | goto label_0;
| }
0x000120f8 ldr r1, [pc, 0xe4] | r1 = "reserved_ebs";
0x000120fc ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00012100 bl 0x119bc | r0 = fcn_000119bc (r0, "reserved_ebs");
0x00012104 cmp r0, 0 |
0x00012108 str r0, [r4, 0x58] | *((r4 + 0x58)) = r0;
| if (r0 == 0) {
0x0001210c beq 0x11edc | goto label_0;
| }
0x00012110 ldr r1, [pc, 0xd0] | r1 = "usable_eb_size";
0x00012114 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00012118 bl 0x119bc | r0 = fcn_000119bc (r0, "usable_eb_size");
0x0001211c cmp r0, 0 |
0x00012120 str r0, [r4, 0x5c] | *((r4 + 0x5c)) = r0;
| if (r0 == 0) {
0x00012124 beq 0x11edc | goto label_0;
| }
0x00012128 ldr r1, [pc, 0xbc] | r1 = "corrupted";
0x0001212c ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00012130 bl 0x119bc | r0 = fcn_000119bc (r0, "corrupted");
0x00012134 cmp r0, 0 |
0x00012138 str r0, [r4, 0x60] | *((r4 + 0x60)) = r0;
| if (r0 == 0) {
0x0001213c beq 0x11edc | goto label_0;
| }
0x00012140 add r1, sp, 0xc | r1 += var_ch;
0x00012144 ldr r0, [r4, 0x14] | r0 = *((r4 + 0x14));
0x00012148 bl 0x1171c | r0 = fcn_0001171c (r0, r1);
0x0001214c cmp r0, 0 |
| if (r0 != 0) {
0x00012150 bne 0x11edc | goto label_0;
| }
0x00012154 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00012158 cmp r3, 1 |
| if (r3 == 1) {
0x0001215c beq 0x11ee8 | goto label_1;
| }
0x00012160 ldr r0, [pc, 0x28] |
0x00012164 str r3, [sp] | *(sp) = r3;
0x00012168 ldr r2, [pc, 0x24] | r2 = stderr;
0x0001216c mov r3, 1 | r3 = 1;
0x00012170 ldr r1, [pc, 0x78] | r1 = "name";
0x00012174 ldr r0, [r0] | r0 = "class/ubi";
0x00012178 bl 0x10a64 | fprintf ("class/ubi", "name", r2, r3)
0x0001217c b 0x11edc | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x12320 */
| #include <stdint.h>
|
; (fcn) fcn.00012320 () | void fcn_00012320 (int32_t arg1, void * s) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_110h;
| r0 = arg1;
| r1 = s;
0x00012320 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00012324 mov r4, r1 | r4 = r1;
0x00012328 sub sp, sp, 0x110 |
0x0001232c mov r5, r0 | r5 = r0;
0x00012330 mov r2, 0x18 | r2 = 0x18;
0x00012334 mov r1, 0 | r1 = 0;
0x00012338 mov r0, r4 | r0 = r4;
0x0001233c bl 0x10adc | memset (r0, r1, r2);
0x00012340 add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00012344 add r1, r4, 0x10 | r1 = r4 + 0x10;
0x00012348 ldr r0, [r5, 8] | r0 = *((r5 + 8));
0x0001234c bl 0x11ba4 | r0 = fcn_00011ba4 (r0, r1);
0x00012350 cmp r0, 0 |
| if (r0 == 0) {
0x00012354 mvnne r3, 0 | r3 = ~0;
| }
| if (r0 == 0) {
0x00012358 strne r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
| }
| if (r0 == 0) {
0x0001235c strne r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x00012360 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00012364 bl 0x10b00 | r0 = opendir ();
0x00012368 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x0001236c beq 0x124cc | goto label_2;
| }
0x00012370 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00012374 str r3, [r4, 4] | *((r4 + 4)) = r3;
0x00012378 bl 0x10b24 | errno_location ();
0x0001237c ldr sl, [pc, 0x17c] | sl = "ubi_d_s";
0x00012380 mov sb, 0 | sb = 0;
0x00012384 mov r7, r0 | r7 = r0;
| do {
| label_0:
0x00012388 str sb, [r7] | *(r7) = sb;
0x0001238c mov r0, r8 | r0 = r8;
0x00012390 bl 0x10aa0 | r0 = readdir64 ();
0x00012394 cmp r0, 0 |
| if (r0 == 0) {
0x00012398 beq 0x12428 | goto label_3;
| }
0x0001239c add r6, r0, 0x13 | r6 = r0 + 0x13;
0x000123a0 mov r0, r6 | r0 = r6;
0x000123a4 bl 0x10b3c | r0 = strlen (r0);
0x000123a8 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x000123ac bls 0x123e0 |
0x000123b0 ldr r0, [pc, 0x14c] |
0x000123b4 str r6, [sp] | *(sp) = r6;
0x000123b8 ldr r2, [pc, 0x148] | r2 = stderr;
0x000123bc ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000123c0 ldr r1, [pc, 0x144] | r1 = "libubi";
0x000123c4 ldr r0, [r0] | r0 = "ubi_d_s";
0x000123c8 bl 0x10a64 | fprintf ("ubi_d_s", "libubi", r2, r3, r4, r5, r6)
0x000123cc mov r3, 0x16 | r3 = 0x16;
0x000123d0 str r3, [r7] | *(r7) = r3;
| label_1:
0x000123d4 mov r0, r8 | r0 = r8;
0x000123d8 bl 0x10b54 | closedir ();
0x000123dc b 0x124cc | goto label_2;
| }
0x000123e0 add r3, sp, 0x10 | r3 += var_10h;
0x000123e4 add r2, sp, 0xc | r2 += var_ch;
0x000123e8 mov r1, sl | r1 = sl;
0x000123ec mov r0, r6 | r0 = r6;
0x000123f0 bl 0x10aac | r0 = sscanf (r0, r1, r2);
0x000123f4 cmp r0, 1 |
0x000123f8 bne 0x12388 |
| } while (r0 != 1);
0x000123fc ldr r3, [r4] | r3 = *(r4);
0x00012400 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00012404 add r3, r3, 1 | r3++;
0x00012408 str r3, [r4] | *(r4) = r3;
0x0001240c ldr r3, [sp, 0xc] | r3 = var_ch;
0x00012410 cmp r2, r3 |
0x00012414 ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r2 >= r3) {
0x00012418 strlt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x0001241c cmp r3, r2 |
| if (r3 >= r2) {
0x00012420 strlt r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x00012424 b 0x12388 | goto label_0;
| label_3:
0x00012428 ldr r6, [r7] | r6 = *(r7);
0x0001242c cmp r6, 0 |
| if (r6 != 0) {
0x00012430 beq 0x12478 |
0x00012434 ldr r4, [pc, 0xc8] |
0x00012438 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x0001243c ldr r2, [pc, 0xc4] | r2 = stderr;
0x00012440 ldr r1, [pc, 0xc8] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x00012444 ldr r0, [r4] | r0 = "ubi_d_s";
0x00012448 bl 0x10a64 | fprintf ("ubi_d_s", "%s: error!: invalid entry in %s: \"%s\"\n", r2, r3, "ubi_d_s")
0x0001244c mov r0, r6 | r0 = r6;
0x00012450 ldr r4, [r4] | r4 = "ubi_d_s";
0x00012454 bl 0x109d4 | strerror (r0);
0x00012458 str r6, [sp] | *(sp) = r6;
0x0001245c ldr r3, [pc, 0xb0] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x00012460 mov r2, 8 | r2 = 8;
0x00012464 ldr r1, [pc, 0xac] | r1 = *(0x12514);
0x00012468 str r0, [sp, 4] | var_4h = r0;
0x0001246c mov r0, r4 | r0 = r4;
0x00012470 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_", r4, r5, r6)
0x00012474 b 0x123d4 | goto label_1;
| }
0x00012478 mov r0, r8 | r0 = r8;
0x0001247c bl 0x10b54 | r0 = closedir ();
0x00012480 cmp r0, 0 |
| if (r0 != 0) {
0x00012484 beq 0x124d4 |
0x00012488 ldr r6, [pc, 0x74] | r6 = "ubi_d_s";
0x0001248c ldr r4, [r7] | r4 = *(r7);
0x00012490 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012494 ldr r2, [pc, 0x6c] | r2 = stderr;
0x00012498 ldr r1, [pc, 0x7c] | r1 = "%*serror %d (%s)\n";
0x0001249c ldr r0, [r6] | r0 = "ubi_d_s";
0x000124a0 bl 0x10a64 | fprintf ("ubi_d_s", "%*serror %d (%s)\n", r2, r3, r4, r5, "ubi_d_s")
0x000124a4 mov r0, r4 | r0 = r4;
0x000124a8 ldr r5, [r6] | r5 = "ubi_d_s";
0x000124ac bl 0x109d4 | strerror (r0);
0x000124b0 str r4, [sp] | *(sp) = r4;
0x000124b4 ldr r3, [pc, 0x58] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x000124b8 mov r2, 8 | r2 = 8;
0x000124bc ldr r1, [pc, 0x54] | r1 = *(0x12514);
0x000124c0 str r0, [sp, 4] | var_4h = r0;
0x000124c4 mov r0, r5 | r0 = r5;
0x000124c8 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_", r4)
| label_2:
0x000124cc mvn r0, 0 | r0 = ~0;
0x000124d0 b 0x124f8 |
| } else {
0x000124d4 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x000124d8 add r1, r4, 0xc | r1 = r4 + 0xc;
0x000124dc cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x000124e0 streq r0, [r4, 4] | *((r4 + 4)) = r0;
| }
0x000124e4 ldr r0, [r5, 0x14] | r0 = *((r5 + 0x14));
0x000124e8 bl 0x1171c | r0 = fcn_0001171c (r0, r1);
0x000124ec adds r0, r0, 0 | r0 += 0;
| if (r0 == r0) {
0x000124f0 movne r0, 1 | r0 = 1;
| }
0x000124f4 rsb r0, r0, 0 | r0 -= ;
| }
0x000124f8 add sp, sp, 0x110 |
0x000124fc pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x12650 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012650 () | void fcn_00012650 (int32_t arg2, char * s) {
| int32_t var_b4h;
| int32_t var_ach;
| int32_t var_a8h;
| int32_t var_a4h;
| int32_t var_a0h;
| int32_t var_9ch;
| int32_t var_8ch;
| int32_t var_7ch;
| int32_t var_6ch;
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_sp_b4h;
| int32_t var_sp_6ch;
| int32_t var_20h_2;
| int32_t var_20h;
| r1 = arg2;
| r0 = s;
0x00012650 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012654 add fp, sp, 0x20 |
0x00012658 sub sp, sp, 0x9c |
0x0001265c mov r6, r0 | r6 = r0;
0x00012660 ldr r0, [r0, 0x40] | r0 = *((r0 + 0x40));
0x00012664 mov r5, r1 | r5 = r1;
0x00012668 bl 0x10b3c | strlen (r0);
0x0001266c sub r1, fp, 0x8c | r1 -= var_8ch;
0x00012670 add r0, r0, 0x6b | r0 += 0x6b;
0x00012674 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012678 sub sp, sp, r0 |
0x0001267c mov r0, r5 | r0 = r5;
0x00012680 bl 0x109e0 | r0 = stat64 ();
0x00012684 cmp r0, 0 |
| if (r0 == 0) {
0x00012688 beq 0x126e0 | goto label_5;
| }
0x0001268c bl 0x10b24 | errno_location ();
0x00012690 ldr r6, [pc, 0x1e8] | r6 = *(0x1287c);
0x00012694 mov r3, r5 | r3 = r5;
0x00012698 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x0001269c ldr r1, [pc, 0x1e4] | r1 = "libubi";
0x000126a0 ldr r4, [r0] | r4 = *(r0);
0x000126a4 ldr r0, [r6] | r0 = *(0x1287c);
0x000126a8 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000126ac mov r0, r4 | r0 = r4;
0x000126b0 ldr r5, [r6] | r5 = *(0x1287c);
0x000126b4 bl 0x109d4 | strerror (r0);
0x000126b8 str r4, [sp] | *(sp) = r4;
0x000126bc ldr r3, [pc, 0x1c8] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x000126c0 mov r2, 8 | r2 = 8;
0x000126c4 ldr r1, [pc, 0x1c4] | r1 = *(0x1288c);
0x000126c8 str r0, [sp, 4] | var_4h = r0;
0x000126cc mov r0, r5 | r0 = r5;
0x000126d0 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n", r4)
| do {
| label_0:
0x000126d4 mvn r0, 0 | r0 = ~0;
| label_4:
0x000126d8 sub sp, fp, 0x20 |
0x000126dc pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_5:
0x000126e0 ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x000126e4 and r3, r3, 0xf000 | r3 &= 0xf000;
0x000126e8 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x000126ec beq 0x12718 | goto label_6;
| }
0x000126f0 ldr r0, [pc, 0x188] |
0x000126f4 mov r3, r5 | r3 = r5;
0x000126f8 ldr r2, [pc, 0x184] | r2 = stderr;
0x000126fc ldr r1, [pc, 0x190] | r1 = "%*serror %d (%s)\n";
0x00012700 ldr r0, [r0] | r0 = *(0x1287c);
0x00012704 bl 0x10a64 | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x00012708 bl 0x10b24 | errno_location ();
0x0001270c mov r3, 0x16 | r3 = 0x16;
| label_1:
0x00012710 str r3, [r0] | *(r0) = r3;
0x00012714 b 0x126d4 |
| } while (1);
| label_6:
0x00012718 ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x0001271c mov r1, r3 | r1 = r3;
0x00012720 mov r0, r2 | r0 = r2;
0x00012724 strd r2, r3, [fp, -0xb4] | __asm ("strd r2, r3, [var_b4h]");
0x00012728 bl 0x10a04 | gnu_dev_major ();
0x0001272c ldrd r2, r3, [fp, -0xb4] | __asm ("ldrd r2, r3, [var_b4h]");
0x00012730 mov r1, r3 | r1 = r3;
0x00012734 mov sb, r0 | sb = r0;
0x00012738 mov r0, r2 | r0 = r2;
0x0001273c bl 0x10a40 | gnu_dev_minor ();
0x00012740 sub r1, fp, 0xa4 | r1 -= var_a4h;
0x00012744 mov r7, r0 | r7 = r0;
0x00012748 mov r0, r6 | r0 = r6;
0x0001274c bl 0x12320 | r0 = fcn_00012320 (r0, r1);
0x00012750 cmp r0, 0 |
| if (r0 != 0) {
0x00012754 addeq r8, sp, 8 | r8 += var_b4h;
| }
| if (r0 != 0) {
0x00012758 ldreq r4, [fp, -0xa0] | r4 = var_a0h;
| }
| if (r0 == 0) {
0x0001275c addeq sl, r6, 0x18 | sl = r6 + 0x18;
| goto label_7;
| }
| if (r0 != 0) {
| label_7:
0x00012760 bne 0x126d4 | goto label_0;
| }
| do {
0x00012764 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012768 cmp r4, r3 |
| if (r4 > r3) {
0x0001276c bgt 0x127e4 | goto label_8;
| }
0x00012770 sub r3, fp, 0xa8 | r3 -= var_a8h;
0x00012774 sub r2, fp, 0xac | r2 -= var_ach;
0x00012778 mov r1, r4 | r1 = r4;
0x0001277c mov r0, sl | r0 = sl;
0x00012780 bl 0x11c7c | r0 = fcn_00011c7c (r0, r1);
0x00012784 cmp r0, 0 |
| if (r0 == 0) {
0x00012788 beq 0x127d8 | goto label_9;
| }
0x0001278c bl 0x10b24 | r0 = errno_location ();
0x00012790 ldr r3, [r0] | r3 = *(r0);
0x00012794 cmp r3, 2 |
| if (r3 != 2) {
0x00012798 bne 0x127a4 | goto label_10;
| }
| label_2:
0x0001279c add r4, r4, 1 | r4++;
0x000127a0 b 0x12764 |
| } while (1);
| label_10:
0x000127a4 cmp r3, 0 |
| if (r3 != 0) {
0x000127a8 bne 0x126d4 | goto label_0;
| }
| label_3:
0x000127ac ldr r0, [pc, 0xcc] |
0x000127b0 mov r3, r5 | r3 = r5;
0x000127b4 str r7, [sp, 4] | var_4h = r7;
0x000127b8 str sb, [sp] | *(sp) = sb;
0x000127bc ldr r2, [pc, 0xc0] | r2 = stderr;
0x000127c0 ldr r1, [pc, 0xd0] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x000127c4 ldr r0, [r0] | r0 = *(0x1287c);
0x000127c8 bl 0x10a64 | r0 = fprintf (r0, "%s: error!: \"%s\" is not a character device\n", r2, r3)
0x000127cc bl 0x10b24 | errno_location ();
0x000127d0 mov r3, 0x13 | r3 = 0x13;
0x000127d4 b 0x12710 | goto label_1;
| label_9:
0x000127d8 ldr r3, [fp, -0xac] | r3 = var_ach;
0x000127dc cmp r3, sb |
| if (r3 != sb) {
0x000127e0 bne 0x1279c | goto label_2;
| }
| label_8:
0x000127e4 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x000127e8 cmp r4, r3 |
| if (r4 > r3) {
0x000127ec bgt 0x127ac | goto label_3;
| }
0x000127f0 cmp r7, 0 |
| if (r7 == 0) {
0x000127f4 moveq r0, 1 | r0 = 1;
| goto label_11;
| }
| if (r7 == 0) {
| label_11:
0x000127f8 beq 0x126d8 | goto label_4;
| }
0x000127fc sub r3, r7, 1 | r3 = r7 - 1;
0x00012800 mov r2, r4 | r2 = r4;
0x00012804 ldr r1, [r6, 0x40] | r1 = *((r6 + 0x40));
0x00012808 mov r0, r8 | r0 = r8;
0x0001280c bl 0x10b18 | sprintf (r0, r1, r2);
0x00012810 mov r1, 0 | r1 = 0;
0x00012814 mov r0, r8 | r0 = r8;
0x00012818 bl 0x10af4 | r0 = open64 ();
0x0001281c cmn r0, 1 |
| if (r0 == 1) {
0x00012820 beq 0x127ac | goto label_3;
| }
0x00012824 bl 0x10b6c | r0 = close (r0);
0x00012828 cmp r0, 0 |
| if (r0 != 0) {
0x0001282c beq 0x12878 |
0x00012830 bl 0x10b24 | errno_location ();
0x00012834 ldr r5, [pc, 0x44] |
0x00012838 mov r3, r8 | r3 = r8;
0x0001283c ldr r2, [pc, 0x40] | r2 = stderr;
0x00012840 ldr r1, [pc, 0x54] | r1 = "_s:_error_:___s__has_major:minor__d:_d__but_this_does_not_correspond_to_any_existing_UBI_device_or_volume";
0x00012844 ldr r4, [r0] | r4 = *(r0);
0x00012848 ldr r0, [r5] | r0 = *(0x1287c);
0x0001284c bl 0x10a64 | fprintf (r0, "_s:_error_:___s__has_major:minor__d:_d__but_this_does_not_correspond_to_any_existing_UBI_device_or_volume", r2, r3, r4, r5)
0x00012850 mov r0, r4 | r0 = r4;
0x00012854 ldr r5, [r5] | r5 = *(0x1287c);
0x00012858 bl 0x109d4 | strerror (r0);
0x0001285c str r4, [sp] | *(sp) = r4;
0x00012860 ldr r3, [pc, 0x24] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x00012864 mov r2, 8 | r2 = 8;
0x00012868 ldr r1, [pc, 0x20] | r1 = *(0x1288c);
0x0001286c str r0, [sp, 4] | var_4h = r0;
0x00012870 mov r0, r5 | r0 = r5;
0x00012874 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n", r4)
| }
0x00012878 mov r0, 2 | r0 = 2;
0x0001287c b 0x126d8 | goto label_4;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x12af8 */
| #include <stdint.h>
|
; (fcn) fcn.00012af8 () | void fcn_00012af8 (int32_t arg_30h, int32_t arg_34h, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| r1 = arg2;
0x00012af8 push {r4, r5, r6, r7, r8, lr} |
0x00012afc mov r7, r1 | r7 = r1;
0x00012b00 sub sp, sp, 0x18 |
0x00012b04 mov r1, 0 | r1 = 0;
0x00012b08 mov r0, r7 | r0 = r7;
0x00012b0c mov r5, r2 | r5 = r2;
0x00012b10 ldr r8, [sp, 0x30] | r8 = *(arg_30h);
0x00012b14 ldr r6, [sp, 0x34] | r6 = *(arg_34h);
0x00012b18 bl 0x10af4 | r0 = open64 ();
0x00012b1c cmn r0, 1 |
0x00012b20 mov r4, r0 | r4 = r0;
| if (r0 != 1) {
0x00012b24 bne 0x12b7c | goto label_0;
| }
0x00012b28 bl 0x10b24 | errno_location ();
0x00012b2c ldr r6, [pc, 0x74] |
0x00012b30 mov r3, r7 | r3 = r7;
0x00012b34 ldr r2, [pc, 0x70] | r2 = stderr;
0x00012b38 ldr r1, [pc, 0x70] | r1 = "libubi";
0x00012b3c ldr r5, [r0] | r5 = *(r0);
0x00012b40 ldr r0, [r6] | r0 = *(0x12ba4);
0x00012b44 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00012b48 mov r0, r5 | r0 = r5;
0x00012b4c ldr r6, [r6] | r6 = *(0x12ba4);
0x00012b50 bl 0x109d4 | strerror (r0);
0x00012b54 str r5, [sp] | *(sp) = r5;
0x00012b58 ldr r3, [pc, 0x54] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00012b5c mov r2, 8 | r2 = 8;
0x00012b60 ldr r1, [pc, 0x50] | r1 = *(0x12bb4);
0x00012b64 str r0, [sp, 4] | var_4h = r0;
0x00012b68 mov r0, r6 | r0 = r6;
0x00012b6c bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5)
| do {
0x00012b70 mov r0, r4 | r0 = r4;
0x00012b74 add sp, sp, 0x18 |
0x00012b78 pop {r4, r5, r6, r7, r8, pc} |
| label_0:
0x00012b7c add r2, sp, 0xc | r2 += var_ch;
0x00012b80 ldr r1, [pc, 0x34] | r1 = "%*serror %d (%s)\n";
0x00012b84 str r5, [sp, 0x14] | var_14h = r5;
0x00012b88 str r8, [sp, 0xc] | var_ch = r8;
0x00012b8c str r6, [sp, 0x10] | var_10h = r6;
0x00012b90 bl 0x109bc | r0 = ioctl (r0, r1);
0x00012b94 mov r5, r0 | r5 = r0;
0x00012b98 mov r0, r4 | r0 = r4;
0x00012b9c bl 0x10b6c | close (r0);
0x00012ba0 mov r4, r5 | r4 = r5;
0x00012ba4 b 0x12b70 |
| } while (1);
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x12cac */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012cac () | void fcn_00012cac (int32_t arg1, int32_t arg2) {
| int32_t var_128h;
| int32_t var_124h;
| int32_t var_0h;
| int32_t var_4h;
| char * s;
| int32_t var_20h_2;
| int32_t var_20h;
| r0 = arg1;
| r1 = arg2;
0x00012cac push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012cb0 add sl, r2, 4 | sl = r2 + 4;
0x00012cb4 add fp, sp, 0x20 |
0x00012cb8 sub sp, sp, 0x114 |
0x00012cbc mov r6, r1 | r6 = r1;
0x00012cc0 mov r5, r0 | r5 = r0;
0x00012cc4 mov r4, r2 | r4 = r2;
0x00012cc8 mov r1, 0 | r1 = 0;
0x00012ccc mov r2, 0x54 | r2 = 0x54;
0x00012cd0 mov r0, sl | r0 = sl;
0x00012cd4 bl 0x10adc | memset (r0, r1, r2);
0x00012cd8 str r6, [r4] | *(r4) = r6;
0x00012cdc mov r1, r6 | r1 = r6;
0x00012ce0 mov r0, r5 | r0 = r5;
0x00012ce4 bl 0x12c58 | r0 = fcn_00012c58 (r0, r1);
0x00012ce8 cmp r0, 0 |
0x00012cec bne 0x12cf8 |
| while (r8 == r0) {
| label_0:
0x00012cf0 mvn r0, 0 | r0 = ~0;
0x00012cf4 b 0x12fbc | goto label_3;
0x00012cf8 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00012cfc bl 0x10b00 | r0 = opendir ();
0x00012d00 subs r8, r0, 0 | r8 = r0 - 0;
0x00012d04 beq 0x12cf0 |
| }
0x00012d08 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00012d0c str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x00012d10 bl 0x10b24 | r0 = errno_location ();
0x00012d14 mov sb, r0 | sb = r0;
| do {
| label_1:
0x00012d18 mov r3, 0 | r3 = 0;
0x00012d1c str r3, [sb] | *(sb) = r3;
0x00012d20 mov r0, r8 | r0 = r8;
0x00012d24 bl 0x10aa0 | r0 = readdir64 ();
0x00012d28 cmp r0, 0 |
| if (r0 == 0) {
0x00012d2c beq 0x12dc8 | goto label_4;
| }
0x00012d30 add r7, r0, 0x13 | r7 = r0 + 0x13;
0x00012d34 mov r0, r7 | r0 = r7;
0x00012d38 bl 0x10b3c | r0 = strlen (r0);
0x00012d3c cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00012d40 bls 0x12d6c |
0x00012d44 ldr r0, [pc, 0x278] |
0x00012d48 str r7, [sp] | *(sp) = r7;
0x00012d4c ldr r2, [pc, 0x274] | r2 = stderr;
0x00012d50 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012d54 ldr r1, [pc, 0x270] | r1 = "libubi";
0x00012d58 ldr r0, [r0] | r0 = *(0x12fc0);
0x00012d5c bl 0x10a64 | fprintf (r0, "libubi", r2, r3)
| label_2:
0x00012d60 mov r0, r8 | r0 = r8;
0x00012d64 bl 0x10b54 | closedir ();
0x00012d68 b 0x12cf0 | goto label_0;
| }
0x00012d6c sub r3, fp, 0x124 | r3 -= var_124h;
0x00012d70 str r3, [sp] | *(sp) = r3;
0x00012d74 sub r2, fp, 0x128 | r2 -= var_128h;
0x00012d78 sub r3, fp, 0x12c | r3 -= s;
0x00012d7c ldr r1, [pc, 0x24c] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x00012d80 mov r0, r7 | r0 = r7;
0x00012d84 bl 0x10aac | r0 = sscanf (r0, "%s: error!: invalid entry in %s: \"%s\"\n", r2);
0x00012d88 cmp r0, 2 |
0x00012d8c bne 0x12d18 |
| } while (r0 != 2);
0x00012d90 ldr r3, [fp, -0x128] | r3 = var_128h;
0x00012d94 cmp r3, r6 |
| if (r3 != r6) {
0x00012d98 bne 0x12d18 | goto label_1;
| }
0x00012d9c ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00012da0 ldr r2, [r4, 0x10] | r2 = *((r4 + 0x10));
0x00012da4 add r3, r3, 1 | r3++;
0x00012da8 str r3, [r4, 8] | *((r4 + 8)) = r3;
0x00012dac ldr r3, [fp, -0x12c] | r3 = s;
0x00012db0 cmp r2, r3 |
0x00012db4 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
| if (r2 >= r3) {
0x00012db8 strlt r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x00012dbc cmp r3, r2 |
| if (r3 >= r2) {
0x00012dc0 strlt r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
| }
0x00012dc4 b 0x12d18 | goto label_1;
| label_4:
0x00012dc8 ldr r7, [sb] | r7 = *(sb);
0x00012dcc cmp r7, 0 |
| if (r7 != 0) {
0x00012dd0 beq 0x12e18 |
0x00012dd4 ldr r4, [pc, 0x1e8] |
0x00012dd8 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012ddc ldr r2, [pc, 0x1e4] | r2 = stderr;
0x00012de0 ldr r1, [pc, 0x1ec] | r1 = "ubi%d_%d%s";
0x00012de4 ldr r0, [r4] | r0 = *(0x12fc0);
0x00012de8 bl 0x10a64 | fprintf (r0, "ubi%d_%d%s", r2, r3, r4)
0x00012dec mov r0, r7 | r0 = r7;
0x00012df0 ldr r4, [r4] | r4 = *(0x12fc0);
0x00012df4 bl 0x109d4 | strerror (r0);
0x00012df8 str r7, [sp] | *(sp) = r7;
0x00012dfc ldr r3, [pc, 0x1d4] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x00012e00 mov r2, 8 | r2 = 8;
0x00012e04 ldr r1, [pc, 0x1d0] | r1 = *(0x12fd8);
0x00012e08 str r0, [sp, 4] | var_4h = r0;
0x00012e0c mov r0, r4 | r0 = r4;
0x00012e10 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_")
0x00012e14 b 0x12d60 | goto label_2;
| }
0x00012e18 mov r0, r8 | r0 = r8;
0x00012e1c bl 0x10b54 | r0 = closedir ();
0x00012e20 cmp r0, 0 |
| if (r0 != 0) {
0x00012e24 beq 0x12e70 |
0x00012e28 ldr r6, [pc, 0x194] | r6 = *(0x12fc0);
0x00012e2c ldr r4, [sb] | r4 = *(sb);
0x00012e30 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012e34 ldr r2, [pc, 0x18c] | r2 = stderr;
0x00012e38 ldr r1, [pc, 0x1a0] | r1 = "%*serror %d (%s)\n";
0x00012e3c ldr r0, [r6] | r0 = *(0x12fc0);
0x00012e40 bl 0x10a64 | fprintf (r0, "%*serror %d (%s)\n", r2, r3, r4, r5, r6)
0x00012e44 mov r0, r4 | r0 = r4;
0x00012e48 ldr r5, [r6] | r5 = *(0x12fc0);
0x00012e4c bl 0x109d4 | strerror (r0);
0x00012e50 str r4, [sp] | *(sp) = r4;
0x00012e54 ldr r3, [pc, 0x17c] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x00012e58 mov r2, 8 | r2 = 8;
0x00012e5c ldr r1, [pc, 0x178] | r1 = *(0x12fd8);
0x00012e60 str r0, [sp, 4] | var_4h = r0;
0x00012e64 mov r0, r5 | r0 = r5;
0x00012e68 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_", r4)
0x00012e6c b 0x12cf0 | goto label_0;
| }
0x00012e70 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00012e74 add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00012e78 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00012e7c streq r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| }
0x00012e80 add r3, r4, 0x18 | r3 = r4 + 0x18;
0x00012e84 mov r1, r6 | r1 = r6;
0x00012e88 add r0, r5, 0x18 | r0 = r5 + 0x18;
0x00012e8c bl 0x11c7c | r0 = fcn_00011c7c (r0, r1);
0x00012e90 cmp r0, 0 |
| if (r0 != 0) {
0x00012e94 bne 0x12cf0 | goto label_0;
| }
0x00012e98 mov r2, sl | r2 = sl;
0x00012e9c mov r1, r6 | r1 = r6;
0x00012ea0 ldr r0, [r5, 0x3c] | r0 = *((r5 + 0x3c));
0x00012ea4 bl 0x11790 | r0 = fcn_00011790 (r0, r1);
0x00012ea8 cmp r0, 0 |
| if (r0 != 0) {
0x00012eac bne 0x12cf0 | goto label_0;
| }
0x00012eb0 add r2, r4, 0x20 | r2 = r4 + 0x20;
0x00012eb4 mov r1, r6 | r1 = r6;
0x00012eb8 ldr r0, [r5, 0x1c] | r0 = *((r5 + 0x1c));
0x00012ebc bl 0x11790 | r0 = fcn_00011790 (r0, r1);
0x00012ec0 cmp r0, 0 |
| if (r0 != 0) {
0x00012ec4 bne 0x12cf0 | goto label_0;
| }
0x00012ec8 add r2, r4, 0x1c | r2 = r4 + 0x1c;
0x00012ecc mov r1, r6 | r1 = r6;
0x00012ed0 ldr r0, [r5, 0x20] | r0 = *((r5 + 0x20));
0x00012ed4 bl 0x11790 | r0 = fcn_00011790 (r0, r1);
0x00012ed8 cmp r0, 0 |
| if (r0 != 0) {
0x00012edc bne 0x12cf0 | goto label_0;
| }
0x00012ee0 add r2, r4, 0x38 | r2 = r4 + 0x38;
0x00012ee4 mov r1, r6 | r1 = r6;
0x00012ee8 ldr r0, [r5, 0x24] | r0 = *((r5 + 0x24));
0x00012eec bl 0x11790 | r0 = fcn_00011790 (r0, r1);
0x00012ef0 cmp r0, 0 |
| if (r0 != 0) {
0x00012ef4 bne 0x12cf0 | goto label_0;
| }
0x00012ef8 add r2, r4, 0x3c | r2 = r4 + 0x3c;
0x00012efc mov r1, r6 | r1 = r6;
0x00012f00 ldr r0, [r5, 0x28] | r0 = *((r5 + 0x28));
0x00012f04 bl 0x11790 | r0 = fcn_00011790 (r0, r1);
0x00012f08 cmp r0, 0 |
| if (r0 != 0) {
0x00012f0c bne 0x12cf0 | goto label_0;
| }
0x00012f10 add r2, r4, 0x48 | r2 = r4 + 0x48;
0x00012f14 mov r1, r6 | r1 = r6;
0x00012f18 ldr r0, [r5, 0x30] | r0 = *((r5 + 0x30));
0x00012f1c bl 0x11790 | r0 = fcn_00011790 (r0, r1);
0x00012f20 cmp r0, 0 |
| if (r0 != 0) {
0x00012f24 bne 0x12cf0 | goto label_0;
| }
0x00012f28 ldr r8, [r5, 0x2c] | r8 = *((r5 + 0x2c));
0x00012f2c mov sb, sp | sb = sp;
0x00012f30 mov r0, r8 | r0 = r8;
0x00012f34 bl 0x10b3c | strlen (r0);
0x00012f38 mov r2, r6 | r2 = r6;
0x00012f3c mov r1, r8 | r1 = r8;
0x00012f40 add r0, r0, 0x39 | r0 += 0x39;
0x00012f44 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012f48 sub sp, sp, r0 |
0x00012f4c add r7, sp, 8 | r7 += s;
0x00012f50 mov r0, r7 | r0 = r7;
0x00012f54 bl 0x10b18 | sprintf (r0, r1, r2);
0x00012f58 add r1, r4, 0x40 | r1 = r4 + 0x40;
0x00012f5c mov r0, r7 | r0 = r7;
0x00012f60 bl 0x1156c | fcn_0001156c (r0, r1);
0x00012f64 mov sp, sb |
0x00012f68 cmp r0, 0 |
| if (r0 != 0) {
0x00012f6c bne 0x12cf0 | goto label_0;
| }
0x00012f70 add r2, r4, 0x4c | r2 = r4 + 0x4c;
0x00012f74 mov r1, r6 | r1 = r6;
0x00012f78 ldr r0, [r5, 0x34] | r0 = *((r5 + 0x34));
0x00012f7c bl 0x11790 | r0 = fcn_00011790 (r0, r1);
0x00012f80 cmp r0, 0 |
| if (r0 != 0) {
0x00012f84 bne 0x12cf0 | goto label_0;
| }
0x00012f88 add r2, r4, 0x50 | r2 = r4 + 0x50;
0x00012f8c mov r1, r6 | r1 = r6;
0x00012f90 ldr r0, [r5, 0x38] | r0 = *((r5 + 0x38));
0x00012f94 bl 0x11790 | r0 = fcn_00011790 (r0, r1);
0x00012f98 cmp r0, 0 |
| if (r0 != 0) {
0x00012f9c bne 0x12cf0 | goto label_0;
| }
0x00012fa0 ldr r3, [r4, 0x3c] | r3 = *((r4 + 0x3c));
0x00012fa4 ldr r2, [r4, 0x20] | r2 = *((r4 + 0x20));
0x00012fa8 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x00012fac ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x00012fb0 strd r6, r7, [r4, 0x30] | __asm ("strd r6, r7, [r4, 0x30]");
0x00012fb4 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x00012fb8 strd r6, r7, [r4, 0x28] | __asm ("strd r6, r7, [r4, 0x28]");
| label_3:
0x00012fbc sub sp, fp, 0x20 |
0x00012fc0 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x12fe4 */
| #include <stdint.h>
|
; (fcn) fcn.00012fe4 () | void fcn_00012fe4 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_28h;
| int32_t var_38h;
| int32_t var_48h;
| int32_t var_48h_2;
| int32_t var_90h;
| r0 = arg1;
| r1 = arg2;
0x00012fe4 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00012fe8 sub sp, sp, 0x90 |
0x00012fec mov r6, r0 | r6 = r0;
0x00012ff0 mov r4, r1 | r4 = r1;
0x00012ff4 mov r7, r2 | r7 = r2;
0x00012ff8 bl 0x12650 | r0 = fcn_00012650 (r0, r1);
0x00012ffc cmp r0, 1 |
| if (r0 == 1) {
0x00013000 beq 0x13020 | goto label_2;
| }
0x00013004 cmp r0, 2 |
| if (r0 != 2) {
0x00013008 bne 0x13018 | goto label_0;
| }
0x0001300c bl 0x10b24 | errno_location ();
0x00013010 mov r3, 0x13 | r3 = 0x13;
0x00013014 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x00013018 mvn r0, 0 | r0 = ~0;
0x0001301c b 0x131ac | goto label_3;
| label_2:
0x00013020 add r1, sp, 0x28 | r1 += var_28h;
0x00013024 mov r0, r4 | r0 = r4;
0x00013028 bl 0x109e0 | r0 = stat64 ();
0x0001302c cmp r0, 0 |
| if (r0 == 0) {
0x00013030 beq 0x13080 | goto label_4;
| }
0x00013034 bl 0x10b24 | errno_location ();
0x00013038 ldr r6, [pc, 0x174] | r6 = *(0x131b0);
0x0001303c mov r3, r4 | r3 = r4;
0x00013040 ldr r2, [pc, 0x170] | r2 = stderr;
0x00013044 ldr r1, [pc, 0x170] | r1 = "libubi";
0x00013048 ldr r5, [r0] | r5 = *(r0);
0x0001304c ldr r0, [r6] | r0 = *(0x131b0);
0x00013050 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00013054 mov r0, r5 | r0 = r5;
0x00013058 ldr r4, [r6] | r4 = *(0x131b0);
0x0001305c bl 0x109d4 | strerror (r0);
0x00013060 str r5, [sp] | *(sp) = r5;
0x00013064 ldr r3, [pc, 0x154] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x00013068 mov r2, 8 | r2 = 8;
0x0001306c ldr r1, [pc, 0x150] | r1 = *(0x131c0);
0x00013070 str r0, [sp, 4] | var_4h = r0;
0x00013074 mov r0, r4 | r0 = r4;
0x00013078 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n", r4, r5)
0x0001307c b 0x13018 |
| } while (1);
| label_4:
0x00013080 ldr r3, [sp, 0x38] | r3 = var_38h;
0x00013084 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00013088 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x0001308c beq 0x130b8 | goto label_5;
| }
0x00013090 bl 0x10b24 | errno_location ();
0x00013094 ldr r2, [pc, 0x11c] | r2 = stderr;
0x00013098 ldr r1, [pc, 0x128] | r1 = "%*serror %d (%s)\n";
0x0001309c mov r3, 0x16 | r3 = 0x16;
0x000130a0 str r3, [r0] | *(r0) = r3;
0x000130a4 mov r3, r4 | r3 = r4;
| do {
0x000130a8 ldr r0, [pc, 0x104] |
0x000130ac ldr r0, [r0] | r0 = *(0x131b0);
0x000130b0 bl 0x10a64 | fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x000130b4 b 0x13018 | goto label_0;
| label_5:
0x000130b8 ldrd r8, sb, [sp, 0x48] | __asm ("ldrd r8, sb, [var_48h]");
0x000130bc mov r1, sb | r1 = sb;
0x000130c0 mov r0, r8 | r0 = r8;
0x000130c4 bl 0x10a04 | gnu_dev_major ();
0x000130c8 mov r1, sb | r1 = sb;
0x000130cc mov sl, r0 | sl = r0;
0x000130d0 mov r0, r8 | r0 = r8;
0x000130d4 bl 0x10a40 | r0 = gnu_dev_minor ();
0x000130d8 cmp r0, 0 |
| if (r0 == 0) {
0x000130dc beq 0x130fc | goto label_6;
| }
0x000130e0 bl 0x10b24 | errno_location ();
0x000130e4 mov r3, 0x16 | r3 = 0x16;
0x000130e8 ldr r2, [pc, 0xc8] | r2 = stderr;
0x000130ec ldr r1, [pc, 0xd8] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x000130f0 str r3, [r0] | *(r0) = r3;
0x000130f4 mov r3, r4 | r3 = r4;
0x000130f8 b 0x130a8 |
| } while (1);
| label_6:
0x000130fc add r1, sp, 0x10 | r1 += var_10h;
0x00013100 mov r0, r6 | r0 = r6;
0x00013104 bl 0x12320 | r0 = fcn_00012320 (r0, r1);
0x00013108 cmp r0, 0 |
| if (r0 != 0) {
0x0001310c bne 0x13018 | goto label_0;
| }
0x00013110 bl 0x10b24 | errno_location ();
0x00013114 ldr r4, [sp, 0x14] | r4 = var_14h;
0x00013118 add r8, r6, 0x18 | r8 = r6 + 0x18;
0x0001311c mov r5, r0 | r5 = r0;
| label_1:
0x00013120 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00013124 cmp r4, r3 |
| if (r4 <= r3) {
0x00013128 movgt r3, 0x13 | r3 = 0x13;
| }
| if (r4 > r3) {
0x0001312c bgt 0x13190 | goto label_7;
| }
0x00013130 add r3, sp, 0xc | r3 += var_ch;
0x00013134 add r2, sp, 8 | r2 += var_8h;
0x00013138 mov r1, r4 | r1 = r4;
0x0001313c mov r0, r8 | r0 = r8;
0x00013140 bl 0x11c7c | r0 = fcn_00011c7c (r0, r1);
0x00013144 cmp r0, 0 |
| if (r0 == 0) {
0x00013148 beq 0x13160 | goto label_8;
| }
0x0001314c ldr r3, [r5] | r3 = *(r5);
0x00013150 cmp r3, 2 |
| if (r3 != 2) {
0x00013154 bne 0x13018 | goto label_0;
| }
| do {
0x00013158 add r4, r4, 1 | r4++;
0x0001315c b 0x13120 | goto label_1;
| label_8:
0x00013160 ldr r3, [sp, 8] | r3 = var_8h;
0x00013164 cmp sl, r3 |
0x00013168 bne 0x13158 |
| } while (sl != r3);
0x0001316c ldr r3, [sp, 0xc] | r3 = var_ch;
0x00013170 cmp r3, 0 |
| if (r3 != 0) {
0x00013174 beq 0x13198 |
0x00013178 ldr r0, [pc, 0x34] |
0x0001317c ldr r2, [pc, 0x34] | r2 = stderr;
0x00013180 ldr r1, [pc, 0x48] | r1 = "_s:_error_:___s__is_not_an_UBI_character_device";
0x00013184 ldr r0, [r0] | r0 = *(0x131b0);
0x00013188 bl 0x10a64 | fprintf (r0, "_s:_error_:___s__is_not_an_UBI_character_device", r2)
0x0001318c mov r3, 0x16 | r3 = 0x16;
| label_7:
0x00013190 str r3, [r5] | *(r5) = r3;
0x00013194 b 0x13018 | goto label_0;
| }
0x00013198 str r3, [r5] | *(r5) = r3;
0x0001319c mov r2, r7 | r2 = r7;
0x000131a0 mov r1, r4 | r1 = r4;
0x000131a4 mov r0, r6 | r0 = r6;
0x000131a8 bl 0x12cac | fcn_00012cac (r0, r1);
| label_3:
0x000131ac add sp, sp, 0x90 |
0x000131b0 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x131d4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000131d4 () | void fcn_000131d4 (int32_t arg1, int32_t arg2) {
| char * s1;
| int32_t var_0h;
| int32_t var_20h_2;
| int32_t var_20h;
| r0 = arg1;
| r1 = arg2;
0x000131d4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000131d8 add sb, r3, 8 | sb = r3 + 8;
0x000131dc add fp, sp, 0x20 |
0x000131e0 sub sp, sp, 0x3c |
0x000131e4 mov r5, r1 | r5 = r1;
0x000131e8 mov r6, r2 | r6 = r2;
0x000131ec mov r1, 0 | r1 = 0;
0x000131f0 mov r2, 0xb0 | r2 = 0xb0;
0x000131f4 mov r7, r0 | r7 = r0;
0x000131f8 mov r0, sb | r0 = sb;
0x000131fc mov r4, r3 | r4 = r3;
0x00013200 bl 0x10adc | memset (r0, r1, r2);
0x00013204 ldr sl, [r7, 0x48] | sl = *((r7 + 0x48));
0x00013208 stm r4, {r5, r6} | *(r4) = r5;
| *((r4 + 4)) = r6;
0x0001320c mov r0, sl | r0 = sl;
0x00013210 bl 0x10b3c | strlen (r0);
0x00013214 mov r8, sp | r8 = sp;
0x00013218 mov r3, r6 | r3 = r6;
0x0001321c mov r2, r5 | r2 = r5;
0x00013220 mov r1, sl | r1 = sl;
0x00013224 add r0, r0, 0x6b | r0 += 0x6b;
0x00013228 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x0001322c sub sp, sp, r0 |
0x00013230 mov r0, sp | r0 = sp;
0x00013234 bl 0x10b18 | sprintf (r0, r1, r2);
0x00013238 mov r0, sp | r0 = sp;
0x0001323c add r2, r4, 0xc | r2 = r4 + 0xc;
0x00013240 mov r1, sb | r1 = sb;
0x00013244 bl 0x11ba4 | fcn_00011ba4 (r0, r1);
0x00013248 mov sp, r8 |
0x0001324c cmp r0, 0 |
0x00013250 beq 0x13264 |
| while (r8 < r0) {
| label_0:
0x00013254 mvn r8, 0 | r8 = ~0;
| label_1:
0x00013258 mov r0, r8 | r0 = r8;
0x0001325c sub sp, fp, 0x20 |
0x00013260 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00013264 ldr sb, [r7, 0x44] | sb = *((r7 + 0x44));
0x00013268 mov r0, sb | r0 = sb;
0x0001326c bl 0x10b3c | strlen (r0);
0x00013270 mov r3, r6 | r3 = r6;
0x00013274 mov r2, r5 | r2 = r5;
0x00013278 mov r1, sb | r1 = sb;
0x0001327c add r0, r0, 0x6b | r0 += 0x6b;
0x00013280 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013284 sub sp, sp, r0 |
0x00013288 mov r0, sp | r0 = sp;
0x0001328c bl 0x10b18 | sprintf (r0, r1, r2);
0x00013290 mov r0, sp | r0 = sp;
0x00013294 mov r2, 0x32 | r2 = 0x32;
0x00013298 sub r1, fp, 0x58 | r1 -= s1;
0x0001329c bl 0x11828 | fcn_00011828 (r0, r1);
0x000132a0 mov sp, r8 |
0x000132a4 subs r8, r0, 0 | r8 = r0 - 0;
0x000132a8 blt 0x13254 |
| }
0x000132ac mov r2, r8 | r2 = r8;
0x000132b0 ldr r1, [pc, 0x174] | r1 = *(0x13428);
0x000132b4 sub r0, fp, 0x58 | r0 -= s1;
0x000132b8 bl 0x10a88 | r0 = strncmp (r0, r1, r2);
0x000132bc cmp r0, 0 |
| if (r0 != 0) {
0x000132c0 moveq r3, 4 | r3 = 4;
| }
| if (r0 != 0) {
0x000132c4 beq 0x132e4 |
0x000132c8 mov r2, r8 | r2 = r8;
0x000132cc ldr r1, [pc, 0x15c] | r1 = "static\n";
0x000132d0 sub r0, fp, 0x58 | r0 -= s1;
0x000132d4 bl 0x10a88 | r0 = strncmp (r0, "static\n", r2);
0x000132d8 cmp r0, 0 |
| if (r0 != 0) {
0x000132dc bne 0x13404 | goto label_2;
| }
0x000132e0 mov r3, 3 | r3 = 3;
| }
0x000132e4 str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x000132e8 mov r2, r6 | r2 = r6;
0x000132ec add r3, r4, 0x14 | r3 = r4 + 0x14;
0x000132f0 mov r1, r5 | r1 = r5;
0x000132f4 ldr r0, [r7, 0x4c] | r0 = *((r7 + 0x4c));
0x000132f8 bl 0x117d8 | r0 = fcn_000117d8 (r0, r1);
0x000132fc cmp r0, 0 |
| if (r0 != 0) {
0x00013300 bne 0x13254 | goto label_0;
| }
0x00013304 ldr r8, [r7, 0x50] | r8 = *((r7 + 0x50));
0x00013308 mov sb, sp | sb = sp;
0x0001330c mov r0, r8 | r0 = r8;
0x00013310 bl 0x10b3c | strlen (r0);
0x00013314 mov r3, r6 | r3 = r6;
0x00013318 mov r2, r5 | r2 = r5;
0x0001331c mov r1, r8 | r1 = r8;
0x00013320 add r0, r0, 0x6b | r0 += 0x6b;
0x00013324 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013328 sub sp, sp, r0 |
0x0001332c mov r0, sp | r0 = sp;
0x00013330 bl 0x10b18 | sprintf (r0, r1, r2);
0x00013334 mov r0, sp | r0 = sp;
0x00013338 add r1, r4, 0x18 | r1 = r4 + 0x18;
0x0001333c bl 0x1156c | fcn_0001156c (r0, r1);
0x00013340 mov sp, sb |
0x00013344 cmp r0, 0 |
| if (r0 != 0) {
0x00013348 bne 0x13254 | goto label_0;
| }
0x0001334c add r3, r4, 0x28 | r3 = r4 + 0x28;
0x00013350 mov r2, r6 | r2 = r6;
0x00013354 mov r1, r5 | r1 = r5;
0x00013358 ldr r0, [r7, 0x54] | r0 = *((r7 + 0x54));
0x0001335c bl 0x117d8 | r0 = fcn_000117d8 (r0, r1);
0x00013360 cmp r0, 0 |
| if (r0 != 0) {
0x00013364 bne 0x13254 | goto label_0;
| }
0x00013368 add r3, r4, 0x2c | r3 = r4 + 0x2c;
0x0001336c mov r2, r6 | r2 = r6;
0x00013370 mov r1, r5 | r1 = r5;
0x00013374 ldr r0, [r7, 0x58] | r0 = *((r7 + 0x58));
0x00013378 bl 0x117d8 | r0 = fcn_000117d8 (r0, r1);
0x0001337c cmp r0, 0 |
| if (r0 != 0) {
0x00013380 bne 0x13254 | goto label_0;
| }
0x00013384 add r3, r4, 0x30 | r3 = r4 + 0x30;
0x00013388 mov r2, r6 | r2 = r6;
0x0001338c mov r1, r5 | r1 = r5;
0x00013390 ldr r0, [r7, 0x5c] | r0 = *((r7 + 0x5c));
0x00013394 bl 0x117d8 | r0 = fcn_000117d8 (r0, r1);
0x00013398 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 != r0) {
0x0001339c bne 0x13254 | goto label_0;
| }
0x000133a0 ldr r1, [r4, 0x28] | r1 = *((r4 + 0x28));
0x000133a4 ldr r0, [r4, 0x2c] | r0 = *((r4 + 0x2c));
0x000133a8 ldr r7, [r7, 0x60] | r7 = *((r7 + 0x60));
0x000133ac smull r2, r3, r0, r1 | r2:r3 = r0 * r1;
0x000133b0 mov r0, r7 | r0 = r7;
0x000133b4 strd r2, r3, [r4, 0x20] | __asm ("strd r2, r3, [r4, 0x20]");
0x000133b8 bl 0x10b3c | strlen (r0);
0x000133bc mov r3, r6 | r3 = r6;
0x000133c0 mov r2, r5 | r2 = r5;
0x000133c4 mov r1, r7 | r1 = r7;
0x000133c8 add r0, r0, 0x6b | r0 += 0x6b;
0x000133cc bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000133d0 sub sp, sp, r0 |
0x000133d4 mov r0, sp | r0 = sp;
0x000133d8 bl 0x10b18 | sprintf (r0, r1, r2);
0x000133dc mov r0, sp | r0 = sp;
0x000133e0 mov r2, 0x81 | r2 = 0x81;
0x000133e4 add r1, r4, 0x34 | r1 = r4 + 0x34;
0x000133e8 bl 0x11828 | fcn_00011828 (r0, r1);
0x000133ec mov sp, sb |
0x000133f0 cmp r0, 0 |
| if (r0 < 0) {
0x000133f4 blt 0x13254 | goto label_0;
| }
0x000133f8 add r4, r4, r0 | r4 += r0;
0x000133fc strb r8, [r4, 0x33] | *((r4 + 0x33)) = r8;
0x00013400 b 0x13258 | goto label_1;
| label_2:
0x00013404 ldr r0, [pc, 0x28] |
0x00013408 sub r3, fp, 0x58 | r3 -= s1;
0x0001340c ldr r2, [pc, 0x24] | r2 = stderr;
0x00013410 ldr r1, [pc, 0x24] | r1 = "libubi";
0x00013414 ldr r0, [r0] | r0 = "dynamic\n";
0x00013418 bl 0x10a64 | r0 = fprintf ("dynamic\n", "libubi", r2, r3)
0x0001341c bl 0x10b24 | errno_location ();
0x00013420 mov r3, 0x16 | r3 = 0x16;
0x00013424 str r3, [r0] | *(r0) = r3;
0x00013428 b 0x13254 | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x136e4 */
| #include <stdint.h>
|
; (fcn) fcn.000136e4 () | void fcn_000136e4 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_5ch;
| r0 = arg1;
| r1 = arg2;
0x000136e4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000136e8 mov r6, r0 | r6 = r0;
0x000136ec sub sp, sp, 0x5c |
0x000136f0 mov r0, r2 | r0 = r2;
0x000136f4 mov r7, r1 | r7 = r1;
0x000136f8 mov r8, r2 | r8 = r2;
0x000136fc mov sb, r3 | sb = r3;
0x00013700 bl 0x10b3c | r0 = strlen (r0);
0x00013704 subs fp, r0, 0 |
| if (fp == r0) {
0x00013708 bne 0x13734 |
0x0001370c ldr r3, [pc, 0xc0] | r3 = *(0x137d0);
0x00013710 ldr r2, [pc, 0xc0] | r2 = stderr;
0x00013714 ldr r0, [r3] | r0 = *(0x137d0);
0x00013718 ldr r1, [pc, 0xbc] | r1 = "libubi";
0x0001371c bl 0x10a64 | r0 = fprintf (r0, "libubi", r2, r3)
0x00013720 bl 0x10b24 | errno_location ();
0x00013724 mov r3, 0x16 | r3 = 0x16;
| label_1:
0x00013728 str r3, [r0] | *(r0) = r3;
0x0001372c mvn r4, 0 | r4 = ~0;
0x00013730 b 0x13754 |
| } else {
0x00013734 mov r2, sp | r2 = sp;
0x00013738 mov r1, r7 | r1 = r7;
0x0001373c mov r0, r6 | r0 = r6;
0x00013740 bl 0x12cac | r0 = fcn_00012cac (r0, r1);
0x00013744 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00013748 ldreq r5, [sp, 0xc] | r5 = var_ch;
| }
| if (r4 != r0) {
0x0001374c addeq sl, sb, 0x34 | sl = sb + 0x34;
| }
| if (r4 == r0) {
0x00013750 beq 0x13794 | goto label_4;
| }
| }
| do {
| label_3:
0x00013754 mov r0, r4 | r0 = r4;
0x00013758 add sp, sp, 0x5c |
0x0001375c pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_0:
0x00013760 mov r3, sb | r3 = sb;
0x00013764 mov r2, r5 | r2 = r5;
0x00013768 mov r1, r7 | r1 = r7;
0x0001376c mov r0, r6 | r0 = r6;
0x00013770 bl 0x131d4 | r0 = fcn_000131d4 (r0, r1);
0x00013774 cmn r0, 1 |
0x00013778 mov r4, r0 | r4 = r0;
| if (r0 != 1) {
0x0001377c bne 0x137ac | goto label_5;
| }
0x00013780 bl 0x10b24 | r0 = errno_location ();
0x00013784 ldr r3, [r0] | r3 = *(r0);
0x00013788 cmp r3, 2 |
0x0001378c bne 0x13754 |
| } while (r3 != 2);
| label_2:
0x00013790 add r5, r5, 1 | r5++;
| label_4:
0x00013794 ldr r3, [sp, 0x10] | r3 = var_10h;
0x00013798 cmp r3, r5 |
| if (r3 >= r5) {
0x0001379c bge 0x13760 | goto label_0;
| }
0x000137a0 bl 0x10b24 | errno_location ();
0x000137a4 mov r3, 2 | r3 = 2;
0x000137a8 b 0x13728 | goto label_1;
| label_5:
0x000137ac mov r0, sl | r0 = sl;
0x000137b0 bl 0x10b3c | r0 = strlen (r0);
0x000137b4 cmp r0, fp |
| if (r0 != fp) {
0x000137b8 bne 0x13790 | goto label_2;
| }
0x000137bc mov r1, sl | r1 = sl;
0x000137c0 mov r0, r8 | r0 = r8;
0x000137c4 bl 0x10b0c | r0 = strcmp (r0, r1);
0x000137c8 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x000137cc bne 0x13790 | goto label_2;
| }
0x000137d0 b 0x13754 | goto label_3;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubirsvol @ 0x10b90 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main (int32_t argc, char ** argv) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| char * * endptr;
| int32_t var_64h;
| int32_t var_8ch;
| int32_t var_118h;
| r0 = argc;
| r1 = argv;
| /* [10] -r-x section size 12292 named .text */
0x00010b90 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00010b94 ldr sl, [pc, 0x560] | sl = "vol_id";
0x00010b98 ldr r4, [pc, 0x560] | r4 = "vol_id";
0x00010b9c sub sp, sp, 0x118 |
0x00010ba0 mov r6, r0 | r6 = r0;
0x00010ba4 mov r8, r1 | r8 = r1;
| label_0:
0x00010ba8 mov r7, 0 | r7 = 0;
0x00010bac str r7, [sp] | *(sp) = r7;
0x00010bb0 mov r3, sl | r3 = sl;
0x00010bb4 ldr r2, [pc, 0x548] | r2 = optarg;
0x00010bb8 mov r1, r8 | r1 = r8;
0x00010bbc mov r0, r6 | r0 = r6;
0x00010bc0 bl 0x109ec | r0 = getopt_long ();
0x00010bc4 cmn r0, 1 |
0x00010bc8 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x00010bcc beq 0x10de8 | goto label_10;
| }
0x00010bd0 cmp r0, 0x53 |
| if (r0 == 0x53) {
0x00010bd4 beq 0x10c88 | goto label_11;
| }
| if (r0 <= 0x53) {
0x00010bd8 bgt 0x10c0c |
0x00010bdc cmp r0, 0x3f |
| if (r0 == 0x3f) {
0x00010be0 beq 0x10db0 | goto label_12;
| }
0x00010be4 cmp r0, 0x4e |
| if (r0 == 0x4e) {
0x00010be8 beq 0x10d78 | goto label_13;
| }
0x00010bec cmp r0, 0x3a |
| if (r0 != 0x3a) {
0x00010bf0 bne 0x10c20 | goto label_14;
| }
0x00010bf4 ldr r2, [pc, 0x50c] | r2 = "s:S:n:N:h_V";
0x00010bf8 ldr r1, [pc, 0x50c] | r1 = "ubirsvol";
| label_6:
0x00010bfc ldr r3, [pc, 0x50c] | r3 = "_s:_error_:_parameter_is_missing";
0x00010c00 ldr r0, [r3] | r0 = "_s:_error_:_parameter_is_missing";
0x00010c04 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "ubirsvol", "s:S:n:N:h_V", "_s:_error_:_parameter_is_missing")
0x00010c08 b 0x10c78 | goto label_3;
| }
0x00010c0c cmp r0, 0x68 |
| if (r0 == 0x68) {
0x00010c10 beq 0x10d88 | goto label_15;
| }
| if (r0 > 0x68) {
0x00010c14 bgt 0x10c34 | goto label_16;
| }
0x00010c18 cmp r0, 0x56 |
| if (r0 == 0x56) {
0x00010c1c beq 0x10dd4 | goto label_17;
| }
| do {
| label_14:
0x00010c20 ldr r3, [pc, 0x4e8] | r3 = "_s:_error_:_parameter_is_missing";
0x00010c24 ldr r0, [pc, 0x4e8] | r0 = stderr;
0x00010c28 ldr r1, [r3] | r1 = "_s:_error_:_parameter_is_missing";
0x00010c2c bl 0x10b48 | fputs (r0, "_s:_error_:_parameter_is_missing");
0x00010c30 b 0x10c78 | goto label_3;
| label_16:
0x00010c34 cmp r0, 0x6e |
| if (r0 == 0x6e) {
0x00010c38 beq 0x10d00 | goto label_18;
| }
0x00010c3c cmp r0, 0x73 |
0x00010c40 bne 0x10c20 |
| } while (r0 != 0x73);
0x00010c44 ldr r0, [r4] | r0 = *(r4);
0x00010c48 bl 0x112a8 | fcn_000112a8 (r0);
0x00010c4c ldr r3, [pc, 0x4c4] | r3 = "Use__h_for_help";
0x00010c50 cmp r0, 1 |
0x00010c54 strd r0, r1, [r3, 0x10] | __asm ("strd r0, r1, [r3, 0x10]");
0x00010c58 sbcs r3, r1, 0 | __asm ("sbcs r3, r1, 0");
| if (r0 >= 1) {
0x00010c5c bge 0x10ba8 | goto label_0;
| }
0x00010c60 ldr r3, [r4] | r3 = *(r4);
0x00010c64 ldr r2, [pc, 0x49c] | r2 = "s:S:n:N:h_V";
0x00010c68 ldr r1, [pc, 0x4ac] | r1 = *(0x11118);
| do {
| label_2:
0x00010c6c ldr r0, [pc, 0x49c] |
0x00010c70 ldr r0, [r0] | r0 = "_s:_error_:_parameter_is_missing";
0x00010c74 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", r1, "s:S:n:N:h_V", r3)
| label_3:
0x00010c78 mvn r5, 0 | r5 = ~0;
| label_4:
0x00010c7c mov r0, r5 | r0 = r5;
0x00010c80 add sp, sp, 0x118 |
0x00010c84 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_11:
0x00010c88 ldr sb, [r4] | sb = *(r4);
0x00010c8c mov r2, r7 | r2 = r7;
0x00010c90 add r1, sp, 0x60 | r1 += endptr;
0x00010c94 mov r0, sb | r0 = sb;
0x00010c98 bl 0x10ac4 | strtoull (r0, r1, r2);
0x00010c9c ldrb r3, [sb] | r3 = *(sb);
0x00010ca0 ldr r7, [pc, 0x470] | r7 = "Use__h_for_help";
0x00010ca4 cmp r3, 0 |
0x00010ca8 mov r5, r0 | r5 = r0;
| if (r3 != 0) {
0x00010cac beq 0x10cc0 |
0x00010cb0 ldr r3, [sp, 0x60] | r3 = endptr;
0x00010cb4 ldrb r3, [r3] | r3 = *(r3);
0x00010cb8 cmp r3, 0 |
| if (r3 == 0) {
0x00010cbc beq 0x10cf0 | goto label_19;
| }
| }
0x00010cc0 ldr r0, [pc, 0x448] |
0x00010cc4 str sb, [sp] | *(sp) = sb;
0x00010cc8 ldr r3, [pc, 0x450] | r3 = "%s: error!: bad volume size: \"%s\"\n";
0x00010ccc ldr r2, [pc, 0x434] | r2 = "s:S:n:N:h_V";
0x00010cd0 ldr r1, [pc, 0x44c] | r1 = "strtoull";
0x00010cd4 ldr r0, [r0] | r0 = "_s:_error_:_parameter_is_missing";
0x00010cd8 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "strtoull", "s:S:n:N:h_V", "%s: error!: bad volume size: \"%s\"\n")
0x00010cdc str r5, [r7, 0x18] | *((r7 + 0x18)) = r5;
| label_1:
0x00010ce0 ldr r3, [r4] | r3 = *(r4);
0x00010ce4 ldr r2, [pc, 0x41c] | r2 = "s:S:n:N:h_V";
0x00010ce8 ldr r1, [pc, 0x438] | r1 = "%s: error!: %s: unable to parse the number '%s'\n";
0x00010cec b 0x10c6c |
| } while (1);
| label_19:
0x00010cf0 cmp r0, 0 |
0x00010cf4 str r0, [r7, 0x18] | *((r7 + 0x18)) = r0;
| if (r0 > 0) {
0x00010cf8 bgt 0x10ba8 | goto label_0;
| }
0x00010cfc b 0x10ce0 | goto label_1;
| label_18:
0x00010d00 ldr sb, [r4] | sb = *(r4);
0x00010d04 mov r2, r7 | r2 = r7;
0x00010d08 add r1, sp, 0x60 | r1 += endptr;
0x00010d0c mov r0, sb | r0 = sb;
0x00010d10 bl 0x10a34 | strtoul (r0, r1, r2);
0x00010d14 ldrb r3, [sb] | r3 = *(sb);
0x00010d18 ldr r7, [pc, 0x3f8] | r7 = "Use__h_for_help";
0x00010d1c cmp r3, 0 |
0x00010d20 mov r5, r0 | r5 = r0;
| if (r3 == 0) {
0x00010d24 beq 0x10d54 | goto label_20;
| }
0x00010d28 ldr r3, [sp, 0x60] | r3 = endptr;
0x00010d2c ldrb r3, [r3] | r3 = *(r3);
0x00010d30 cmp r3, 0 |
| if (r3 != 0) {
0x00010d34 bne 0x10d54 | goto label_20;
| }
0x00010d38 cmp r0, 0 |
0x00010d3c str r0, [r7] | *(r7) = r0;
| if (r0 >= 0) {
0x00010d40 bge 0x10ba8 | goto label_0;
| }
| do {
0x00010d44 ldr r3, [r4] | r3 = *(r4);
0x00010d48 ldr r2, [pc, 0x3b8] | r2 = "s:S:n:N:h_V";
0x00010d4c ldr r1, [pc, 0x3d8] | r1 = "_s:_error_:_bad_LEB_count:___s_";
0x00010d50 b 0x10c6c | goto label_2;
| label_20:
0x00010d54 ldr r0, [pc, 0x3b4] |
0x00010d58 str sb, [sp] | *(sp) = sb;
0x00010d5c ldr r3, [pc, 0x3cc] | r3 = "%s: error!: bad volume ID: \"%s\"\n";
0x00010d60 ldr r2, [pc, 0x3a0] | r2 = "s:S:n:N:h_V";
0x00010d64 ldr r1, [pc, 0x3b8] | r1 = "strtoull";
0x00010d68 ldr r0, [r0] | r0 = "_s:_error_:_parameter_is_missing";
0x00010d6c bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "strtoull", "s:S:n:N:h_V", "%s: error!: bad volume ID: \"%s\"\n")
0x00010d70 str r5, [r7] | *(r7) = r5;
0x00010d74 b 0x10d44 |
| } while (1);
| label_13:
0x00010d78 ldr r2, [r4] | r2 = *(r4);
0x00010d7c ldr r3, [pc, 0x394] | r3 = "Use__h_for_help";
0x00010d80 str r2, [r3, 8] | *((r3 + 8)) = r2;
0x00010d84 b 0x10ba8 | goto label_0;
| label_15:
0x00010d88 ldr r1, [pc, 0x3a4] | r1 = "strtoul";
0x00010d8c ldr r0, [pc, 0x3a4] | r0 = "ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.";
0x00010d90 bl 0x109c8 | printf ("ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.", "strtoul");
0x00010d94 ldr r1, [pc, 0x3a0] | r1 = "_s";
0x00010d98 ldr r0, [pc, 0x398] | r0 = "ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.";
0x00010d9c bl 0x109c8 | printf ("ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.", "_s");
0x00010da0 ldr r0, [pc, 0x398] | r0 = "Usage: ubirsvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\nExample: ubirsvol /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n UBI device corresponding to /dev/ubi0\n ubirsvol /dev/ubi0 -N my_vol -s 1MiB - resize UBI volume named \"my_vol\" to 1 MiB\n\t on UBI device corresponding to /dev/ubi0";
0x00010da4 bl 0x10a1c | puts ("Usage: ubirsvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\nExample: ubirsvol /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n UBI device corresponding to /dev/ubi0\n ubirsvol /dev/ubi0 -N my_vol -s 1MiB - resize UBI volume named \"my_vol\" to 1 MiB\n\t on UBI device corresponding to /dev/ubi0");
| do {
0x00010da8 mov r0, r7 | r0 = r7;
0x00010dac bl 0x10b30 | exit (r0);
| label_12:
0x00010db0 ldr r1, [pc, 0x37c] | r1 = "strtoul";
0x00010db4 ldr r0, [pc, 0x37c] | r0 = "ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.";
0x00010db8 bl 0x109c8 | printf ("ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.", "strtoul");
0x00010dbc ldr r1, [pc, 0x378] | r1 = "_s";
0x00010dc0 ldr r0, [pc, 0x370] | r0 = "ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.";
0x00010dc4 bl 0x109c8 | printf ("ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.", "_s");
0x00010dc8 ldr r0, [pc, 0x370] | r0 = "Usage: ubirsvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\nExample: ubirsvol /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n UBI device corresponding to /dev/ubi0\n ubirsvol /dev/ubi0 -N my_vol -s 1MiB - resize UBI volume named \"my_vol\" to 1 MiB\n\t on UBI device corresponding to /dev/ubi0";
0x00010dcc bl 0x10a1c | puts ("Usage: ubirsvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\nExample: ubirsvol /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n UBI device corresponding to /dev/ubi0\n ubirsvol /dev/ubi0 -N my_vol -s 1MiB - resize UBI volume named \"my_vol\" to 1 MiB\n\t on UBI device corresponding to /dev/ubi0");
0x00010dd0 b 0x10c78 | goto label_3;
| label_17:
0x00010dd4 ldr r2, [pc, 0x368] | r2 = "-n, --vol_id=<volume id> volume ID to resize\n-N, --name=<volume name> volume name to resize\n-s, --size=<bytes> volume size volume size in bytes, kilobytes (KiB)\n or megabytes (MiB)\n-S, --lebs=<LEBs count> alternative way to give volume size in logical\n eraseblocks\n-h, -?, --help print help message\n-V, --version print program version";
0x00010dd8 ldr r1, [pc, 0x328] | r1 = "s:S:n:N:h_V";
0x00010ddc ldr r0, [pc, 0x364] | r0 = "2.1.0";
0x00010de0 bl 0x109c8 | printf ("2.1.0", "s:S:n:N:h_V", "-n, --vol_id=<volume id> volume ID to resize\n-N, --name=<volume name> volume name to resize\n-s, --size=<bytes> volume size volume size in bytes, kilobytes (KiB)\n or megabytes (MiB)\n-S, --lebs=<LEBs count> alternative way to give volume size in logical\n eraseblocks\n-h, -?, --help print help message\n-V, --version print program version");
0x00010de4 b 0x10da8 |
| } while (1);
| label_10:
0x00010de8 ldr r3, [pc, 0x35c] |
0x00010dec ldr r3, [r3] | r3 = "%s (mtd-utils) %s\n";
0x00010df0 cmp r6, r3 |
| if (r6 != r3) {
0x00010df4 bne 0x10e10 | goto label_21;
| }
0x00010df8 ldr r2, [pc, 0x308] | r2 = "s:S:n:N:h_V";
0x00010dfc ldr r1, [pc, 0x34c] | r1 = optind;
| do {
| label_5:
0x00010e00 ldr r3, [pc, 0x308] | r3 = "_s:_error_:_parameter_is_missing";
0x00010e04 ldr r0, [r3] | r0 = "_s:_error_:_parameter_is_missing";
0x00010e08 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", r1, "s:S:n:N:h_V", "_s:_error_:_parameter_is_missing")
0x00010e0c b 0x10c7c | goto label_4;
| label_21:
0x00010e10 sub r6, r6, 1 | r6--;
0x00010e14 cmp r3, r6 |
| if (r3 == r6) {
0x00010e18 ldrne r2, [pc, 0x2e8] | r2 = "ubirsvol";
| }
| if (r3 == r6) {
0x00010e1c ldrne r1, [pc, 0x330] | r1 = "_s:_error_:_more_then_one_UBI_device_specified__use__h_for_help_";
| }
0x00010e20 bne 0x10e00 |
| } while (r3 != r6);
0x00010e24 ldr r4, [pc, 0x2ec] | r4 = "Use__h_for_help";
0x00010e28 ldr r3, [r8, r3, lsl 2] | offset_0 = r3 << 2;
| r3 = *((r8 + offset_0));
0x00010e2c ldr r2, [r4] | r2 = "Use__h_for_help";
0x00010e30 str r3, [r4, 4] | *((r4 + 4)) = r3;
0x00010e34 cmn r2, 1 |
0x00010e38 ldr r3, [r4, 8] | r3 = "%s: error!: bad volume size: \"%s\"\n";
| if (r2 == 1) {
0x00010e3c bne 0x10e54 |
0x00010e40 cmp r3, 0 |
| if (r3 != 0) {
0x00010e44 bne 0x10e64 | goto label_22;
| }
0x00010e48 ldr r2, [pc, 0x2b8] | r2 = "s:S:n:N:h_V";
0x00010e4c ldr r1, [pc, 0x304] | r1 = "_s:_error_:_more_then_one_UBI_device_specified__use__h_for_help_";
0x00010e50 b 0x10e00 | goto label_5;
| }
0x00010e54 cmp r3, 0 |
| if (r3 == 0) {
0x00010e58 ldrne r2, [pc, 0x2a8] | r2 = "ubirsvol";
| }
| if (r3 != 0) {
0x00010e5c ldrne r1, [pc, 0x2f8] | r1 = "%s: error!: please, specify either volume ID or volume name, not both\n";
| goto label_23;
| }
| if (r3 != 0) {
| label_23:
0x00010e60 bne 0x10e00 | goto label_5;
| }
| label_22:
0x00010e64 ldrd r2, r3, [r4, 0x10] | __asm ("ldrd r2, r3, [r4, 0x10]");
0x00010e68 ldr r6, [r4, 0x18] | r6 = *((r4 + 0x18));
0x00010e6c mvn r1, 0 | r1 = ~0;
0x00010e70 mvn r0, 0 | r0 = ~0;
0x00010e74 cmp r3, r1 |
0x00010e78 cmpeq r2, r0 | __asm ("cmpeq r2, r0");
| if (r3 == r1) {
0x00010e7c bne 0x10e94 |
0x00010e80 cmn r6, 1 |
| if (r6 != 1) {
0x00010e84 bne 0x10ea4 | goto label_24;
| }
0x00010e88 ldr r2, [pc, 0x278] | r2 = "s:S:n:N:h_V";
0x00010e8c ldr r1, [pc, 0x2cc] | r1 = "%s: error!: please, specify either volume ID or volume name, not both\n";
0x00010e90 b 0x10bfc | goto label_6;
| }
0x00010e94 cmn r6, 1 |
| if (r6 == 1) {
0x00010e98 ldrne r2, [pc, 0x268] | r2 = "ubirsvol";
| }
| if (r6 != 1) {
0x00010e9c ldrne r1, [pc, 0x2c0] | r1 = "%s: error!: size specified with more then one option\n";
| goto label_25;
| }
| if (r6 != 1) {
| label_25:
0x00010ea0 bne 0x10e00 | goto label_5;
| }
| label_24:
0x00010ea4 bl 0x11e64 | r0 = fcn_00011e64 ();
0x00010ea8 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 == r0) {
0x00010eac bne 0x10ef8 |
0x00010eb0 bl 0x10b24 | errno_location ();
0x00010eb4 ldr r6, [pc, 0x254] |
0x00010eb8 ldr r2, [pc, 0x248] | r2 = "s:S:n:N:h_V";
0x00010ebc ldr r1, [pc, 0x2a4] | r1 = "%s: error!: size specified with more then one option\n";
0x00010ec0 ldr r4, [r0] | r4 = *(r0);
0x00010ec4 ldr r0, [r6] | r0 = "_s:_error_:_parameter_is_missing";
0x00010ec8 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "%s: error!: size specified with more then one option\n", "s:S:n:N:h_V", r3, r4, r5, "_s:_error_:_parameter_is_missing")
0x00010ecc mov r0, r4 | r0 = r4;
0x00010ed0 ldr r6, [r6] | r6 = "_s:_error_:_parameter_is_missing";
0x00010ed4 bl 0x109d4 | strerror (r0);
0x00010ed8 str r4, [sp] | *(sp) = r4;
0x00010edc ldr r3, [pc, 0x288] | r3 = "%s: error!: cannot open libubi\n";
0x00010ee0 mov r2, 0xa | r2 = 0xa;
0x00010ee4 ldr r1, [pc, 0x284] | r1 = *(0x1116c);
0x00010ee8 str r0, [sp, 4] | var_4h = r0;
0x00010eec mov r0, r6 | r0 = r6;
0x00010ef0 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n", r4)
0x00010ef4 b 0x10c7c | goto label_4;
| }
0x00010ef8 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00010efc bl 0x12650 | r0 = fcn_00012650 (r0, r1);
0x00010f00 cmp r0, 2 |
| if (r0 != 2) {
0x00010f04 bne 0x10f2c | goto label_26;
| }
0x00010f08 ldr r0, [pc, 0x200] |
0x00010f0c ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010f10 ldr r2, [pc, 0x1f0] | r2 = "s:S:n:N:h_V";
0x00010f14 ldr r1, [pc, 0x258] | r1 = "%*serror %d (%s)\n";
0x00010f18 ldr r0, [r0] | r0 = "_s:_error_:_parameter_is_missing";
0x00010f1c bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "%*serror %d (%s)\n", "s:S:n:N:h_V", r3)
| do {
0x00010f20 mov r0, r6 | r0 = r6;
0x00010f24 bl 0x11d90 | fcn_00011d90 (r0);
0x00010f28 b 0x10c7c | goto label_4;
| label_26:
0x00010f2c cmp r0, 0 |
| if (r0 < 0) {
0x00010f30 bge 0x10f60 |
0x00010f34 bl 0x10b24 | errno_location ();
0x00010f38 ldr sb, [r4, 4] | sb = *((r4 + 4));
0x00010f3c ldr r8, [pc, 0x1cc] | r8 = "_s:_error_:_parameter_is_missing";
0x00010f40 mov r3, sb | r3 = sb;
0x00010f44 ldr r2, [pc, 0x1bc] | r2 = "s:S:n:N:h_V";
0x00010f48 ldr r7, [r0] | r7 = *(r0);
0x00010f4c ldr r0, [r8] | r0 = "_s:_error_:_parameter_is_missing";
0x00010f50 cmp r7, 0x13 |
| if (r7 != 0x13) {
0x00010f54 bne 0x10fc4 | goto label_27;
| }
0x00010f58 ldr r1, [pc, 0x218] | r1 = "%s: error!: \"%s\" is an UBI volume node, not an UBI device node\n";
0x00010f5c bl 0x10a64 | fprintf (r0, "%s: error!: \"%s\" is an UBI volume node, not an UBI device node\n")
| }
| label_7:
0x00010f60 add r2, sp, 8 | r2 += var_8h;
0x00010f64 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00010f68 mov r0, r6 | r0 = r6;
0x00010f6c bl 0x12fe4 | r0 = fcn_00012fe4 (r0, r1);
0x00010f70 cmp r0, 0 |
| if (r0 == 0) {
0x00010f74 beq 0x10ff8 | goto label_28;
| }
0x00010f78 bl 0x10b24 | errno_location ();
0x00010f7c ldr r8, [pc, 0x18c] | r8 = "_s:_error_:_parameter_is_missing";
0x00010f80 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010f84 ldr r2, [pc, 0x17c] | r2 = "s:S:n:N:h_V";
0x00010f88 ldr r1, [pc, 0x1ec] | r1 = "%s: error!: \"%s\" is not an UBI device node\n";
0x00010f8c ldr r7, [r0] | r7 = *(r0);
| label_8:
0x00010f90 ldr r0, [r8] | r0 = *(r8);
0x00010f94 bl 0x10a64 | fprintf (r0, "%s: error!: \"%s\" is not an UBI device node\n", "s:S:n:N:h_V", r3)
0x00010f98 mov r0, r7 | r0 = r7;
0x00010f9c ldr r4, [r8] | r4 = *(r8);
0x00010fa0 bl 0x109d4 | strerror (r0);
0x00010fa4 ldr r3, [pc, 0x1c0] | r3 = "%s: error!: cannot open libubi\n";
0x00010fa8 ldr r1, [pc, 0x1c0] | r1 = *(0x1116c);
0x00010fac mov r2, 0xa | r2 = 0xa;
0x00010fb0 str r7, [sp] | *(sp) = r7;
0x00010fb4 str r0, [sp, 4] | var_4h = r0;
0x00010fb8 mov r0, r4 | r0 = r4;
| label_9:
0x00010fbc bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n")
0x00010fc0 b 0x10f20 |
| } while (1);
| label_27:
0x00010fc4 ldr r1, [pc, 0x1b4] | r1 = "%s: error!: cannot get information about UBI device \"%s\"\n";
0x00010fc8 bl 0x10a64 | fprintf (r0, "%s: error!: cannot get information about UBI device \"%s\"\n")
0x00010fcc mov r0, r7 | r0 = r7;
0x00010fd0 ldr r8, [r8] | r8 = *(r8);
0x00010fd4 bl 0x109d4 | strerror (r0);
0x00010fd8 str r7, [sp] | *(sp) = r7;
0x00010fdc ldr r3, [pc, 0x188] | r3 = "%s: error!: cannot open libubi\n";
0x00010fe0 mov r2, 0xa | r2 = 0xa;
0x00010fe4 ldr r1, [pc, 0x184] | r1 = *(0x1116c);
0x00010fe8 str r0, [sp, 4] | var_4h = r0;
0x00010fec mov r0, r8 | r0 = r8;
0x00010ff0 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n")
0x00010ff4 b 0x10f60 | goto label_7;
| label_28:
0x00010ff8 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00010ffc ldr r1, [sp, 8] | r1 = var_8h;
0x00011000 cmp r2, 0 |
0x00011004 add r3, sp, 0x60 | r3 += endptr;
| if (r2 != 0) {
0x00011008 beq 0x11040 |
0x0001100c mov r0, r6 | r0 = r6;
0x00011010 bl 0x136e4 | r0 = fcn_000136e4 (r0, r1);
0x00011014 cmp r0, 0 |
| if (r0 != 0) {
0x00011018 ldreq r3, [sp, 0x64] | r3 = var_64h;
| }
| if (r0 != 0) {
0x0001101c streq r3, [r4] | *(r4) = r3;
| }
| if (r0 == 0) {
0x00011020 beq 0x11070 | goto label_29;
| }
0x00011024 bl 0x10b24 | errno_location ();
0x00011028 ldr r8, [pc, 0xe0] | r8 = "_s:_error_:_parameter_is_missing";
0x0001102c ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00011030 ldr r2, [pc, 0xd0] | r2 = "s:S:n:N:h_V";
0x00011034 ldr r1, [pc, 0x148] | r1 = "%s: error!: error while probing \"%s\"\n";
0x00011038 ldr r7, [r0] | r7 = *(r0);
0x0001103c b 0x10f90 | goto label_8;
| }
0x00011040 ldr r2, [r4] | r2 = *(r4);
0x00011044 mov r0, r6 | r0 = r6;
0x00011048 bl 0x131d4 | r0 = fcn_000131d4 (r0, r1);
0x0001104c cmp r0, 0 |
| if (r0 != 0) {
0x00011050 beq 0x11070 |
0x00011054 bl 0x10b24 | errno_location ();
0x00011058 ldr r8, [pc, 0xb0] | r8 = "_s:_error_:_parameter_is_missing";
0x0001105c ldr r3, [r4] | r3 = *(r4);
0x00011060 ldr r2, [pc, 0xa0] | r2 = "s:S:n:N:h_V";
0x00011064 ldr r1, [pc, 0x11c] | r1 = "%s: error!: cannot find UBI volume \"%s\"\n";
0x00011068 ldr r7, [r0] | r7 = *(r0);
0x0001106c b 0x10f90 | goto label_8;
| }
| label_29:
0x00011070 ldr r1, [r4, 0x18] | r1 = *((r4 + 0x18));
0x00011074 cmn r1, 1 |
| if (r1 == 1) {
0x00011078 ldrne r3, [sp, 0x8c] | r3 = var_8ch;
| }
| if (r1 == 1) {
0x0001107c mulne r2, r3, r1 | r2 = r3 * r1;
| }
0x00011080 asrne r3, r2, 0x1f | __asm ("asrne r3, r2, 0x1f");
0x00011084 strdne r2, r3, [r4, 0x10] | __asm ("strdne r2, r3, [r4, 0x10]");
0x00011088 ldrd r2, r3, [r4, 0x10] | __asm ("ldrd r2, r3, [r4, 0x10]");
0x0001108c mov r0, r6 | r0 = r6;
0x00011090 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011094 ldr r2, [r4] | r2 = *(r4);
0x00011098 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x0001109c bl 0x12af8 | r0 = fcn_00012af8 (r0, r1, r2);
0x000110a0 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x000110a4 beq 0x110ec |
0x000110a8 bl 0x10b24 | errno_location ();
0x000110ac ldr r7, [pc, 0x5c] |
0x000110b0 ldr r2, [pc, 0x50] | r2 = "s:S:n:N:h_V";
0x000110b4 ldr r1, [pc, 0xd0] | r1 = "_s:_error_:_cannot_find_UBI_volume_ID__d";
0x000110b8 ldr r4, [r0] | r4 = *(r0);
0x000110bc ldr r0, [r7] | r0 = "_s:_error_:_parameter_is_missing";
0x000110c0 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "_s:_error_:_cannot_find_UBI_volume_ID__d", "s:S:n:N:h_V", r3, r4)
0x000110c4 mov r0, r4 | r0 = r4;
0x000110c8 ldr r7, [r7] | r7 = "_s:_error_:_parameter_is_missing";
0x000110cc bl 0x109d4 | strerror (r0);
0x000110d0 str r4, [sp] | *(sp) = r4;
0x000110d4 ldr r3, [pc, 0x90] | r3 = "%s: error!: cannot open libubi\n";
0x000110d8 mov r2, 0xa | r2 = 0xa;
0x000110dc ldr r1, [pc, 0x8c] | r1 = *(0x1116c);
0x000110e0 str r0, [sp, 4] | var_4h = r0;
0x000110e4 mov r0, r7 | r0 = r7;
0x000110e8 b 0x10fbc | goto label_9;
| }
0x000110ec mov r0, r6 | r0 = r6;
0x000110f0 bl 0x11d90 | fcn_00011d90 (r0);
0x000110f4 mov r5, r4 | r5 = r4;
0x000110f8 b 0x10c7c | goto label_4;
| }
[*] Function fprintf used 64 times ubirsvol