[*] Binary protection state of ubiupdatevol
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of ubiupdatevol
; 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/ubiupdatevol @ 0x11504 */
| #include <stdint.h>
|
; (fcn) fcn.00011504 () | void fcn_00011504 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| char * * endptr;
| int32_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x00011504 push {r4, r5, r6, r7, lr} |
0x00011508 sub sp, sp, 0x14 |
0x0001150c mov r5, r1 | r5 = r1;
0x00011510 mov r2, 0 | r2 = 0;
0x00011514 add r1, sp, 0xc | r1 += endptr;
0x00011518 mov r4, r0 | r4 = r0;
0x0001151c bl 0x109ec | strtoull (r0, r1, r2);
0x00011520 ldrb r3, [r4] | r3 = *(r4);
0x00011524 cmp r3, 0 |
0x00011528 mov r6, r0 | r6 = r0;
0x0001152c mov r7, r1 | r7 = r1;
| if (r3 != 0) {
0x00011530 beq 0x11544 |
0x00011534 ldr r3, [sp, 0xc] | r3 = endptr;
0x00011538 ldrb r3, [r3] | r3 = *(r3);
0x0001153c cmp r3, 0 |
| if (r3 == 0) {
0x00011540 beq 0x11568 | goto label_0;
| }
| }
0x00011544 ldr r0, [pc, 0x2c] |
0x00011548 str r4, [sp] | *(sp) = r4;
0x0001154c ldr r3, [pc, 0x28] | r3 = stderr;
0x00011550 ldr r2, [pc, 0x28] | r2 = "strtoull";
0x00011554 ldr r1, [pc, 0x28] | r1 = "ubiupdatevol";
0x00011558 ldr r0, [r0] | r0 = *(0x11574);
0x0001155c bl 0x1098c | fprintf (r0, "ubiupdatevol", "strtoull", r3, r4)
0x00011560 mov r3, 1 | r3 = 1;
0x00011564 str r3, [r5] | *(r5) = r3;
| label_0:
0x00011568 mov r0, r6 | r0 = r6;
0x0001156c mov r1, r7 | r1 = r7;
0x00011570 add sp, sp, 0x14 |
0x00011574 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/ubiupdatevol @ 0x11588 */
| #include <stdint.h>
|
; (fcn) fcn.00011588 () | void fcn_00011588 (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;
0x00011588 push {r4, r5, r6, r7, lr} |
0x0001158c mov r6, r1 | r6 = r1;
0x00011590 sub sp, sp, 0x4c |
0x00011594 mov r1, 0 | r1 = 0;
0x00011598 mov r5, r0 | r5 = r0;
0x0001159c bl 0x10a04 | r0 = open64 ();
0x000115a0 cmn r0, 1 |
0x000115a4 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x000115a8 beq 0x11704 | goto label_2;
| }
0x000115ac mov r2, 0x32 | r2 = 0x32;
0x000115b0 add r1, sp, 0x14 | r1 += buf;
0x000115b4 bl 0x109a4 | r0 = read (r0, r1, r2);
0x000115b8 cmn r0, 1 |
| if (r0 != 1) {
0x000115bc bne 0x11614 | goto label_3;
| }
0x000115c0 bl 0x10a34 | errno_location ();
0x000115c4 ldr r7, [pc, 0x144] | r7 = *(0x1170c);
0x000115c8 mov r3, r5 | r3 = r5;
0x000115cc ldr r2, [pc, 0x140] | r2 = stderr;
0x000115d0 ldr r1, [pc, 0x140] | r1 = "libubi";
0x000115d4 ldr r6, [r0] | r6 = *(r0);
0x000115d8 ldr r0, [r7] | r0 = *(0x1170c);
0x000115dc bl 0x1098c | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000115e0 mov r0, r6 | r0 = r6;
0x000115e4 ldr r5, [r7] | r5 = *(0x1170c);
0x000115e8 bl 0x10908 | strerror (r0);
0x000115ec str r6, [sp] | *(sp) = r6;
0x000115f0 ldr r3, [pc, 0x124] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000115f4 mov r2, 8 | r2 = 8;
0x000115f8 ldr r1, [pc, 0x120] | r1 = *(0x1171c);
0x000115fc str r0, [sp, 4] | var_4h = r0;
0x00011600 mov r0, r5 | r0 = r5;
0x00011604 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x00011608 mov r0, r4 | r0 = r4;
0x0001160c bl 0x10a88 | close (r0);
0x00011610 b 0x11700 | goto label_4;
| label_3:
0x00011614 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x00011618 bne 0x11644 | goto label_5;
| }
0x0001161c ldr r2, [pc, 0xf0] | r2 = stderr;
0x00011620 ldr r1, [pc, 0xfc] | r1 = "%*serror %d (%s)\n";
0x00011624 mov r3, r5 | r3 = r5;
| label_0:
0x00011628 ldr r0, [pc, 0xe0] |
0x0001162c ldr r0, [r0] | r0 = *(0x1170c);
0x00011630 bl 0x1098c | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x00011634 bl 0x10a34 | errno_location ();
0x00011638 mov r3, 0x16 | r3 = 0x16;
0x0001163c str r3, [r0] | *(r0) = r3;
0x00011640 b 0x11608 |
| } while (1);
| label_5:
0x00011644 add r3, sp, 0x48 | r3 += s;
0x00011648 add r0, r3, r0 | r0 = r3 + r0;
0x0001164c mov r3, 0 | r3 = 0;
0x00011650 strb r3, [r0, -0x34] | buf = r3;
0x00011654 mov r2, r6 | r2 = r6;
0x00011658 ldr r1, [pc, 0xc8] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x0001165c add r0, sp, 0x14 | r0 += buf;
0x00011660 bl 0x109d4 | r0 = sscanf (r0, "%s: error!: contents of \"%s\" is too long\n", r2);
0x00011664 cmp r0, 1 |
| if (r0 == 1) {
0x00011668 movne r3, r5 | r3 = r5;
| }
| if (r0 == 1) {
0x0001166c ldrne r2, [pc, 0xa0] | r2 = "libubi";
| }
| if (r0 != 1) {
0x00011670 ldrne r1, [pc, 0xb4] | r1 = "%s: error!: cannot read integer from \"%s\"\n\n";
| goto label_6;
| }
| if (r0 != 1) {
| label_6:
0x00011674 bne 0x11628 | goto label_0;
| }
0x00011678 ldrd r2, r3, [r6] | __asm ("ldrd r2, r3, [r6]");
0x0001167c cmp r2, 0 |
0x00011680 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x00011684 bge 0x116a8 |
0x00011688 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x0001168c ldr r3, [pc, 0x7c] | r3 = *(0x1170c);
0x00011690 str r5, [sp, 8] | var_8h = r5;
0x00011694 ldr r2, [pc, 0x78] | r2 = stderr;
0x00011698 ldr r1, [pc, 0x90] | r1 = "%s: error!: cannot read integer from \"%s\"\n\n";
0x0001169c ldr r0, [r3] | r0 = *(0x1170c);
0x000116a0 bl 0x1098c | fprintf (r0, "%s: error!: cannot read integer from \"%s\"\n\n", r2, r3, r4, r5)
0x000116a4 b 0x11634 | goto label_1;
| }
0x000116a8 mov r0, r4 | r0 = r4;
0x000116ac bl 0x10a88 | r0 = close (r0);
0x000116b0 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x000116b4 beq 0x11704 |
0x000116b8 bl 0x10a34 | errno_location ();
0x000116bc ldr r6, [pc, 0x4c] | r6 = *(0x1170c);
0x000116c0 mov r3, r5 | r3 = r5;
0x000116c4 ldr r2, [pc, 0x48] | r2 = stderr;
0x000116c8 ldr r1, [pc, 0x64] | r1 = "%s: error!: negative value %lld in \"%s\"\n";
0x000116cc ldr r4, [r0] | r4 = *(r0);
0x000116d0 ldr r0, [r6] | r0 = *(0x1170c);
0x000116d4 bl 0x1098c | fprintf (r0, "%s: error!: negative value %lld in \"%s\"\n", r2, r3, r4, r5, r6)
0x000116d8 mov r0, r4 | r0 = r4;
0x000116dc ldr r5, [r6] | r5 = *(0x1170c);
0x000116e0 bl 0x10908 | strerror (r0);
0x000116e4 str r4, [sp] | *(sp) = r4;
0x000116e8 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000116ec mov r2, 8 | r2 = 8;
0x000116f0 ldr r1, [pc, 0x28] | r1 = *(0x1171c);
0x000116f4 str r0, [sp, 4] | var_4h = r0;
0x000116f8 mov r0, r5 | r0 = r5;
0x000116fc bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x00011700 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00011704 mov r0, r4 | r0 = r4;
0x00011708 add sp, sp, 0x4c |
0x0001170c 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/ubiupdatevol @ 0x11738 */
| #include <stdint.h>
|
; (fcn) fcn.00011738 () | void fcn_00011738 (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;
0x00011738 push {r4, r5, lr} |
0x0001173c sub sp, sp, 0x1c |
0x00011740 mov r4, r1 | r4 = r1;
0x00011744 add r1, sp, 0x10 | r1 += var_10h;
0x00011748 mov r5, r0 | r5 = r0;
0x0001174c bl 0x11588 | r0 = fcn_00011588 (r0, r1);
0x00011750 cmp r0, 0 |
| if (r0 == 0) {
0x00011754 bne 0x11794 |
0x00011758 ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [var_10h]");
0x0001175c cmp r2, 0x80000000 |
0x00011760 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 >= 0x80000000) {
0x00011764 strlt r2, [r4] | *(r4) = r2;
| }
| if (r2 < 0x80000000) {
0x00011768 blt 0x11798 | goto label_0;
| }
0x0001176c strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011770 ldr r3, [pc, 0x28] | r3 = *(0x1179c);
0x00011774 str r5, [sp, 8] | var_8h = r5;
0x00011778 ldr r2, [pc, 0x24] | r2 = stderr;
0x0001177c ldr r0, [r3] | r0 = *(0x1179c);
0x00011780 ldr r1, [pc, 0x20] | r1 = "libubi";
0x00011784 bl 0x1098c | r0 = fprintf (r0, "libubi", r2, r3, r4, r5)
0x00011788 bl 0x10a34 | errno_location ();
0x0001178c mov r3, 0x16 | r3 = 0x16;
0x00011790 str r3, [r0] | *(r0) = r3;
| }
0x00011794 mvn r0, 0 | r0 = ~0;
| label_0:
0x00011798 add sp, sp, 0x1c |
0x0001179c 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/ubiupdatevol @ 0x11844 */
| #include <stdint.h>
|
; (fcn) fcn.00011844 () | void fcn_00011844 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| void * buf;
| int32_t var_10h;
| r0 = arg1;
| r1 = arg2;
0x00011844 push {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr} |
0x00011848 mov r8, r1 | r8 = r1;
0x0001184c mov r1, 0 | r1 = 0;
0x00011850 mov r5, r0 | r5 = r0;
0x00011854 mov r7, r2 | r7 = r2;
0x00011858 bl 0x10a04 | r0 = open64 ();
0x0001185c cmn r0, 1 |
0x00011860 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00011864 beq 0x119ac | goto label_2;
| }
0x00011868 mov r2, r7 | r2 = r7;
0x0001186c mov r1, r8 | r1 = r8;
0x00011870 bl 0x109a4 | r0 = read (r0, r1, r2);
0x00011874 cmn r0, 1 |
0x00011878 mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x0001187c bne 0x118d4 | goto label_3;
| }
| label_0:
0x00011880 bl 0x10a34 | errno_location ();
0x00011884 ldr r7, [pc, 0x12c] | r7 = *(0x119b4);
0x00011888 mov r3, r5 | r3 = r5;
0x0001188c ldr r2, [pc, 0x128] | r2 = stderr;
0x00011890 ldr r1, [pc, 0x128] | r1 = "libubi";
0x00011894 ldr r6, [r0] | r6 = *(r0);
0x00011898 ldr r0, [r7] | r0 = *(0x119b4);
0x0001189c bl 0x1098c | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000118a0 mov r0, r6 | r0 = r6;
0x000118a4 ldr r5, [r7] | r5 = *(0x119b4);
0x000118a8 bl 0x10908 | strerror (r0);
0x000118ac str r6, [sp] | *(sp) = r6;
0x000118b0 ldr r3, [pc, 0x10c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000118b4 mov r2, 8 | r2 = 8;
0x000118b8 ldr r1, [pc, 0x108] | r1 = *(0x119c4);
0x000118bc str r0, [sp, 4] | var_4h = r0;
0x000118c0 mov r0, r5 | r0 = r5;
0x000118c4 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x000118c8 mov r0, r4 | r0 = r4;
0x000118cc bl 0x10a88 | close (r0);
0x000118d0 b 0x119a8 | goto label_4;
| label_3:
0x000118d4 cmp r7, r0 |
| if (r7 != r0) {
0x000118d8 bne 0x11904 | goto label_5;
| }
0x000118dc ldr r0, [pc, 0xd4] |
0x000118e0 mov r3, r5 | r3 = r5;
0x000118e4 ldr r2, [pc, 0xd0] | r2 = stderr;
0x000118e8 ldr r1, [pc, 0xdc] | r1 = "%*serror %d (%s)\n";
0x000118ec ldr r0, [r0] | r0 = *(0x119b4);
0x000118f0 bl 0x1098c | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x000118f4 bl 0x10a34 | errno_location ();
0x000118f8 mov r3, 0x16 | r3 = 0x16;
0x000118fc str r3, [r0] | *(r0) = r3;
0x00011900 b 0x118c8 |
| } while (1);
| label_5:
0x00011904 mov r3, 0 | r3 = 0;
0x00011908 strb r3, [r8, r0] | *((r8 + r0)) = r3;
0x0001190c mov r2, 1 | r2 = 1;
0x00011910 add r1, sp, 0xc | r1 += buf;
0x00011914 mov r0, r4 | r0 = r4;
0x00011918 bl 0x109a4 | r0 = read (r0, r1, r2);
0x0001191c cmp r0, 1 |
| if (r0 == 1) {
0x00011920 beq 0x11880 | goto label_0;
| }
0x00011924 cmp r0, 0 |
| if (r0 != 0) {
0x00011928 beq 0x1194c |
0x0001192c ldr r0, [pc, 0x84] |
0x00011930 str r7, [sp] | *(sp) = r7;
0x00011934 mov r3, r5 | r3 = r5;
0x00011938 ldr r2, [pc, 0x7c] | r2 = stderr;
0x0001193c ldr r1, [pc, 0x8c] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x00011940 ldr r0, [r0] | r0 = *(0x119b4);
0x00011944 bl 0x1098c | fprintf (r0, "%s: error!: contents of \"%s\" is too long\n", r2, r3)
0x00011948 b 0x118f4 | goto label_1;
| }
0x0001194c mov r0, r4 | r0 = r4;
0x00011950 bl 0x10a88 | r0 = close (r0);
0x00011954 cmp r0, 0 |
| if (r0 != 0) {
0x00011958 moveq r4, r6 | r4 = r6;
| }
| if (r0 != 0) {
0x0001195c beq 0x119ac |
0x00011960 bl 0x10a34 | errno_location ();
0x00011964 ldr r6, [pc, 0x4c] | r6 = *(0x119b4);
0x00011968 mov r3, r5 | r3 = r5;
0x0001196c ldr r2, [pc, 0x48] | r2 = stderr;
0x00011970 ldr r1, [pc, 0x5c] | r1 = "_s:_error_:_file___s__contains_too_much_data_____d_bytes_";
0x00011974 ldr r4, [r0] | r4 = *(r0);
0x00011978 ldr r0, [r6] | r0 = *(0x119b4);
0x0001197c bl 0x1098c | fprintf (r0, "_s:_error_:_file___s__contains_too_much_data_____d_bytes_", r2, r3, r4, r5, r6)
0x00011980 mov r0, r4 | r0 = r4;
0x00011984 ldr r5, [r6] | r5 = *(0x119b4);
0x00011988 bl 0x10908 | strerror (r0);
0x0001198c str r4, [sp] | *(sp) = r4;
0x00011990 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00011994 mov r2, 8 | r2 = 8;
0x00011998 ldr r1, [pc, 0x28] | r1 = *(0x119c4);
0x0001199c str r0, [sp, 4] | var_4h = r0;
0x000119a0 mov r0, r5 | r0 = r5;
0x000119a4 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x000119a8 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x000119ac mov r0, r4 | r0 = r4;
0x000119b0 add sp, sp, 0x10 |
0x000119b4 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/ubiupdatevol @ 0x119d8 */
| #include <stdint.h>
|
; (fcn) fcn.000119d8 () | void fcn_000119d8 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
| r1 = arg2;
0x000119d8 push {r0, r1, r4, r5, r6, r7, r8, sb, sl, lr} |
0x000119dc mov r7, r1 | r7 = r1;
0x000119e0 mov sl, r0 | sl = r0;
0x000119e4 bl 0x10a4c | r0 = strlen (r0);
0x000119e8 mov r4, r0 | r4 = r0;
0x000119ec mov sb, r0 | sb = r0;
0x000119f0 mov r0, r7 | r0 = r7;
0x000119f4 bl 0x10a4c | r0 = strlen (r0);
0x000119f8 add r6, r4, r0 | r6 = r4 + r0;
0x000119fc add r6, r6, 2 | r6 += 2;
0x00011a00 mov r8, r0 | r8 = r0;
0x00011a04 mov r0, r6 | r0 = r6;
0x00011a08 bl 0x10950 | r0 = malloc (r0);
0x00011a0c subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00011a10 bne 0x11a68 | goto label_0;
| }
0x00011a14 bl 0x10a34 | errno_location ();
0x00011a18 ldr r7, [pc, 0x80] | r7 = *(0x11a9c);
0x00011a1c mov r3, r6 | r3 = r6;
0x00011a20 ldr r2, [pc, 0x7c] | r2 = stderr;
0x00011a24 ldr r1, [pc, 0x7c] | r1 = "libubi";
0x00011a28 ldr r4, [r0] | r4 = *(r0);
0x00011a2c ldr r0, [r7] | r0 = *(0x11a9c);
0x00011a30 bl 0x1098c | fprintf (r0, "libubi", r2, r3, r4)
0x00011a34 mov r0, r4 | r0 = r4;
0x00011a38 ldr r6, [r7] | r6 = *(0x11a9c);
0x00011a3c bl 0x10908 | strerror (r0);
0x00011a40 str r4, [sp] | *(sp) = r4;
0x00011a44 ldr r3, [pc, 0x60] | r3 = "%s: error!: cannot allocate %d bytes\n";
0x00011a48 mov r2, 8 | r2 = 8;
0x00011a4c ldr r1, [pc, 0x5c] | r1 = *(0x11aac);
0x00011a50 str r0, [sp, 4] | var_4h = r0;
0x00011a54 mov r0, r6 | r0 = r6;
0x00011a58 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot allocate %d bytes\n", r4)
| do {
0x00011a5c mov r0, r5 | r0 = r5;
0x00011a60 add sp, sp, 8 |
0x00011a64 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_0:
0x00011a68 mov r2, r4 | r2 = r4;
0x00011a6c mov r1, sl | r1 = sl;
0x00011a70 bl 0x10938 | memcpy (r0, r1, r2);
0x00011a74 add r3, r5, r4 | r3 = r5 + r4;
0x00011a78 ldrb r3, [r3, -1] | r3 = *((r3 - 1));
0x00011a7c add r2, r8, 1 | r2 = r8 + 1;
0x00011a80 cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x00011a84 addne r4, r4, 1 | r4++;
| }
| if (r3 == 0x2f) {
0x00011a88 movne r3, 0x2f | r3 = 0x2f;
| }
| if (r3 == 0x2f) {
0x00011a8c strbne r3, [r5, sb] | *((r5 + sb)) = r3;
| }
0x00011a90 mov r1, r7 | r1 = r7;
0x00011a94 add r0, r5, r4 | r0 = r5 + r4;
0x00011a98 bl 0x10938 | memcpy (r0, r1, r2);
0x00011a9c b 0x11a5c |
| } 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/ubiupdatevol @ 0x11ab4 */
| #include <stdint.h>
|
; (fcn) fcn.00011ab4 () | void fcn_00011ab4 (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;
0x00011ab4 push {r4, r5, r6, r7, lr} |
0x00011ab8 sub sp, sp, 0x74 |
0x00011abc add r1, sp, 8 | r1 += var_8h;
0x00011ac0 mov r5, r0 | r5 = r0;
0x00011ac4 bl 0x10914 | r0 = stat64 ();
0x00011ac8 cmp r0, 0 |
| if (r0 >= 0) {
0x00011acc bge 0x11b24 | goto label_2;
| }
0x00011ad0 bl 0x10a34 | errno_location ();
0x00011ad4 ldr r6, [pc, 0xc8] | r6 = *(0x11ba0);
0x00011ad8 ldr r2, [pc, 0xc8] | r2 = stderr;
0x00011adc ldr r1, [pc, 0xc8] | r1 = "libubi";
0x00011ae0 mov r3, r5 | r3 = r5;
0x00011ae4 ldr r4, [r0] | r4 = *(r0);
| do {
| label_1:
0x00011ae8 ldr r0, [r6] | r0 = *(r6);
0x00011aec bl 0x1098c | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00011af0 mov r0, r4 | r0 = r4;
0x00011af4 ldr r5, [r6] | r5 = *(r6);
0x00011af8 bl 0x10908 | strerror (r0);
0x00011afc str r4, [sp] | *(sp) = r4;
0x00011b00 ldr r3, [pc, 0xa8] | r3 = "%s: error!: cannot stat \"%s\"\n";
0x00011b04 mov r2, 8 | r2 = 8;
0x00011b08 ldr r1, [pc, 0xa4] | r1 = *(0x11bb0);
0x00011b0c str r0, [sp, 4] | var_4h = r0;
0x00011b10 mov r0, r5 | r0 = r5;
0x00011b14 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot stat \"%s\"\n", r4)
0x00011b18 mvn r0, 0 | r0 = ~0;
| label_0:
0x00011b1c add sp, sp, 0x74 |
0x00011b20 pop {r4, r5, r6, r7, pc} |
| label_2:
0x00011b24 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00011b28 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00011b2c cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00011b30 beq 0x11b54 | goto label_3;
| }
0x00011b34 bl 0x10a34 | errno_location ();
0x00011b38 mov r4, 0x16 | r4 = 0x16;
0x00011b3c ldr r6, [pc, 0x60] | r6 = *(0x11ba0);
0x00011b40 mov r3, r5 | r3 = r5;
0x00011b44 ldr r2, [pc, 0x5c] | r2 = stderr;
0x00011b48 ldr r1, [pc, 0x68] | r1 = "%*serror %d (%s)\n";
0x00011b4c str r4, [r0] | *(r0) = r4;
0x00011b50 b 0x11ae8 |
| } while (1);
| label_3:
0x00011b54 ldrd r6, r7, [sp, 0x28] | __asm ("ldrd r6, r7, [var_28h]");
0x00011b58 mov r1, r7 | r1 = r7;
0x00011b5c mov r0, r6 | r0 = r6;
0x00011b60 bl 0x1092c | gnu_dev_major ();
0x00011b64 mov r1, r7 | r1 = r7;
0x00011b68 mov r4, r0 | r4 = r0;
0x00011b6c mov r0, r6 | r0 = r6;
0x00011b70 bl 0x1095c | gnu_dev_minor ();
0x00011b74 cmp r4, 0x5a |
| if (r4 != 0x5a) {
0x00011b78 addeq r0, r0, r0, lsr 31 | r0 += (r0 >> 31);
| }
0x00011b7c asreq r0, r0, 1 | __asm ("asreq r0, r0, 1");
| if (r4 == 0x5a) {
0x00011b80 beq 0x11b1c | goto label_0;
| }
0x00011b84 bl 0x10a34 | errno_location ();
0x00011b88 mov r4, 0x16 | r4 = 0x16;
0x00011b8c ldr r6, [pc, 0x10] | r6 = *(0x11ba0);
0x00011b90 mov r3, r5 | r3 = r5;
0x00011b94 ldr r2, [pc, 0xc] | r2 = stderr;
0x00011b98 ldr r1, [pc, 0x1c] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x00011b9c str r4, [r0] | *(r0) = r4;
0x00011ba0 b 0x11ae8 | 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/ubiupdatevol @ 0x11bc0 */
| #include <stdint.h>
|
; (fcn) fcn.00011bc0 () | void fcn_00011bc0 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| char * s;
| int32_t var_40h;
| r0 = arg1;
| r1 = arg2;
0x00011bc0 push {r4, r5, r6, lr} |
0x00011bc4 sub sp, sp, 0x40 |
0x00011bc8 mov r4, r1 | r4 = r1;
0x00011bcc mov r5, r2 | r5 = r2;
0x00011bd0 add r1, sp, 0xc | r1 += s;
0x00011bd4 mov r2, 0x32 | r2 = 0x32;
0x00011bd8 mov r6, r0 | r6 = r0;
0x00011bdc bl 0x11844 | r0 = fcn_00011844 (r0, r1);
0x00011be0 cmp r0, 0 |
| if (r0 < 0) {
0x00011be4 blt 0x11c2c | goto label_1;
| }
0x00011be8 mov r3, r5 | r3 = r5;
0x00011bec mov r2, r4 | r2 = r4;
0x00011bf0 ldr r1, [pc, 0x8c] | r1 = *(0x11c80);
0x00011bf4 add r0, sp, 0xc | r0 += s;
0x00011bf8 bl 0x109d4 | r0 = sscanf (r0, r1, r2);
0x00011bfc cmp r0, 2 |
| if (r0 == 2) {
0x00011c00 beq 0x11c34 | goto label_2;
| }
0x00011c04 bl 0x10a34 | errno_location ();
0x00011c08 mov r3, 0x16 | r3 = 0x16;
0x00011c0c ldr r2, [pc, 0x74] | r2 = "_d:_d";
0x00011c10 ldr r1, [pc, 0x74] | r1 = "libubi";
0x00011c14 str r3, [r0] | *(r0) = r3;
0x00011c18 ldr r0, [pc, 0x70] |
0x00011c1c mov r3, r6 | r3 = r6;
0x00011c20 ldr r0, [r0] | r0 = "%s: error!: \"%s\" does not have major:minor format\n";
0x00011c24 bl 0x1098c | fprintf ("%s: error!: \"%s\" does not have major:minor format\n", "libubi", "_d:_d", r3)
| label_0:
0x00011c28 mvn r0, 0 | r0 = ~0;
| do {
| label_1:
0x00011c2c add sp, sp, 0x40 |
0x00011c30 pop {r4, r5, r6, pc} |
| label_2:
0x00011c34 ldr r3, [r4] | r3 = *(r4);
0x00011c38 cmp r3, 0 |
| if (r3 < 0) {
0x00011c3c blt 0x11c50 | goto label_3;
| }
0x00011c40 ldr r3, [r5] | r3 = *(r5);
0x00011c44 cmp r3, 0 |
| if (r3 < 0) {
0x00011c48 movge r0, 0 | r0 = 0;
| }
0x00011c4c bge 0x11c2c |
| } while (r3 >= 0);
| label_3:
0x00011c50 bl 0x10a34 | errno_location ();
0x00011c54 mov r3, 0x16 | r3 = 0x16;
0x00011c58 ldr r2, [pc, 0x28] | r2 = "_d:_d";
0x00011c5c ldr r1, [pc, 0x30] | r1 = stderr;
0x00011c60 str r3, [r0] | *(r0) = r3;
0x00011c64 ldr r0, [pc, 0x24] |
0x00011c68 ldr r3, [r5] | r3 = *(r5);
0x00011c6c str r6, [sp, 4] | var_4h = r6;
0x00011c70 str r3, [sp] | *(sp) = r3;
0x00011c74 ldr r3, [r4] | r3 = *(r4);
0x00011c78 ldr r0, [r0] | r0 = "%s: error!: \"%s\" does not have major:minor format\n";
0x00011c7c bl 0x1098c | fprintf ("%s: error!: \"%s\" does not have major:minor format\n", r1, "_d:_d", r3, r4, r5, r6)
0x00011c80 b 0x11c28 | 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/ubiupdatevol @ 0x11cec */
| #include <stdint.h>
|
; (fcn) fcn.00011cec () | void fcn_00011cec (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| r0 = arg1;
0x00011cec push {r0, r1, r4, r5, r6, lr} |
0x00011cf0 ldr r5, [pc, 0x50] |
0x00011cf4 mov r6, r0 | r6 = r0;
0x00011cf8 bl 0x10a34 | errno_location ();
0x00011cfc mov r3, r6 | r3 = r6;
0x00011d00 ldr r2, [pc, 0x44] | r2 = stderr;
0x00011d04 ldr r1, [pc, 0x44] | r1 = "libubi";
0x00011d08 ldr r4, [r0] | r4 = *(r0);
0x00011d0c ldr r0, [r5] | r0 = *(0x11d44);
0x00011d10 bl 0x1098c | fprintf (r0, "libubi", r2, r3, r4)
0x00011d14 mov r0, r4 | r0 = r4;
0x00011d18 ldr r5, [r5] | r5 = *(0x11d44);
0x00011d1c bl 0x10908 | strerror (r0);
0x00011d20 str r4, [sp] | *(sp) = r4;
0x00011d24 ldr r3, [pc, 0x28] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00011d28 mov r2, 8 | r2 = 8;
0x00011d2c ldr r1, [pc, 0x24] | r1 = *(0x11d54);
0x00011d30 str r0, [sp, 4] | var_4h = r0;
0x00011d34 mov r0, r5 | r0 = r5;
0x00011d38 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
0x00011d3c mvn r0, 0 | r0 = ~0;
0x00011d40 add sp, sp, 8 |
0x00011d44 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/ubiupdatevol @ 0x11e80 */
| #include <stdint.h>
|
; (fcn) fcn.00011e80 () | void fcn_00011e80 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
0x00011e80 push {r0, r1, r2, r3, r4, r5, r6, lr} |
0x00011e84 mov r1, 0x68 | r1 = 0x68;
0x00011e88 mov r0, 1 | r0 = 1;
0x00011e8c bl 0x10974 | r0 = calloc (r0, r1);
0x00011e90 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00011e94 beq 0x11f04 | goto label_1;
| }
0x00011e98 ldr r1, [pc, 0x2fc] | r1 = *(0x12198);
0x00011e9c ldr r0, [pc, 0x2fc] | r0 = "class/misc/ubi_ctrl/";
0x00011ea0 bl 0x119d8 | r0 = fcn_000119d8 ("class/misc/ubi_ctrl/", r1);
0x00011ea4 cmp r0, 0 |
0x00011ea8 str r0, [r4, 4] | *((r4 + 4)) = r0;
| if (r0 == 0) {
0x00011eac beq 0x11ef8 | goto label_0;
| }
0x00011eb0 ldr r1, [pc, 0x2ec] | r1 = "_sys";
0x00011eb4 bl 0x119d8 | r0 = fcn_000119d8 (r0, "_sys");
0x00011eb8 cmp r0, 0 |
0x00011ebc str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r0 == 0) {
0x00011ec0 beq 0x11ef8 | goto label_0;
| }
0x00011ec4 ldr r1, [pc, 0x2dc] | r1 = *(0x121a4);
0x00011ec8 ldr r0, [pc, 0x2d0] | r0 = "class/misc/ubi_ctrl/";
0x00011ecc bl 0x119d8 | r0 = fcn_000119d8 ("class/misc/ubi_ctrl/", r1);
0x00011ed0 cmp r0, 0 |
0x00011ed4 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| if (r0 == 0) {
0x00011ed8 beq 0x11ef8 | goto label_0;
| }
0x00011edc mov r1, 0 | r1 = 0;
0x00011ee0 bl 0x10a04 | r0 = open64 ();
0x00011ee4 cmn r0, 1 |
| if (r0 != 1) {
0x00011ee8 bne 0x11f10 | goto label_2;
| }
0x00011eec bl 0x10a34 | errno_location ();
0x00011ef0 mov r3, 0 | r3 = 0;
0x00011ef4 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x00011ef8 mov r0, r4 | r0 = r4;
0x00011efc bl 0x11dac | fcn_00011dac (r0);
0x00011f00 mov r4, 0 | r4 = 0;
| label_1:
0x00011f04 mov r0, r4 | r0 = r4;
0x00011f08 add sp, sp, 0x10 |
0x00011f0c pop {r4, r5, r6, pc} |
| label_2:
0x00011f10 bl 0x10a88 | r0 = close (r0);
0x00011f14 cmp r0, 0 |
| if (r0 == 0) {
0x00011f18 beq 0x11f68 | goto label_3;
| }
0x00011f1c bl 0x10a34 | errno_location ();
0x00011f20 ldr r6, [pc, 0x284] |
0x00011f24 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00011f28 ldr r2, [pc, 0x280] | r2 = stderr;
0x00011f2c ldr r1, [pc, 0x280] | r1 = "libubi";
0x00011f30 ldr r5, [r0] | r5 = *(r0);
0x00011f34 ldr r0, [r6] | r0 = "class/ubi";
0x00011f38 bl 0x1098c | fprintf ("class/ubi", "libubi", r2, r3, r4, r5, "class/ubi")
0x00011f3c mov r0, r5 | r0 = r5;
0x00011f40 ldr r6, [r6] | r6 = "class/ubi";
0x00011f44 bl 0x10908 | strerror (r0);
0x00011f48 str r5, [sp] | *(sp) = r5;
0x00011f4c ldr r3, [pc, 0x264] | r3 = "_s:_error_:_close_failed_on___s_";
0x00011f50 mov r2, 8 | r2 = 8;
0x00011f54 ldr r1, [pc, 0x260] | r1 = *(0x121b8);
0x00011f58 str r0, [sp, 4] | var_4h = r0;
0x00011f5c mov r0, r6 | r0 = r6;
0x00011f60 bl 0x1098c | fprintf (r0, r1, r2, "_s:_error_:_close_failed_on___s_", r4, r5)
0x00011f64 b 0x11ef8 |
| } while (1);
| label_3:
0x00011f68 ldr r1, [pc, 0x250] | r1 = "%*serror %d (%s)\n";
0x00011f6c ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00011f70 bl 0x119d8 | r0 = fcn_000119d8 (r0, "%*serror %d (%s)\n");
0x00011f74 cmp r0, 0 |
0x00011f78 str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
| if (r0 == 0) {
0x00011f7c beq 0x11ef8 | goto label_0;
| }
0x00011f80 ldr r1, [pc, 0x23c] | r1 = "ubi%d";
0x00011f84 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00011f88 bl 0x119d8 | r0 = fcn_000119d8 (r0, "ubi%d");
0x00011f8c cmp r0, 0 |
0x00011f90 str r0, [r4, 0x14] | *((r4 + 0x14)) = r0;
| if (r0 == 0) {
0x00011f94 beq 0x11ef8 | goto label_0;
| }
0x00011f98 ldr r1, [pc, 0x204] | r1 = "_sys";
0x00011f9c ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011fa0 bl 0x119d8 | r0 = fcn_000119d8 (r0, "_sys");
0x00011fa4 cmp r0, 0 |
0x00011fa8 str r0, [r4, 0x18] | *((r4 + 0x18)) = r0;
| if (r0 == 0) {
0x00011fac beq 0x11ef8 | goto label_0;
| }
0x00011fb0 ldr r1, [pc, 0x210] | r1 = "version";
0x00011fb4 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011fb8 bl 0x119d8 | r0 = fcn_000119d8 (r0, "version");
0x00011fbc cmp r0, 0 |
0x00011fc0 str r0, [r4, 0x1c] | *((r4 + 0x1c)) = r0;
| if (r0 == 0) {
0x00011fc4 beq 0x11ef8 | goto label_0;
| }
0x00011fc8 ldr r1, [pc, 0x1fc] | r1 = "avail_eraseblocks";
0x00011fcc ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011fd0 bl 0x119d8 | r0 = fcn_000119d8 (r0, "avail_eraseblocks");
0x00011fd4 cmp r0, 0 |
0x00011fd8 str r0, [r4, 0x20] | *((r4 + 0x20)) = r0;
| if (r0 == 0) {
0x00011fdc beq 0x11ef8 | goto label_0;
| }
0x00011fe0 ldr r1, [pc, 0x1e8] | r1 = "total_eraseblocks";
0x00011fe4 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011fe8 bl 0x119d8 | r0 = fcn_000119d8 (r0, "total_eraseblocks");
0x00011fec cmp r0, 0 |
0x00011ff0 str r0, [r4, 0x24] | *((r4 + 0x24)) = r0;
| if (r0 == 0) {
0x00011ff4 beq 0x11ef8 | goto label_0;
| }
0x00011ff8 ldr r1, [pc, 0x1d4] | r1 = "bad_peb_count";
0x00011ffc ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00012000 bl 0x119d8 | r0 = fcn_000119d8 (r0, "bad_peb_count");
0x00012004 cmp r0, 0 |
0x00012008 str r0, [r4, 0x28] | *((r4 + 0x28)) = r0;
| if (r0 == 0) {
0x0001200c beq 0x11ef8 | goto label_0;
| }
0x00012010 ldr r1, [pc, 0x1c0] | r1 = "eraseblock_size";
0x00012014 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00012018 bl 0x119d8 | r0 = fcn_000119d8 (r0, "eraseblock_size");
0x0001201c cmp r0, 0 |
0x00012020 str r0, [r4, 0x2c] | *((r4 + 0x2c)) = r0;
| if (r0 == 0) {
0x00012024 beq 0x11ef8 | goto label_0;
| }
0x00012028 ldr r1, [pc, 0x1ac] | r1 = "max_ec";
0x0001202c ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00012030 bl 0x119d8 | r0 = fcn_000119d8 (r0, "max_ec");
0x00012034 cmp r0, 0 |
0x00012038 str r0, [r4, 0x30] | *((r4 + 0x30)) = r0;
| if (r0 == 0) {
0x0001203c beq 0x11ef8 | goto label_0;
| }
0x00012040 ldr r1, [pc, 0x198] | r1 = "reserved_for_bad";
0x00012044 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00012048 bl 0x119d8 | r0 = fcn_000119d8 (r0, "reserved_for_bad");
0x0001204c cmp r0, 0 |
0x00012050 str r0, [r4, 0x34] | *((r4 + 0x34)) = r0;
| if (r0 == 0) {
0x00012054 beq 0x11ef8 | goto label_0;
| }
0x00012058 ldr r1, [pc, 0x184] | r1 = "max_vol_count";
0x0001205c ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00012060 bl 0x119d8 | r0 = fcn_000119d8 (r0, "max_vol_count");
0x00012064 cmp r0, 0 |
0x00012068 str r0, [r4, 0x38] | *((r4 + 0x38)) = r0;
| if (r0 == 0) {
0x0001206c beq 0x11ef8 | goto label_0;
| }
0x00012070 ldr r1, [pc, 0x170] | r1 = "min_io_size";
0x00012074 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00012078 bl 0x119d8 | r0 = fcn_000119d8 (r0, "min_io_size");
0x0001207c cmp r0, 0 |
0x00012080 str r0, [r4, 0x3c] | *((r4 + 0x3c)) = r0;
| if (r0 == 0) {
0x00012084 beq 0x11ef8 | goto label_0;
| }
0x00012088 ldr r1, [pc, 0x15c] | r1 = "mtd_num";
0x0001208c ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00012090 bl 0x119d8 | r0 = fcn_000119d8 (r0, "mtd_num");
0x00012094 cmp r0, 0 |
0x00012098 str r0, [r4, 0x40] | *((r4 + 0x40)) = r0;
| if (r0 == 0) {
0x0001209c beq 0x11ef8 | goto label_0;
| }
0x000120a0 ldr r1, [pc, 0x148] | r1 = "ubi%d_%d";
0x000120a4 bl 0x119d8 | r0 = fcn_000119d8 (r0, "ubi%d_%d");
0x000120a8 cmp r0, 0 |
0x000120ac str r0, [r4, 0x44] | *((r4 + 0x44)) = r0;
| if (r0 == 0) {
0x000120b0 beq 0x11ef8 | goto label_0;
| }
0x000120b4 ldr r1, [pc, 0xe8] | r1 = "_sys";
0x000120b8 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000120bc bl 0x119d8 | r0 = fcn_000119d8 (r0, "_sys");
0x000120c0 cmp r0, 0 |
0x000120c4 str r0, [r4, 0x48] | *((r4 + 0x48)) = r0;
| if (r0 == 0) {
0x000120c8 beq 0x11ef8 | goto label_0;
| }
0x000120cc ldr r1, [pc, 0x120] | r1 = "type";
0x000120d0 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000120d4 bl 0x119d8 | r0 = fcn_000119d8 (r0, "type");
0x000120d8 cmp r0, 0 |
0x000120dc str r0, [r4, 0x4c] | *((r4 + 0x4c)) = r0;
| if (r0 == 0) {
0x000120e0 beq 0x11ef8 | goto label_0;
| }
0x000120e4 ldr r1, [pc, 0x10c] | r1 = "alignment";
0x000120e8 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000120ec bl 0x119d8 | r0 = fcn_000119d8 (r0, "alignment");
0x000120f0 cmp r0, 0 |
0x000120f4 str r0, [r4, 0x50] | *((r4 + 0x50)) = r0;
| if (r0 == 0) {
0x000120f8 beq 0x11ef8 | goto label_0;
| }
0x000120fc ldr r1, [pc, 0xf8] | r1 = "data_bytes";
0x00012100 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00012104 bl 0x119d8 | r0 = fcn_000119d8 (r0, "data_bytes");
0x00012108 cmp r0, 0 |
0x0001210c str r0, [r4, 0x54] | *((r4 + 0x54)) = r0;
| if (r0 == 0) {
0x00012110 beq 0x11ef8 | goto label_0;
| }
0x00012114 ldr r1, [pc, 0xe4] | r1 = "reserved_ebs";
0x00012118 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x0001211c bl 0x119d8 | r0 = fcn_000119d8 (r0, "reserved_ebs");
0x00012120 cmp r0, 0 |
0x00012124 str r0, [r4, 0x58] | *((r4 + 0x58)) = r0;
| if (r0 == 0) {
0x00012128 beq 0x11ef8 | goto label_0;
| }
0x0001212c ldr r1, [pc, 0xd0] | r1 = "usable_eb_size";
0x00012130 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00012134 bl 0x119d8 | r0 = fcn_000119d8 (r0, "usable_eb_size");
0x00012138 cmp r0, 0 |
0x0001213c str r0, [r4, 0x5c] | *((r4 + 0x5c)) = r0;
| if (r0 == 0) {
0x00012140 beq 0x11ef8 | goto label_0;
| }
0x00012144 ldr r1, [pc, 0xbc] | r1 = "corrupted";
0x00012148 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x0001214c bl 0x119d8 | r0 = fcn_000119d8 (r0, "corrupted");
0x00012150 cmp r0, 0 |
0x00012154 str r0, [r4, 0x60] | *((r4 + 0x60)) = r0;
| if (r0 == 0) {
0x00012158 beq 0x11ef8 | goto label_0;
| }
0x0001215c add r1, sp, 0xc | r1 += var_ch;
0x00012160 ldr r0, [r4, 0x14] | r0 = *((r4 + 0x14));
0x00012164 bl 0x11738 | r0 = fcn_00011738 (r0, r1);
0x00012168 cmp r0, 0 |
| if (r0 != 0) {
0x0001216c bne 0x11ef8 | goto label_0;
| }
0x00012170 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00012174 cmp r3, 1 |
| if (r3 == 1) {
0x00012178 beq 0x11f04 | goto label_1;
| }
0x0001217c ldr r0, [pc, 0x28] |
0x00012180 str r3, [sp] | *(sp) = r3;
0x00012184 ldr r2, [pc, 0x24] | r2 = stderr;
0x00012188 mov r3, 1 | r3 = 1;
0x0001218c ldr r1, [pc, 0x78] | r1 = "name";
0x00012190 ldr r0, [r0] | r0 = "class/ubi";
0x00012194 bl 0x1098c | fprintf ("class/ubi", "name", r2, r3)
0x00012198 b 0x11ef8 | 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/ubiupdatevol @ 0x1233c */
| #include <stdint.h>
|
; (fcn) fcn.0001233c () | void fcn_0001233c (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;
0x0001233c push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00012340 mov r4, r1 | r4 = r1;
0x00012344 sub sp, sp, 0x110 |
0x00012348 mov r5, r0 | r5 = r0;
0x0001234c mov r2, 0x18 | r2 = 0x18;
0x00012350 mov r1, 0 | r1 = 0;
0x00012354 mov r0, r4 | r0 = r4;
0x00012358 bl 0x109f8 | memset (r0, r1, r2);
0x0001235c add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00012360 add r1, r4, 0x10 | r1 = r4 + 0x10;
0x00012364 ldr r0, [r5, 8] | r0 = *((r5 + 8));
0x00012368 bl 0x11bc0 | r0 = fcn_00011bc0 (r0, r1);
0x0001236c cmp r0, 0 |
| if (r0 == 0) {
0x00012370 mvnne r3, 0 | r3 = ~0;
| }
| if (r0 == 0) {
0x00012374 strne r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
| }
| if (r0 == 0) {
0x00012378 strne r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x0001237c ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00012380 bl 0x10a10 | r0 = opendir ();
0x00012384 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00012388 beq 0x124e8 | goto label_2;
| }
0x0001238c mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00012390 str r3, [r4, 4] | *((r4 + 4)) = r3;
0x00012394 bl 0x10a34 | errno_location ();
0x00012398 ldr sl, [pc, 0x17c] | sl = "ubi%d%s";
0x0001239c mov sb, 0 | sb = 0;
0x000123a0 mov r7, r0 | r7 = r0;
| do {
| label_0:
0x000123a4 str sb, [r7] | *(r7) = sb;
0x000123a8 mov r0, r8 | r0 = r8;
0x000123ac bl 0x109c8 | r0 = readdir64 ();
0x000123b0 cmp r0, 0 |
| if (r0 == 0) {
0x000123b4 beq 0x12444 | goto label_3;
| }
0x000123b8 add r6, r0, 0x13 | r6 = r0 + 0x13;
0x000123bc mov r0, r6 | r0 = r6;
0x000123c0 bl 0x10a4c | r0 = strlen (r0);
0x000123c4 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x000123c8 bls 0x123fc |
0x000123cc ldr r0, [pc, 0x14c] |
0x000123d0 str r6, [sp] | *(sp) = r6;
0x000123d4 ldr r2, [pc, 0x148] | r2 = stderr;
0x000123d8 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000123dc ldr r1, [pc, 0x144] | r1 = "libubi";
0x000123e0 ldr r0, [r0] | r0 = "ubi%d%s";
0x000123e4 bl 0x1098c | fprintf ("ubi%d%s", "libubi", r2, r3, r4, r5, r6)
0x000123e8 mov r3, 0x16 | r3 = 0x16;
0x000123ec str r3, [r7] | *(r7) = r3;
| label_1:
0x000123f0 mov r0, r8 | r0 = r8;
0x000123f4 bl 0x10a70 | closedir ();
0x000123f8 b 0x124e8 | goto label_2;
| }
0x000123fc add r3, sp, 0x10 | r3 += var_10h;
0x00012400 add r2, sp, 0xc | r2 += var_ch;
0x00012404 mov r1, sl | r1 = sl;
0x00012408 mov r0, r6 | r0 = r6;
0x0001240c bl 0x109d4 | r0 = sscanf (r0, r1, r2);
0x00012410 cmp r0, 1 |
0x00012414 bne 0x123a4 |
| } while (r0 != 1);
0x00012418 ldr r3, [r4] | r3 = *(r4);
0x0001241c ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00012420 add r3, r3, 1 | r3++;
0x00012424 str r3, [r4] | *(r4) = r3;
0x00012428 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0001242c cmp r2, r3 |
0x00012430 ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r2 >= r3) {
0x00012434 strlt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x00012438 cmp r3, r2 |
| if (r3 >= r2) {
0x0001243c strlt r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x00012440 b 0x123a4 | goto label_0;
| label_3:
0x00012444 ldr r6, [r7] | r6 = *(r7);
0x00012448 cmp r6, 0 |
| if (r6 != 0) {
0x0001244c beq 0x12494 |
0x00012450 ldr r4, [pc, 0xc8] |
0x00012454 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012458 ldr r2, [pc, 0xc4] | r2 = stderr;
0x0001245c ldr r1, [pc, 0xc8] | r1 = "_s:_error_:_invalid_entry_in__s:___s_";
0x00012460 ldr r0, [r4] | r0 = "ubi%d%s";
0x00012464 bl 0x1098c | fprintf ("ubi%d%s", "_s:_error_:_invalid_entry_in__s:___s_", r2, r3, "ubi%d%s")
0x00012468 mov r0, r6 | r0 = r6;
0x0001246c ldr r4, [r4] | r4 = "ubi%d%s";
0x00012470 bl 0x10908 | strerror (r0);
0x00012474 str r6, [sp] | *(sp) = r6;
0x00012478 ldr r3, [pc, 0xb0] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x0001247c mov r2, 8 | r2 = 8;
0x00012480 ldr r1, [pc, 0xac] | r1 = *(0x12530);
0x00012484 str r0, [sp, 4] | var_4h = r0;
0x00012488 mov r0, r4 | r0 = r4;
0x0001248c bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n", r4, r5, r6)
0x00012490 b 0x123f0 | goto label_1;
| }
0x00012494 mov r0, r8 | r0 = r8;
0x00012498 bl 0x10a70 | r0 = closedir ();
0x0001249c cmp r0, 0 |
| if (r0 != 0) {
0x000124a0 beq 0x124f0 |
0x000124a4 ldr r6, [pc, 0x74] | r6 = "ubi%d%s";
0x000124a8 ldr r4, [r7] | r4 = *(r7);
0x000124ac ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000124b0 ldr r2, [pc, 0x6c] | r2 = stderr;
0x000124b4 ldr r1, [pc, 0x7c] | r1 = "%*serror %d (%s)\n";
0x000124b8 ldr r0, [r6] | r0 = "ubi%d%s";
0x000124bc bl 0x1098c | fprintf ("ubi%d%s", "%*serror %d (%s)\n", r2, r3, r4, r5, "ubi%d%s")
0x000124c0 mov r0, r4 | r0 = r4;
0x000124c4 ldr r5, [r6] | r5 = "ubi%d%s";
0x000124c8 bl 0x10908 | strerror (r0);
0x000124cc str r4, [sp] | *(sp) = r4;
0x000124d0 ldr r3, [pc, 0x58] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x000124d4 mov r2, 8 | r2 = 8;
0x000124d8 ldr r1, [pc, 0x54] | r1 = *(0x12530);
0x000124dc str r0, [sp, 4] | var_4h = r0;
0x000124e0 mov r0, r5 | r0 = r5;
0x000124e4 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n", r4)
| label_2:
0x000124e8 mvn r0, 0 | r0 = ~0;
0x000124ec b 0x12514 |
| } else {
0x000124f0 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x000124f4 add r1, r4, 0xc | r1 = r4 + 0xc;
0x000124f8 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x000124fc streq r0, [r4, 4] | *((r4 + 4)) = r0;
| }
0x00012500 ldr r0, [r5, 0x14] | r0 = *((r5 + 0x14));
0x00012504 bl 0x11738 | r0 = fcn_00011738 (r0, r1);
0x00012508 adds r0, r0, 0 | r0 += 0;
| if (r0 == r0) {
0x0001250c movne r0, 1 | r0 = 1;
| }
0x00012510 rsb r0, r0, 0 | r0 -= ;
| }
0x00012514 add sp, sp, 0x110 |
0x00012518 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/ubiupdatevol @ 0x1266c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.0001266c () | void fcn_0001266c (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;
0x0001266c push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012670 add fp, sp, 0x20 |
0x00012674 sub sp, sp, 0x9c |
0x00012678 mov r6, r0 | r6 = r0;
0x0001267c ldr r0, [r0, 0x40] | r0 = *((r0 + 0x40));
0x00012680 mov r5, r1 | r5 = r1;
0x00012684 bl 0x10a4c | strlen (r0);
0x00012688 sub r1, fp, 0x8c | r1 -= var_8ch;
0x0001268c add r0, r0, 0x6b | r0 += 0x6b;
0x00012690 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012694 sub sp, sp, r0 |
0x00012698 mov r0, r5 | r0 = r5;
0x0001269c bl 0x10914 | r0 = stat64 ();
0x000126a0 cmp r0, 0 |
| if (r0 == 0) {
0x000126a4 beq 0x126fc | goto label_5;
| }
0x000126a8 bl 0x10a34 | errno_location ();
0x000126ac ldr r6, [pc, 0x1e8] | r6 = *(0x12898);
0x000126b0 mov r3, r5 | r3 = r5;
0x000126b4 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x000126b8 ldr r1, [pc, 0x1e4] | r1 = "libubi";
0x000126bc ldr r4, [r0] | r4 = *(r0);
0x000126c0 ldr r0, [r6] | r0 = *(0x12898);
0x000126c4 bl 0x1098c | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000126c8 mov r0, r4 | r0 = r4;
0x000126cc ldr r5, [r6] | r5 = *(0x12898);
0x000126d0 bl 0x10908 | strerror (r0);
0x000126d4 str r4, [sp] | *(sp) = r4;
0x000126d8 ldr r3, [pc, 0x1c8] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x000126dc mov r2, 8 | r2 = 8;
0x000126e0 ldr r1, [pc, 0x1c4] | r1 = *(0x128a8);
0x000126e4 str r0, [sp, 4] | var_4h = r0;
0x000126e8 mov r0, r5 | r0 = r5;
0x000126ec bl 0x1098c | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4)
| do {
| label_0:
0x000126f0 mvn r0, 0 | r0 = ~0;
| label_4:
0x000126f4 sub sp, fp, 0x20 |
0x000126f8 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_5:
0x000126fc ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x00012700 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00012704 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00012708 beq 0x12734 | goto label_6;
| }
0x0001270c ldr r0, [pc, 0x188] |
0x00012710 mov r3, r5 | r3 = r5;
0x00012714 ldr r2, [pc, 0x184] | r2 = stderr;
0x00012718 ldr r1, [pc, 0x190] | r1 = "%*serror %d (%s)\n";
0x0001271c ldr r0, [r0] | r0 = *(0x12898);
0x00012720 bl 0x1098c | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x00012724 bl 0x10a34 | errno_location ();
0x00012728 mov r3, 0x16 | r3 = 0x16;
| label_1:
0x0001272c str r3, [r0] | *(r0) = r3;
0x00012730 b 0x126f0 |
| } while (1);
| label_6:
0x00012734 ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x00012738 mov r1, r3 | r1 = r3;
0x0001273c mov r0, r2 | r0 = r2;
0x00012740 strd r2, r3, [fp, -0xb4] | __asm ("strd r2, r3, [var_b4h]");
0x00012744 bl 0x1092c | gnu_dev_major ();
0x00012748 ldrd r2, r3, [fp, -0xb4] | __asm ("ldrd r2, r3, [var_b4h]");
0x0001274c mov r1, r3 | r1 = r3;
0x00012750 mov sb, r0 | sb = r0;
0x00012754 mov r0, r2 | r0 = r2;
0x00012758 bl 0x1095c | gnu_dev_minor ();
0x0001275c sub r1, fp, 0xa4 | r1 -= var_a4h;
0x00012760 mov r7, r0 | r7 = r0;
0x00012764 mov r0, r6 | r0 = r6;
0x00012768 bl 0x1233c | r0 = fcn_0001233c (r0, r1);
0x0001276c cmp r0, 0 |
| if (r0 != 0) {
0x00012770 addeq r8, sp, 8 | r8 += var_b4h;
| }
| if (r0 != 0) {
0x00012774 ldreq r4, [fp, -0xa0] | r4 = var_a0h;
| }
| if (r0 == 0) {
0x00012778 addeq sl, r6, 0x18 | sl = r6 + 0x18;
| goto label_7;
| }
| if (r0 != 0) {
| label_7:
0x0001277c bne 0x126f0 | goto label_0;
| }
| do {
0x00012780 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012784 cmp r4, r3 |
| if (r4 > r3) {
0x00012788 bgt 0x12800 | goto label_8;
| }
0x0001278c sub r3, fp, 0xa8 | r3 -= var_a8h;
0x00012790 sub r2, fp, 0xac | r2 -= var_ach;
0x00012794 mov r1, r4 | r1 = r4;
0x00012798 mov r0, sl | r0 = sl;
0x0001279c bl 0x11c98 | r0 = fcn_00011c98 (r0, r1);
0x000127a0 cmp r0, 0 |
| if (r0 == 0) {
0x000127a4 beq 0x127f4 | goto label_9;
| }
0x000127a8 bl 0x10a34 | r0 = errno_location ();
0x000127ac ldr r3, [r0] | r3 = *(r0);
0x000127b0 cmp r3, 2 |
| if (r3 != 2) {
0x000127b4 bne 0x127c0 | goto label_10;
| }
| label_2:
0x000127b8 add r4, r4, 1 | r4++;
0x000127bc b 0x12780 |
| } while (1);
| label_10:
0x000127c0 cmp r3, 0 |
| if (r3 != 0) {
0x000127c4 bne 0x126f0 | goto label_0;
| }
| label_3:
0x000127c8 ldr r0, [pc, 0xcc] |
0x000127cc mov r3, r5 | r3 = r5;
0x000127d0 str r7, [sp, 4] | var_4h = r7;
0x000127d4 str sb, [sp] | *(sp) = sb;
0x000127d8 ldr r2, [pc, 0xc0] | r2 = stderr;
0x000127dc ldr r1, [pc, 0xd0] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x000127e0 ldr r0, [r0] | r0 = *(0x12898);
0x000127e4 bl 0x1098c | r0 = fprintf (r0, "%s: error!: \"%s\" is not a character device\n", r2, r3)
0x000127e8 bl 0x10a34 | errno_location ();
0x000127ec mov r3, 0x13 | r3 = 0x13;
0x000127f0 b 0x1272c | goto label_1;
| label_9:
0x000127f4 ldr r3, [fp, -0xac] | r3 = var_ach;
0x000127f8 cmp r3, sb |
| if (r3 != sb) {
0x000127fc bne 0x127b8 | goto label_2;
| }
| label_8:
0x00012800 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012804 cmp r4, r3 |
| if (r4 > r3) {
0x00012808 bgt 0x127c8 | goto label_3;
| }
0x0001280c cmp r7, 0 |
| if (r7 == 0) {
0x00012810 moveq r0, 1 | r0 = 1;
| goto label_11;
| }
| if (r7 == 0) {
| label_11:
0x00012814 beq 0x126f4 | goto label_4;
| }
0x00012818 sub r3, r7, 1 | r3 = r7 - 1;
0x0001281c mov r2, r4 | r2 = r4;
0x00012820 ldr r1, [r6, 0x40] | r1 = *((r6 + 0x40));
0x00012824 mov r0, r8 | r0 = r8;
0x00012828 bl 0x10a28 | sprintf (r0, r1, r2);
0x0001282c mov r1, 0 | r1 = 0;
0x00012830 mov r0, r8 | r0 = r8;
0x00012834 bl 0x10a04 | r0 = open64 ();
0x00012838 cmn r0, 1 |
| if (r0 == 1) {
0x0001283c beq 0x127c8 | goto label_3;
| }
0x00012840 bl 0x10a88 | r0 = close (r0);
0x00012844 cmp r0, 0 |
| if (r0 != 0) {
0x00012848 beq 0x12894 |
0x0001284c bl 0x10a34 | errno_location ();
0x00012850 ldr r5, [pc, 0x44] |
0x00012854 mov r3, r8 | r3 = r8;
0x00012858 ldr r2, [pc, 0x40] | r2 = stderr;
0x0001285c 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\n";
0x00012860 ldr r4, [r0] | r4 = *(r0);
0x00012864 ldr r0, [r5] | r0 = *(0x12898);
0x00012868 bl 0x1098c | fprintf (r0, "%s: error!: \"%s\" has major:minor %d:%d, but this does not correspond to any existing UBI device or volume\n", r2, r3, r4, r5)
0x0001286c mov r0, r4 | r0 = r4;
0x00012870 ldr r5, [r5] | r5 = *(0x12898);
0x00012874 bl 0x10908 | strerror (r0);
0x00012878 str r4, [sp] | *(sp) = r4;
0x0001287c ldr r3, [pc, 0x24] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x00012880 mov r2, 8 | r2 = 8;
0x00012884 ldr r1, [pc, 0x20] | r1 = *(0x128a8);
0x00012888 str r0, [sp, 4] | var_4h = r0;
0x0001288c mov r0, r5 | r0 = r5;
0x00012890 bl 0x1098c | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4)
| }
0x00012894 mov r0, 2 | r0 = 2;
0x00012898 b 0x126f4 | 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/ubiupdatevol @ 0x12cc8 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012cc8 () | void fcn_00012cc8 (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;
0x00012cc8 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012ccc add sl, r2, 4 | sl = r2 + 4;
0x00012cd0 add fp, sp, 0x20 |
0x00012cd4 sub sp, sp, 0x114 |
0x00012cd8 mov r6, r1 | r6 = r1;
0x00012cdc mov r5, r0 | r5 = r0;
0x00012ce0 mov r4, r2 | r4 = r2;
0x00012ce4 mov r1, 0 | r1 = 0;
0x00012ce8 mov r2, 0x54 | r2 = 0x54;
0x00012cec mov r0, sl | r0 = sl;
0x00012cf0 bl 0x109f8 | memset (r0, r1, r2);
0x00012cf4 str r6, [r4] | *(r4) = r6;
0x00012cf8 mov r1, r6 | r1 = r6;
0x00012cfc mov r0, r5 | r0 = r5;
0x00012d00 bl 0x12c74 | r0 = fcn_00012c74 (r0, r1);
0x00012d04 cmp r0, 0 |
0x00012d08 bne 0x12d14 |
| while (r8 == r0) {
| label_0:
0x00012d0c mvn r0, 0 | r0 = ~0;
0x00012d10 b 0x12fd8 | goto label_3;
0x00012d14 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00012d18 bl 0x10a10 | r0 = opendir ();
0x00012d1c subs r8, r0, 0 | r8 = r0 - 0;
0x00012d20 beq 0x12d0c |
| }
0x00012d24 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00012d28 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x00012d2c bl 0x10a34 | r0 = errno_location ();
0x00012d30 mov sb, r0 | sb = r0;
| do {
| label_1:
0x00012d34 mov r3, 0 | r3 = 0;
0x00012d38 str r3, [sb] | *(sb) = r3;
0x00012d3c mov r0, r8 | r0 = r8;
0x00012d40 bl 0x109c8 | r0 = readdir64 ();
0x00012d44 cmp r0, 0 |
| if (r0 == 0) {
0x00012d48 beq 0x12de4 | goto label_4;
| }
0x00012d4c add r7, r0, 0x13 | r7 = r0 + 0x13;
0x00012d50 mov r0, r7 | r0 = r7;
0x00012d54 bl 0x10a4c | r0 = strlen (r0);
0x00012d58 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00012d5c bls 0x12d88 |
0x00012d60 ldr r0, [pc, 0x278] |
0x00012d64 str r7, [sp] | *(sp) = r7;
0x00012d68 ldr r2, [pc, 0x274] | r2 = stderr;
0x00012d6c ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012d70 ldr r1, [pc, 0x270] | r1 = "libubi";
0x00012d74 ldr r0, [r0] | r0 = *(0x12fdc);
0x00012d78 bl 0x1098c | fprintf (r0, "libubi", r2, r3)
| label_2:
0x00012d7c mov r0, r8 | r0 = r8;
0x00012d80 bl 0x10a70 | closedir ();
0x00012d84 b 0x12d0c | goto label_0;
| }
0x00012d88 sub r3, fp, 0x124 | r3 -= var_124h;
0x00012d8c str r3, [sp] | *(sp) = r3;
0x00012d90 sub r2, fp, 0x128 | r2 -= var_128h;
0x00012d94 sub r3, fp, 0x12c | r3 -= s;
0x00012d98 ldr r1, [pc, 0x24c] | r1 = "_s:_error_:_invalid_entry_in__s:___s_";
0x00012d9c mov r0, r7 | r0 = r7;
0x00012da0 bl 0x109d4 | r0 = sscanf (r0, "_s:_error_:_invalid_entry_in__s:___s_", r2);
0x00012da4 cmp r0, 2 |
0x00012da8 bne 0x12d34 |
| } while (r0 != 2);
0x00012dac ldr r3, [fp, -0x128] | r3 = var_128h;
0x00012db0 cmp r3, r6 |
| if (r3 != r6) {
0x00012db4 bne 0x12d34 | goto label_1;
| }
0x00012db8 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00012dbc ldr r2, [r4, 0x10] | r2 = *((r4 + 0x10));
0x00012dc0 add r3, r3, 1 | r3++;
0x00012dc4 str r3, [r4, 8] | *((r4 + 8)) = r3;
0x00012dc8 ldr r3, [fp, -0x12c] | r3 = s;
0x00012dcc cmp r2, r3 |
0x00012dd0 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
| if (r2 >= r3) {
0x00012dd4 strlt r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x00012dd8 cmp r3, r2 |
| if (r3 >= r2) {
0x00012ddc strlt r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
| }
0x00012de0 b 0x12d34 | goto label_1;
| label_4:
0x00012de4 ldr r7, [sb] | r7 = *(sb);
0x00012de8 cmp r7, 0 |
| if (r7 != 0) {
0x00012dec beq 0x12e34 |
0x00012df0 ldr r4, [pc, 0x1e8] |
0x00012df4 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012df8 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x00012dfc ldr r1, [pc, 0x1ec] | r1 = "ubi_d__d_s";
0x00012e00 ldr r0, [r4] | r0 = *(0x12fdc);
0x00012e04 bl 0x1098c | fprintf (r0, "ubi_d__d_s", r2, r3, r4)
0x00012e08 mov r0, r7 | r0 = r7;
0x00012e0c ldr r4, [r4] | r4 = *(0x12fdc);
0x00012e10 bl 0x10908 | strerror (r0);
0x00012e14 str r7, [sp] | *(sp) = r7;
0x00012e18 ldr r3, [pc, 0x1d4] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x00012e1c mov r2, 8 | r2 = 8;
0x00012e20 ldr r1, [pc, 0x1d0] | r1 = *(0x12ff4);
0x00012e24 str r0, [sp, 4] | var_4h = r0;
0x00012e28 mov r0, r4 | r0 = r4;
0x00012e2c bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n")
0x00012e30 b 0x12d7c | goto label_2;
| }
0x00012e34 mov r0, r8 | r0 = r8;
0x00012e38 bl 0x10a70 | r0 = closedir ();
0x00012e3c cmp r0, 0 |
| if (r0 != 0) {
0x00012e40 beq 0x12e8c |
0x00012e44 ldr r6, [pc, 0x194] | r6 = *(0x12fdc);
0x00012e48 ldr r4, [sb] | r4 = *(sb);
0x00012e4c ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012e50 ldr r2, [pc, 0x18c] | r2 = stderr;
0x00012e54 ldr r1, [pc, 0x1a0] | r1 = "%*serror %d (%s)\n";
0x00012e58 ldr r0, [r6] | r0 = *(0x12fdc);
0x00012e5c bl 0x1098c | fprintf (r0, "%*serror %d (%s)\n", r2, r3, r4, r5, r6)
0x00012e60 mov r0, r4 | r0 = r4;
0x00012e64 ldr r5, [r6] | r5 = *(0x12fdc);
0x00012e68 bl 0x10908 | strerror (r0);
0x00012e6c str r4, [sp] | *(sp) = r4;
0x00012e70 ldr r3, [pc, 0x17c] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x00012e74 mov r2, 8 | r2 = 8;
0x00012e78 ldr r1, [pc, 0x178] | r1 = *(0x12ff4);
0x00012e7c str r0, [sp, 4] | var_4h = r0;
0x00012e80 mov r0, r5 | r0 = r5;
0x00012e84 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n", r4)
0x00012e88 b 0x12d0c | goto label_0;
| }
0x00012e8c ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00012e90 add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00012e94 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00012e98 streq r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| }
0x00012e9c add r3, r4, 0x18 | r3 = r4 + 0x18;
0x00012ea0 mov r1, r6 | r1 = r6;
0x00012ea4 add r0, r5, 0x18 | r0 = r5 + 0x18;
0x00012ea8 bl 0x11c98 | r0 = fcn_00011c98 (r0, r1);
0x00012eac cmp r0, 0 |
| if (r0 != 0) {
0x00012eb0 bne 0x12d0c | goto label_0;
| }
0x00012eb4 mov r2, sl | r2 = sl;
0x00012eb8 mov r1, r6 | r1 = r6;
0x00012ebc ldr r0, [r5, 0x3c] | r0 = *((r5 + 0x3c));
0x00012ec0 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012ec4 cmp r0, 0 |
| if (r0 != 0) {
0x00012ec8 bne 0x12d0c | goto label_0;
| }
0x00012ecc add r2, r4, 0x20 | r2 = r4 + 0x20;
0x00012ed0 mov r1, r6 | r1 = r6;
0x00012ed4 ldr r0, [r5, 0x1c] | r0 = *((r5 + 0x1c));
0x00012ed8 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012edc cmp r0, 0 |
| if (r0 != 0) {
0x00012ee0 bne 0x12d0c | goto label_0;
| }
0x00012ee4 add r2, r4, 0x1c | r2 = r4 + 0x1c;
0x00012ee8 mov r1, r6 | r1 = r6;
0x00012eec ldr r0, [r5, 0x20] | r0 = *((r5 + 0x20));
0x00012ef0 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012ef4 cmp r0, 0 |
| if (r0 != 0) {
0x00012ef8 bne 0x12d0c | goto label_0;
| }
0x00012efc add r2, r4, 0x38 | r2 = r4 + 0x38;
0x00012f00 mov r1, r6 | r1 = r6;
0x00012f04 ldr r0, [r5, 0x24] | r0 = *((r5 + 0x24));
0x00012f08 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012f0c cmp r0, 0 |
| if (r0 != 0) {
0x00012f10 bne 0x12d0c | goto label_0;
| }
0x00012f14 add r2, r4, 0x3c | r2 = r4 + 0x3c;
0x00012f18 mov r1, r6 | r1 = r6;
0x00012f1c ldr r0, [r5, 0x28] | r0 = *((r5 + 0x28));
0x00012f20 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012f24 cmp r0, 0 |
| if (r0 != 0) {
0x00012f28 bne 0x12d0c | goto label_0;
| }
0x00012f2c add r2, r4, 0x48 | r2 = r4 + 0x48;
0x00012f30 mov r1, r6 | r1 = r6;
0x00012f34 ldr r0, [r5, 0x30] | r0 = *((r5 + 0x30));
0x00012f38 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012f3c cmp r0, 0 |
| if (r0 != 0) {
0x00012f40 bne 0x12d0c | goto label_0;
| }
0x00012f44 ldr r8, [r5, 0x2c] | r8 = *((r5 + 0x2c));
0x00012f48 mov sb, sp | sb = sp;
0x00012f4c mov r0, r8 | r0 = r8;
0x00012f50 bl 0x10a4c | strlen (r0);
0x00012f54 mov r2, r6 | r2 = r6;
0x00012f58 mov r1, r8 | r1 = r8;
0x00012f5c add r0, r0, 0x39 | r0 += 0x39;
0x00012f60 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012f64 sub sp, sp, r0 |
0x00012f68 add r7, sp, 8 | r7 += s;
0x00012f6c mov r0, r7 | r0 = r7;
0x00012f70 bl 0x10a28 | sprintf (r0, r1, r2);
0x00012f74 add r1, r4, 0x40 | r1 = r4 + 0x40;
0x00012f78 mov r0, r7 | r0 = r7;
0x00012f7c bl 0x11588 | fcn_00011588 (r0, r1);
0x00012f80 mov sp, sb |
0x00012f84 cmp r0, 0 |
| if (r0 != 0) {
0x00012f88 bne 0x12d0c | goto label_0;
| }
0x00012f8c add r2, r4, 0x4c | r2 = r4 + 0x4c;
0x00012f90 mov r1, r6 | r1 = r6;
0x00012f94 ldr r0, [r5, 0x34] | r0 = *((r5 + 0x34));
0x00012f98 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012f9c cmp r0, 0 |
| if (r0 != 0) {
0x00012fa0 bne 0x12d0c | goto label_0;
| }
0x00012fa4 add r2, r4, 0x50 | r2 = r4 + 0x50;
0x00012fa8 mov r1, r6 | r1 = r6;
0x00012fac ldr r0, [r5, 0x38] | r0 = *((r5 + 0x38));
0x00012fb0 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012fb4 cmp r0, 0 |
| if (r0 != 0) {
0x00012fb8 bne 0x12d0c | goto label_0;
| }
0x00012fbc ldr r3, [r4, 0x3c] | r3 = *((r4 + 0x3c));
0x00012fc0 ldr r2, [r4, 0x20] | r2 = *((r4 + 0x20));
0x00012fc4 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x00012fc8 ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x00012fcc strd r6, r7, [r4, 0x30] | __asm ("strd r6, r7, [r4, 0x30]");
0x00012fd0 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x00012fd4 strd r6, r7, [r4, 0x28] | __asm ("strd r6, r7, [r4, 0x28]");
| label_3:
0x00012fd8 sub sp, fp, 0x20 |
0x00012fdc 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/ubiupdatevol @ 0x131f0 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000131f0 () | void fcn_000131f0 (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;
0x000131f0 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000131f4 add sb, r3, 8 | sb = r3 + 8;
0x000131f8 add fp, sp, 0x20 |
0x000131fc sub sp, sp, 0x3c |
0x00013200 mov r5, r1 | r5 = r1;
0x00013204 mov r6, r2 | r6 = r2;
0x00013208 mov r1, 0 | r1 = 0;
0x0001320c mov r2, 0xb0 | r2 = 0xb0;
0x00013210 mov r7, r0 | r7 = r0;
0x00013214 mov r0, sb | r0 = sb;
0x00013218 mov r4, r3 | r4 = r3;
0x0001321c bl 0x109f8 | memset (r0, r1, r2);
0x00013220 ldr sl, [r7, 0x48] | sl = *((r7 + 0x48));
0x00013224 stm r4, {r5, r6} | *(r4) = r5;
| *((r4 + 4)) = r6;
0x00013228 mov r0, sl | r0 = sl;
0x0001322c bl 0x10a4c | strlen (r0);
0x00013230 mov r8, sp | r8 = sp;
0x00013234 mov r3, r6 | r3 = r6;
0x00013238 mov r2, r5 | r2 = r5;
0x0001323c mov r1, sl | r1 = sl;
0x00013240 add r0, r0, 0x6b | r0 += 0x6b;
0x00013244 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013248 sub sp, sp, r0 |
0x0001324c mov r0, sp | r0 = sp;
0x00013250 bl 0x10a28 | sprintf (r0, r1, r2);
0x00013254 mov r0, sp | r0 = sp;
0x00013258 add r2, r4, 0xc | r2 = r4 + 0xc;
0x0001325c mov r1, sb | r1 = sb;
0x00013260 bl 0x11bc0 | fcn_00011bc0 (r0, r1);
0x00013264 mov sp, r8 |
0x00013268 cmp r0, 0 |
0x0001326c beq 0x13280 |
| while (r8 < r0) {
| label_0:
0x00013270 mvn r8, 0 | r8 = ~0;
| label_1:
0x00013274 mov r0, r8 | r0 = r8;
0x00013278 sub sp, fp, 0x20 |
0x0001327c pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00013280 ldr sb, [r7, 0x44] | sb = *((r7 + 0x44));
0x00013284 mov r0, sb | r0 = sb;
0x00013288 bl 0x10a4c | strlen (r0);
0x0001328c mov r3, r6 | r3 = r6;
0x00013290 mov r2, r5 | r2 = r5;
0x00013294 mov r1, sb | r1 = sb;
0x00013298 add r0, r0, 0x6b | r0 += 0x6b;
0x0001329c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000132a0 sub sp, sp, r0 |
0x000132a4 mov r0, sp | r0 = sp;
0x000132a8 bl 0x10a28 | sprintf (r0, r1, r2);
0x000132ac mov r0, sp | r0 = sp;
0x000132b0 mov r2, 0x32 | r2 = 0x32;
0x000132b4 sub r1, fp, 0x58 | r1 -= s1;
0x000132b8 bl 0x11844 | fcn_00011844 (r0, r1);
0x000132bc mov sp, r8 |
0x000132c0 subs r8, r0, 0 | r8 = r0 - 0;
0x000132c4 blt 0x13270 |
| }
0x000132c8 mov r2, r8 | r2 = r8;
0x000132cc ldr r1, [pc, 0x174] | r1 = *(0x13444);
0x000132d0 sub r0, fp, 0x58 | r0 -= s1;
0x000132d4 bl 0x109b0 | r0 = strncmp (r0, r1, r2);
0x000132d8 cmp r0, 0 |
| if (r0 != 0) {
0x000132dc moveq r3, 4 | r3 = 4;
| }
| if (r0 != 0) {
0x000132e0 beq 0x13300 |
0x000132e4 mov r2, r8 | r2 = r8;
0x000132e8 ldr r1, [pc, 0x15c] | r1 = "static";
0x000132ec sub r0, fp, 0x58 | r0 -= s1;
0x000132f0 bl 0x109b0 | r0 = strncmp (r0, "static", r2);
0x000132f4 cmp r0, 0 |
| if (r0 != 0) {
0x000132f8 bne 0x13420 | goto label_2;
| }
0x000132fc mov r3, 3 | r3 = 3;
| }
0x00013300 str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x00013304 mov r2, r6 | r2 = r6;
0x00013308 add r3, r4, 0x14 | r3 = r4 + 0x14;
0x0001330c mov r1, r5 | r1 = r5;
0x00013310 ldr r0, [r7, 0x4c] | r0 = *((r7 + 0x4c));
0x00013314 bl 0x117f4 | r0 = fcn_000117f4 (r0, r1);
0x00013318 cmp r0, 0 |
| if (r0 != 0) {
0x0001331c bne 0x13270 | goto label_0;
| }
0x00013320 ldr r8, [r7, 0x50] | r8 = *((r7 + 0x50));
0x00013324 mov sb, sp | sb = sp;
0x00013328 mov r0, r8 | r0 = r8;
0x0001332c bl 0x10a4c | strlen (r0);
0x00013330 mov r3, r6 | r3 = r6;
0x00013334 mov r2, r5 | r2 = r5;
0x00013338 mov r1, r8 | r1 = r8;
0x0001333c add r0, r0, 0x6b | r0 += 0x6b;
0x00013340 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013344 sub sp, sp, r0 |
0x00013348 mov r0, sp | r0 = sp;
0x0001334c bl 0x10a28 | sprintf (r0, r1, r2);
0x00013350 mov r0, sp | r0 = sp;
0x00013354 add r1, r4, 0x18 | r1 = r4 + 0x18;
0x00013358 bl 0x11588 | fcn_00011588 (r0, r1);
0x0001335c mov sp, sb |
0x00013360 cmp r0, 0 |
| if (r0 != 0) {
0x00013364 bne 0x13270 | goto label_0;
| }
0x00013368 add r3, r4, 0x28 | r3 = r4 + 0x28;
0x0001336c mov r2, r6 | r2 = r6;
0x00013370 mov r1, r5 | r1 = r5;
0x00013374 ldr r0, [r7, 0x54] | r0 = *((r7 + 0x54));
0x00013378 bl 0x117f4 | r0 = fcn_000117f4 (r0, r1);
0x0001337c cmp r0, 0 |
| if (r0 != 0) {
0x00013380 bne 0x13270 | goto label_0;
| }
0x00013384 add r3, r4, 0x2c | r3 = r4 + 0x2c;
0x00013388 mov r2, r6 | r2 = r6;
0x0001338c mov r1, r5 | r1 = r5;
0x00013390 ldr r0, [r7, 0x58] | r0 = *((r7 + 0x58));
0x00013394 bl 0x117f4 | r0 = fcn_000117f4 (r0, r1);
0x00013398 cmp r0, 0 |
| if (r0 != 0) {
0x0001339c bne 0x13270 | goto label_0;
| }
0x000133a0 add r3, r4, 0x30 | r3 = r4 + 0x30;
0x000133a4 mov r2, r6 | r2 = r6;
0x000133a8 mov r1, r5 | r1 = r5;
0x000133ac ldr r0, [r7, 0x5c] | r0 = *((r7 + 0x5c));
0x000133b0 bl 0x117f4 | r0 = fcn_000117f4 (r0, r1);
0x000133b4 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 != r0) {
0x000133b8 bne 0x13270 | goto label_0;
| }
0x000133bc ldr r1, [r4, 0x28] | r1 = *((r4 + 0x28));
0x000133c0 ldr r0, [r4, 0x2c] | r0 = *((r4 + 0x2c));
0x000133c4 ldr r7, [r7, 0x60] | r7 = *((r7 + 0x60));
0x000133c8 smull r2, r3, r0, r1 | r2:r3 = r0 * r1;
0x000133cc mov r0, r7 | r0 = r7;
0x000133d0 strd r2, r3, [r4, 0x20] | __asm ("strd r2, r3, [r4, 0x20]");
0x000133d4 bl 0x10a4c | strlen (r0);
0x000133d8 mov r3, r6 | r3 = r6;
0x000133dc mov r2, r5 | r2 = r5;
0x000133e0 mov r1, r7 | r1 = r7;
0x000133e4 add r0, r0, 0x6b | r0 += 0x6b;
0x000133e8 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000133ec sub sp, sp, r0 |
0x000133f0 mov r0, sp | r0 = sp;
0x000133f4 bl 0x10a28 | sprintf (r0, r1, r2);
0x000133f8 mov r0, sp | r0 = sp;
0x000133fc mov r2, 0x81 | r2 = 0x81;
0x00013400 add r1, r4, 0x34 | r1 = r4 + 0x34;
0x00013404 bl 0x11844 | fcn_00011844 (r0, r1);
0x00013408 mov sp, sb |
0x0001340c cmp r0, 0 |
| if (r0 < 0) {
0x00013410 blt 0x13270 | goto label_0;
| }
0x00013414 add r4, r4, r0 | r4 += r0;
0x00013418 strb r8, [r4, 0x33] | *((r4 + 0x33)) = r8;
0x0001341c b 0x13274 | goto label_1;
| label_2:
0x00013420 ldr r0, [pc, 0x28] |
0x00013424 sub r3, fp, 0x58 | r3 -= s1;
0x00013428 ldr r2, [pc, 0x24] | r2 = stderr;
0x0001342c ldr r1, [pc, 0x24] | r1 = "libubi";
0x00013430 ldr r0, [r0] | r0 = "dynamic";
0x00013434 bl 0x1098c | r0 = fprintf ("dynamic", "libubi", r2, r3)
0x00013438 bl 0x10a34 | errno_location ();
0x0001343c mov r3, 0x16 | r3 = 0x16;
0x00013440 str r3, [r0] | *(r0) = r3;
0x00013444 b 0x13270 | 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/ubiupdatevol @ 0x1345c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.0001345c () | void fcn_0001345c (int32_t arg1, int32_t arg2) {
| int32_t var_b4h;
| int32_t var_b0h;
| 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_8h;
| int32_t var_bch;
| int32_t var_sp_6ch;
| int32_t var_20h_2;
| int32_t var_20h;
| r0 = arg1;
| r1 = arg2;
0x0001345c push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013460 add fp, sp, 0x20 |
0x00013464 sub sp, sp, 0xa4 |
0x00013468 mov r5, r0 | r5 = r0;
0x0001346c mov r6, r1 | r6 = r1;
0x00013470 mov sb, r2 | sb = r2;
0x00013474 bl 0x1266c | r0 = fcn_0001266c (r0, r1);
0x00013478 cmp r0, 2 |
| if (r0 == 2) {
0x0001347c beq 0x134a4 | goto label_7;
| }
0x00013480 cmp r0, 1 |
0x00013484 beq 0x13494 |
| while (1) {
| label_0:
0x00013488 mvn r0, 0 | r0 = ~0;
| label_1:
0x0001348c sub sp, fp, 0x20 |
0x00013490 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00013494 bl 0x10a34 | errno_location ();
0x00013498 mov r3, 0x13 | r3 = 0x13;
0x0001349c str r3, [r0] | *(r0) = r3;
0x000134a0 b 0x13488 |
| }
| label_7:
0x000134a4 ldr r0, [r5, 0x40] | r0 = *((r5 + 0x40));
0x000134a8 str sp, [fp, -0xb0] | var_b0h = sp;
0x000134ac bl 0x10a4c | strlen (r0);
0x000134b0 sub r1, fp, 0x8c | r1 -= var_8ch;
0x000134b4 add r0, r0, 0x6b | r0 += 0x6b;
0x000134b8 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000134bc sub sp, sp, r0 |
0x000134c0 mov r0, r6 | r0 = r6;
0x000134c4 bl 0x10914 | stat64 ();
0x000134c8 add r7, sp, 8 | r7 += var_8h;
0x000134cc cmp r0, 0 |
| if (r0 != 0) {
0x000134d0 beq 0x13520 |
0x000134d4 bl 0x10a34 | errno_location ();
0x000134d8 ldr sl, [pc, 0x200] | sl = obj.stderr;
0x000134dc mov r3, r6 | r3 = r6;
0x000134e0 ldr r2, [pc, 0x1fc] | r2 = stderr;
0x000134e4 ldr r1, [pc, 0x1fc] | r1 = "libubi";
0x000134e8 ldr r7, [r0] | r7 = *(r0);
0x000134ec ldr r0, [sl] | r0 = *(sl);
0x000134f0 bl 0x1098c | fprintf (r0, "libubi", r2, r3)
0x000134f4 mov r0, r7 | r0 = r7;
0x000134f8 ldr r6, [sl] | r6 = *(sl);
0x000134fc bl 0x10908 | strerror (r0);
0x00013500 ldr r3, [pc, 0x1e4] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x00013504 ldr r1, [pc, 0x1e4] | r1 = *(0x136ec);
0x00013508 mov r2, 8 | r2 = 8;
0x0001350c str r7, [sp] | *(sp) = r7;
0x00013510 str r0, [sp, 4] | var_4h = r0;
0x00013514 mov r0, r6 | r0 = r6;
| label_6:
0x00013518 bl 0x1098c | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_")
0x0001351c b 0x13554 |
| } else {
0x00013520 ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x00013524 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00013528 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x0001352c beq 0x1357c | goto label_8;
| }
0x00013530 bl 0x10a34 | errno_location ();
0x00013534 ldr r2, [pc, 0x1a8] | r2 = stderr;
0x00013538 ldr r1, [pc, 0x1b4] | r1 = "%*serror %d (%s)\n";
0x0001353c mov r3, 0x16 | r3 = 0x16;
0x00013540 str r3, [r0] | *(r0) = r3;
0x00013544 mov r3, r6 | r3 = r6;
| label_2:
0x00013548 ldr r0, [pc, 0x190] |
0x0001354c ldr r0, [r0] | r0 = *(0x136dc);
0x00013550 bl 0x1098c | fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| }
| label_3:
0x00013554 mvn r3, 0 | r3 = ~0;
| label_5:
0x00013558 cmp r3, 0 |
0x0001355c ldr sp, [fp, -0xb0] | sp = var_b0h;
| if (r3 != 0) {
0x00013560 bne 0x13488 | goto label_0;
| }
0x00013564 mov r3, sb | r3 = sb;
0x00013568 mov r2, r8 | r2 = r8;
0x0001356c mov r1, r4 | r1 = r4;
0x00013570 mov r0, r5 | r0 = r5;
0x00013574 bl 0x131f0 | fcn_000131f0 (r0, r1);
0x00013578 b 0x1348c | goto label_1;
| label_8:
0x0001357c ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x00013580 mov r1, r3 | r1 = r3;
0x00013584 mov r0, r2 | r0 = r2;
0x00013588 strd r2, r3, [fp, -0xbc] | __asm ("strd r2, r3, [var_8h]");
0x0001358c bl 0x1092c | gnu_dev_major ();
0x00013590 ldrd r2, r3, [fp, -0xbc] | __asm ("ldrd r2, r3, [var_8h]");
0x00013594 mov r1, r3 | r1 = r3;
0x00013598 mov sl, r0 | sl = r0;
0x0001359c mov r0, r2 | r0 = r2;
0x000135a0 bl 0x1095c | r0 = gnu_dev_minor ();
0x000135a4 subs r3, r0, 0 | r3 = r0 - 0;
0x000135a8 str r3, [fp, -0xbc] | var_8h = r3;
| if (r3 == r0) {
0x000135ac bne 0x135cc |
0x000135b0 bl 0x10a34 | errno_location ();
0x000135b4 mov r3, 0x16 | r3 = 0x16;
0x000135b8 ldr r2, [pc, 0x124] | r2 = stderr;
0x000135bc ldr r1, [pc, 0x134] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x000135c0 str r3, [r0] | *(r0) = r3;
0x000135c4 mov r3, r6 | r3 = r6;
0x000135c8 b 0x13548 | goto label_2;
| }
0x000135cc sub r1, fp, 0xa4 | r1 -= var_a4h;
0x000135d0 mov r0, r5 | r0 = r5;
0x000135d4 bl 0x1233c | r0 = fcn_0001233c (r0, r1);
0x000135d8 cmp r0, 0 |
| if (r0 != 0) {
0x000135dc bne 0x13554 | goto label_3;
| }
0x000135e0 bl 0x10a34 | errno_location ();
0x000135e4 ldr r4, [fp, -0xa0] | r4 = var_a0h;
0x000135e8 add r3, r5, 0x18 | r3 = r5 + 0x18;
0x000135ec str r3, [fp, -0xb4] | var_b4h = r3;
0x000135f0 mov r6, r0 | r6 = r0;
| label_4:
0x000135f4 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x000135f8 cmp r4, r3 |
| if (r4 > r3) {
0x000135fc bgt 0x1363c | goto label_9;
| }
0x00013600 sub r3, fp, 0xa8 | r3 -= var_a8h;
0x00013604 sub r2, fp, 0xac | r2 -= var_ach;
0x00013608 mov r1, r4 | r1 = r4;
0x0001360c ldr r0, [fp, -0xb4] | r0 = var_b4h;
0x00013610 bl 0x11c98 | r0 = fcn_00011c98 (r0, r1);
0x00013614 cmp r0, 0 |
| if (r0 == 0) {
0x00013618 beq 0x13630 | goto label_10;
| }
0x0001361c ldr r3, [r6] | r3 = *(r6);
0x00013620 cmp r3, 2 |
| if (r3 != 2) {
0x00013624 bne 0x13554 | goto label_3;
| }
| do {
0x00013628 add r4, r4, 1 | r4++;
0x0001362c b 0x135f4 | goto label_4;
| label_10:
0x00013630 ldr r3, [fp, -0xac] | r3 = var_ach;
0x00013634 cmp sl, r3 |
0x00013638 bne 0x13628 |
| } while (sl != r3);
| label_9:
0x0001363c ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00013640 cmp r4, r3 |
| if (r4 <= r3) {
0x00013644 movgt r3, 0x13 | r3 = 0x13;
| }
| if (r4 > r3) {
0x00013648 strgt r3, [r6] | *(r6) = r3;
| goto label_11;
| }
| if (r4 > r3) {
| label_11:
0x0001364c bgt 0x13554 | goto label_3;
| }
0x00013650 ldr r3, [fp, -0xbc] | r3 = var_8h;
0x00013654 mov r2, r4 | r2 = r4;
0x00013658 sub r8, r3, 1 | r8 = r3 - 1;
0x0001365c mov r3, r8 | r3 = r8;
0x00013660 ldr r1, [r5, 0x40] | r1 = *((r5 + 0x40));
0x00013664 mov r0, r7 | r0 = r7;
0x00013668 bl 0x10a28 | sprintf (r0, r1, r2);
0x0001366c mov r1, 0 | r1 = 0;
0x00013670 mov r0, r7 | r0 = r7;
0x00013674 bl 0x10a04 | r0 = open64 ();
0x00013678 cmn r0, 1 |
| if (r0 != 1) {
0x0001367c moveq r2, 0x13 | r2 = 0x13;
| }
0x00013680 mov r3, r0 | r3 = r0;
| if (r0 == 1) {
0x00013684 streq r2, [r6] | *(r6) = r2;
| goto label_12;
| }
| if (r0 == 1) {
| label_12:
0x00013688 beq 0x13558 | goto label_5;
| }
0x0001368c bl 0x10a88 | r0 = close (r0);
0x00013690 subs r3, r0, 0 | r3 = r0 - 0;
| if (r3 == r0) {
0x00013694 streq r3, [r6] | *(r6) = r3;
| goto label_13;
| }
| if (r3 == r0) {
| label_13:
0x00013698 beq 0x13558 | goto label_5;
| }
0x0001369c ldr sl, [pc, 0x3c] | sl = obj.stderr;
0x000136a0 ldr r6, [r6] | r6 = *(r6);
0x000136a4 mov r3, r7 | r3 = r7;
0x000136a8 ldr r2, [pc, 0x34] | r2 = stderr;
0x000136ac ldr r1, [pc, 0x48] | r1 = "_s:_error_:___s__is_not_a_volume_character_device";
0x000136b0 ldr r0, [sl] | r0 = *(sl);
0x000136b4 bl 0x1098c | fprintf (r0, "_s:_error_:___s__is_not_a_volume_character_device", r2, r3, r4, r5, r6)
0x000136b8 mov r0, r6 | r0 = r6;
0x000136bc ldr r7, [sl] | r7 = *(sl);
0x000136c0 bl 0x10908 | strerror (r0);
0x000136c4 str r6, [sp] | *(sp) = r6;
0x000136c8 ldr r3, [pc, 0x1c] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x000136cc mov r2, 8 | r2 = 8;
0x000136d0 ldr r1, [pc, 0x18] | r1 = *(0x136ec);
0x000136d4 str r0, [sp, 4] | var_4h = r0;
0x000136d8 mov r0, r7 | r0 = r7;
0x000136dc b 0x13518 | goto label_6;
| }
; 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/ubiupdatevol @ 0x10aa0 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main (char ** stream, int32_t argc, char ** argv) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_10h;
| int32_t var_10h_2;
| int32_t var_18h;
| int32_t var_18h_2;
| void * ptr;
| int32_t var_24h;
| int32_t var_28h;
| int32_t var_30h;
| int32_t var_30h_2;
| int32_t var_90h;
| int32_t var_b0h;
| int32_t var_b0h_2;
| size_t size;
| int32_t var_14ch;
| r0 = argc;
| r1 = argv;
| /* [10] -r-x section size 11724 named .text */
0x00010aa0 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00010aa4 ldr sb, [pc, 0x890] | sb = "skip";
0x00010aa8 ldr sl, [pc, 0x890] | sl = "ts:h?V";
0x00010aac ldr r8, [pc, 0x890] | r8 = "ts:h?V";
0x00010ab0 sub sp, sp, 0x14c |
0x00010ab4 mov r4, r0 | r4 = r0;
0x00010ab8 mov r6, r1 | r6 = r1;
| do {
| label_0:
0x00010abc add r7, sp, 0x28 | r7 += var_28h;
0x00010ac0 mov fp, 0 |
0x00010ac4 str r7, [sp] | *(sp) = r7;
0x00010ac8 mov r3, sb | r3 = sb;
0x00010acc mov r2, sl | r2 = sl;
0x00010ad0 mov r1, r6 | r1 = r6;
0x00010ad4 mov r0, r4 | r0 = r4;
0x00010ad8 str fp, [sp, 0x90] | var_90h = fp;
0x00010adc bl 0x10920 | r0 = getopt_long ();
0x00010ae0 cmn r0, 1 |
0x00010ae4 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x00010ae8 beq 0x10c60 | goto label_18;
| }
0x00010aec cmp r0, 0x56 |
| if (r0 == 0x56) {
0x00010af0 beq 0x10c20 | goto label_19;
| }
| if (r0 > 0x56) {
0x00010af4 bgt 0x10b70 | goto label_20;
| }
0x00010af8 cmp r0, 0x3a |
| if (r0 == 0x3a) {
0x00010afc beq 0x10c34 | goto label_21;
| }
0x00010b00 cmp r0, 0x3f |
| if (r0 == 0x3f) {
0x00010b04 beq 0x10bfc | goto label_22;
| }
0x00010b08 cmp r0, fp |
| if (r0 != fp) {
0x00010b0c bne 0x10c4c | goto label_23;
| }
0x00010b10 ldr r3, [sp, 0x28] | r3 = var_28h;
0x00010b14 cmp r3, 0 |
0x00010b18 bne 0x10abc |
| } while (r3 != 0);
0x00010b1c add r1, sp, 0x90 | r1 += var_90h;
0x00010b20 ldr r0, [r8] | r0 = *(r8);
0x00010b24 bl 0x11504 | fcn_00011504 (r0, r1);
0x00010b28 ldr r3, [pc, 0x818] | r3 = optarg;
0x00010b2c strd r0, r1, [r3, -8] | __asm ("strd r0, r1, [r3, -8]");
0x00010b30 ldr r3, [sp, 0x90] | r3 = var_90h;
0x00010b34 cmp r3, 0 |
| if (r3 != 0) {
0x00010b38 lsreq r1, r1, 0x1f | r1 >>= 0x1f;
| }
| if (r3 == 0) {
0x00010b3c movne r1, 1 | r1 = 1;
| }
0x00010b40 cmp r1, 0 |
| if (r1 == 0) {
0x00010b44 beq 0x10abc | goto label_0;
| }
0x00010b48 ldr r3, [r8] | r3 = *(r8);
0x00010b4c ldr r2, [pc, 0x7f8] | r2 = *(0x11348);
0x00010b50 ldr r1, [pc, 0x7f8] | r1 = "ubiupdatevol";
| label_1:
0x00010b54 ldr r0, [pc, 0x7f8] |
0x00010b58 ldr r0, [r0] | r0 = "_s:_error_:_bad_skip:___s_";
0x00010b5c bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "ubiupdatevol", r2, r3)
| label_2:
0x00010b60 mvn r5, 0 | r5 = ~0;
| label_4:
0x00010b64 mov r0, r5 | r0 = r5;
0x00010b68 add sp, sp, 0x14c |
0x00010b6c pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_20:
0x00010b70 cmp r0, 0x73 |
| if (r0 != 0x73) {
0x00010b74 beq 0x10bc0 |
0x00010b78 cmp r0, 0x74 |
| if (r0 != 0x74) {
0x00010b7c beq 0x10bb0 |
0x00010b80 cmp r0, 0x68 |
| if (r0 != 0x68) {
0x00010b84 bne 0x10c4c | goto label_23;
| }
0x00010b88 ldr r1, [pc, 0x7c8] | r1 = stderr;
0x00010b8c ldr r0, [pc, 0x7c8] | r0 = "ubiupdatevol_version_2.1.0___a_tool_to_write_data_to_UBI_volumes.";
0x00010b90 bl 0x108fc | printf ("ubiupdatevol_version_2.1.0___a_tool_to_write_data_to_UBI_volumes.", r1);
0x00010b94 ldr r1, [pc, 0x7c4] | r1 = "_s";
0x00010b98 ldr r0, [pc, 0x7bc] | r0 = "ubiupdatevol_version_2.1.0___a_tool_to_write_data_to_UBI_volumes.";
0x00010b9c bl 0x108fc | printf ("ubiupdatevol_version_2.1.0___a_tool_to_write_data_to_UBI_volumes.", "_s");
0x00010ba0 ldr r0, [pc, 0x7bc] | r0 = "Usage:_ubiupdatevol__UBI_volume_node_file_name____t____s__size_____h____V_____truncate____size_size______help_____version___image_file_Example_1:_ubiupdatevol__dev_ubi0_1_fs.img___write_file__fs.img__to_UBI_volume__dev_ubi0_1Example_2:_ubiupdatevo";
0x00010ba4 bl 0x10944 | puts ("Usage:_ubiupdatevol__UBI_volume_node_file_name____t____s__size_____h____V_____truncate____size_size______help_____version___image_file_Example_1:_ubiupdatevol__dev_ubi0_1_fs.img___write_file__fs.img__to_UBI_volume__dev_ubi0_1Example_2:_ubiupdatevo");
| label_3:
0x00010ba8 mov r0, fp | r0 = fp;
0x00010bac bl 0x10a40 | exit (r0);
| }
0x00010bb0 ldr r3, [pc, 0x7b0] | r3 = "_t____truncate_____________truncate_volume__wipe_it_out__s____size_bytes__________bytes_to_read_from_input______skip_bytes__________leading_bytes_to_skip_from_input_h____help_________________print_help_message_V____version______________print_program";
0x00010bb4 mov r2, 1 | r2 = 1;
0x00010bb8 str r2, [r3] | *(r3) = r2;
0x00010bbc b 0x10abc | goto label_0;
| }
0x00010bc0 add r1, sp, 0x90 | r1 += var_90h;
0x00010bc4 ldr r0, [r8] | r0 = *(r8);
0x00010bc8 bl 0x11504 | fcn_00011504 (r0, r1);
0x00010bcc ldr r3, [pc, 0x798] | r3 = *(0x11368);
0x00010bd0 strd r0, r1, [r3] | __asm ("strd r0, r1, [r3]");
0x00010bd4 ldr r3, [sp, 0x90] | r3 = var_90h;
0x00010bd8 cmp r3, 0 |
| if (r3 != 0) {
0x00010bdc lsreq r1, r1, 0x1f | r1 >>= 0x1f;
| }
| if (r3 == 0) {
0x00010be0 movne r1, 1 | r1 = 1;
| }
0x00010be4 cmp r1, 0 |
| if (r1 == 0) {
0x00010be8 beq 0x10abc | goto label_0;
| }
0x00010bec ldr r3, [r8] | r3 = *(r8);
0x00010bf0 ldr r2, [pc, 0x754] | r2 = *(0x11348);
0x00010bf4 ldr r1, [pc, 0x774] | r1 = *(0x1136c);
0x00010bf8 b 0x10b54 | goto label_1;
| label_22:
0x00010bfc ldr r1, [pc, 0x754] | r1 = stderr;
0x00010c00 ldr r0, [pc, 0x754] | r0 = "ubiupdatevol_version_2.1.0___a_tool_to_write_data_to_UBI_volumes.";
0x00010c04 bl 0x108fc | printf ("ubiupdatevol_version_2.1.0___a_tool_to_write_data_to_UBI_volumes.", r1);
0x00010c08 ldr r1, [pc, 0x750] | r1 = "_s";
0x00010c0c ldr r0, [pc, 0x748] | r0 = "ubiupdatevol_version_2.1.0___a_tool_to_write_data_to_UBI_volumes.";
0x00010c10 bl 0x108fc | printf ("ubiupdatevol_version_2.1.0___a_tool_to_write_data_to_UBI_volumes.", "_s");
0x00010c14 ldr r0, [pc, 0x748] | r0 = "Usage:_ubiupdatevol__UBI_volume_node_file_name____t____s__size_____h____V_____truncate____size_size______help_____version___image_file_Example_1:_ubiupdatevol__dev_ubi0_1_fs.img___write_file__fs.img__to_UBI_volume__dev_ubi0_1Example_2:_ubiupdatevo";
0x00010c18 bl 0x10944 | puts ("Usage:_ubiupdatevol__UBI_volume_node_file_name____t____s__size_____h____V_____truncate____size_size______help_____version___image_file_Example_1:_ubiupdatevol__dev_ubi0_1_fs.img___write_file__fs.img__to_UBI_volume__dev_ubi0_1Example_2:_ubiupdatevo");
0x00010c1c b 0x10b60 | goto label_2;
| label_19:
0x00010c20 ldr r2, [pc, 0x74c] | r2 = "_s:_error_:_bad_size:___s_";
0x00010c24 ldr r1, [pc, 0x720] | r1 = *(0x11348);
0x00010c28 ldr r0, [pc, 0x748] | r0 = "2.1.0";
0x00010c2c bl 0x108fc | printf ("2.1.0", r1, "_s:_error_:_bad_size:___s_");
0x00010c30 b 0x10ba8 | goto label_3;
| label_21:
0x00010c34 ldr r3, [pc, 0x718] | r3 = "_s:_error_:_bad_skip:___s_";
0x00010c38 ldr r2, [pc, 0x70c] | r2 = *(0x11348);
0x00010c3c ldr r1, [pc, 0x738] | r1 = "%s (mtd-utils) %s\n";
0x00010c40 ldr r0, [r3] | r0 = "_s:_error_:_bad_skip:___s_";
0x00010c44 bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "%s (mtd-utils) %s\n", r2, "_s:_error_:_bad_skip:___s_")
0x00010c48 b 0x10b60 | goto label_2;
| label_23:
0x00010c4c ldr r3, [pc, 0x700] | r3 = "_s:_error_:_bad_skip:___s_";
0x00010c50 ldr r0, [pc, 0x728] | r0 = "_s:_error_:_parameter_is_missing";
0x00010c54 ldr r1, [r3] | r1 = "_s:_error_:_bad_skip:___s_";
0x00010c58 bl 0x10a64 | fputs ("_s:_error_:_parameter_is_missing", "_s:_error_:_bad_skip:___s_");
0x00010c5c b 0x10b60 | goto label_2;
| label_18:
0x00010c60 ldr r3, [pc, 0x71c] |
0x00010c64 ldr r3, [r3] | r3 = "Use__h_for_help";
0x00010c68 cmp r4, r3 |
| if (r4 != r3) {
0x00010c6c bne 0x10c88 | goto label_24;
| }
0x00010c70 ldr r2, [pc, 0x6d4] | r2 = *(0x11348);
0x00010c74 ldr r1, [pc, 0x70c] | r1 = optind;
| do {
| label_5:
0x00010c78 ldr r3, [pc, 0x6d4] | r3 = "_s:_error_:_bad_skip:___s_";
0x00010c7c ldr r0, [r3] | r0 = "_s:_error_:_bad_skip:___s_";
0x00010c80 bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", r1, r2, "_s:_error_:_bad_skip:___s_")
0x00010c84 b 0x10b64 | goto label_4;
| label_24:
0x00010c88 sub r4, r4, 2 | r4 -= 2;
0x00010c8c cmp r3, r4 |
0x00010c90 ldr r4, [pc, 0x6d0] | r4 = "_t____truncate_____________truncate_volume__wipe_it_out__s____size_bytes__________bytes_to_read_from_input______skip_bytes__________leading_bytes_to_skip_from_input_h____help_________________print_help_message_V____version______________print_program";
| if (r3 == r4) {
0x00010c94 beq 0x10cac | goto label_25;
| }
0x00010c98 ldr r2, [r4] | r2 = *(r4);
0x00010c9c cmp r2, 0 |
| if (r2 != 0) {
0x00010ca0 ldreq r2, [pc, 0x6a4] | r2 = "ubiupdatevol";
| }
| if (r2 != 0) {
0x00010ca4 ldreq r1, [pc, 0x6e0] | r1 = "_s:_error_:_specify_UBI_device_name_and_image_file_name_as_first_2_parameters__use__h_for_help_";
| }
0x00010ca8 beq 0x10c78 |
| } while (r2 == 0);
| label_25:
0x00010cac ldr r2, [r6, r3, lsl 2] | offset_0 = r3 << 2;
| r2 = *((r6 + offset_0));
0x00010cb0 add r6, r6, r3, lsl 2 | r6 += (r3 << 2);
0x00010cb4 ldr r0, [r6, 4] | r0 = *((r6 + 4));
0x00010cb8 str r2, [r4, 4] | *((r4 + 4)) = r2;
0x00010cbc cmp r0, 0 |
0x00010cc0 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r0 == 0) {
0x00010cc4 beq 0x10d14 | goto label_26;
| }
0x00010cc8 ldr r3, [r4] | r3 = *(r4);
0x00010ccc cmp r3, 0 |
| if (r3 == 0) {
0x00010cd0 ldrne r2, [pc, 0x674] | r2 = "ubiupdatevol";
| }
| if (r3 != 0) {
0x00010cd4 ldrne r1, [pc, 0x6b4] | r1 = "%s: error!: You can't truncate and specify an image (use -h for help)\n";
| goto label_27;
| }
| if (r3 != 0) {
| label_27:
0x00010cd8 bne 0x10c78 | goto label_5;
| }
0x00010cdc ldr r1, [pc, 0x6b0] | r1 = "%s: error!: You can't truncate and specify an image (use -h for help)\n";
0x00010ce0 bl 0x10a1c | r0 = strcmp (r0, "%s: error!: You can't truncate and specify an image (use -h for help)\n");
0x00010ce4 cmp r0, 0 |
| if (r0 != 0) {
0x00010ce8 moveq r3, 1 | r3 = 1;
| }
| if (r0 != 0) {
0x00010cec streq r3, [r4, 0x120] | *((r4 + 0x120)) = r3;
| }
0x00010cf0 ldr r3, [r4, 0x120] | r3 = *((r4 + 0x120));
0x00010cf4 cmp r3, 0 |
| if (r3 == 0) {
0x00010cf8 beq 0x10d14 | goto label_26;
| }
0x00010cfc ldr r3, [pc, 0x668] | r3 = *(0x11368);
0x00010d00 ldrd r2, r3, [r3] | __asm ("ldrd r2, r3, [r3]");
0x00010d04 orrs r3, r2, r3 | r3 = r2 | r3;
| if (r3 != r2) {
0x00010d08 ldreq r2, [pc, 0x63c] | r2 = "ubiupdatevol";
| }
| if (r3 == r2) {
0x00010d0c ldreq r1, [pc, 0x684] | r1 = "_s:_error_:_file_size_must_be_specified_if_input_is_stdin";
| goto label_28;
| }
| if (r3 == r2) {
| label_28:
0x00010d10 beq 0x10c78 | goto label_5;
| }
| label_26:
0x00010d14 bl 0x11e80 | r0 = fcn_00011e80 ();
0x00010d18 subs sl, r0, 0 | sl = r0 - 0;
| if (sl != r0) {
0x00010d1c bne 0x10d84 | goto label_29;
| }
0x00010d20 bl 0x10a34 | errno_location ();
0x00010d24 ldr r6, [pc, 0x628] | r6 = "_s:_error_:_bad_skip:___s_";
0x00010d28 ldr r2, [pc, 0x61c] | r2 = *(0x11348);
0x00010d2c ldr r4, [r0] | r4 = *(r0);
0x00010d30 ldr r0, [r6] | r0 = "_s:_error_:_bad_skip:___s_";
0x00010d34 cmp r4, 0 |
| if (r4 != 0) {
0x00010d38 bne 0x10d50 | goto label_30;
| }
0x00010d3c ldr r1, [pc, 0x658] | r1 = "_s:_error_:_file_size_must_be_specified_if_input_is_stdin";
0x00010d40 bl 0x1098c | fprintf (r0, "_s:_error_:_file_size_must_be_specified_if_input_is_stdin")
| do {
| label_6:
0x00010d44 mov r0, sl | r0 = sl;
0x00010d48 bl 0x11dac | fcn_00011dac (r0);
0x00010d4c b 0x10b64 | goto label_4;
| label_30:
0x00010d50 ldr r1, [pc, 0x648] | r1 = "%s: error!: UBI is not present in the system\n";
0x00010d54 bl 0x1098c | fprintf (r0, "%s: error!: UBI is not present in the system\n")
0x00010d58 ldr r6, [r6] | r6 = *(r6);
| label_7:
0x00010d5c mov r0, r4 | r0 = r4;
0x00010d60 bl 0x10908 | strerror (r0);
0x00010d64 ldr r3, [pc, 0x638] | r3 = "%s: error!: cannot open libubi\n";
0x00010d68 ldr r1, [pc, 0x638] | r1 = *(0x113a4);
0x00010d6c mov r2, 0xe | r2 = 0xe;
0x00010d70 str r4, [sp] | *(sp) = r4;
0x00010d74 str r0, [sp, 4] | var_4h = r0;
0x00010d78 mov r0, r6 | r0 = r6;
| label_8:
0x00010d7c bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n", r4)
0x00010d80 b 0x10d44 |
| } while (1);
| label_29:
0x00010d84 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00010d88 bl 0x1266c | r0 = fcn_0001266c (r0, r1);
0x00010d8c cmp r0, 1 |
| if (r0 != 1) {
0x00010d90 bne 0x10db0 | goto label_31;
| }
0x00010d94 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010d98 ldr r2, [pc, 0x5ac] | r2 = *(0x11348);
0x00010d9c ldr r1, [pc, 0x608] | r1 = "%*serror %d (%s)\n";
| label_9:
0x00010da0 ldr r0, [pc, 0x5ac] |
0x00010da4 ldr r0, [r0] | r0 = "_s:_error_:_bad_skip:___s_";
| do {
0x00010da8 bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "%*serror %d (%s)\n", r2, r3)
0x00010dac b 0x10d44 | goto label_6;
| label_31:
0x00010db0 cmp r0, 0 |
0x00010db4 ldr r6, [r4, 4] | r6 = *((r4 + 4));
| if (r0 >= 0) {
0x00010db8 bge 0x10df0 | goto label_32;
| }
0x00010dbc bl 0x10a34 | errno_location ();
0x00010dc0 ldr r7, [pc, 0x58c] | r7 = "_s:_error_:_bad_skip:___s_";
0x00010dc4 mov r3, r6 | r3 = r6;
0x00010dc8 ldr r2, [pc, 0x57c] | r2 = *(0x11348);
0x00010dcc ldr r4, [r0] | r4 = *(r0);
0x00010dd0 ldr r0, [r7] | r0 = "_s:_error_:_bad_skip:___s_";
0x00010dd4 cmp r4, 0x13 |
| if (r4 != 0x13) {
0x00010dd8 ldreq r1, [pc, 0x5d0] | r1 = "%s: error!: \"%s\" is not an UBI volume node\n";
| }
0x00010ddc beq 0x10da8 |
| } while (r4 == 0x13);
0x00010de0 ldr r1, [pc, 0x5cc] | r1 = "%s: error!: \"%s\" is not an UBI volume node\n";
0x00010de4 bl 0x1098c | fprintf (r0, "%s: error!: \"%s\" is not an UBI volume node\n")
0x00010de8 ldr r6, [r7] | r6 = *(r7);
0x00010dec b 0x10d5c | goto label_7;
| label_32:
0x00010df0 add r2, sp, 0x90 | r2 += var_90h;
0x00010df4 mov r1, r6 | r1 = r6;
0x00010df8 mov r0, sl | r0 = sl;
0x00010dfc bl 0x1345c | r0 = fcn_0001345c (r0, r1);
0x00010e00 cmp r0, 0 |
| if (r0 == 0) {
0x00010e04 beq 0x10e50 | goto label_33;
| }
0x00010e08 bl 0x10a34 | errno_location ();
0x00010e0c ldr r7, [pc, 0x540] | r7 = "_s:_error_:_bad_skip:___s_";
0x00010e10 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010e14 ldr r2, [pc, 0x530] | r2 = *(0x11348);
0x00010e18 ldr r1, [pc, 0x598] | r1 = "%s: error!: error while probing \"%s\"\n";
0x00010e1c ldr r6, [r0] | r6 = *(r0);
| do {
0x00010e20 ldr r0, [r7] | r0 = *(r7);
0x00010e24 bl 0x1098c | fprintf (r0, "%s: error!: error while probing \"%s\"\n", r2, r3, r4, r5, r6)
0x00010e28 mov r0, r6 | r0 = r6;
0x00010e2c ldr r4, [r7] | r4 = *(r7);
0x00010e30 bl 0x10908 | strerror (r0);
0x00010e34 str r6, [sp] | *(sp) = r6;
0x00010e38 ldr r3, [pc, 0x564] | r3 = "%s: error!: cannot open libubi\n";
0x00010e3c mov r2, 0xe | r2 = 0xe;
0x00010e40 ldr r1, [pc, 0x560] | r1 = *(0x113a4);
0x00010e44 str r0, [sp, 4] | var_4h = r0;
0x00010e48 mov r0, r4 | r0 = r4;
0x00010e4c b 0x10d7c | goto label_8;
| label_33:
0x00010e50 ldr r6, [r4] | r6 = *(r4);
0x00010e54 cmp r6, 0 |
| if (r6 == 0) {
0x00010e58 beq 0x10f18 | goto label_34;
| }
0x00010e5c mov r1, 2 | r1 = 2;
0x00010e60 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00010e64 bl 0x10a04 | r0 = open64 ();
0x00010e68 cmn r0, 1 |
0x00010e6c mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x00010e70 bne 0x10e90 | goto label_35;
| }
0x00010e74 bl 0x10a34 | errno_location ();
0x00010e78 ldr r7, [pc, 0x4d4] | r7 = "_s:_error_:_bad_skip:___s_";
0x00010e7c ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010e80 ldr r2, [pc, 0x4c4] | r2 = *(0x11348);
0x00010e84 ldr r1, [pc, 0x530] | r1 = "%s: error!: cannot get information about UBI volume \"%s\"\n";
0x00010e88 ldr r6, [r0] | r6 = *(r0);
0x00010e8c b 0x10e20 |
| } while (1);
| label_35:
0x00010e90 mov r1, r0 | r1 = r0;
0x00010e94 mov r2, 0 | r2 = 0;
0x00010e98 mov r3, 0 | r3 = 0;
0x00010e9c mov r0, sl | r0 = sl;
0x00010ea0 bl 0x12bfc | r0 = fcn_00012bfc (r0);
0x00010ea4 cmp r0, 0 |
| if (r0 != 0) {
0x00010ea8 beq 0x10f00 |
0x00010eac bl 0x10a34 | errno_location ();
0x00010eb0 ldr r8, [pc, 0x49c] | r8 = "_s:_error_:_bad_skip:___s_";
0x00010eb4 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010eb8 ldr r2, [pc, 0x48c] | r2 = *(0x11348);
0x00010ebc ldr r1, [pc, 0x4fc] | r1 = "%s: error!: cannot open \"%s\"\n";
0x00010ec0 ldr r7, [r0] | r7 = *(r0);
0x00010ec4 ldr r0, [r8] | r0 = "_s:_error_:_bad_skip:___s_";
0x00010ec8 bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "%s: error!: cannot open \"%s\"\n", r2, r3)
0x00010ecc mov r0, r7 | r0 = r7;
0x00010ed0 ldr r4, [r8] | r4 = "_s:_error_:_bad_skip:___s_";
0x00010ed4 bl 0x10908 | strerror (r0);
0x00010ed8 str r7, [sp] | *(sp) = r7;
0x00010edc ldr r3, [pc, 0x4c0] | r3 = "%s: error!: cannot open libubi\n";
0x00010ee0 mov r2, 0xe | r2 = 0xe;
0x00010ee4 ldr r1, [pc, 0x4bc] | r1 = *(0x113a4);
0x00010ee8 str r0, [sp, 4] | var_4h = r0;
0x00010eec mov r0, r4 | r0 = r4;
0x00010ef0 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n")
0x00010ef4 mov r0, r6 | r0 = r6;
0x00010ef8 bl 0x10a88 | close (r0);
0x00010efc b 0x10d44 | goto label_6;
| }
0x00010f00 mov r0, r6 | r0 = r6;
0x00010f04 bl 0x10a88 | close (r0);
| label_12:
0x00010f08 mov r0, sl | r0 = sl;
0x00010f0c bl 0x11dac | fcn_00011dac (r0);
0x00010f10 mov r5, 0 | r5 = 0;
0x00010f14 b 0x10b64 | goto label_4;
| label_34:
0x00010f18 ldr r8, [sp, 0xbc] | r8 = size;
0x00010f1c mov r0, r8 | r0 = r8;
0x00010f20 bl 0x10950 | r0 = malloc (r0);
0x00010f24 subs r3, r0, 0 | r3 = r0 - 0;
0x00010f28 str r3, [sp, 0x20] | ptr = r3;
| if (r3 != r0) {
0x00010f2c moveq r3, r8 | r3 = r8;
| }
| if (r3 != r0) {
0x00010f30 ldreq r2, [pc, 0x414] | r2 = "ubiupdatevol";
| }
| if (r3 == r0) {
0x00010f34 ldreq r1, [pc, 0x488] | r1 = "_s:_error_:_cannot_allocate__d_bytes_of_memory";
| goto label_36;
| }
| if (r3 == r0) {
| label_36:
0x00010f38 beq 0x10da0 | goto label_9;
| }
0x00010f3c ldr r8, [pc, 0x428] | r8 = *(0x11368);
0x00010f40 ldrd r2, r3, [r8] | __asm ("ldrd r2, r3, [r8]");
0x00010f44 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x00010f48 orrs r3, r2, r3 | r3 = r2 | r3;
| if (r3 != r2) {
0x00010f4c bne 0x10fa0 | goto label_37;
| }
0x00010f50 ldr sb, [r4, 8] | sb = *((r4 + 8));
0x00010f54 mov r1, r7 | r1 = r7;
0x00010f58 mov r0, sb | r0 = sb;
0x00010f5c bl 0x10914 | r0 = stat64 ();
0x00010f60 cmp r0, 0 |
| if (r0 >= 0) {
0x00010f64 bge 0x10f8c | goto label_38;
| }
0x00010f68 ldr r0, [pc, 0x3e4] |
0x00010f6c mov r3, sb | r3 = sb;
0x00010f70 ldr r2, [pc, 0x3d4] | r2 = *(0x11348);
0x00010f74 ldr r1, [pc, 0x44c] | r1 = "_s:_error_:_cannot_allocate__d_bytes_of_memory";
0x00010f78 ldr r0, [r0] | r0 = "_s:_error_:_bad_skip:___s_";
0x00010f7c bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "_s:_error_:_cannot_allocate__d_bytes_of_memory", r2, r3)
| do {
| label_10:
0x00010f80 ldr r0, [sp, 0x20] | r0 = ptr;
0x00010f84 bl 0x10a94 | free (r0);
0x00010f88 b 0x10d44 | goto label_6;
| label_38:
0x00010f8c ldrd r2, r3, [r7, 0x30] | __asm ("ldrd r2, r3, [var_30h]");
0x00010f90 ldrd r0, r1, [r8, 8] | __asm ("ldrd r0, r1, [r8, 8]");
0x00010f94 subs r2, r2, r0 | r2 -= r0;
0x00010f98 sbc r3, r3, r1 | __asm ("sbc r3, r3, r1");
0x00010f9c strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
| label_37:
0x00010fa0 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00010fa4 ldrd r2, r3, [sp, 0xb0] | __asm ("ldrd r2, r3, [var_b0h]");
0x00010fa8 ldrd r8, sb, [sp, 0x18] | __asm ("ldrd r8, sb, [var_18h]");
0x00010fac cmp r2, r8 |
0x00010fb0 sbcs r1, r3, sb | __asm ("sbcs r1, r3, sb");
| if (r2 >= r8) {
0x00010fb4 bge 0x10fe8 | goto label_39;
| }
0x00010fb8 str r0, [sp, 8] | var_8h = r0;
0x00010fbc ldr r0, [pc, 0x390] |
0x00010fc0 strd r2, r3, [sp, 0x10] | __asm ("strd r2, r3, [var_10h]");
0x00010fc4 ldr r1, [pc, 0x400] | r1 = "_s:_error_:_stat_failed_on___s_";
0x00010fc8 mov r2, r8 | r2 = r8;
0x00010fcc mov r3, sb | r3 = sb;
0x00010fd0 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00010fd4 ldr r2, [pc, 0x370] | r2 = *(0x11348);
0x00010fd8 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00010fdc ldr r0, [r0] | r0 = "_s:_error_:_bad_skip:___s_";
0x00010fe0 bl 0x1098c | fprintf (r0, "_s:_error_:_stat_failed_on___s_", r2, r3)
0x00010fe4 b 0x10f80 |
| } while (1);
| label_39:
0x00010fe8 mov r1, 2 | r1 = 2;
0x00010fec bl 0x10a04 | r0 = open64 ();
0x00010ff0 cmn r0, 1 |
0x00010ff4 mov r7, r0 | r7 = r0;
| if (r0 == 1) {
0x00010ff8 bne 0x11048 |
0x00010ffc bl 0x10a34 | errno_location ();
0x00011000 ldr r7, [pc, 0x34c] | r7 = "_s:_error_:_bad_skip:___s_";
0x00011004 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00011008 ldr r2, [pc, 0x33c] | r2 = *(0x11348);
0x0001100c ldr r1, [pc, 0x3bc] | r1 = "%s: error!: \"%s\" (size %lld) will not fit volume \"%s\" (size %lld)\n";
0x00011010 ldr r6, [r0] | r6 = *(r0);
0x00011014 ldr r0, [r7] | r0 = "_s:_error_:_bad_skip:___s_";
0x00011018 bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "%s: error!: \"%s\" (size %lld) will not fit volume \"%s\" (size %lld)\n", r2, r3, r4, r5, r6)
0x0001101c mov r0, r6 | r0 = r6;
0x00011020 ldr r4, [r7] | r4 = "_s:_error_:_bad_skip:___s_";
0x00011024 bl 0x10908 | strerror (r0);
0x00011028 str r6, [sp] | *(sp) = r6;
0x0001102c ldr r3, [pc, 0x370] | r3 = "%s: error!: cannot open libubi\n";
0x00011030 mov r2, 0xe | r2 = 0xe;
0x00011034 ldr r1, [pc, 0x36c] | r1 = *(0x113a4);
0x00011038 str r0, [sp, 4] | var_4h = r0;
0x0001103c mov r0, r4 | r0 = r4;
0x00011040 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n", r4, r5, r6)
0x00011044 b 0x10f80 | goto label_10;
| }
0x00011048 ldr r1, [r4, 0x120] | r1 = *((r4 + 0x120));
0x0001104c cmp r1, 0 |
| if (r1 == 0) {
0x00011050 beq 0x11084 | goto label_40;
| }
0x00011054 ldr r3, [pc, 0x2ec] | r3 = optarg;
0x00011058 ldrd r2, r3, [r3, -8] | __asm ("ldrd r2, r3, [r3, -8]");
0x0001105c orrs r3, r2, r3 | r3 = r2 | r3;
| if (r3 == r2) {
0x00011060 beq 0x11170 | goto label_41;
| }
0x00011064 ldr r3, [pc, 0x2e8] | r3 = "_s:_error_:_bad_skip:___s_";
0x00011068 ldr r2, [pc, 0x2dc] | r2 = *(0x11348);
0x0001106c ldr r1, [pc, 0x360] | r1 = "_s:_error_:_cannot_open_UBI_volume___s_";
0x00011070 ldr r0, [r3] | r0 = "_s:_error_:_bad_skip:___s_";
0x00011074 bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "_s:_error_:_cannot_open_UBI_volume___s_", r2, "_s:_error_:_bad_skip:___s_")
| do {
| label_11:
0x00011078 mov r0, r7 | r0 = r7;
0x0001107c bl 0x10a88 | close (r0);
0x00011080 b 0x10f80 | goto label_10;
| label_40:
0x00011084 ldr r0, [r4, 8] | r0 = *((r4 + 8));
0x00011088 bl 0x10a04 | r0 = open64 ();
0x0001108c cmn r0, 1 |
0x00011090 mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x00011094 bne 0x110e4 | goto label_42;
| }
0x00011098 bl 0x10a34 | errno_location ();
0x0001109c ldr r8, [pc, 0x2b0] | r8 = "_s:_error_:_bad_skip:___s_";
0x000110a0 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x000110a4 ldr r2, [pc, 0x2a0] | r2 = *(0x11348);
0x000110a8 ldr r1, [pc, 0x30c] | r1 = "%s: error!: cannot get information about UBI volume \"%s\"\n";
0x000110ac ldr r6, [r0] | r6 = *(r0);
0x000110b0 ldr r0, [r8] | r0 = "_s:_error_:_bad_skip:___s_";
0x000110b4 bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "%s: error!: cannot get information about UBI volume \"%s\"\n", r2, r3, r4, r5, r6)
0x000110b8 mov r0, r6 | r0 = r6;
0x000110bc ldr r4, [r8] | r4 = "_s:_error_:_bad_skip:___s_";
0x000110c0 bl 0x10908 | strerror (r0);
0x000110c4 str r6, [sp] | *(sp) = r6;
0x000110c8 ldr r3, [pc, 0x2d4] | r3 = "%s: error!: cannot open libubi\n";
0x000110cc mov r2, 0xe | r2 = 0xe;
0x000110d0 ldr r1, [pc, 0x2d0] | r1 = *(0x113a4);
0x000110d4 str r0, [sp, 4] | var_4h = r0;
0x000110d8 mov r0, r4 | r0 = r4;
0x000110dc bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n", r4, r5, r6)
0x000110e0 b 0x11078 |
| } while (1);
| label_42:
0x000110e4 ldr r3, [pc, 0x25c] | r3 = optarg;
0x000110e8 ldrd r8, sb, [r3, -8] | __asm ("ldrd r8, sb, [r3, -8]");
0x000110ec orrs r3, r8, sb | r3 = r8 | sb;
| if (r3 != r8) {
0x000110f0 beq 0x11170 |
0x000110f4 mov r3, 1 | r3 = 1;
0x000110f8 str r3, [sp] | *(sp) = r3;
0x000110fc mov r2, r8 | r2 = r8;
0x00011100 mov r3, sb | r3 = sb;
0x00011104 bl 0x10a58 | lseek64 ();
0x00011108 mvn r3, 0 | r3 = ~0;
0x0001110c mvn r2, 0 | r2 = ~0;
0x00011110 cmp r1, r3 |
0x00011114 cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| if (r1 != r3) {
0x00011118 bne 0x11170 | goto label_41;
| }
0x0001111c bl 0x10a34 | errno_location ();
0x00011120 ldr fp, [pc, 0x22c] | fp = obj.stderr;
0x00011124 ldr r2, [pc, 0x220] | r2 = *(0x11348);
0x00011128 ldr r1, [pc, 0x2a8] | r1 = "%s: error!: seeking stdin not supported\n";
0x0001112c ldr r4, [r0] | r4 = *(r0);
0x00011130 strd r8, sb, [sp] | __asm ("strd r8, sb, [sp]");
0x00011134 ldr r0, [fp] | r0 = *(fp);
0x00011138 bl 0x1098c | fprintf (r0, "%s: error!: seeking stdin not supported\n", r2, r3, r4)
0x0001113c mov r0, r4 | r0 = r4;
0x00011140 ldr r8, [fp] | r8 = *(fp);
0x00011144 bl 0x10908 | strerror (r0);
0x00011148 ldr r3, [pc, 0x254] | r3 = "%s: error!: cannot open libubi\n";
0x0001114c ldr r1, [pc, 0x254] | r1 = *(0x113a4);
0x00011150 mov r2, 0xe | r2 = 0xe;
0x00011154 str r4, [sp] | *(sp) = r4;
0x00011158 str r0, [sp, 4] | var_4h = r0;
0x0001115c mov r0, r8 | r0 = r8;
| label_13:
0x00011160 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n", r4)
| label_15:
0x00011164 mov r0, r6 | r0 = r6;
0x00011168 bl 0x10a88 | close (r0);
0x0001116c b 0x11078 | goto label_11;
| }
| label_41:
0x00011170 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00011174 mov r1, r7 | r1 = r7;
0x00011178 mov r0, sl | r0 = sl;
0x0001117c bl 0x12bfc | r0 = fcn_00012bfc (r0);
0x00011180 cmp r0, 0 |
| if (r0 == 0) {
0x00011184 beq 0x11218 | goto label_17;
| }
0x00011188 bl 0x10a34 | errno_location ();
0x0001118c ldr sb, [pc, 0x1c0] | sb = obj.stderr;
0x00011190 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00011194 ldr r2, [pc, 0x1b0] | r2 = *(0x11348);
0x00011198 ldr r1, [pc, 0x23c] | r1 = "_s:_error_:_lseek_input_by__lld_failed";
0x0001119c ldr r8, [r0] | r8 = *(r0);
0x000111a0 ldr r0, [sb] | r0 = *(sb);
0x000111a4 bl 0x1098c | fprintf (r0, "_s:_error_:_lseek_input_by__lld_failed", r2, r3)
0x000111a8 ldr r4, [sb] | r4 = *(sb);
| label_14:
0x000111ac mov r0, r8 | r0 = r8;
0x000111b0 bl 0x10908 | strerror (r0);
0x000111b4 str r8, [sp] | *(sp) = r8;
0x000111b8 str r0, [sp, 4] | var_4h = r0;
0x000111bc b 0x11270 | goto label_43;
| do {
0x000111c0 ldr r8, [sp, 0xbc] | r8 = size;
0x000111c4 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x000111c8 asr sb, r8, 0x1f | sb = r8 >> 0x1f;
0x000111cc cmp r2, r8 |
0x000111d0 sbcs r3, r3, sb | __asm ("sbcs r3, r3, sb");
0x000111d4 ldrdlt r8, sb, [sp, 0x18] | __asm ("ldrdlt r8, sb, [var_18h]");
0x000111d8 ldr r1, [sp, 0x20] | r1 = ptr;
0x000111dc mov r2, r8 | r2 = r8;
0x000111e0 mov r0, r6 | r0 = r6;
0x000111e4 bl 0x109a4 | r0 = read (r0, r1, r2);
0x000111e8 subs r3, r0, 0 | r3 = r0 - 0;
0x000111ec str r3, [sp, 0x24] | var_24h = r3;
| if (r3 > r0) {
0x000111f0 bgt 0x11284 | goto label_44;
| }
0x000111f4 bl 0x10a34 | errno_location ();
0x000111f8 ldr r3, [pc, 0x154] | r3 = "_s:_error_:_bad_skip:___s_";
0x000111fc ldr fp, [r0] | fp = *(r0);
0x00011200 ldr r0, [r3] | r0 = "_s:_error_:_bad_skip:___s_";
0x00011204 cmp fp, 4 |
| if (fp != 4) {
0x00011208 bne 0x11240 | goto label_45;
| }
0x0001120c ldr r2, [pc, 0x138] | r2 = *(0x11348);
0x00011210 ldr r1, [pc, 0x1c8] | r1 = "_s:_error_:_cannot_start_volume___s__update";
0x00011214 bl 0x1098c | fprintf (r0, "_s:_error_:_cannot_start_volume___s__update", r2)
| label_17:
0x00011218 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x0001121c orrs r3, r2, r3 | r3 = r2 | r3;
0x00011220 bne 0x111c0 |
| } while (r3 != r2);
0x00011224 mov r0, r6 | r0 = r6;
0x00011228 bl 0x10a88 | close (r0);
0x0001122c mov r0, r7 | r0 = r7;
0x00011230 bl 0x10a88 | close (r0);
0x00011234 ldr r0, [sp, 0x20] | r0 = ptr;
0x00011238 bl 0x10a94 | free (r0);
0x0001123c b 0x10f08 | goto label_12;
| label_45:
0x00011240 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00011244 ldr r2, [pc, 0x100] | r2 = *(0x11348);
0x00011248 str r3, [sp] | *(sp) = r3;
0x0001124c ldr r1, [pc, 0x190] | r1 = "%s: warning!: do not interrupt me!\n";
0x00011250 mov r3, r8 | r3 = r8;
0x00011254 bl 0x1098c | fprintf (r0, "%s: warning!: do not interrupt me!\n", r2, r3)
0x00011258 ldr r3, [pc, 0xf4] | r3 = "_s:_error_:_bad_skip:___s_";
0x0001125c mov r0, fp | r0 = fp;
0x00011260 ldr r4, [r3] | r4 = "_s:_error_:_bad_skip:___s_";
0x00011264 bl 0x10908 | strerror (r0);
0x00011268 str fp, [sp] | *(sp) = fp;
0x0001126c str r0, [sp, 4] | var_4h = r0;
| label_43:
0x00011270 ldr r3, [pc, 0x12c] | r3 = "%s: error!: cannot open libubi\n";
0x00011274 mov r2, 0xe | r2 = 0xe;
0x00011278 ldr r1, [pc, 0x128] | r1 = *(0x113a4);
0x0001127c mov r0, r4 | r0 = r4;
0x00011280 b 0x11160 | goto label_13;
| label_44:
0x00011284 ldr sb, [sp, 0x20] | sb = ptr;
0x00011288 ldr fp, [sp, 0x24] | fp = var_24h;
| do {
| label_16:
0x0001128c mov r2, fp | r2 = fp;
0x00011290 mov r1, sb | r1 = sb;
0x00011294 mov r0, r7 | r0 = r7;
0x00011298 bl 0x10980 | r0 = write (r0, r1, r2);
0x0001129c cmp r0, 0 |
| if (r0 >= 0) {
0x000112a0 bge 0x112f0 | goto label_46;
| }
0x000112a4 bl 0x10a34 | errno_location ();
0x000112a8 ldr r3, [pc, 0xa4] | r3 = "_s:_error_:_bad_skip:___s_";
0x000112ac ldr r8, [r0] | r8 = *(r0);
0x000112b0 ldr r0, [r3] | r0 = "_s:_error_:_bad_skip:___s_";
0x000112b4 cmp r8, 4 |
| if (r8 != 4) {
0x000112b8 bne 0x112cc | goto label_47;
| }
0x000112bc ldr r2, [pc, 0x88] | r2 = *(0x11348);
0x000112c0 ldr r1, [pc, 0x118] | r1 = "_s:_error_:_cannot_start_volume___s__update";
0x000112c4 bl 0x1098c | fprintf (r0, "_s:_error_:_cannot_start_volume___s__update", r2)
0x000112c8 b 0x1128c |
| } while (1);
| label_47:
0x000112cc ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x000112d0 mov r3, fp | r3 = fp;
0x000112d4 str r2, [sp] | *(sp) = r2;
0x000112d8 ldr r1, [pc, 0x108] | r1 = "%s: error!: cannot read %d bytes from \"%s\"\n";
0x000112dc ldr r2, [pc, 0x68] | r2 = *(0x11348);
0x000112e0 bl 0x1098c | fprintf (r0, "%s: error!: cannot read %d bytes from \"%s\"\n", r2, r3)
0x000112e4 ldr r3, [pc, 0x68] | r3 = "_s:_error_:_bad_skip:___s_";
0x000112e8 ldr r4, [r3] | r4 = "_s:_error_:_bad_skip:___s_";
0x000112ec b 0x111ac | goto label_14;
| if (r8 == 4) {
| label_46:
0x000112f0 bne 0x11318 |
0x000112f4 ldr r2, [r4, 4] | r2 = *((r4 + 4));
0x000112f8 ldr r0, [pc, 0x54] |
0x000112fc str r2, [sp] | *(sp) = r2;
0x00011300 mov r3, fp | r3 = fp;
0x00011304 ldr r2, [pc, 0x40] | r2 = *(0x11348);
0x00011308 ldr r1, [pc, 0xd8] | r1 = "%s: error!: cannot read %d bytes from \"%s\"\n";
0x0001130c ldr r0, [r0] | r0 = "_s:_error_:_bad_skip:___s_";
0x00011310 bl 0x1098c | fprintf ("_s:_error_:_bad_skip:___s_", "%s: error!: cannot read %d bytes from \"%s\"\n", r2, r3)
0x00011314 b 0x11164 | goto label_15;
| }
0x00011318 subs fp, fp, r0 |
0x0001131c add sb, sb, r0 | sb += r0;
| if (fp != fp) {
0x00011320 bne 0x1128c | goto label_16;
| }
0x00011324 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00011328 ldr r1, [sp, 0x24] | r1 = var_24h;
0x0001132c subs r2, r2, r1 | r2 -= r1;
0x00011330 sbc r3, r3, r1, asr 31 | __asm ("sbc r3, r3, r1, asr 31");
0x00011334 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x00011338 b 0x11218 | goto label_17;
| }
[*] Function fprintf used 73 times ubiupdatevol