[*] Binary protection state of flash_erase
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of flash_erase
; 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/flash_erase @ 0x10bc8 */
| #include <stdint.h>
|
; (fcn) fcn.00010bc8 () | void fcn_00010bc8 () {
| int32_t var_0h_2;
| int32_t var_140h;
| int32_t var_0h;
| int32_t var_4h;
| /* [10] -r-x section size 16164 named .text */
0x00010bc8 push {r0, r1, r2, lr} |
0x00010bcc bl 0x10b5c | errno_location ();
0x00010bd0 ldr r5, [pc, 0x40] |
0x00010bd4 ldr r2, [pc, 0x40] | r2 = stderr;
0x00010bd8 ldr r1, [pc, 0x40] | r1 = "libmtd";
0x00010bdc ldr r4, [r0] | r4 = *(r0);
0x00010be0 ldr r0, [r5] | r0 = *(0x10c14);
0x00010be4 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x00010be8 mov r0, r4 | r0 = r4;
0x00010bec ldr r5, [r5] | r5 = *(0x10c14);
0x00010bf0 bl 0x10a0c | strerror (r0);
0x00010bf4 str r4, [sp] | *(sp) = r4;
0x00010bf8 ldr r3, [pc, 0x24] | r3 = "%s: error!: out of memory\n";
0x00010bfc mov r2, 8 | r2 = 8;
0x00010c00 ldr r1, [pc, 0x20] | r1 = *(0x10c24);
0x00010c04 str r0, [sp, 4] | var_4h = r0;
0x00010c08 mov r0, r5 | r0 = r5;
0x00010c0c bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x00010c10 mvn r0, 0 | r0 = ~0;
0x00010c14 bl 0x10b68 | exit (r0);
| if (? != ?) {
0x00010c18 andeq r7, r2, r4, asr 1 | r7 = r2 & (r4 >> 1);
| }
| if (? != ?) {
0x00010c1c andeq r5, r1, sl, lsl 3 | r5 = r1 & (sl << 3);
| }
| if (? != ?) {
0x00010c20 andeq r5, r1, sb, lsl r5 | r5 = r1 & (sb << r5);
| }
0x00010c24 ldrdeq r5, r6, [r1], -r3 | __asm ("ldrdeq r5, r6, [r1], -r3");
| /* Beware that this jump is a conditional jump.
| * r2dec transformed it as a return, due being the
| * last instruction. Please, check 'pdda' output
| * for more hints. */
0x00010c28 muleq r1, pc, pc | return r1 = pc * 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/flash_erase @ 0x11564 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00011564 () | void fcn_00011564 (char * s) {
| int32_t var_120h;
| int32_t var_11ch;
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_18h_2;
| int32_t var_18h;
| r0 = s;
0x00011564 push {r4, r5, r6, r7, r8, fp, lr} |
0x00011568 add fp, sp, 0x18 |
0x0001156c sub sp, sp, 0x114 |
0x00011570 mov r5, r0 | r5 = r0;
0x00011574 ldr r0, [r0, 0xc] | r0 = *((r0 + 0xc));
0x00011578 bl 0x10b74 | r0 = strlen (r0);
0x0001157c add r0, r0, 0x11 | r0 += 0x11;
0x00011580 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00011584 sub sp, sp, r0 |
0x00011588 ldr r0, [r5] | r0 = *(r5);
0x0001158c bl 0x10b2c | r0 = opendir ();
0x00011590 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00011594 addne r7, sp, 8 | r7 += var_8h;
| }
| if (r4 == r0) {
0x00011598 ldrne r8, [pc, 0x1a0] | r8 = "mtd_d_s";
| }
| if (r4 != r0) {
0x0001159c bne 0x115f8 | goto label_3;
| }
0x000115a0 bl 0x10b5c | r0 = errno_location ();
0x000115a4 ldr r6, [r0] | r6 = *(r0);
0x000115a8 cmp r6, 2 |
| if (r6 != 2) {
0x000115ac streq r4, [r0] | *(r0) = r4;
| }
| if (r6 == 2) {
0x000115b0 beq 0x11650 | goto label_1;
| }
0x000115b4 ldr r4, [pc, 0x188] |
0x000115b8 ldr r3, [r5] | r3 = *(r5);
0x000115bc ldr r2, [pc, 0x184] | r2 = stderr;
0x000115c0 ldr r1, [pc, 0x184] | r1 = "libmtd";
0x000115c4 ldr r0, [r4] | r0 = "mtd_d_s";
0x000115c8 bl 0x10aa8 | fprintf ("mtd_d_s", "libmtd", r2, r3, "mtd_d_s")
0x000115cc mov r0, r6 | r0 = r6;
0x000115d0 ldr r4, [r4] | r4 = "mtd_d_s";
0x000115d4 bl 0x10a0c | strerror (r0);
0x000115d8 ldr r3, [pc, 0x170] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000115dc ldr r1, [pc, 0x170] | r1 = *(0x11750);
0x000115e0 mov r2, 8 | r2 = 8;
0x000115e4 str r6, [sp] | *(sp) = r6;
0x000115e8 str r0, [sp, 4] | var_4h = r0;
0x000115ec mov r0, r4 | r0 = r4;
| label_0:
0x000115f0 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5, r6)
0x000115f4 b 0x1164c |
| while (r0 != 1) {
| label_3:
0x000115f8 mov r0, r4 | r0 = r4;
0x000115fc bl 0x10ad8 | r0 = readdir64 ();
0x00011600 cmp r0, 0 |
| if (r0 == 0) {
0x00011604 beq 0x116d4 | goto label_4;
| }
0x00011608 add r6, r0, 0x13 | r6 = r0 + 0x13;
0x0001160c mov r0, r6 | r0 = r6;
0x00011610 bl 0x10b74 | r0 = strlen (r0);
0x00011614 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00011618 bls 0x1165c |
0x0001161c ldr r0, [pc, 0x120] |
0x00011620 str r6, [sp] | *(sp) = r6;
0x00011624 ldr r2, [pc, 0x11c] | r2 = stderr;
0x00011628 ldr r3, [r5] | r3 = *(r5);
0x0001162c ldr r1, [pc, 0x124] | r1 = "%*serror %d (%s)\n";
0x00011630 ldr r0, [r0] | r0 = "mtd_d_s";
0x00011634 bl 0x10aa8 | r0 = fprintf ("mtd_d_s", "%*serror %d (%s)\n", r2, r3, r4, r5, r6)
0x00011638 bl 0x10b5c | errno_location ();
0x0001163c mov r3, 0x16 | r3 = 0x16;
0x00011640 str r3, [r0] | *(r0) = r3;
0x00011644 mov r0, r4 | r0 = r4;
0x00011648 bl 0x10b8c | closedir ();
0x0001164c mvn r4, 0 | r4 = ~0;
| label_1:
0x00011650 mov r0, r4 | r0 = r4;
0x00011654 sub sp, fp, 0x18 |
0x00011658 pop {r4, r5, r6, r7, r8, fp, pc} |
| }
0x0001165c sub r3, fp, 0x11c | r3 -= var_11ch;
0x00011660 sub r2, fp, 0x120 | r2 -= var_120h;
0x00011664 mov r1, r8 | r1 = r8;
0x00011668 mov r0, r6 | r0 = r6;
0x0001166c bl 0x10af0 | r0 = sscanf (r0, r1, r2);
0x00011670 cmp r0, 1 |
0x00011674 bne 0x115f8 |
| }
0x00011678 ldr r6, [fp, -0x120] | r6 = var_120h;
| do {
0x0001167c mov r0, r4 | r0 = r4;
0x00011680 bl 0x10b8c | r0 = closedir ();
0x00011684 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00011688 beq 0x116dc | goto label_5;
| }
0x0001168c bl 0x10b5c | errno_location ();
0x00011690 ldr r6, [pc, 0xac] | r6 = "mtd_d_s";
0x00011694 ldr r3, [r5] | r3 = *(r5);
0x00011698 ldr r2, [pc, 0xa8] | r2 = stderr;
0x0001169c ldr r1, [pc, 0xb8] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x000116a0 ldr r4, [r0] | r4 = *(r0);
0x000116a4 ldr r0, [r6] | r0 = "mtd_d_s";
0x000116a8 bl 0x10aa8 | fprintf ("mtd_d_s", "%s: error!: invalid entry in %s: \"%s\"\n", r2, r3, r4, r5, "mtd_d_s")
0x000116ac ldr r5, [r6] | r5 = "mtd_d_s";
| label_2:
0x000116b0 mov r0, r4 | r0 = r4;
0x000116b4 bl 0x10a0c | strerror (r0);
0x000116b8 str r4, [sp] | *(sp) = r4;
0x000116bc ldr r3, [pc, 0x8c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000116c0 mov r2, 8 | r2 = 8;
0x000116c4 ldr r1, [pc, 0x88] | r1 = *(0x11750);
0x000116c8 str r0, [sp, 4] | var_4h = r0;
0x000116cc mov r0, r5 | r0 = r5;
0x000116d0 b 0x115f0 | goto label_0;
| label_4:
0x000116d4 mvn r6, 0 | r6 = ~0;
0x000116d8 b 0x1167c |
| } while (1);
| label_5:
0x000116dc cmn r6, 1 |
| if (r6 == 1) {
0x000116e0 beq 0x11650 | goto label_1;
| }
0x000116e4 mov r2, r6 | r2 = r6;
0x000116e8 ldr r1, [r5, 0xc] | r1 = *((r5 + 0xc));
0x000116ec mov r0, r7 | r0 = r7;
0x000116f0 bl 0x10b44 | sprintf (r0, r1, r2);
0x000116f4 mov r1, 0x80000 | r1 = 0x80000;
0x000116f8 mov r0, r7 | r0 = r7;
0x000116fc bl 0x10b20 | r0 = open64 ();
0x00011700 cmn r0, 1 |
| if (r0 == 1) {
0x00011704 beq 0x11650 | goto label_1;
| }
0x00011708 bl 0x10ba4 | r0 = close (r0);
0x0001170c cmp r0, 0 |
| if (r0 == 0) {
0x00011710 moveq r4, 1 | r4 = 1;
| goto label_6;
| }
| if (r0 == 0) {
| label_6:
0x00011714 beq 0x11650 | goto label_1;
| }
0x00011718 bl 0x10b5c | errno_location ();
0x0001171c ldr r5, [pc, 0x20] |
0x00011720 mov r3, r7 | r3 = r7;
0x00011724 ldr r2, [pc, 0x1c] | r2 = stderr;
0x00011728 ldr r1, [pc, 0x30] | r1 = "_s:_error_:_closedir_failed_on___s_";
0x0001172c ldr r4, [r0] | r4 = *(r0);
0x00011730 ldr r0, [r5] | r0 = "mtd_d_s";
0x00011734 bl 0x10aa8 | fprintf ("mtd_d_s", "_s:_error_:_closedir_failed_on___s_", r2, r3, r4, "mtd_d_s")
0x00011738 ldr r5, [r5] | r5 = "mtd_d_s";
0x0001173c b 0x116b0 | goto label_2;
| }
; 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/flash_erase @ 0x11764 */
| #include <stdint.h>
|
; (fcn) fcn.00011764 () | void fcn_00011764 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| void * buf;
| int32_t var_10h;
| r0 = arg1;
| r1 = arg2;
0x00011764 push {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr} |
0x00011768 mov r8, r1 | r8 = r1;
0x0001176c mov r1, 0x80000 | r1 = 0x80000;
0x00011770 mov r5, r0 | r5 = r0;
0x00011774 mov r7, r2 | r7 = r2;
0x00011778 bl 0x10b20 | r0 = open64 ();
0x0001177c cmn r0, 1 |
0x00011780 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00011784 beq 0x118cc | goto label_2;
| }
0x00011788 mov r2, r7 | r2 = r7;
0x0001178c mov r1, r8 | r1 = r8;
0x00011790 bl 0x10acc | r0 = read (r0, r1, r2);
0x00011794 cmn r0, 1 |
0x00011798 mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x0001179c bne 0x117f4 | goto label_3;
| }
| label_0:
0x000117a0 bl 0x10b5c | errno_location ();
0x000117a4 ldr r7, [pc, 0x12c] | r7 = *(0x118d4);
0x000117a8 mov r3, r5 | r3 = r5;
0x000117ac ldr r2, [pc, 0x128] | r2 = stderr;
0x000117b0 ldr r1, [pc, 0x128] | r1 = "libmtd";
0x000117b4 ldr r6, [r0] | r6 = *(r0);
0x000117b8 ldr r0, [r7] | r0 = *(0x118d4);
0x000117bc bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x000117c0 mov r0, r6 | r0 = r6;
0x000117c4 ldr r5, [r7] | r5 = *(0x118d4);
0x000117c8 bl 0x10a0c | strerror (r0);
0x000117cc str r6, [sp] | *(sp) = r6;
0x000117d0 ldr r3, [pc, 0x10c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000117d4 mov r2, 8 | r2 = 8;
0x000117d8 ldr r1, [pc, 0x108] | r1 = *(0x118e4);
0x000117dc str r0, [sp, 4] | var_4h = r0;
0x000117e0 mov r0, r5 | r0 = r5;
0x000117e4 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x000117e8 mov r0, r4 | r0 = r4;
0x000117ec bl 0x10ba4 | close (r0);
0x000117f0 b 0x118c8 | goto label_4;
| label_3:
0x000117f4 cmp r7, r0 |
| if (r7 != r0) {
0x000117f8 bne 0x11824 | goto label_5;
| }
0x000117fc ldr r0, [pc, 0xd4] |
0x00011800 mov r3, r5 | r3 = r5;
0x00011804 ldr r2, [pc, 0xd0] | r2 = stderr;
0x00011808 ldr r1, [pc, 0xdc] | r1 = "%*serror %d (%s)\n";
0x0001180c ldr r0, [r0] | r0 = *(0x118d4);
0x00011810 bl 0x10aa8 | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x00011814 bl 0x10b5c | errno_location ();
0x00011818 mov r3, 0x16 | r3 = 0x16;
0x0001181c str r3, [r0] | *(r0) = r3;
0x00011820 b 0x117e8 |
| } while (1);
| label_5:
0x00011824 mov r3, 0 | r3 = 0;
0x00011828 strb r3, [r8, r0] | *((r8 + r0)) = r3;
0x0001182c mov r2, 1 | r2 = 1;
0x00011830 add r1, sp, 0xc | r1 += buf;
0x00011834 mov r0, r4 | r0 = r4;
0x00011838 bl 0x10acc | r0 = read (r0, r1, r2);
0x0001183c cmp r0, 1 |
| if (r0 == 1) {
0x00011840 beq 0x117a0 | goto label_0;
| }
0x00011844 cmp r0, 0 |
| if (r0 != 0) {
0x00011848 beq 0x1186c |
0x0001184c ldr r0, [pc, 0x84] |
0x00011850 str r7, [sp] | *(sp) = r7;
0x00011854 mov r3, r5 | r3 = r5;
0x00011858 ldr r2, [pc, 0x7c] | r2 = stderr;
0x0001185c ldr r1, [pc, 0x8c] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x00011860 ldr r0, [r0] | r0 = *(0x118d4);
0x00011864 bl 0x10aa8 | fprintf (r0, "%s: error!: contents of \"%s\" is too long\n", r2, r3)
0x00011868 b 0x11814 | goto label_1;
| }
0x0001186c mov r0, r4 | r0 = r4;
0x00011870 bl 0x10ba4 | r0 = close (r0);
0x00011874 cmp r0, 0 |
| if (r0 != 0) {
0x00011878 moveq r4, r6 | r4 = r6;
| }
| if (r0 != 0) {
0x0001187c beq 0x118cc |
0x00011880 bl 0x10b5c | errno_location ();
0x00011884 ldr r6, [pc, 0x4c] | r6 = *(0x118d4);
0x00011888 mov r3, r5 | r3 = r5;
0x0001188c ldr r2, [pc, 0x48] | r2 = stderr;
0x00011890 ldr r1, [pc, 0x5c] | r1 = "%s: error!: file \"%s\" contains too much data (> %d bytes)\n";
0x00011894 ldr r4, [r0] | r4 = *(r0);
0x00011898 ldr r0, [r6] | r0 = *(0x118d4);
0x0001189c bl 0x10aa8 | fprintf (r0, "%s: error!: file \"%s\" contains too much data (> %d bytes)\n", r2, r3, r4, r5, r6)
0x000118a0 mov r0, r4 | r0 = r4;
0x000118a4 ldr r5, [r6] | r5 = *(0x118d4);
0x000118a8 bl 0x10a0c | strerror (r0);
0x000118ac str r4, [sp] | *(sp) = r4;
0x000118b0 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000118b4 mov r2, 8 | r2 = 8;
0x000118b8 ldr r1, [pc, 0x28] | r1 = *(0x118e4);
0x000118bc str r0, [sp, 4] | var_4h = r0;
0x000118c0 mov r0, r5 | r0 = r5;
0x000118c4 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x000118c8 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x000118cc mov r0, r4 | r0 = r4;
0x000118d0 add sp, sp, 0x10 |
0x000118d4 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/flash_erase @ 0x118f8 */
| #include <stdint.h>
|
; (fcn) fcn.000118f8 () | void fcn_000118f8 (int32_t arg1, char * arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| char * buf;
| int32_t var_4ch;
| r0 = arg1;
| r1 = arg2;
0x000118f8 push {r4, r5, r6, r7, lr} |
0x000118fc sub sp, sp, 0x4c |
0x00011900 mov r5, r0 | r5 = r0;
0x00011904 mov r2, 0x32 | r2 = 0x32;
0x00011908 mov r6, r1 | r6 = r1;
0x0001190c add r0, sp, 0x14 | r0 += buf;
0x00011910 mov r1, 0 | r1 = 0;
0x00011914 bl 0x10b14 | memset (r0, r1, r2);
0x00011918 mov r1, 0x80000 | r1 = 0x80000;
0x0001191c mov r0, r5 | r0 = r5;
0x00011920 bl 0x10b20 | r0 = open64 ();
0x00011924 cmn r0, 1 |
0x00011928 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x0001192c beq 0x11a78 | goto label_2;
| }
0x00011930 mov r2, 0x32 | r2 = 0x32;
0x00011934 add r1, sp, 0x14 | r1 += buf;
0x00011938 bl 0x10acc | r0 = read (r0, r1, r2);
0x0001193c cmn r0, 1 |
| if (r0 != 1) {
0x00011940 bne 0x11998 | goto label_3;
| }
0x00011944 bl 0x10b5c | errno_location ();
0x00011948 ldr r7, [pc, 0x134] | r7 = *(0x11a80);
0x0001194c mov r3, r5 | r3 = r5;
0x00011950 ldr r2, [pc, 0x130] | r2 = stderr;
0x00011954 ldr r1, [pc, 0x130] | r1 = "libmtd";
0x00011958 ldr r6, [r0] | r6 = *(r0);
0x0001195c ldr r0, [r7] | r0 = *(0x11a80);
0x00011960 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00011964 mov r0, r6 | r0 = r6;
0x00011968 ldr r5, [r7] | r5 = *(0x11a80);
0x0001196c bl 0x10a0c | strerror (r0);
0x00011970 str r6, [sp] | *(sp) = r6;
0x00011974 ldr r3, [pc, 0x114] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00011978 mov r2, 8 | r2 = 8;
0x0001197c ldr r1, [pc, 0x110] | r1 = *(0x11a90);
0x00011980 str r0, [sp, 4] | var_4h = r0;
0x00011984 mov r0, r5 | r0 = r5;
0x00011988 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x0001198c mov r0, r4 | r0 = r4;
0x00011990 bl 0x10ba4 | close (r0);
0x00011994 b 0x11a74 | goto label_4;
| label_3:
0x00011998 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x0001199c bne 0x119c8 | goto label_5;
| }
0x000119a0 ldr r2, [pc, 0xe0] | r2 = stderr;
0x000119a4 ldr r1, [pc, 0xec] | r1 = "%*serror %d (%s)\n";
0x000119a8 mov r3, r5 | r3 = r5;
| label_0:
0x000119ac ldr r0, [pc, 0xd0] |
0x000119b0 ldr r0, [r0] | r0 = *(0x11a80);
0x000119b4 bl 0x10aa8 | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x000119b8 bl 0x10b5c | errno_location ();
0x000119bc mov r3, 0x16 | r3 = 0x16;
0x000119c0 str r3, [r0] | *(r0) = r3;
0x000119c4 b 0x1198c |
| } while (1);
| label_5:
0x000119c8 mov r2, r6 | r2 = r6;
0x000119cc ldr r1, [pc, 0xc8] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x000119d0 add r0, sp, 0x14 | r0 += buf;
0x000119d4 bl 0x10af0 | r0 = sscanf (r0, "%s: error!: contents of \"%s\" is too long\n", r2);
0x000119d8 cmp r0, 1 |
| if (r0 == 1) {
0x000119dc movne r3, r5 | r3 = r5;
| }
| if (r0 == 1) {
0x000119e0 ldrne r2, [pc, 0xa0] | r2 = "libmtd";
| }
| if (r0 != 1) {
0x000119e4 ldrne r1, [pc, 0xb4] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
| goto label_6;
| }
| if (r0 != 1) {
| label_6:
0x000119e8 bne 0x119ac | goto label_0;
| }
0x000119ec ldrd r2, r3, [r6] | __asm ("ldrd r2, r3, [r6]");
0x000119f0 cmp r2, 0 |
0x000119f4 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x000119f8 bge 0x11a1c |
0x000119fc strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011a00 ldr r3, [pc, 0x7c] | r3 = *(0x11a80);
0x00011a04 str r5, [sp, 8] | var_8h = r5;
0x00011a08 ldr r2, [pc, 0x78] | r2 = stderr;
0x00011a0c ldr r1, [pc, 0x90] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
0x00011a10 ldr r0, [r3] | r0 = *(0x11a80);
0x00011a14 bl 0x10aa8 | fprintf (r0, "_s:_error_:_cannot_read_integer_from___s_", r2, r3, r4, r5)
0x00011a18 b 0x119b8 | goto label_1;
| }
0x00011a1c mov r0, r4 | r0 = r4;
0x00011a20 bl 0x10ba4 | r0 = close (r0);
0x00011a24 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00011a28 beq 0x11a78 |
0x00011a2c bl 0x10b5c | errno_location ();
0x00011a30 ldr r6, [pc, 0x4c] | r6 = *(0x11a80);
0x00011a34 mov r3, r5 | r3 = r5;
0x00011a38 ldr r2, [pc, 0x48] | r2 = stderr;
0x00011a3c ldr r1, [pc, 0x64] | r1 = "_s:_error_:_negative_value__lld_in___s_";
0x00011a40 ldr r4, [r0] | r4 = *(r0);
0x00011a44 ldr r0, [r6] | r0 = *(0x11a80);
0x00011a48 bl 0x10aa8 | fprintf (r0, "_s:_error_:_negative_value__lld_in___s_", r2, r3, r4, r5, r6)
0x00011a4c mov r0, r4 | r0 = r4;
0x00011a50 ldr r5, [r6] | r5 = *(0x11a80);
0x00011a54 bl 0x10a0c | strerror (r0);
0x00011a58 str r4, [sp] | *(sp) = r4;
0x00011a5c ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00011a60 mov r2, 8 | r2 = 8;
0x00011a64 ldr r1, [pc, 0x28] | r1 = *(0x11a90);
0x00011a68 str r0, [sp, 4] | var_4h = r0;
0x00011a6c mov r0, r5 | r0 = r5;
0x00011a70 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x00011a74 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00011a78 mov r0, r4 | r0 = r4;
0x00011a7c add sp, sp, 0x4c |
0x00011a80 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/flash_erase @ 0x11aac */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00011aac () | void fcn_00011aac (int32_t arg1, int32_t arg2) {
| int32_t var_8h;
| char * s;
| int32_t var_1ch;
| int32_t var_14h_2;
| int32_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x00011aac push {r4, r5, r6, r7, fp, lr} |
0x00011ab0 add fp, sp, 0x14 |
0x00011ab4 sub sp, sp, 0x18 |
0x00011ab8 mov r7, r1 | r7 = r1;
0x00011abc mov r6, r0 | r6 = r0;
0x00011ac0 mov r5, r2 | r5 = r2;
0x00011ac4 bl 0x10b74 | strlen (r0);
0x00011ac8 mov r2, r7 | r2 = r7;
0x00011acc mov r1, r6 | r1 = r6;
0x00011ad0 add r0, r0, 0x39 | r0 += 0x39;
0x00011ad4 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00011ad8 sub sp, sp, r0 |
0x00011adc add r4, sp, 0x10 | r4 += s;
0x00011ae0 mov r0, r4 | r0 = r4;
0x00011ae4 bl 0x10b44 | sprintf (r0, r1, r2);
0x00011ae8 sub r1, fp, 0x1c | r1 -= s;
0x00011aec mov r0, r4 | r0 = r4;
0x00011af0 bl 0x118f8 | r0 = fcn_000118f8 (r0, r1);
0x00011af4 cmp r0, 0 |
| if (r0 == 0) {
0x00011af8 bne 0x11b38 |
0x00011afc ldrd r2, r3, [fp, -0x1c] | __asm ("ldrd r2, r3, [s]");
0x00011b00 cmp r2, 0x80000000 |
0x00011b04 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 >= 0x80000000) {
0x00011b08 strlt r2, [r5] | *(r5) = r2;
| }
| if (r2 < 0x80000000) {
0x00011b0c blt 0x11b3c | goto label_0;
| }
0x00011b10 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011b14 ldr r3, [pc, 0x28] | r3 = *(0x11b40);
0x00011b18 str r4, [sp, 8] | var_8h = r4;
0x00011b1c ldr r2, [pc, 0x24] | r2 = stderr;
0x00011b20 ldr r0, [r3] | r0 = *(0x11b40);
0x00011b24 ldr r1, [pc, 0x20] | r1 = "libmtd";
0x00011b28 bl 0x10aa8 | r0 = fprintf (r0, "libmtd", r2, r3, r4)
0x00011b2c bl 0x10b5c | errno_location ();
0x00011b30 mov r3, 0x16 | r3 = 0x16;
0x00011b34 str r3, [r0] | *(r0) = r3;
| }
0x00011b38 mvn r0, 0 | r0 = ~0;
| label_0:
0x00011b3c sub sp, fp, 0x14 |
0x00011b40 pop {r4, r5, r6, r7, 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/flash_erase @ 0x11b50 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00011b50 () | void fcn_00011b50 (int32_t arg_78h, int32_t arg_80h, int32_t arg_84h, int32_t arg_88h, uint32_t request, uint32_t arg_90h, int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_24h;
| int32_t var_2ch;
| int32_t var_30h;
| int32_t var_34h;
| void * s;
| int32_t var_38h_2;
| int32_t var_44h;
| int32_t var_48h;
| int32_t var_4ch;
| int32_t var_54h;
| r0 = arg1;
| r1 = arg2;
0x00011b50 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00011b54 ldr r8, [pc, 0x2d0] | r8 = *(0x11e28);
0x00011b58 sub sp, sp, 0x54 |
0x00011b5c mov r4, r1 | r4 = r1;
0x00011b60 mov r5, r0 | r5 = r0;
0x00011b64 mov r1, 0 | r1 = 0;
0x00011b68 mov sb, r2 | sb = r2;
0x00011b6c add r0, sp, 0x38 | r0 += s;
0x00011b70 mov r2, 0x18 | r2 = 0x18;
0x00011b74 ldrd sl, fp, [sp, 0x78] | __asm ("ldrd sl, fp, [arg_78h]");
0x00011b78 bl 0x10b14 | memset (r0, r1, r2);
0x00011b7c mov r3, 0 | r3 = 0;
0x00011b80 ldr r2, [sp, 0x8c] | r2 = *(request);
0x00011b84 str r3, [sp, 0x2c] | var_2ch = r3;
0x00011b88 str r3, [sp, 0x30] | var_30h = r3;
0x00011b8c str r3, [sp, 0x34] | var_34h = r3;
0x00011b90 ldr r3, [pc, 0x298] | r3 = "MEMREADOOB64";
0x00011b94 cmp r2, r3 |
0x00011b98 ldr r2, [pc, 0x294] | r2 = *(0x11e30);
0x00011b9c ldr r3, [pc, 0x294] | r3 = "MEMREADOOB";
| if (r2 != r3) {
0x00011ba0 moveq r3, r2 | r3 = r2;
| }
0x00011ba4 str r3, [sp, 0x24] | var_24h = r3;
0x00011ba8 ldr r3, [pc, 0x28c] | r3 = "MEMWRITEOOB";
0x00011bac ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
| if (r2 == r3) {
0x00011bb0 movne r8, r3 | r8 = r3;
| }
0x00011bb4 ldr r3, [r4, 0xe0] | r3 = *((r4 + 0xe0));
0x00011bb8 smull r0, r1, r3, r2 | r0:r1 = r3 * r2;
0x00011bbc cmp r1, fp |
0x00011bc0 cmpeq r0, sl | __asm ("cmpeq r0, sl");
| if (r1 > fp) {
0x00011bc4 bhi 0x11c0c | goto label_2;
| }
0x00011bc8 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x00011bcc ldr r2, [pc, 0x26c] | r2 = "MEMWRITEOOB64";
0x00011bd0 str r3, [sp, 0xc] | var_ch = r3;
0x00011bd4 ldr r3, [r4] | r3 = *(r4);
0x00011bd8 ldr r1, [pc, 0x264] | r1 = "libmtd";
0x00011bdc str r3, [sp, 8] | var_8h = r3;
0x00011be0 ldr r3, [pc, 0x260] | r3 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011be4 strd sl, fp, [sp] | __asm ("strd sl, fp, [sp]");
0x00011be8 ldr r0, [r3] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011bec bl 0x10aa8 | r0 = fprintf (r0, "libmtd", "MEMWRITEOOB64", r3)
| do {
| label_1:
0x00011bf0 bl 0x10b5c | errno_location ();
0x00011bf4 mvn r7, 0 | r7 = ~0;
0x00011bf8 mov r3, 0x16 | r3 = 0x16;
0x00011bfc str r3, [r0] | *(r0) = r3;
| label_0:
0x00011c00 mov r0, r7 | r0 = r7;
0x00011c04 add sp, sp, 0x54 |
0x00011c08 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_2:
0x00011c0c ldr r3, [r4, 0xe8] | r3 = *((r4 + 0xe8));
0x00011c10 ldrd r0, r1, [sp, 0x80] | __asm ("ldrd r0, r1, [arg_80h]");
0x00011c14 ldr r2, [r4, 0xf0] | r2 = *((r4 + 0xf0));
0x00011c18 sub r3, r3, 1 | r3--;
0x00011c1c and r3, r3, sl | r3 &= sl;
0x00011c20 adds r0, r0, r3 | r0 += r3;
0x00011c24 adc r1, r1, r3, asr 31 | __asm ("adc r1, r1, r3, asr 31");
0x00011c28 mov r6, r0 | r6 = r0;
0x00011c2c mov r7, r1 | r7 = r1;
0x00011c30 ldr r0, [sp, 0x80] | r0 = *(arg_80h);
0x00011c34 asr r1, r2, 0x1f | r1 = r2 >> 0x1f;
0x00011c38 ldr ip, [sp, 0x84] | ip = *(arg_84h);
0x00011c3c cmp r7, r1 |
0x00011c40 cmpeq r6, r2 | __asm ("cmpeq r6, r2");
| if (r7 <= r1) {
0x00011c44 movhi r1, 1 | r1 = 1;
| }
| if (r7 > r1) {
0x00011c48 movls r1, 0 | r1 = 0;
| }
0x00011c4c orrs r0, r0, ip | r0 |= ip;
| if (r0 != r0) {
0x00011c50 moveq r1, 1 | r1 = 1;
| }
0x00011c54 cmp r1, 0 |
| if (r1 == 0) {
0x00011c58 beq 0x11c90 | goto label_3;
| }
0x00011c5c str r2, [sp, 0x18] | var_18h = r2;
0x00011c60 ldr r2, [r4] | r2 = *(r4);
0x00011c64 str r3, [sp, 0x10] | var_10h = r3;
0x00011c68 str r2, [sp, 0x14] | var_14h = r2;
0x00011c6c ldrd r2, r3, [sp, 0x80] | __asm ("ldrd r2, r3, [arg_80h]");
0x00011c70 ldr r1, [pc, 0x1d4] | r1 = stderr;
0x00011c74 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011c78 ldr r3, [pc, 0x1c8] | r3 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011c7c strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x00011c80 ldr r2, [pc, 0x1b8] | r2 = "MEMWRITEOOB64";
0x00011c84 ldr r0, [r3] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011c88 bl 0x10aa8 | fprintf ("%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n", r1, r2, r3)
0x00011c8c b 0x11bf0 |
| } while (1);
| label_3:
0x00011c90 ldr r3, [sp, 0x80] | r3 = *(arg_80h);
0x00011c94 strd sl, fp, [sp, 0x38] | __asm ("strd sl, fp, [s]");
0x00011c98 str r3, [sp, 0x44] | var_44h = r3;
0x00011c9c ldr r3, [sp, 0x88] | r3 = *(arg_88h);
0x00011ca0 str r1, [sp, 0x4c] | var_4ch = r1;
0x00011ca4 str r3, [sp, 0x48] | var_48h = r3;
0x00011ca8 ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x00011cac tst r3, 2 |
| if ((r3 & 2) != 0) {
0x00011cb0 bne 0x11d5c | goto label_4;
| }
0x00011cb4 add r2, sp, 0x38 | r2 += s;
0x00011cb8 ldr r1, [sp, 0x8c] | r1 = *(request);
0x00011cbc mov r0, sb | r0 = sb;
0x00011cc0 bl 0x109f4 | r0 = ioctl (r0, r1);
0x00011cc4 subs r7, r0, 0 | r7 = r0 - 0;
| if (r7 == r0) {
0x00011cc8 beq 0x11c00 | goto label_0;
| }
0x00011ccc bl 0x10b5c | r0 = errno_location ();
0x00011cd0 ldr r7, [r0] | r7 = *(r0);
0x00011cd4 cmp r7, 0x19 |
| if (r7 == 0x19) {
0x00011cd8 bne 0x11ce8 |
0x00011cdc ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x00011ce0 tst r3, 6 |
| if ((r3 & 6) == 0) {
0x00011ce4 beq 0x11d4c | goto label_5;
| }
| }
0x00011ce8 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x00011cec mov r0, sl | r0 = sl;
0x00011cf0 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011cf4 mov r1, fp | r1 = fp;
0x00011cf8 bl 0x14920 | fcn_00014920 (r0, r1);
0x00011cfc ldr r6, [pc, 0x144] | r6 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011d00 strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x00011d04 ldr r2, [pc, 0x134] | r2 = "MEMWRITEOOB64";
0x00011d08 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x00011d0c ldr r3, [r4] | r3 = *(r4);
0x00011d10 ldr r1, [pc, 0x138] | r1 = "%s: error!: Cannot write %llu OOB bytes to address %llu (OOB offset %u) - mtd%d OOB size is only %d bytes\n";
0x00011d14 str r3, [sp] | *(sp) = r3;
0x00011d18 mov r3, r8 | r3 = r8;
0x00011d1c ldr r0, [r6] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011d20 bl 0x10aa8 | fprintf (r0, "%s: error!: Cannot write %llu OOB bytes to address %llu (OOB offset %u) - mtd%d OOB size is only %d bytes\n", "MEMWRITEOOB64", r3, r4, r5, "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n")
0x00011d24 mov r0, r7 | r0 = r7;
0x00011d28 ldr r8, [r6] | r8 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011d2c bl 0x10a0c | strerror (r0);
0x00011d30 str r7, [sp] | *(sp) = r7;
0x00011d34 ldr r3, [pc, 0x118] | r3 = "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_";
0x00011d38 mov r2, 8 | r2 = 8;
0x00011d3c ldr r1, [pc, 0x114] | r1 = *(0x11e54);
0x00011d40 str r0, [sp, 4] | var_4h = r0;
0x00011d44 mov r0, r8 | r0 = r8;
0x00011d48 bl 0x10aa8 | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_")
| label_5:
0x00011d4c ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x00011d50 bic r3, r3, 4 | r3 = BIT_MASK (r3, 4);
0x00011d54 orr r3, r3, 2 | r3 |= 2;
0x00011d58 strb r3, [r5, 0x34] | *((r5 + 0x34)) = r3;
| label_4:
0x00011d5c ldrd r2, r3, [sp, 0x38] | __asm ("ldrd r2, r3, [s]");
0x00011d60 mov r1, 0 | r1 = 0;
0x00011d64 mvn r0, 0 | r0 = ~0;
0x00011d68 cmp r3, r1 |
0x00011d6c cmpeq r2, r0 | __asm ("cmpeq r2, r0");
| if (r3 >= r1) {
0x00011d70 bls 0x11d90 |
0x00011d74 ldr r0, [pc, 0xcc] |
0x00011d78 mvn r3, 0 | r3 = ~0;
0x00011d7c ldr r2, [pc, 0xbc] | r2 = "MEMWRITEOOB64";
0x00011d80 ldr r1, [pc, 0xd4] | r1 = "%*serror %d (%s)\n";
0x00011d84 ldr r0, [r0] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011d88 bl 0x10aa8 | fprintf ("%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n", "%*serror %d (%s)\n", "MEMWRITEOOB64", r3)
0x00011d8c b 0x11bf0 | goto label_1;
| }
0x00011d90 ldr r3, [sp, 0x44] | r3 = var_44h;
0x00011d94 str r2, [sp, 0x2c] | var_2ch = r2;
0x00011d98 str r3, [sp, 0x30] | var_30h = r3;
0x00011d9c ldr r3, [sp, 0x88] | r3 = *(arg_88h);
0x00011da0 add r2, sp, 0x2c | r2 += var_2ch;
0x00011da4 ldr r1, [sp, 0x90] | r1 = *(arg_90h);
0x00011da8 mov r0, sb | r0 = sb;
0x00011dac str r3, [sp, 0x34] | var_34h = r3;
0x00011db0 bl 0x109f4 | r0 = ioctl (r0, r1);
0x00011db4 subs r7, r0, 0 | r7 = r0 - 0;
| if (r7 >= r0) {
0x00011db8 bge 0x11c00 | goto label_0;
| }
0x00011dbc bl 0x10b5c | errno_location ();
0x00011dc0 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x00011dc4 mov r1, fp | r1 = fp;
0x00011dc8 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011dcc ldr r8, [pc, 0x74] | r8 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011dd0 ldr r5, [r0] | r5 = *(r0);
0x00011dd4 mov r0, sl | r0 = sl;
0x00011dd8 bl 0x14920 | fcn_00014920 (r0, r1);
0x00011ddc strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x00011de0 ldr r2, [pc, 0x58] | r2 = "MEMWRITEOOB64";
0x00011de4 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x00011de8 ldr r3, [r4] | r3 = *(r4);
0x00011dec ldr r1, [pc, 0x5c] | r1 = "%s: error!: Cannot write %llu OOB bytes to address %llu (OOB offset %u) - mtd%d OOB size is only %d bytes\n";
0x00011df0 str r3, [sp] | *(sp) = r3;
0x00011df4 ldr r3, [sp, 0x24] | r3 = var_24h;
0x00011df8 ldr r0, [r8] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011dfc bl 0x10aa8 | fprintf (r0, "%s: error!: Cannot write %llu OOB bytes to address %llu (OOB offset %u) - mtd%d OOB size is only %d bytes\n", "MEMWRITEOOB64", r3)
0x00011e00 mov r0, r5 | r0 = r5;
0x00011e04 ldr r4, [r8] | r4 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00011e08 bl 0x10a0c | strerror (r0);
0x00011e0c str r5, [sp] | *(sp) = r5;
0x00011e10 ldr r3, [pc, 0x3c] | r3 = "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_";
0x00011e14 mov r2, 8 | r2 = 8;
0x00011e18 ldr r1, [pc, 0x38] | r1 = *(0x11e54);
0x00011e1c str r0, [sp, 4] | var_4h = r0;
0x00011e20 mov r0, r4 | r0 = r4;
0x00011e24 bl 0x10aa8 | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_", r4, r5)
0x00011e28 b 0x11c00 | 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/flash_erase @ 0x11e60 */
| #include <stdint.h>
|
; (fcn) fcn.00011e60 () | void fcn_00011e60 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| r0 = arg1;
| r1 = arg2;
0x00011e60 subs r3, r1, 0 | r3 = r1 - 0;
0x00011e64 push {r0, r1, r2, lr} |
0x00011e68 ldr r2, [r0, 0xe0] | r2 = *((r0 + 0xe0));
| if (r3 >= r1) {
0x00011e6c blt 0x11e7c |
0x00011e70 cmp r3, r2 |
| if (r3 >= r2) {
0x00011e74 movlt r0, 0 | r0 = 0;
| }
| if (r3 < r2) {
0x00011e78 blt 0x11eac | goto label_0;
| }
| }
0x00011e7c str r2, [sp, 4] | var_4h = r2;
0x00011e80 ldr r2, [r0] | r2 = *(r0);
0x00011e84 ldr r0, [pc, 0x28] |
0x00011e88 str r2, [sp] | *(sp) = r2;
0x00011e8c ldr r1, [pc, 0x24] | r1 = stderr;
0x00011e90 ldr r2, [pc, 0x24] | r2 = "_s:_error_:_bad_eraseblock_number__d__mtd_d_has__d_eraseblocks";
0x00011e94 ldr r0, [r0] | r0 = *(0x11eb0);
0x00011e98 bl 0x10aa8 | r0 = fprintf (r0, r1, r2)
0x00011e9c bl 0x10b5c | errno_location ();
0x00011ea0 mov r3, 0x16 | r3 = 0x16;
0x00011ea4 str r3, [r0] | *(r0) = r3;
0x00011ea8 mvn r0, 0 | r0 = ~0;
| label_0:
0x00011eac add sp, sp, 0xc |
0x00011eb0 pop {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/flash_erase @ 0x11ec0 */
| #include <stdint.h>
|
; (fcn) fcn.00011ec0 () | void fcn_00011ec0 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
| r1 = arg2;
0x00011ec0 push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x00011ec4 ldr r5, [pc, 0x5c] |
0x00011ec8 mov r7, r1 | r7 = r1;
0x00011ecc mov r6, r2 | r6 = r2;
0x00011ed0 mov r8, r0 | r8 = r0;
0x00011ed4 bl 0x10b5c | errno_location ();
0x00011ed8 mov r3, r6 | r3 = r6;
0x00011edc ldr r2, [pc, 0x48] | r2 = stderr;
0x00011ee0 ldr r1, [pc, 0x48] | r1 = "libmtd";
0x00011ee4 ldr r4, [r0] | r4 = *(r0);
0x00011ee8 stm sp, {r7, r8} | *(sp) = r7;
| *((sp + 4)) = r8;
0x00011eec ldr r0, [r5] | r0 = *(0x11f24);
0x00011ef0 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4)
0x00011ef4 mov r0, r4 | r0 = r4;
0x00011ef8 ldr r5, [r5] | r5 = *(0x11f24);
0x00011efc bl 0x10a0c | strerror (r0);
0x00011f00 str r4, [sp] | *(sp) = r4;
0x00011f04 ldr r3, [pc, 0x28] | r3 = "_s:_error_:__s_ioctl_failed_for_eraseblock__d__mtd_d_";
0x00011f08 mov r2, 8 | r2 = 8;
0x00011f0c ldr r1, [pc, 0x24] | r1 = *(0x11f34);
0x00011f10 str r0, [sp, 4] | var_4h = r0;
0x00011f14 mov r0, r5 | r0 = r5;
0x00011f18 bl 0x10aa8 | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_eraseblock__d__mtd_d_", r4)
0x00011f1c mvn r0, 0 | r0 = ~0;
0x00011f20 add sp, sp, 8 |
0x00011f24 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/flash_erase @ 0x11f3c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00011f3c () | void fcn_00011f3c (int32_t arg2, char * s) {
| char * var_50h;
| int32_t var_0h;
| int32_t var_4h;
| char * var_8h;
| int32_t var_18h_2;
| int32_t var_18h;
| r1 = arg2;
| r0 = s;
0x00011f3c push {r4, r5, r6, r7, r8, fp, lr} |
0x00011f40 add fp, sp, 0x18 |
0x00011f44 sub sp, sp, 0x44 |
0x00011f48 ldr r7, [r0] | r7 = *(r0);
0x00011f4c mov r8, r1 | r8 = r1;
0x00011f50 mov r0, r7 | r0 = r7;
0x00011f54 mov r6, r3 | r6 = r3;
0x00011f58 mov r5, r2 | r5 = r2;
0x00011f5c bl 0x10b74 | strlen (r0);
0x00011f60 mov r2, r8 | r2 = r8;
0x00011f64 mov r1, r7 | r1 = r7;
0x00011f68 add r0, r0, 0x39 | r0 += 0x39;
0x00011f6c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00011f70 sub sp, sp, r0 |
0x00011f74 add r4, sp, 8 | r4 += var_8h;
0x00011f78 mov r0, r4 | r0 = r4;
0x00011f7c bl 0x10b44 | sprintf (r0, r1, r2);
0x00011f80 mov r2, 0x32 | r2 = 0x32;
0x00011f84 sub r1, fp, 0x50 | r1 -= var_50h;
0x00011f88 mov r0, r4 | r0 = r4;
0x00011f8c bl 0x11764 | r0 = fcn_00011764 (r0, r1);
0x00011f90 cmp r0, 0 |
| if (r0 < 0) {
0x00011f94 blt 0x11fdc | goto label_1;
| }
0x00011f98 mov r3, r6 | r3 = r6;
0x00011f9c mov r2, r5 | r2 = r5;
0x00011fa0 ldr r1, [pc, 0x8c] | r1 = *(0x12030);
0x00011fa4 sub r0, fp, 0x50 | r0 -= var_50h;
0x00011fa8 bl 0x10af0 | r0 = sscanf (r0, r1, r2);
0x00011fac cmp r0, 2 |
| if (r0 == 2) {
0x00011fb0 beq 0x11fe4 | goto label_2;
| }
0x00011fb4 bl 0x10b5c | errno_location ();
0x00011fb8 mov r3, 0x16 | r3 = 0x16;
0x00011fbc ldr r2, [pc, 0x74] | r2 = "_d:_d";
0x00011fc0 ldr r1, [pc, 0x74] | r1 = "libmtd";
0x00011fc4 str r3, [r0] | *(r0) = r3;
0x00011fc8 ldr r0, [pc, 0x70] |
0x00011fcc mov r3, r4 | r3 = r4;
0x00011fd0 ldr r0, [r0] | r0 = "%s: error!: \"%s\" does not have major:minor format\n";
0x00011fd4 bl 0x10aa8 | fprintf ("%s: error!: \"%s\" does not have major:minor format\n", "libmtd", "_d:_d", r3)
| label_0:
0x00011fd8 mvn r0, 0 | r0 = ~0;
| do {
| label_1:
0x00011fdc sub sp, fp, 0x18 |
0x00011fe0 pop {r4, r5, r6, r7, r8, fp, pc} |
| label_2:
0x00011fe4 ldr r3, [r5] | r3 = *(r5);
0x00011fe8 cmp r3, 0 |
| if (r3 < 0) {
0x00011fec blt 0x12000 | goto label_3;
| }
0x00011ff0 ldr r3, [r6] | r3 = *(r6);
0x00011ff4 cmp r3, 0 |
| if (r3 < 0) {
0x00011ff8 movge r0, 0 | r0 = 0;
| }
0x00011ffc bge 0x11fdc |
| } while (r3 >= 0);
| label_3:
0x00012000 bl 0x10b5c | errno_location ();
0x00012004 mov r3, 0x16 | r3 = 0x16;
0x00012008 ldr r2, [pc, 0x28] | r2 = "_d:_d";
0x0001200c ldr r1, [pc, 0x30] | r1 = stderr;
0x00012010 str r3, [r0] | *(r0) = r3;
0x00012014 ldr r0, [pc, 0x24] |
0x00012018 ldr r3, [r6] | r3 = *(r6);
0x0001201c str r4, [sp, 4] | var_4h = r4;
0x00012020 str r3, [sp] | *(sp) = r3;
0x00012024 ldr r3, [r5] | r3 = *(r5);
0x00012028 ldr r0, [r0] | r0 = "%s: error!: \"%s\" does not have major:minor format\n";
0x0001202c bl 0x10aa8 | fprintf ("%s: error!: \"%s\" does not have major:minor format\n", r1, "_d:_d", r3, r4)
0x00012030 b 0x11fd8 | 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/flash_erase @ 0x12388 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012388 () | void fcn_00012388 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
0x00012388 push {r0, r1, r2, r4, r5, lr} |
0x0001238c mov r1, 0x38 | r1 = 0x38;
0x00012390 mov r0, 1 | r0 = 1;
0x00012394 bl 0x10a90 | r0 = calloc (r0, r1);
0x00012398 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x0001239c bne 0x123ec |
0x000123a0 bl 0x10b5c | errno_location ();
0x000123a4 ldr r5, [pc, 0x1ec] |
0x000123a8 ldr r2, [pc, 0x1ec] | r2 = stderr;
0x000123ac ldr r1, [pc, 0x1ec] | r1 = "libmtd";
0x000123b0 ldr r4, [r0] | r4 = *(r0);
0x000123b4 ldr r0, [r5] | r0 = *(0x12594);
0x000123b8 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x000123bc mov r0, r4 | r0 = r4;
0x000123c0 ldr r5, [r5] | r5 = *(0x12594);
0x000123c4 bl 0x10a0c | strerror (r0);
0x000123c8 str r4, [sp] | *(sp) = r4;
0x000123cc ldr r3, [pc, 0x1d0] | r3 = "%s: error!: out of memory\n";
0x000123d0 mov r2, 8 | r2 = 8;
0x000123d4 ldr r1, [pc, 0x1cc] | r1 = *(0x125a4);
0x000123d8 str r0, [sp, 4] | var_4h = r0;
0x000123dc mov r0, r5 | r0 = r5;
0x000123e0 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x000123e4 mvn r0, 0 | r0 = ~0;
0x000123e8 bl 0x10b68 | exit (r0);
| }
0x000123ec ldrb r3, [r4, 0x34] | r3 = *((r4 + 0x34));
0x000123f0 ldr r1, [pc, 0x1b4] | r1 = "%*serror %d (%s)\n";
0x000123f4 bic r3, r3, 6 | r3 = BIT_MASK (r3, 6);
0x000123f8 strb r3, [r4, 0x34] | *((r4 + 0x34)) = r3;
0x000123fc ldr r0, [pc, 0x1ac] | r0 = "class/mtd";
0x00012400 bl 0x12298 | r0 = fcn_00012298 ("class/mtd", r1);
0x00012404 cmp r0, 0 |
0x00012408 str r0, [r4] | *(r4) = r0;
| if (r0 == 0) {
0x0001240c beq 0x1258c | goto label_1;
| }
0x00012410 ldr r1, [pc, 0x19c] | r1 = "/sys";
0x00012414 bl 0x12298 | r0 = fcn_00012298 (r0, "/sys");
0x00012418 cmp r0, 0 |
0x0001241c str r0, [r4, 4] | *((r4 + 4)) = r0;
| if (r0 == 0) {
0x00012420 beq 0x1258c | goto label_1;
| }
0x00012424 ldr r1, [pc, 0x18c] | r1 = *(0x125b4);
0x00012428 bl 0x12298 | r0 = fcn_00012298 (r0, r1);
0x0001242c cmp r0, 0 |
0x00012430 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| if (r0 == 0) {
0x00012434 beq 0x1258c | goto label_1;
| }
0x00012438 mov r0, r4 | r0 = r4;
0x0001243c bl 0x11564 | r0 = fcn_00011564 (r0);
0x00012440 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00012444 bne 0x12490 | goto label_2;
| }
0x00012448 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x0001244c bl 0x10bbc | free (r0);
0x00012450 ldr r0, [r4] | r0 = *(r4);
0x00012454 bl 0x10bbc | free (r0);
0x00012458 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x0001245c bl 0x10bbc | free (r0);
0x00012460 str r5, [r4] | *(r4) = r5;
0x00012464 str r5, [r4, 4] | *((r4 + 4)) = r5;
0x00012468 str r5, [r4, 0xc] | *((r4 + 0xc)) = r5;
0x0001246c bl 0x13e48 | r0 = fcn_00013e48 ();
0x00012470 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00012474 bne 0x12484 | goto label_3;
| }
0x00012478 mov r0, r4 | r0 = r4;
0x0001247c bl 0x10bbc | free (r0);
| label_0:
0x00012480 mov r4, 0 | r4 = 0;
| do {
| label_3:
0x00012484 mov r0, r4 | r0 = r4;
0x00012488 add sp, sp, 0xc |
0x0001248c pop {r4, r5, pc} |
| label_2:
0x00012490 ldr r1, [pc, 0x124] | r1 = "name";
0x00012494 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012498 bl 0x12298 | r0 = fcn_00012298 (r0, "name");
0x0001249c cmp r0, 0 |
0x000124a0 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r0 == 0) {
0x000124a4 beq 0x1258c | goto label_1;
| }
0x000124a8 ldr r1, [pc, 0x110] | r1 = *(0x125bc);
0x000124ac ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000124b0 bl 0x12298 | r0 = fcn_00012298 (r0, r1);
0x000124b4 cmp r0, 0 |
0x000124b8 str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
| if (r0 == 0) {
0x000124bc beq 0x1258c | goto label_1;
| }
0x000124c0 ldr r1, [pc, 0xfc] | r1 = "type";
0x000124c4 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000124c8 bl 0x12298 | r0 = fcn_00012298 (r0, "type");
0x000124cc cmp r0, 0 |
0x000124d0 str r0, [r4, 0x14] | *((r4 + 0x14)) = r0;
| if (r0 == 0) {
0x000124d4 beq 0x1258c | goto label_1;
| }
0x000124d8 ldr r1, [pc, 0xe8] | r1 = "erasesize";
0x000124dc ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000124e0 bl 0x12298 | r0 = fcn_00012298 (r0, "erasesize");
0x000124e4 cmp r0, 0 |
0x000124e8 str r0, [r4, 0x18] | *((r4 + 0x18)) = r0;
| if (r0 == 0) {
0x000124ec beq 0x1258c | goto label_1;
| }
0x000124f0 ldr r1, [pc, 0xd4] | r1 = *(0x125c8);
0x000124f4 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000124f8 bl 0x12298 | r0 = fcn_00012298 (r0, r1);
0x000124fc cmp r0, 0 |
0x00012500 str r0, [r4, 0x1c] | *((r4 + 0x1c)) = r0;
| if (r0 == 0) {
0x00012504 beq 0x1258c | goto label_1;
| }
0x00012508 ldr r1, [pc, 0xc0] | r1 = "writesize";
0x0001250c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012510 bl 0x12298 | r0 = fcn_00012298 (r0, "writesize");
0x00012514 cmp r0, 0 |
0x00012518 str r0, [r4, 0x20] | *((r4 + 0x20)) = r0;
| if (r0 == 0) {
0x0001251c beq 0x1258c | goto label_1;
| }
0x00012520 ldr r1, [pc, 0xac] | r1 = "subpagesize";
0x00012524 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012528 bl 0x12298 | r0 = fcn_00012298 (r0, "subpagesize");
0x0001252c cmp r0, 0 |
0x00012530 str r0, [r4, 0x24] | *((r4 + 0x24)) = r0;
| if (r0 == 0) {
0x00012534 beq 0x1258c | goto label_1;
| }
0x00012538 ldr r1, [pc, 0x98] | r1 = "oobsize";
0x0001253c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012540 bl 0x12298 | r0 = fcn_00012298 (r0, "oobsize");
0x00012544 cmp r0, 0 |
0x00012548 str r0, [r4, 0x28] | *((r4 + 0x28)) = r0;
| if (r0 == 0) {
0x0001254c beq 0x1258c | goto label_1;
| }
0x00012550 ldr r1, [pc, 0x84] | r1 = "oobavail";
0x00012554 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012558 bl 0x12298 | r0 = fcn_00012298 (r0, "oobavail");
0x0001255c cmp r0, 0 |
0x00012560 str r0, [r4, 0x2c] | *((r4 + 0x2c)) = r0;
| if (r0 == 0) {
0x00012564 beq 0x1258c | goto label_1;
| }
0x00012568 ldr r1, [pc, 0x70] | r1 = "numeraseregions";
0x0001256c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012570 bl 0x12298 | r0 = fcn_00012298 (r0, "numeraseregions");
0x00012574 cmp r0, 0 |
| if (r0 == 0) {
0x00012578 ldrbne r3, [r4, 0x34] | r3 = *((r4 + 0x34));
| }
0x0001257c str r0, [r4, 0x30] | *((r4 + 0x30)) = r0;
| if (r0 == 0) {
0x00012580 orrne r3, r3, 1 | r3 |= 1;
| }
| if (r0 == 0) {
0x00012584 strbne r3, [r4, 0x34] | *((r4 + 0x34)) = r3;
| }
0x00012588 bne 0x12484 |
| } while (r0 != 0);
| label_1:
0x0001258c mov r0, r4 | r0 = r4;
0x00012590 bl 0x1230c | fcn_0001230c (r0);
0x00012594 b 0x12480 | 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/flash_erase @ 0x12664 */
| #include <stdint.h>
|
; (fcn) fcn.00012664 () | void fcn_00012664 (int32_t arg1, void * s) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_0h_2;
| r0 = arg1;
| r1 = s;
| label_3:
0x000120b4 ldrb r3, [r1, 0xc] | r3 = *((r1 + 0xc));
0x000120b8 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x000120bc orr r3, r3, 1 | r3 |= 1;
0x000120c0 sub sp, sp, 0x110 |
0x000120c4 strb r3, [r1, 0xc] | *((r1 + 0xc)) = r3;
0x000120c8 mov r5, r0 | r5 = r0;
0x000120cc ldr r0, [r0] | r0 = *(r0);
0x000120d0 mov r4, r1 | r4 = r1;
0x000120d4 bl 0x10b2c | r0 = opendir ();
0x000120d8 mov r8, r0 | r8 = r0;
0x000120dc bl 0x10b5c | errno_location ();
0x000120e0 cmp r8, 0 |
0x000120e4 mov r6, r0 | r6 = r0;
| if (r8 != 0) {
0x000120e8 bne 0x12138 | goto label_4;
| }
0x000120ec ldr r4, [r0] | r4 = *(r0);
0x000120f0 ldr r6, [pc, 0x17c] | r6 = *(0x12270);
0x000120f4 ldr r3, [r5] | r3 = *(r5);
0x000120f8 ldr r2, [pc, 0x178] | r2 = stderr;
0x000120fc ldr r1, [pc, 0x178] | r1 = "libmtd";
| label_2:
0x00012100 ldr r0, [r6] | r0 = *(r6);
0x00012104 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00012108 mov r0, r4 | r0 = r4;
0x0001210c ldr r5, [r6] | r5 = *(r6);
0x00012110 bl 0x10a0c | strerror (r0);
0x00012114 str r4, [sp] | *(sp) = r4;
0x00012118 ldr r3, [pc, 0x160] | r3 = "%s: error!: cannot open \"%s\"\n";
0x0001211c mov r2, 8 | r2 = 8;
0x00012120 ldr r1, [pc, 0x15c] | r1 = *(0x12280);
0x00012124 str r0, [sp, 4] | var_4h = r0;
0x00012128 mov r0, r5 | r0 = r5;
0x0001212c bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| do {
0x00012130 mvn r0, 0 | r0 = ~0;
0x00012134 b 0x1226c | goto label_5;
| label_4:
0x00012138 ldr sl, [pc, 0x148] | sl = "mtd_d_s";
0x0001213c mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00012140 mov sb, 0 | sb = 0;
0x00012144 str r3, [r4, 4] | *((r4 + 4)) = r3;
| label_0:
0x00012148 str sb, [r6] | *(r6) = sb;
0x0001214c mov r0, r8 | r0 = r8;
0x00012150 bl 0x10ad8 | r0 = readdir64 ();
0x00012154 cmp r0, 0 |
| if (r0 == 0) {
0x00012158 beq 0x121e8 | goto label_6;
| }
0x0001215c add r7, r0, 0x13 | r7 = r0 + 0x13;
0x00012160 mov r0, r7 | r0 = r7;
0x00012164 bl 0x10b74 | r0 = strlen (r0);
0x00012168 cmp r0, 0xfe |
| if (r0 < 0xfe) {
0x0001216c bls 0x121a0 | goto label_7;
| }
0x00012170 ldr r0, [pc, 0xfc] |
0x00012174 str r7, [sp] | *(sp) = r7;
0x00012178 ldr r2, [pc, 0xf8] | r2 = stderr;
0x0001217c ldr r3, [r5] | r3 = *(r5);
0x00012180 ldr r1, [pc, 0x104] | r1 = "mtd_d_s";
0x00012184 ldr r0, [r0] | r0 = *(0x12270);
0x00012188 bl 0x10aa8 | fprintf (r0, "mtd_d_s", r2, r3)
0x0001218c mov r3, 0x16 | r3 = 0x16;
0x00012190 str r3, [r6] | *(r6) = r3;
| label_1:
0x00012194 mov r0, r8 | r0 = r8;
0x00012198 bl 0x10b8c | closedir ();
0x0001219c b 0x12130 |
| } while (1);
| label_7:
0x000121a0 add r3, sp, 0x10 | r3 += var_10h;
0x000121a4 add r2, sp, 0xc | r2 += var_ch;
0x000121a8 mov r1, sl | r1 = sl;
0x000121ac mov r0, r7 | r0 = r7;
0x000121b0 bl 0x10af0 | r0 = sscanf (r0, r1, r2);
0x000121b4 cmp r0, 1 |
| if (r0 != 1) {
0x000121b8 bne 0x12148 | goto label_0;
| }
0x000121bc ldr r3, [r4] | r3 = *(r4);
0x000121c0 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x000121c4 add r3, r3, 1 | r3++;
0x000121c8 str r3, [r4] | *(r4) = r3;
0x000121cc ldr r3, [sp, 0xc] | r3 = var_ch;
0x000121d0 cmp r2, r3 |
0x000121d4 ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r2 >= r3) {
0x000121d8 strlt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x000121dc cmp r3, r2 |
| if (r3 >= r2) {
0x000121e0 strlt r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x000121e4 b 0x12148 | goto label_0;
| label_6:
0x000121e8 ldr r7, [r6] | r7 = *(r6);
0x000121ec cmp r7, 0 |
| if (r7 != 0) {
0x000121f0 beq 0x12238 |
0x000121f4 ldr r4, [pc, 0x78] |
0x000121f8 ldr r3, [r5] | r3 = *(r5);
0x000121fc ldr r2, [pc, 0x74] | r2 = stderr;
0x00012200 ldr r1, [pc, 0x88] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x00012204 ldr r0, [r4] | r0 = *(0x12270);
0x00012208 bl 0x10aa8 | fprintf (r0, "%s: error!: invalid entry in %s: \"%s\"\n", r2, r3, r4)
0x0001220c mov r0, r7 | r0 = r7;
0x00012210 ldr r4, [r4] | r4 = *(0x12270);
0x00012214 bl 0x10a0c | strerror (r0);
0x00012218 str r7, [sp] | *(sp) = r7;
0x0001221c ldr r3, [pc, 0x5c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00012220 mov r2, 8 | r2 = 8;
0x00012224 ldr r1, [pc, 0x58] | r1 = *(0x12280);
0x00012228 str r0, [sp, 4] | var_4h = r0;
0x0001222c mov r0, r4 | r0 = r4;
0x00012230 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n")
0x00012234 b 0x12194 | goto label_1;
| }
0x00012238 mov r0, r8 | r0 = r8;
0x0001223c bl 0x10b8c | r0 = closedir ();
0x00012240 cmp r0, 0 |
| if (r0 != 0) {
0x00012244 beq 0x12260 |
0x00012248 ldr r4, [r6] | r4 = *(r6);
0x0001224c ldr r3, [r5] | r3 = *(r5);
0x00012250 ldr r6, [pc, 0x1c] | r6 = *(0x12270);
0x00012254 ldr r2, [pc, 0x1c] | r2 = stderr;
0x00012258 ldr r1, [pc, 0x34] | r1 = "%s: error!: readdir failed on \"%s\"\n";
0x0001225c b 0x12100 | goto label_2;
| }
0x00012260 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00012264 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00012268 streq r0, [r4, 4] | *((r4 + 4)) = r0;
| }
| label_5:
0x0001226c add sp, sp, 0x110 |
0x00012270 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
0x00012664 mov r3, r1 | r3 = r1;
0x00012668 push {r4, lr} |
0x0001266c mov r2, 0x10 | r2 = 0x10;
0x00012670 mov r4, r0 | r4 = r0;
0x00012674 mov r1, 0 | r1 = 0;
0x00012678 mov r0, r3 | r0 = r3;
0x0001267c bl 0x10b14 | memset (r0, r1, r2);
0x00012680 ldrb r2, [r4, 0x34] | r2 = *((r4 + 0x34));
0x00012684 tst r2, 1 |
| if ((r2 & 1) == 0) {
0x00012688 bne 0x12694 |
0x0001268c pop {r4, lr} |
0x00012690 b 0x13f30 |
| } else {
0x00012694 mov r1, r0 | r1 = r0;
0x00012698 mov r0, r4 | r0 = r4;
0x0001269c pop {r4, lr} |
0x000126a0 b 0x120b4 | goto label_3;
| }
0x00013f30 push {r4, lr} |
0x00013f34 sub sp, sp, 0xa0 |
0x00013f38 mov r4, r0 | r4 = r0;
0x00013f3c mov r0, sp | r0 = sp;
0x00013f40 bl 0x13cc0 | r0 = fcn_00013cc0 (r0);
0x00013f44 cmp r0, 0 |
| if (r0 != 0) {
0x00013f48 mvneq r3, 0x80000000 | r3 = ~0x80000000;
| }
| if (r0 == 0) {
0x00013f4c beq 0x13f80 | goto label_8;
| }
0x00013f50 mvn r0, 0 | r0 = ~0;
0x00013f54 b 0x13f94 | goto label_9;
| do {
0x00013f58 ldr r3, [r4] | r3 = *(r4);
0x00013f5c ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00013f60 add r3, r3, 1 | r3++;
0x00013f64 str r3, [r4] | *(r4) = r3;
0x00013f68 ldr r3, [sp] | r3 = *(sp);
0x00013f6c cmp r3, r2 |
0x00013f70 ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r3 <= r2) {
0x00013f74 strgt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x00013f78 cmp r3, r2 |
| if (r3 < r2) {
0x00013f7c bge 0x13f84 |
| label_8:
0x00013f80 str r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x00013f84 mov r0, sp | r0 = sp;
0x00013f88 bl 0x13b5c | r0 = fcn_00013b5c (r0);
0x00013f8c cmp r0, 0 |
0x00013f90 bne 0x13f58 |
| } while (r0 != 0);
| label_9:
0x00013f94 add sp, sp, 0xa0 |
0x00013f98 pop {r4, 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/flash_erase @ 0x126a4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000126a4 () | void fcn_000126a4 (int32_t arg1, int32_t arg2) {
| int32_t var_68h;
| int32_t var_64h;
| char * buf;
| int32_t var_24h;
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| char * s;
| int32_t var_sp_64h;
| int32_t var_20h_2;
| int32_t var_20h;
| r0 = arg1;
| r1 = arg2;
0x000126a4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000126a8 add r6, r2, 4 | r6 = r2 + 4;
0x000126ac add fp, sp, 0x20 |
0x000126b0 sub sp, sp, 0x5c |
0x000126b4 mov r5, r1 | r5 = r1;
0x000126b8 mov r7, r0 | r7 = r0;
0x000126bc mov r4, r2 | r4 = r2;
0x000126c0 mov r1, 0 | r1 = 0;
0x000126c4 mov r2, 0xfc | r2 = 0xfc;
0x000126c8 mov r0, r6 | r0 = r6;
0x000126cc bl 0x10b14 | memset (r0, r1, r2);
0x000126d0 str r5, [r4] | *(r4) = r5;
0x000126d4 mov r1, r5 | r1 = r5;
0x000126d8 mov r0, r7 | r0 = r7;
0x000126dc bl 0x125e4 | r0 = fcn_000125e4 (r0, r1);
0x000126e0 cmp r0, 0 |
| if (r0 != 0) {
0x000126e4 bne 0x126fc | goto label_4;
| }
0x000126e8 bl 0x10b5c | errno_location ();
0x000126ec mov r3, 0x13 | r3 = 0x13;
0x000126f0 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x000126f4 mvn r5, 0 | r5 = ~0;
0x000126f8 b 0x12718 | goto label_1;
| label_4:
0x000126fc ldrb r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x00012700 tst r3, 1 |
| if ((r3 & 1) == 0) {
0x00012704 bne 0x12724 |
0x00012708 mov r0, r5 | r0 = r5;
0x0001270c mov r1, r4 | r1 = r4;
0x00012710 bl 0x14654 | r0 = fcn_00014654 (r0, r1);
0x00012714 mov r5, r0 | r5 = r0;
| label_1:
0x00012718 mov r0, r5 | r0 = r5;
0x0001271c sub sp, fp, 0x20 |
0x00012720 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x00012724 add r3, r4, 8 | r3 = r4 + 8;
0x00012728 mov r2, r6 | r2 = r6;
0x0001272c mov r1, r5 | r1 = r5;
0x00012730 add r0, r7, 8 | r0 = r7 + 8;
0x00012734 bl 0x11f3c | r0 = fcn_00011f3c (r0, r1);
0x00012738 subs sl, r0, 0 | sl = r0 - 0;
0x0001273c bne 0x126f4 |
| } while (sl != r0);
0x00012740 ldr r8, [r7, 0xc] | r8 = *((r7 + 0xc));
0x00012744 mov sb, sp | sb = sp;
0x00012748 mov r0, r8 | r0 = r8;
0x0001274c bl 0x10b74 | strlen (r0);
0x00012750 mov r2, r5 | r2 = r5;
0x00012754 mov r1, r8 | r1 = r8;
0x00012758 add r6, r4, 0x51 | r6 = r4 + 0x51;
0x0001275c add r0, r0, 0x6b | r0 += 0x6b;
0x00012760 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012764 sub sp, sp, r0 |
0x00012768 add r3, sp, 0x10 | r3 += s;
0x0001276c mov r0, r3 | r0 = r3;
0x00012770 str r3, [fp, -0x68] | var_68h = r3;
0x00012774 bl 0x10b44 | sprintf (r0, r1, r2);
0x00012778 ldr r3, [fp, -0x68] | r3 = var_68h;
0x0001277c mov r2, 0x80 | r2 = 0x80;
0x00012780 mov r1, r6 | r1 = r6;
0x00012784 mov r0, r3 | r0 = r3;
0x00012788 bl 0x11764 | fcn_00011764 (r0, r1);
0x0001278c mov sp, sb |
0x00012790 cmp r0, 0 |
| if (r0 < 0) {
0x00012794 blt 0x126f4 | goto label_0;
| }
0x00012798 add r6, r6, r0 | r6 += r0;
0x0001279c strb sl, [r6, -1] | *((r6 - 1)) = sl;
0x000127a0 ldr r6, [r7, 0x10] | r6 = *((r7 + 0x10));
0x000127a4 add r8, r4, 0x10 | r8 = r4 + 0x10;
0x000127a8 mov r0, r6 | r0 = r6;
0x000127ac bl 0x10b74 | strlen (r0);
0x000127b0 mov r2, r5 | r2 = r5;
0x000127b4 mov r1, r6 | r1 = r6;
0x000127b8 add r0, r0, 0x6b | r0 += 0x6b;
0x000127bc bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000127c0 sub sp, sp, r0 |
0x000127c4 add r3, sp, 0x10 | r3 += s;
0x000127c8 mov r0, r3 | r0 = r3;
0x000127cc str r3, [fp, -0x68] | var_68h = r3;
0x000127d0 bl 0x10b44 | sprintf (r0, r1, r2);
0x000127d4 ldr r3, [fp, -0x68] | r3 = var_68h;
0x000127d8 mov r2, 0x41 | r2 = 0x41;
0x000127dc mov r1, r8 | r1 = r8;
0x000127e0 mov r0, r3 | r0 = r3;
0x000127e4 bl 0x11764 | fcn_00011764 (r0, r1);
0x000127e8 mov sp, sb |
0x000127ec cmp r0, 0 |
| if (r0 < 0) {
0x000127f0 blt 0x126f4 | goto label_0;
| }
0x000127f4 add r0, r8, r0 | r0 = r8 + r0;
0x000127f8 strb sl, [r0, -1] | *((r0 - 1)) = sl;
0x000127fc add r2, r4, 0xe4 | r2 = r4 + 0xe4;
0x00012800 mov r1, r5 | r1 = r5;
0x00012804 ldr r0, [r7, 0x14] | r0 = *((r7 + 0x14));
0x00012808 bl 0x11aac | r0 = fcn_00011aac (r0, r1);
0x0001280c cmp r0, 0 |
| if (r0 != 0) {
0x00012810 bne 0x126f4 | goto label_0;
| }
0x00012814 ldr sl, [r7, 0x18] | sl = *((r7 + 0x18));
0x00012818 mov r0, sl | r0 = sl;
0x0001281c bl 0x10b74 | strlen (r0);
0x00012820 mov r2, r5 | r2 = r5;
0x00012824 mov r1, sl | r1 = sl;
0x00012828 add r0, r0, 0x39 | r0 += 0x39;
0x0001282c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012830 sub sp, sp, r0 |
0x00012834 add r6, sp, 0x10 | r6 += s;
0x00012838 mov r0, r6 | r0 = r6;
0x0001283c bl 0x10b44 | sprintf (r0, r1, r2);
0x00012840 add r1, r4, 0xd8 | r1 = r4 + 0xd8;
0x00012844 mov r0, r6 | r0 = r6;
0x00012848 bl 0x118f8 | fcn_000118f8 (r0, r1);
0x0001284c mov sp, sb |
0x00012850 cmp r0, 0 |
| if (r0 != 0) {
0x00012854 bne 0x126f4 | goto label_0;
| }
0x00012858 add r2, r4, 0xe8 | r2 = r4 + 0xe8;
0x0001285c mov r1, r5 | r1 = r5;
0x00012860 ldr r0, [r7, 0x1c] | r0 = *((r7 + 0x1c));
0x00012864 bl 0x11aac | r0 = fcn_00011aac (r0, r1);
0x00012868 cmp r0, 0 |
| if (r0 != 0) {
0x0001286c bne 0x126f4 | goto label_0;
| }
0x00012870 add r2, r4, 0xec | r2 = r4 + 0xec;
0x00012874 mov r1, r5 | r1 = r5;
0x00012878 ldr r0, [r7, 0x20] | r0 = *((r7 + 0x20));
0x0001287c bl 0x11aac | r0 = fcn_00011aac (r0, r1);
0x00012880 cmp r0, 0 |
| if (r0 != 0) {
0x00012884 bne 0x126f4 | goto label_0;
| }
0x00012888 add r2, r4, 0xf0 | r2 = r4 + 0xf0;
0x0001288c mov r1, r5 | r1 = r5;
0x00012890 ldr r0, [r7, 0x24] | r0 = *((r7 + 0x24));
0x00012894 bl 0x11aac | r0 = fcn_00011aac (r0, r1);
0x00012898 cmp r0, 0 |
| if (r0 != 0) {
0x0001289c bne 0x126f4 | goto label_0;
| }
0x000128a0 add r2, r4, 0xf4 | r2 = r4 + 0xf4;
0x000128a4 mov r1, r5 | r1 = r5;
0x000128a8 ldr r0, [r7, 0x28] | r0 = *((r7 + 0x28));
0x000128ac bl 0x11aac | r0 = fcn_00011aac (r0, r1);
0x000128b0 cmp r0, 0 |
| if (r0 != 0) {
0x000128b4 beq 0x128d0 |
0x000128b8 mov r0, r5 | r0 = r5;
0x000128bc bl 0x1413c | r0 = fcn_0001413c (r0);
0x000128c0 cmp r0, 0 |
| if (r0 >= 0) {
0x000128c4 movlt r3, 0 | r3 = 0;
| }
| if (r0 < 0) {
0x000128c8 strge r0, [r4, 0xf4] | *((r4 + 0xf4)) = r0;
| }
| if (r0 < 0) {
0x000128cc strlt r3, [r4, 0xf4] | *((r4 + 0xf4)) = r3;
| goto label_5;
| }
| }
| label_5:
0x000128d0 add r2, r4, 0xf8 | r2 = r4 + 0xf8;
0x000128d4 mov r1, r5 | r1 = r5;
0x000128d8 ldr r0, [r7, 0x2c] | r0 = *((r7 + 0x2c));
0x000128dc bl 0x11aac | r0 = fcn_00011aac (r0, r1);
0x000128e0 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 != r0) {
0x000128e4 bne 0x126f4 | goto label_0;
| }
0x000128e8 ldr r7, [r7, 0x30] | r7 = *((r7 + 0x30));
0x000128ec mov sl, sp | sl = sp;
0x000128f0 mov r0, r7 | r0 = r7;
0x000128f4 bl 0x10b74 | strlen (r0);
0x000128f8 mov r2, r5 | r2 = r5;
0x000128fc mov r1, r7 | r1 = r7;
0x00012900 add r0, r0, 0x39 | r0 += 0x39;
0x00012904 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012908 sub sp, sp, r0 |
0x0001290c add sb, sp, 0x10 | sb += s;
0x00012910 mov r0, sb | r0 = sb;
0x00012914 bl 0x10b44 | sprintf (r0, r1, r2);
0x00012918 mov r1, 0x80000 | r1 = 0x80000;
0x0001291c mov r0, sb | r0 = sb;
0x00012920 bl 0x10b20 | r0 = open64 ();
0x00012924 cmn r0, 1 |
0x00012928 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x0001292c bne 0x12938 |
0x00012930 mov sp, sl |
0x00012934 b 0x12718 | goto label_1;
| }
0x00012938 mov r2, 0x32 | r2 = 0x32;
0x0001293c sub r1, fp, 0x58 | r1 -= buf;
0x00012940 bl 0x10acc | r0 = read (r0, r1, r2);
0x00012944 cmn r0, 1 |
| if (r0 != 1) {
0x00012948 bne 0x129a0 | goto label_6;
| }
0x0001294c bl 0x10b5c | errno_location ();
0x00012950 ldr r6, [pc, 0x294] |
0x00012954 mov r3, sb | r3 = sb;
0x00012958 ldr r2, [pc, 0x290] | r2 = stderr;
0x0001295c ldr r1, [pc, 0x290] | r1 = "libmtd";
0x00012960 ldr r4, [r0] | r4 = *(r0);
0x00012964 ldr r0, [r6] | r0 = *(0x12be8);
0x00012968 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x0001296c mov r0, r4 | r0 = r4;
0x00012970 ldr r6, [r6] | r6 = *(0x12be8);
0x00012974 bl 0x10a0c | strerror (r0);
0x00012978 str r4, [sp] | *(sp) = r4;
0x0001297c ldr r3, [pc, 0x274] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00012980 mov r2, 8 | r2 = 8;
0x00012984 ldr r1, [pc, 0x270] | r1 = *(0x12bf8);
0x00012988 str r0, [sp, 4] | var_4h = r0;
0x0001298c mov r0, r6 | r0 = r6;
0x00012990 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| do {
0x00012994 mov r0, r5 | r0 = r5;
0x00012998 bl 0x10ba4 | close (r0);
0x0001299c b 0x12a88 | goto label_7;
| label_6:
0x000129a0 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x000129a4 bne 0x129d0 | goto label_8;
| }
0x000129a8 ldr r2, [pc, 0x240] | r2 = stderr;
0x000129ac ldr r1, [pc, 0x24c] | r1 = "%*serror %d (%s)\n";
0x000129b0 mov r3, sb | r3 = sb;
| label_2:
0x000129b4 ldr r0, [pc, 0x230] |
0x000129b8 ldr r0, [r0] | r0 = *(0x12be8);
0x000129bc bl 0x10aa8 | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_3:
0x000129c0 bl 0x10b5c | errno_location ();
0x000129c4 mov r3, 0x16 | r3 = 0x16;
0x000129c8 str r3, [r0] | *(r0) = r3;
0x000129cc b 0x12994 |
| } while (1);
| label_8:
0x000129d0 sub r3, fp, 0x24 | r3 -= var_24h;
0x000129d4 add r0, r3, r0 | r0 = r3 + r0;
0x000129d8 strb r6, [r0, -0x34] | *((r0 - 0x34)) = r6;
0x000129dc sub r2, fp, 0x64 | r2 -= var_64h;
0x000129e0 ldr r1, [pc, 0x21c] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x000129e4 sub r0, fp, 0x58 | r0 -= buf;
0x000129e8 bl 0x10af0 | r0 = sscanf (r0, "%s: error!: contents of \"%s\" is too long\n", r2);
0x000129ec cmp r0, 1 |
| if (r0 == 1) {
0x000129f0 movne r3, sb | r3 = sb;
| }
| if (r0 == 1) {
0x000129f4 ldrne r2, [pc, 0x1f4] | r2 = "libmtd";
| }
| if (r0 != 1) {
0x000129f8 ldrne r1, [pc, 0x208] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
| goto label_9;
| }
| if (r0 != 1) {
| label_9:
0x000129fc bne 0x129b4 | goto label_2;
| }
0x00012a00 ldrd r2, r3, [fp, -0x64] | __asm ("ldrd r2, r3, [var_64h]");
0x00012a04 cmp r2, 0 |
0x00012a08 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x00012a0c bge 0x12a30 |
0x00012a10 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00012a14 ldr r3, [pc, 0x1d0] | r3 = *(0x12be8);
0x00012a18 str sb, [sp, 8] | var_8h = sb;
0x00012a1c ldr r2, [pc, 0x1cc] | r2 = stderr;
0x00012a20 ldr r1, [pc, 0x1e4] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
0x00012a24 ldr r0, [r3] | r0 = *(0x12be8);
0x00012a28 bl 0x10aa8 | fprintf (r0, "_s:_error_:_cannot_read_integer_from___s_", r2, r3)
0x00012a2c b 0x129c0 | goto label_3;
| }
0x00012a30 mov r0, r5 | r0 = r5;
0x00012a34 bl 0x10ba4 | r0 = close (r0);
0x00012a38 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 == r0) {
0x00012a3c beq 0x12a90 | goto label_10;
| }
0x00012a40 bl 0x10b5c | errno_location ();
0x00012a44 ldr r5, [pc, 0x1a0] |
0x00012a48 mov r3, sb | r3 = sb;
0x00012a4c ldr r2, [pc, 0x19c] | r2 = stderr;
0x00012a50 ldr r1, [pc, 0x1b8] | r1 = "_s:_error_:_negative_value__lld_in___s_";
0x00012a54 ldr r4, [r0] | r4 = *(r0);
0x00012a58 ldr r0, [r5] | r0 = *(0x12be8);
0x00012a5c bl 0x10aa8 | fprintf (r0, "_s:_error_:_negative_value__lld_in___s_", r2, r3, r4, r5)
0x00012a60 mov r0, r4 | r0 = r4;
0x00012a64 ldr r5, [r5] | r5 = *(0x12be8);
0x00012a68 bl 0x10a0c | strerror (r0);
0x00012a6c str r4, [sp] | *(sp) = r4;
0x00012a70 ldr r3, [pc, 0x180] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00012a74 mov r2, 8 | r2 = 8;
0x00012a78 ldr r1, [pc, 0x17c] | r1 = *(0x12bf8);
0x00012a7c str r0, [sp, 4] | var_4h = r0;
0x00012a80 mov r0, r5 | r0 = r5;
0x00012a84 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| do {
| label_7:
0x00012a88 mov sp, sl |
0x00012a8c b 0x126f4 | goto label_0;
| label_10:
0x00012a90 ldrd r2, r3, [fp, -0x64] | __asm ("ldrd r2, r3, [var_64h]");
0x00012a94 mov r1, 0 | r1 = 0;
0x00012a98 adds r6, r2, 0x80000000 | r6 = r2 + 0x80000000;
0x00012a9c adc r7, r3, 0 | __asm ("adc r7, r3, 0");
0x00012aa0 mvn r0, 0 | r0 = ~0;
0x00012aa4 cmp r7, r1 |
0x00012aa8 cmpeq r6, r0 | __asm ("cmpeq r6, r0");
| if (r7 < r1) {
0x00012aac bls 0x12adc | goto label_11;
| }
0x00012ab0 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00012ab4 ldr r3, [pc, 0x130] | r3 = *(0x12be8);
0x00012ab8 str sb, [sp, 8] | var_8h = sb;
0x00012abc ldr r2, [pc, 0x12c] | r2 = stderr;
0x00012ac0 ldr r0, [r3] | r0 = *(0x12be8);
0x00012ac4 ldr r1, [pc, 0x148] | r1 = "%s: error!: close failed on \"%s\"\n";
0x00012ac8 bl 0x10aa8 | r0 = fprintf (r0, "%s: error!: close failed on \"%s\"\n", r2, r3)
0x00012acc bl 0x10b5c | errno_location ();
0x00012ad0 mov r3, 0x16 | r3 = 0x16;
0x00012ad4 str r3, [r0] | *(r0) = r3;
0x00012ad8 b 0x12a88 |
| } while (1);
| label_11:
0x00012adc lsl r3, r2, 0x15 | r3 = r2 << 0x15;
0x00012ae0 ldrb r2, [r4, 0xfc] | r2 = *((r4 + 0xfc));
0x00012ae4 mov sp, sl |
0x00012ae8 bic r2, r2, 1 | r2 = BIT_MASK (r2, 1);
0x00012aec orr r2, r2, r3, lsr 31 | r2 |= (r3 >> 31);
0x00012af0 strb r2, [r4, 0xfc] | *((r4 + 0xfc)) = r2;
0x00012af4 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x00012af8 ldrd r0, r1, [r4, 0xd8] | __asm ("ldrd r0, r1, [r4, 0xd8]");
0x00012afc asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00012b00 bl 0x1484c | fcn_0001484c (r0, r1);
0x00012b04 ldr r1, [pc, 0x10c] | r1 = "%s: error!: value %lld read from file \"%s\" is out of range\n";
0x00012b08 str r0, [r4, 0xe0] | *((r4 + 0xe0)) = r0;
0x00012b0c mov r0, r8 | r0 = r8;
0x00012b10 bl 0x10b38 | r0 = strcmp (r0, r1);
0x00012b14 cmp r0, 0 |
| if (r0 != 0) {
0x00012b18 moveq r0, 4 | r0 = 4;
| }
| if (r0 != 0) {
0x00012b1c beq 0x12bc4 |
0x00012b20 ldr r1, [pc, 0xf4] | r1 = *(0x12c18);
0x00012b24 mov r0, r8 | r0 = r8;
0x00012b28 bl 0x10b38 | r0 = strcmp (r0, r1);
0x00012b2c cmp r0, 0 |
| if (r0 != 0) {
0x00012b30 moveq r0, 8 | r0 = 8;
| }
| if (r0 == 0) {
0x00012b34 beq 0x12bc4 | goto label_12;
| }
0x00012b38 ldr r1, [pc, 0xe0] | r1 = "mlc-nand";
0x00012b3c mov r0, r8 | r0 = r8;
0x00012b40 bl 0x10b38 | r0 = strcmp (r0, "mlc-nand");
0x00012b44 cmp r0, 0 |
| if (r0 != 0) {
0x00012b48 moveq r0, 3 | r0 = 3;
| }
| if (r0 == 0) {
0x00012b4c beq 0x12bc4 | goto label_12;
| }
0x00012b50 ldr r1, [pc, 0xcc] | r1 = "nor";
0x00012b54 mov r0, r8 | r0 = r8;
0x00012b58 bl 0x10b38 | r0 = strcmp (r0, "nor");
0x00012b5c cmp r0, 0 |
| if (r0 != 0) {
0x00012b60 moveq r0, 2 | r0 = 2;
| }
| if (r0 == 0) {
0x00012b64 beq 0x12bc4 | goto label_12;
| }
0x00012b68 ldr r1, [pc, 0xb8] | r1 = "rom";
0x00012b6c mov r0, r8 | r0 = r8;
0x00012b70 bl 0x10b38 | r0 = strcmp (r0, "rom");
0x00012b74 cmp r0, 0 |
| if (r0 == 0) {
0x00012b78 beq 0x12bc4 | goto label_12;
| }
0x00012b7c ldr r1, [pc, 0xa8] | r1 = "absent";
0x00012b80 mov r0, r8 | r0 = r8;
0x00012b84 bl 0x10b38 | r0 = strcmp (r0, "absent");
0x00012b88 cmp r0, 0 |
| if (r0 != 0) {
0x00012b8c moveq r0, 6 | r0 = 6;
| }
| if (r0 == 0) {
0x00012b90 beq 0x12bc4 | goto label_12;
| }
0x00012b94 ldr r1, [pc, 0x94] | r1 = "dataflash";
0x00012b98 mov r0, r8 | r0 = r8;
0x00012b9c bl 0x10b38 | r0 = strcmp (r0, "dataflash");
0x00012ba0 cmp r0, 0 |
| if (r0 != 0) {
0x00012ba4 moveq r0, 1 | r0 = 1;
| }
| if (r0 == 0) {
0x00012ba8 beq 0x12bc4 | goto label_12;
| }
0x00012bac ldr r1, [pc, 0x80] | r1 = *(0x12c30);
0x00012bb0 mov r0, r8 | r0 = r8;
0x00012bb4 bl 0x10b38 | r0 = strcmp (r0, r1);
0x00012bb8 cmp r0, 0 |
| if (r0 != 0) {
0x00012bbc moveq r0, 7 | r0 = 7;
| }
| if (r0 != 0) {
0x00012bc0 mvnne r0, 0 | r0 = ~0;
| goto label_12;
| }
| }
| label_12:
0x00012bc4 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
0x00012bc8 sub r0, r0, 4 | r0 -= 4;
0x00012bcc bics r3, r0, 4 | __asm ("bics r3, r0, 4");
0x00012bd0 ldrb r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
0x00012bd4 bic r2, r3, 2 | r2 = BIT_MASK (r3, 2);
| if (r0 != 0) {
0x00012bd8 moveq r3, 2 | r3 = 2;
| }
| if (r0 == 0) {
0x00012bdc movne r3, 0 | r3 = 0;
| }
0x00012be0 orr r3, r3, r2 | r3 |= r2;
0x00012be4 strb r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
0x00012be8 b 0x12718 | 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/flash_erase @ 0x12c38 */
| #include <stdint.h>
|
; (fcn) fcn.00012c38 () | void fcn_00012c38 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_20h;
| int32_t var_30h;
| int32_t var_40h;
| int32_t var_40h_2;
| int32_t var_88h;
| r0 = arg1;
| r1 = arg2;
0x00012c38 ldrb r3, [r0, 0x34] | r3 = *((r0 + 0x34));
0x00012c3c push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00012c40 tst r3, 1 |
0x00012c44 sub sp, sp, 0x88 |
0x00012c48 mov r4, r1 | r4 = r1;
0x00012c4c mov r7, r2 | r7 = r2;
| if ((r3 & 1) != 0) {
0x00012c50 bne 0x12c68 | goto label_3;
| }
0x00012c54 mov r1, r2 | r1 = r2;
0x00012c58 mov r0, r4 | r0 = r4;
0x00012c5c bl 0x14168 | fcn_00014168 (r0, r1);
| do {
| label_2:
0x00012c60 add sp, sp, 0x88 |
0x00012c64 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_3:
0x00012c68 mov r5, r0 | r5 = r0;
0x00012c6c add r1, sp, 0x20 | r1 += var_20h;
0x00012c70 mov r0, r4 | r0 = r4;
0x00012c74 bl 0x10a18 | r0 = stat64 ();
0x00012c78 cmp r0, 0 |
| if (r0 == 0) {
0x00012c7c beq 0x12cd0 | goto label_4;
| }
0x00012c80 bl 0x10b5c | errno_location ();
0x00012c84 ldr r6, [pc, 0x144] | r6 = *(0x12dcc);
0x00012c88 mov r3, r4 | r3 = r4;
0x00012c8c ldr r2, [pc, 0x140] | r2 = stderr;
0x00012c90 ldr r1, [pc, 0x140] | r1 = "libmtd";
0x00012c94 ldr r5, [r0] | r5 = *(r0);
0x00012c98 ldr r0, [r6] | r0 = *(0x12dcc);
0x00012c9c bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00012ca0 mov r0, r5 | r0 = r5;
0x00012ca4 ldr r4, [r6] | r4 = *(0x12dcc);
0x00012ca8 bl 0x10a0c | strerror (r0);
0x00012cac str r5, [sp] | *(sp) = r5;
0x00012cb0 ldr r3, [pc, 0x124] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x00012cb4 mov r2, 8 | r2 = 8;
0x00012cb8 ldr r1, [pc, 0x120] | r1 = *(0x12ddc);
0x00012cbc str r0, [sp, 4] | var_4h = r0;
0x00012cc0 mov r0, r4 | r0 = r4;
0x00012cc4 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n", r4, r5)
| label_0:
0x00012cc8 mvn r0, 0 | r0 = ~0;
0x00012ccc b 0x12c60 |
| } while (1);
| label_4:
0x00012cd0 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00012cd4 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00012cd8 cmp r3, 0x2000 |
| if (r3 != 0x2000) {
0x00012cdc beq 0x12d08 |
0x00012ce0 ldr r0, [pc, 0xe8] |
0x00012ce4 mov r3, r4 | r3 = r4;
0x00012ce8 ldr r2, [pc, 0xe4] | r2 = stderr;
0x00012cec ldr r1, [pc, 0xf0] | r1 = "%*serror %d (%s)\n";
0x00012cf0 ldr r0, [r0] | r0 = *(0x12dcc);
0x00012cf4 bl 0x10aa8 | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x00012cf8 bl 0x10b5c | errno_location ();
0x00012cfc mov r3, 0x16 | r3 = 0x16;
0x00012d00 str r3, [r0] | *(r0) = r3;
0x00012d04 b 0x12cc8 | goto label_0;
| }
0x00012d08 ldrd r8, sb, [sp, 0x40] | __asm ("ldrd r8, sb, [var_40h]");
0x00012d0c mov r0, r8 | r0 = r8;
0x00012d10 mov r1, sb | r1 = sb;
0x00012d14 bl 0x10a3c | gnu_dev_major ();
0x00012d18 mov r1, sb | r1 = sb;
0x00012d1c mov sl, r0 | sl = r0;
0x00012d20 mov r0, r8 | r0 = r8;
0x00012d24 bl 0x10a78 | gnu_dev_minor ();
0x00012d28 add r1, sp, 0x10 | r1 += var_10h;
0x00012d2c mov r8, r0 | r8 = r0;
0x00012d30 mov r0, r5 | r0 = r5;
0x00012d34 bl 0x12664 | r0 = fcn_00012664 (r0, r1);
0x00012d38 cmp r0, 0 |
| if (r0 != 0) {
0x00012d3c bne 0x12cc8 | goto label_0;
| }
0x00012d40 bl 0x10b5c | errno_location ();
0x00012d44 ldr r4, [sp, 0x14] | r4 = var_14h;
0x00012d48 add sb, r5, 8 | sb = r5 + 8;
0x00012d4c mov r6, r0 | r6 = r0;
| do {
0x00012d50 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00012d54 cmp r4, r3 |
| if (r4 > r3) {
0x00012d58 bgt 0x12d94 | goto label_5;
| }
0x00012d5c add r3, sp, 0xc | r3 += var_ch;
0x00012d60 add r2, sp, 8 | r2 += var_8h;
0x00012d64 mov r1, r4 | r1 = r4;
0x00012d68 mov r0, sb | r0 = sb;
0x00012d6c bl 0x11f3c | r0 = fcn_00011f3c (r0, r1);
0x00012d70 cmp r0, 0 |
| if (r0 == 0) {
0x00012d74 beq 0x12da0 | goto label_6;
| }
0x00012d78 ldr r3, [r6] | r3 = *(r6);
0x00012d7c cmp r3, 2 |
| if (r3 != 2) {
0x00012d80 bne 0x12d8c | goto label_7;
| }
| label_1:
0x00012d84 add r4, r4, 1 | r4++;
0x00012d88 b 0x12d50 |
| } while (1);
| label_7:
0x00012d8c cmp r3, 0 |
| if (r3 != 0) {
0x00012d90 bne 0x12cc8 | goto label_0;
| }
| label_5:
0x00012d94 mov r3, 0x13 | r3 = 0x13;
0x00012d98 str r3, [r6] | *(r6) = r3;
0x00012d9c b 0x12cc8 | goto label_0;
| label_6:
0x00012da0 ldr r3, [sp, 8] | r3 = var_8h;
0x00012da4 cmp sl, r3 |
| if (sl != r3) {
0x00012da8 bne 0x12d84 | goto label_1;
| }
0x00012dac ldr r3, [sp, 0xc] | r3 = var_ch;
0x00012db0 cmp r8, r3 |
| if (r8 != r3) {
0x00012db4 bne 0x12d84 | goto label_1;
| }
0x00012db8 str r0, [r6] | *(r6) = r0;
0x00012dbc mov r2, r7 | r2 = r7;
0x00012dc0 mov r1, r4 | r1 = r4;
0x00012dc4 mov r0, r5 | r0 = r5;
0x00012dc8 bl 0x126a4 | fcn_000126a4 (r0, r1);
0x00012dcc b 0x12c60 | goto label_2;
| }
; 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/flash_erase @ 0x12e30 */
| #include <stdint.h>
|
; (fcn) fcn.00012e30 () | void fcn_00012e30 (int32_t arg_40h, int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_8h;
| int32_t var_8h_2;
| int32_t var_10h;
| int32_t var_10h_2;
| int32_t var_1ch;
| r0 = arg1;
| r1 = arg2;
0x00012e30 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012e34 mov r4, r1 | r4 = r1;
0x00012e38 sub sp, sp, 0x1c |
0x00012e3c mov r6, r0 | r6 = r0;
0x00012e40 mov r1, r3 | r1 = r3;
0x00012e44 mov r0, r4 | r0 = r4;
0x00012e48 mov fp, r2 |
0x00012e4c mov sl, r3 | sl = r3;
0x00012e50 ldr r7, [sp, 0x40] | r7 = *(arg_40h);
0x00012e54 bl 0x11e60 | r0 = fcn_00011e60 (r0, r1);
0x00012e58 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00012e5c bne 0x12f48 | goto label_1;
| }
0x00012e60 add r1, sl, r7 | r1 = sl + r7;
0x00012e64 sub r1, r1, 1 | r1--;
0x00012e68 mov r0, r4 | r0 = r4;
0x00012e6c bl 0x11e60 | r0 = fcn_00011e60 (r0, r1);
0x00012e70 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00012e74 bne 0x12f48 | goto label_1;
| }
0x00012e78 ldr r3, [r4, 0xe4] | r3 = *((r4 + 0xe4));
0x00012e7c smull r0, r1, sl, r3 | r0:r1 = sl * r3;
0x00012e80 strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [var_8h]");
0x00012e84 smull r0, r1, r3, r7 | r0:r1 = r3 * r7;
0x00012e88 ldrb r3, [r6, 0x34] | r3 = *((r6 + 0x34));
0x00012e8c strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x00012e90 tst r3, 2 |
| if ((r3 & 2) == 0) {
0x00012e94 bne 0x12ef0 |
0x00012e98 add r2, sp, 8 | r2 += var_8h;
0x00012e9c ldr r1, [pc, 0xd4] | r1 = *(0x12f74);
0x00012ea0 mov r0, fp | r0 = fp;
0x00012ea4 bl 0x109f4 | r0 = ioctl (r0, r1);
0x00012ea8 cmp r0, 0 |
| if (r0 == 0) {
0x00012eac beq 0x12f48 | goto label_1;
| }
0x00012eb0 bl 0x10b5c | r0 = errno_location ();
0x00012eb4 ldr r3, [r0] | r3 = *(r0);
0x00012eb8 cmp r3, 0x19 |
| if (r3 == 0x19) {
0x00012ebc bne 0x12ed8 |
0x00012ec0 ldrb r3, [r6, 0x34] | r3 = *((r6 + 0x34));
0x00012ec4 tst r3, 6 |
0x00012ec8 biceq r3, r3, 4 | __asm ("biceq r3, r3, 4");
| if ((r3 & 6) != 0) {
0x00012ecc orreq r3, r3, 2 | r3 |= 2;
| }
| if ((r3 & 6) != 0) {
0x00012ed0 strbeq r3, [r6, 0x34] | *((r6 + 0x34)) = r3;
| }
| if ((r3 & 6) == 0) {
0x00012ed4 beq 0x12ef0 | goto label_2;
| }
| }
0x00012ed8 ldr r2, [pc, 0x9c] | r2 = *(0x12f78);
| label_0:
0x00012edc mov r1, sl | r1 = sl;
0x00012ee0 ldr r0, [r4] | r0 = *(r4);
0x00012ee4 bl 0x11ec0 | r0 = fcn_00011ec0 (r0, r1);
0x00012ee8 mov r5, r0 | r5 = r0;
0x00012eec b 0x12f48 |
| } else {
| label_2:
0x00012ef0 ldrd r0, r1, [sp, 8] | __asm ("ldrd r0, r1, [var_8h]");
0x00012ef4 ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [var_10h]");
0x00012ef8 mov r7, 0 | r7 = 0;
0x00012efc adds r8, r0, r2 | r8 = r0 + r2;
0x00012f00 adc sb, r1, r3 | __asm ("adc sb, r1, r3");
0x00012f04 mvn r6, 0 | r6 = ~0;
0x00012f08 cmp sb, r7 |
0x00012f0c cmpeq r8, r6 | __asm ("cmpeq r8, r6");
| if (sb < r7) {
0x00012f10 bls 0x12f54 | goto label_3;
| }
0x00012f14 ldr r1, [r4, 0xe4] | r1 = *((r4 + 0xe4));
0x00012f18 mvn r0, 0 | r0 = ~0;
0x00012f1c bl 0x14688 | fcn_00014688 (r0, r1);
0x00012f20 ldr r2, [pc, 0x58] | r2 = "MEMERASE64";
0x00012f24 ldr r1, [pc, 0x58] | r1 = "libmtd";
0x00012f28 mvn r5, 0 | r5 = ~0;
0x00012f2c mov r3, r0 | r3 = r0;
0x00012f30 ldr r0, [pc, 0x50] |
0x00012f34 ldr r0, [r0] | r0 = "%s: error!: this system can address only %u eraseblocks\n";
0x00012f38 bl 0x10aa8 | r0 = fprintf ("%s: error!: this system can address only %u eraseblocks\n", "libmtd", "MEMERASE64", r3, r4, r5)
0x00012f3c bl 0x10b5c | errno_location ();
0x00012f40 mov r3, 0x16 | r3 = 0x16;
0x00012f44 str r3, [r0] | *(r0) = r3;
| }
| do {
| label_1:
0x00012f48 mov r0, r5 | r0 = r5;
0x00012f4c add sp, sp, 0x1c |
0x00012f50 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_3:
0x00012f54 stm sp, {r0, r2} | *(sp) = r0;
| *((sp + 4)) = r2;
0x00012f58 ldr r1, [pc, 0x2c] | r1 = stderr;
0x00012f5c mov r2, sp | r2 = sp;
0x00012f60 mov r0, fp | r0 = fp;
0x00012f64 bl 0x109f4 | r0 = ioctl (r0, r1);
0x00012f68 cmp r0, 0 |
0x00012f6c bge 0x12f48 |
| } while (r0 >= 0);
0x00012f70 ldr r2, [pc, 0x18] | r2 = *(0x12f8c);
0x00012f74 b 0x12edc | 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/flash_erase @ 0x131c4 */
| #include <stdint.h>
|
; (fcn) fcn.000131c4 () | void fcn_000131c4 (int32_t arg_38h, int32_t arg_3ch, int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x000131c4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000131c8 mov fp, r1 |
0x000131cc sub sp, sp, 0x14 |
0x000131d0 mov r1, r2 | r1 = r2;
0x000131d4 mov sb, r0 | sb = r0;
0x000131d8 mov sl, r2 | sl = r2;
0x000131dc mov r5, r3 | r5 = r3;
0x000131e0 ldr r8, [sp, 0x3c] | r8 = *(arg_3ch);
0x000131e4 bl 0x11e60 | r0 = fcn_00011e60 (r0, r1);
0x000131e8 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x000131ec bne 0x13240 | goto label_0;
| }
0x000131f0 cmp r5, 0 |
0x000131f4 ldr r3, [sb, 0xe4] | r3 = *((sb + 0xe4));
| if (r5 >= 0) {
0x000131f8 blt 0x13208 |
0x000131fc add r2, r5, r8 | r2 = r5 + r8;
0x00013200 cmp r2, r3 |
| if (r2 <= r3) {
0x00013204 ble 0x1324c | goto label_3;
| }
| }
0x00013208 str r3, [sp, 8] | var_8h = r3;
0x0001320c ldr r0, [pc, 0x128] |
0x00013210 ldr r3, [sb] | r3 = *(sb);
0x00013214 str r8, [sp] | *(sp) = r8;
0x00013218 str r3, [sp, 4] | var_4h = r3;
0x0001321c ldr r2, [pc, 0x11c] | r2 = stderr;
0x00013220 mov r3, r5 | r3 = r5;
0x00013224 ldr r1, [pc, 0x118] | r1 = "libmtd";
0x00013228 ldr r0, [r0] | r0 = *(0x13338);
0x0001322c bl 0x10aa8 | r0 = fprintf (r0, "libmtd", r2, r3)
0x00013230 bl 0x10b5c | errno_location ();
0x00013234 mov r3, 0x16 | r3 = 0x16;
0x00013238 str r3, [r0] | *(r0) = r3;
| do {
0x0001323c mvn r4, 0 | r4 = ~0;
| label_0:
0x00013240 mov r0, r4 | r0 = r4;
0x00013244 add sp, sp, 0x14 |
0x00013248 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_3:
0x0001324c mov r6, r5 | r6 = r5;
0x00013250 asr r7, r5, 0x1f | r7 = r5 >> 0x1f;
0x00013254 smlal r6, r7, r3, sl | __asm ("smlal r6, r7, r3, sl");
0x00013258 str r4, [sp] | *(sp) = r4;
0x0001325c mov r3, r7 | r3 = r7;
0x00013260 mov r2, r6 | r2 = r6;
0x00013264 mov r0, fp | r0 = fp;
0x00013268 bl 0x10b80 | lseek64 ();
0x0001326c cmp r7, r1 |
0x00013270 cmpeq r6, r0 | __asm ("cmpeq r6, r0");
| if (r7 != r1) {
0x00013274 moveq r7, r4 | r7 = r4;
| }
| if (r7 == r1) {
0x00013278 beq 0x132d8 | goto label_4;
| }
0x0001327c bl 0x10b5c | errno_location ();
0x00013280 ldr r5, [pc, 0xb4] |
0x00013284 mov r2, r6 | r2 = r6;
0x00013288 mov r3, r7 | r3 = r7;
0x0001328c ldr r1, [pc, 0xb4] | r1 = "%s: error!: bad offset %d or length %d, mtd%d eraseblock size is %d\n";
0x00013290 ldr r4, [r0] | r4 = *(r0);
0x00013294 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00013298 ldr r3, [sb] | r3 = *(sb);
0x0001329c ldr r0, [r5] | r0 = *(0x13338);
0x000132a0 ldr r2, [pc, 0x98] | r2 = stderr;
0x000132a4 bl 0x10aa8 | fprintf (r0, "%s: error!: bad offset %d or length %d, mtd%d eraseblock size is %d\n", r2, r3, r4, r5)
0x000132a8 ldr r5, [r5] | r5 = *(0x13338);
| label_2:
0x000132ac mov r0, r4 | r0 = r4;
0x000132b0 bl 0x10a0c | strerror (r0);
0x000132b4 str r4, [sp] | *(sp) = r4;
0x000132b8 ldr r3, [pc, 0x8c] | r3 = "_s:_error_:_cannot_seek_mtd_d_to_offset__lld";
0x000132bc mov r2, 8 | r2 = 8;
0x000132c0 ldr r1, [pc, 0x88] | r1 = *(0x1334c);
0x000132c4 str r0, [sp, 4] | var_4h = r0;
0x000132c8 mov r0, r5 | r0 = r5;
0x000132cc bl 0x10aa8 | fprintf (r0, r1, r2, "_s:_error_:_cannot_seek_mtd_d_to_offset__lld", r4)
0x000132d0 b 0x1323c |
| } while (1);
| label_1:
0x000132d4 add r7, r7, r0 | r7 += r0;
| label_4:
0x000132d8 cmp r8, r7 |
| if (r8 <= r7) {
0x000132dc ble 0x13240 | goto label_0;
| }
0x000132e0 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x000132e4 sub r6, r8, r7 | r6 = r8 - r7;
0x000132e8 mov r2, r6 | r2 = r6;
0x000132ec add r1, r3, r7 | r1 = r3 + r7;
0x000132f0 mov r0, fp | r0 = fp;
0x000132f4 bl 0x10acc | r0 = read (r0, r1, r2);
0x000132f8 cmp r0, 0 |
| if (r0 >= 0) {
0x000132fc bge 0x132d4 | goto label_1;
| }
0x00013300 bl 0x10b5c | errno_location ();
0x00013304 ldr r8, [pc, 0x30] | r8 = *(0x13338);
0x00013308 ldr r3, [sb] | r3 = *(sb);
0x0001330c add r5, r5, r7 | r5 += r7;
0x00013310 ldr r2, [pc, 0x28] | r2 = stderr;
0x00013314 ldr r1, [pc, 0x38] | r1 = "%*serror %d (%s)\n";
0x00013318 ldr r4, [r0] | r4 = *(r0);
0x0001331c str r5, [sp, 8] | var_8h = r5;
0x00013320 str r3, [sp] | *(sp) = r3;
0x00013324 str sl, [sp, 4] | var_4h = sl;
0x00013328 mov r3, r6 | r3 = r6;
0x0001332c ldr r0, [r8] | r0 = *(0x13338);
0x00013330 bl 0x10aa8 | fprintf (r0, "%*serror %d (%s)\n", r2, r3, r4, r5)
0x00013334 ldr r5, [r8] | r5 = *(0x13338);
0x00013338 b 0x132ac | goto label_2;
| }
; 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/flash_erase @ 0x133e0 */
| #include <stdint.h>
|
; (fcn) fcn.000133e0 () | void fcn_000133e0 (int32_t arg_158h, char * ptr, int32_t arg_160h, void * s2, int32_t arg_168h, int32_t arg_16ch, int32_t arg1, char * * arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_8h_2;
| int32_t var_10h;
| int32_t var_18h;
| int32_t var_18h_2;
| int32_t var_24h;
| int32_t var_28h;
| int32_t var_28h_2;
| int32_t var_30h;
| int32_t var_34h;
| void * s;
| int32_t var_38h_2;
| int32_t var_40h;
| int32_t var_40h_2;
| int32_t var_48h;
| int32_t var_48h_2;
| int32_t var_50h;
| int32_t var_54h;
| int32_t var_58h;
| int32_t var_5ch;
| int32_t var_60h;
| int32_t var_68h;
| void * s1;
| int32_t var_70h;
| int32_t var_134h;
| r0 = arg1;
| r1 = arg2;
0x000133e0 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000133e4 sub sp, sp, 0x134 |
0x000133e8 str r0, [sp, 0x34] | var_34h = r0;
0x000133ec mov r5, r1 | r5 = r1;
0x000133f0 mov r7, r2 | r7 = r2;
0x000133f4 mov r1, 0 | r1 = 0;
0x000133f8 mov r2, 0x30 | r2 = 0x30;
0x000133fc add r0, sp, 0x38 | r0 += s;
0x00013400 str r3, [sp, 0x24] | var_24h = r3;
0x00013404 ldr r6, [sp, 0x160] | r6 = *(arg_160h);
0x00013408 ldr sl, [sp, 0x168] | sl = *(arg_168h);
0x0001340c ldrb r8, [sp, 0x16c] | r8 = *(arg_16ch);
0x00013410 bl 0x10b14 | memset (r0, r1, r2);
0x00013414 ldr r1, [sp, 0x24] | r1 = var_24h;
0x00013418 mov r0, r5 | r0 = r5;
0x0001341c bl 0x11e60 | r0 = fcn_00011e60 (r0, r1);
0x00013420 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00013424 bne 0x13594 | goto label_3;
| }
0x00013428 ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x0001342c ldr fp, [r5, 0xe4] | fp = *((r5 + 0xe4));
0x00013430 cmp r3, 0 |
| if (r3 >= 0) {
0x00013434 blt 0x13444 |
0x00013438 add r3, r3, r6 | r3 += r6;
0x0001343c cmp r3, fp |
| if (r3 <= fp) {
0x00013440 ble 0x13480 | goto label_5;
| }
| }
0x00013444 str fp, [sp, 8] | var_8h = fp;
0x00013448 ldr r0, [pc, 0x328] |
0x0001344c ldr r3, [r5] | r3 = *(r5);
0x00013450 ldr r2, [pc, 0x324] | r2 = stderr;
0x00013454 str r3, [sp, 4] | var_4h = r3;
0x00013458 str r6, [sp] | *(sp) = r6;
0x0001345c ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x00013460 ldr r1, [pc, 0x318] | r1 = "libmtd";
0x00013464 ldr r0, [r0] | r0 = *(0x13774);
0x00013468 bl 0x10aa8 | r0 = fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
| do {
0x0001346c bl 0x10b5c | errno_location ();
0x00013470 mov r3, 0x16 | r3 = 0x16;
0x00013474 str r3, [r0] | *(r0) = r3;
| label_1:
0x00013478 mvn r4, 0 | r4 = ~0;
0x0001347c b 0x13594 | goto label_3;
| label_5:
0x00013480 ldr sb, [r5, 0xec] | sb = *((r5 + 0xec));
0x00013484 ldr r0, [sp, 0x158] | r0 = *(arg_158h);
0x00013488 mov r1, sb | r1 = sb;
0x0001348c bl 0x1482c | fcn_0001482c (r0, r1);
0x00013490 cmp r1, 0 |
| if (r1 == 0) {
0x00013494 beq 0x134c0 | goto label_6;
| }
0x00013498 str sb, [sp, 4] | var_4h = sb;
0x0001349c ldr r3, [r5] | r3 = *(r5);
0x000134a0 ldr r2, [pc, 0x2d4] | r2 = stderr;
0x000134a4 str r3, [sp] | *(sp) = r3;
0x000134a8 ldr r1, [pc, 0x2d4] | r1 = "%s: error!: bad offset %d or length %d, mtd%d eraseblock size is %d\n";
0x000134ac ldr r3, [sp, 0x158] | r3 = *(arg_158h);
| label_0:
0x000134b0 ldr r0, [pc, 0x2c0] |
0x000134b4 ldr r0, [r0] | r0 = *(0x13774);
0x000134b8 bl 0x10aa8 | fprintf (r0, "%s: error!: bad offset %d or length %d, mtd%d eraseblock size is %d\n", r2, r3)
0x000134bc b 0x1346c |
| } while (1);
| label_6:
0x000134c0 mov r1, sb | r1 = sb;
0x000134c4 mov r0, r6 | r0 = r6;
0x000134c8 bl 0x1482c | fcn_0001482c (r0, r1);
0x000134cc subs r4, r1, 0 | r4 = r1 - 0;
| if (r4 != r1) {
0x000134d0 beq 0x134f0 |
0x000134d4 str sb, [sp, 4] | var_4h = sb;
0x000134d8 ldr r3, [r5] | r3 = *(r5);
0x000134dc ldr r2, [pc, 0x298] | r2 = stderr;
0x000134e0 str r3, [sp] | *(sp) = r3;
0x000134e4 ldr r1, [pc, 0x29c] | r1 = "_s:_error_:_write_offset__d_is_not_aligned_to_mtd_d_min._I_O_size__d";
0x000134e8 mov r3, r6 | r3 = r6;
0x000134ec b 0x134b0 | goto label_0;
| }
0x000134f0 ldr r2, [sp, 0x158] | r2 = *(arg_158h);
0x000134f4 ldr r1, [sp, 0x24] | r1 = var_24h;
0x000134f8 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x000134fc smlal r2, r3, fp, r1 | __asm ("smlal r2, r3, fp, r1");
0x00013500 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x00013504 ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013508 cmp r3, 0 |
| if (r3 == 0) {
0x0001350c beq 0x136c0 | goto label_7;
| }
0x00013510 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00013514 ldr r1, [pc, 0x270] | r1 = "_s:_error_:_write_length__d_is_not_aligned_to_mtd_d_min._I_O_size__d";
0x00013518 strd r2, r3, [sp, 0x38] | __asm ("strd r2, r3, [s]");
0x0001351c mov r2, r6 | r2 = r6;
0x00013520 asr r3, r6, 0x1f | r3 = r6 >> 0x1f;
0x00013524 strd r2, r3, [sp, 0x40] | __asm ("strd r2, r3, [var_40h]");
0x00013528 mov r2, sl | r2 = sl;
0x0001352c asr r3, sl, 0x1f | r3 = sl >> 0x1f;
0x00013530 strd r2, r3, [sp, 0x28] | __asm ("strd r2, r3, [var_28h]");
0x00013534 strd r2, r3, [sp, 0x48] | __asm ("strd r2, r3, [var_48h]");
0x00013538 ldr r3, [sp, 0x15c] | r3 = *(ptr);
0x0001353c add r2, sp, 0x38 | r2 += s;
0x00013540 str r3, [sp, 0x50] | var_50h = r3;
0x00013544 ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013548 mov r0, r7 | r0 = r7;
0x0001354c str r4, [sp, 0x54] | var_54h = r4;
0x00013550 str r3, [sp, 0x58] | var_58h = r3;
0x00013554 str r4, [sp, 0x5c] | var_5ch = r4;
0x00013558 strb r8, [sp, 0x60] | var_60h = r8;
0x0001355c bl 0x109f4 | r0 = ioctl (r0, r1);
0x00013560 cmp r0, 0 |
| if (r0 != 0) {
0x00013564 beq 0x13594 |
0x00013568 bl 0x10b5c | r0 = errno_location ();
0x0001356c ldr r3, [r0] | r3 = *(r0);
0x00013570 mov sb, r0 | sb = r0;
0x00013574 cmp r3, 0x19 |
0x00013578 cmpne r3, 0x5f | __asm ("cmpne r3, 0x5f");
| if (r3 == 0x19) {
0x0001357c beq 0x135a0 | goto label_8;
| }
0x00013580 ldr r2, [pc, 0x208] | r2 = *(0x1378c);
0x00013584 ldr r1, [sp, 0x24] | r1 = var_24h;
0x00013588 ldr r0, [r5] | r0 = *(r5);
0x0001358c bl 0x11ec0 | r0 = fcn_00011ec0 (r0, r1);
0x00013590 mov r4, r0 | r4 = r0;
| }
| label_3:
0x00013594 mov r0, r4 | r0 = r4;
0x00013598 add sp, sp, 0x134 |
0x0001359c pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_8:
0x000135a0 cmp r8, 1 |
| if (r8 != 1) {
0x000135a4 bne 0x13680 | goto label_9;
| }
0x000135a8 add r2, sp, 0x68 | r2 += var_68h;
0x000135ac ldr r1, [pc, 0x1e0] | r1 = "MEMWRITE";
0x000135b0 mov r0, r7 | r0 = r7;
0x000135b4 bl 0x109f4 | r0 = ioctl (r0, "MEMWRITE");
0x000135b8 subs fp, r0, 0 |
| if (fp != r0) {
0x000135bc beq 0x13604 |
0x000135c0 ldr r4, [sb] | r4 = *(sb);
0x000135c4 ldr r5, [pc, 0x1ac] | r5 = *(0x13774);
0x000135c8 ldr r2, [pc, 0x1ac] | r2 = stderr;
0x000135cc ldr r1, [pc, 0x1c4] | r1 = *(0x13794);
| label_2:
0x000135d0 ldr r0, [r5] | r0 = *(r5);
0x000135d4 bl 0x10aa8 | fprintf (r0, r1, r2, r3, r4, r5)
0x000135d8 ldr r5, [r5] | r5 = *(r5);
| label_4:
0x000135dc mov r0, r4 | r0 = r4;
0x000135e0 bl 0x10a0c | strerror (r0);
0x000135e4 str r4, [sp] | *(sp) = r4;
0x000135e8 ldr r3, [pc, 0x1ac] | r3 = "%s: error!: MEMGETOOBSEL failed\n";
0x000135ec mov r2, 8 | r2 = 8;
0x000135f0 ldr r1, [pc, 0x1a8] | r1 = *(0x1379c);
0x000135f4 str r0, [sp, 4] | var_4h = r0;
0x000135f8 mov r0, r5 | r0 = r5;
0x000135fc bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: MEMGETOOBSEL failed\n", r4)
0x00013600 b 0x13478 | goto label_1;
| }
0x00013604 mov r0, sl | r0 = sl;
0x00013608 bl 0x10a54 | malloc (r0);
0x0001360c mov r2, sl | r2 = sl;
0x00013610 ldr r1, [sp, 0x164] | r1 = *(s2);
0x00013614 str r0, [sp, 0x30] | var_30h = r0;
0x00013618 bl 0x10a48 | memcpy (r0, r1, r2);
0x0001361c ldr r2, [sp, 0x68] | r2 = var_68h;
0x00013620 cmp r2, 2 |
| if (r2 != 2) {
0x00013624 addeq r8, sp, 0x70 | r8 += var_70h;
| }
| if (r2 == 2) {
0x00013628 beq 0x13670 | goto label_10;
| }
0x0001362c ldr r0, [sp, 0x6c] | r0 = s1;
0x00013630 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00013634 ldr r2, [r5, 0xf0] | r2 = *((r5 + 0xf0));
0x00013638 add r1, r3, r0 | r1 = r3 + r0;
0x0001363c ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013640 sub r2, r2, r0 | r2 -= r0;
0x00013644 add r0, r3, r0 | r0 = r3 + r0;
0x00013648 bl 0x10a48 | memcpy (r0, r1, r2);
0x0001364c b 0x13680 | goto label_9;
| do {
0x00013650 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00013654 ldr r0, [r8, -8] | r0 = *((r8 - 8));
0x00013658 add r1, r3, fp | r1 = r3 + fp;
0x0001365c ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013660 mov r2, sl | r2 = sl;
0x00013664 add r0, r3, r0 | r0 = r3 + r0;
0x00013668 bl 0x10a48 | memcpy (r0, r1, r2);
0x0001366c add fp, fp, sl |
| label_10:
0x00013670 add r8, r8, 8 | r8 += 8;
0x00013674 ldr sl, [r8, -4] | sl = *((r8 - 4));
0x00013678 cmp sl, 0 |
0x0001367c bne 0x13650 |
| } while (sl != 0);
| label_9:
0x00013680 ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013684 mov r1, r5 | r1 = r5;
0x00013688 str r3, [sp, 0x10] | var_10h = r3;
0x0001368c ldrd r2, r3, [sp, 0x28] | __asm ("ldrd r2, r3, [var_28h]");
0x00013690 ldr r0, [sp, 0x34] | r0 = var_34h;
0x00013694 strd r2, r3, [sp, 8] | __asm ("strd r2, r3, [var_8h]");
0x00013698 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x0001369c strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x000136a0 mov r2, r7 | r2 = r7;
0x000136a4 bl 0x1339c | r0 = fcn_0001339c (r0, r1, r2, r3, r4);
0x000136a8 cmp r0, 0 |
| if (r0 >= 0) {
0x000136ac ldrlt r4, [sb] | r4 = *(sb);
| }
| if (r0 >= 0) {
0x000136b0 ldrlt r5, [pc, 0xc0] | r5 = obj.stderr;
| }
| if (r0 >= 0) {
0x000136b4 ldrlt r2, [pc, 0xc0] | r2 = "libmtd";
| }
| if (r0 < 0) {
0x000136b8 ldrlt r1, [pc, 0xe4] | r1 = "%s: error!: cannot write to OOB\n";
| goto label_11;
| }
| if (r0 < 0) {
| label_11:
0x000136bc blt 0x135d0 | goto label_2;
| }
| label_7:
0x000136c0 ldr r3, [sp, 0x15c] | r3 = *(ptr);
0x000136c4 cmp r3, 0 |
| if (r3 == 0) {
0x000136c8 beq 0x13594 | goto label_3;
| }
0x000136cc mov r3, 0 | r3 = 0;
0x000136d0 str r3, [sp] | *(sp) = r3;
0x000136d4 mov r0, r7 | r0 = r7;
0x000136d8 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x000136dc bl 0x10b80 | lseek64 ();
0x000136e0 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x000136e4 cmp r1, r3 |
0x000136e8 cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| if (r1 != r3) {
0x000136ec beq 0x13720 |
0x000136f0 bl 0x10b5c | errno_location ();
0x000136f4 ldr r6, [pc, 0x7c] | r6 = *(0x13774);
0x000136f8 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x000136fc ldr r1, [pc, 0xa4] | r1 = "%s: error!: cannot write to OOB\n";
0x00013700 ldr r4, [r0] | r4 = *(r0);
0x00013704 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00013708 ldr r2, [pc, 0x6c] | r2 = stderr;
0x0001370c ldr r3, [r5] | r3 = *(r5);
0x00013710 ldr r0, [r6] | r0 = *(0x13774);
0x00013714 bl 0x10aa8 | fprintf (r0, "%s: error!: cannot write to OOB\n", r2, r3, r4, r5, r6)
0x00013718 ldr r5, [r6] | r5 = *(0x13774);
0x0001371c b 0x135dc | goto label_4;
| }
0x00013720 mov r2, r6 | r2 = r6;
0x00013724 ldr r1, [sp, 0x15c] | r1 = *(ptr);
0x00013728 mov r0, r7 | r0 = r7;
0x0001372c bl 0x10a9c | r0 = write (r0, r1, r2);
0x00013730 cmp r6, r0 |
| if (r6 == r0) {
0x00013734 beq 0x13594 | goto label_3;
| }
0x00013738 bl 0x10b5c | errno_location ();
0x0001373c ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x00013740 ldr r7, [pc, 0x30] | r7 = *(0x13774);
0x00013744 ldr r2, [pc, 0x30] | r2 = stderr;
0x00013748 ldr r1, [pc, 0x5c] | r1 = "_s:_error_:_cannot_seek_mtd_d_to_offset__lld";
0x0001374c ldr r4, [r0] | r4 = *(r0);
0x00013750 str r3, [sp, 8] | var_8h = r3;
0x00013754 ldr r3, [sp, 0x24] | r3 = var_24h;
0x00013758 str r3, [sp, 4] | var_4h = r3;
0x0001375c ldr r3, [r5] | r3 = *(r5);
0x00013760 str r3, [sp] | *(sp) = r3;
0x00013764 mov r3, r6 | r3 = r6;
0x00013768 ldr r0, [r7] | r0 = *(0x13774);
0x0001376c bl 0x10aa8 | fprintf (r0, "_s:_error_:_cannot_seek_mtd_d_to_offset__lld", r2, r3, r4)
0x00013770 ldr r5, [r7] | r5 = *(0x13774);
0x00013774 b 0x135dc | 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/flash_erase @ 0x13b5c */
| #include <stdint.h>
|
; (fcn) fcn.00013b5c () | void fcn_00013b5c (int32_t arg1) {
| int32_t var_0h;
| int32_t var_8h;
| r0 = arg1;
0x00013b5c push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x00013b60 mov r4, r0 | r4 = r0;
0x00013b64 ldr r3, [r4, 0x94] | r3 = *((r4 + 0x94));
0x00013b68 ldr r0, [r0, 0x9c] | r0 = *((r0 + 0x9c));
0x00013b6c ldr r2, [r4, 0x98] | r2 = *((r4 + 0x98));
0x00013b70 sub r5, r0, r3 | r5 = r0 - r3;
0x00013b74 cmp r2, r5 |
| if (r2 > r5) {
0x00013b78 bgt 0x13b90 | goto label_4;
| }
0x00013b7c mov r0, r3 | r0 = r3;
0x00013b80 bl 0x10bbc | free (r0);
0x00013b84 mov r0, 0 | r0 = 0;
| do {
| label_3:
0x00013b88 add sp, sp, 8 |
0x00013b8c pop {r4, r5, r6, r7, r8, pc} |
| label_4:
0x00013b90 add r3, r4, 0x90 | r3 = r4 + 0x90;
0x00013b94 str r3, [sp] | *(sp) = r3;
0x00013b98 mov r2, r4 | r2 = r4;
0x00013b9c add r3, r4, 8 | r3 = r4 + 8;
0x00013ba0 ldr r1, [pc, 0xf8] | r1 = *(0x13c9c);
0x00013ba4 bl 0x10af0 | r0 = sscanf (r0, r1, r2);
0x00013ba8 cmp r0, 3 |
| if (r0 == 3) {
0x00013bac beq 0x13bd0 | goto label_5;
| }
0x00013bb0 ldr r3, [pc, 0xe8] | r3 = *(0x13c9c);
0x00013bb4 ldr r2, [pc, 0xe8] | r2 = "mtd_d:__llx__x";
0x00013bb8 ldr r1, [pc, 0xe8] | r1 = "libmtd";
| label_2:
0x00013bbc ldr r0, [pc, 0xe8] |
0x00013bc0 ldr r0, [r0] | r0 = "%s: error!: \"%s\" pattern not found\n";
0x00013bc4 bl 0x10aa8 | fprintf ("%s: error!: \"%s\" pattern not found\n", "libmtd", "mtd_d:__llx__x", r3)
| label_0:
0x00013bc8 mvn r0, 0 | r0 = ~0;
0x00013bcc b 0x13b88 |
| } while (1);
| label_5:
0x00013bd0 ldr r8, [r4, 0x98] | r8 = *((r4 + 0x98));
0x00013bd4 mov r1, 0x22 | r1 = 0x22;
0x00013bd8 sub r2, r8, r5 | r2 = r8 - r5;
0x00013bdc ldr r0, [r4, 0x9c] | r0 = *((r4 + 0x9c));
0x00013be0 bl 0x10ac0 | r0 = memchr (r0, r1, r2);
0x00013be4 cmp r0, 0 |
0x00013be8 bne 0x13c04 |
| while (r8 <= r2) {
0x00013bec ldr r2, [pc, 0xb0] | r2 = "mtd_d:__llx__x";
0x00013bf0 ldr r1, [pc, 0xb8] | r1 = stderr;
| label_1:
0x00013bf4 ldr r3, [pc, 0xb0] | r3 = "%s: error!: \"%s\" pattern not found\n";
0x00013bf8 ldr r0, [r3] | r0 = "%s: error!: \"%s\" pattern not found\n";
0x00013bfc bl 0x10aa8 | fprintf ("%s: error!: \"%s\" pattern not found\n", r1, "mtd_d:__llx__x", "%s: error!: \"%s\" pattern not found\n")
0x00013c00 b 0x13bc8 | goto label_0;
0x00013c04 ldr r7, [r4, 0x94] | r7 = *((r4 + 0x94));
0x00013c08 add r6, r0, 1 | r6 = r0 + 1;
0x00013c0c sub r2, r6, r7 | r2 = r6 - r7;
0x00013c10 cmp r8, r2 |
0x00013c14 ble 0x13bec |
| }
0x00013c18 sub r2, r8, r2 | r2 = r8 - r2;
0x00013c1c mov r1, 0x22 | r1 = 0x22;
0x00013c20 mov r0, r6 | r0 = r6;
0x00013c24 bl 0x10ac0 | r0 = memchr (r0, r1, r2);
0x00013c28 subs r5, r0, 0 | r5 = r0 - 0;
0x00013c2c bne 0x13c3c |
| while (r8 <= r7) {
0x00013c30 ldr r2, [pc, 0x6c] | r2 = "mtd_d:__llx__x";
0x00013c34 ldr r1, [pc, 0x78] | r1 = "%s: error!: opening \" not found\n";
0x00013c38 b 0x13bf4 | goto label_1;
0x00013c3c sub r7, r5, r7 | r7 = r5 - r7;
0x00013c40 cmp r8, r7 |
0x00013c44 ble 0x13c30 |
| }
0x00013c48 sub r7, r5, r6 | r7 = r5 - r6;
0x00013c4c cmp r7, 0x7f |
| if (r7 <= 0x7f) {
0x00013c50 ldrgt r3, [r4] | r3 = *(r4);
| }
| if (r7 <= 0x7f) {
0x00013c54 ldrgt r2, [pc, 0x48] | r2 = "libmtd";
| }
| if (r7 > 0x7f) {
0x00013c58 ldrgt r1, [pc, 0x58] | r1 = "%s: error!: too long mtd%d device name\n";
| goto label_6;
| }
| if (r7 > 0x7f) {
| label_6:
0x00013c5c bgt 0x13bbc | goto label_2;
| }
0x00013c60 mov r2, r7 | r2 = r7;
0x00013c64 mov r1, r6 | r1 = r6;
0x00013c68 add r0, r4, 0x10 | r0 = r4 + 0x10;
0x00013c6c bl 0x10a48 | memcpy (r0, r1, r2);
0x00013c70 add r7, r4, r7 | r7 = r4 + r7;
0x00013c74 mov r3, 0 | r3 = 0;
0x00013c78 strb r3, [r7, 0x10] | *((r7 + 0x10)) = r3;
0x00013c7c ldrb r3, [r5, 1] | r3 = *((r5 + 1));
0x00013c80 cmp r3, 0xa |
| if (r3 != 0xa) {
0x00013c84 addeq r5, r5, 2 | r5 += 2;
| }
| if (r3 != 0xa) {
0x00013c88 streq r5, [r4, 0x9c] | *((r4 + 0x9c)) = r5;
| }
| if (r3 == 0xa) {
0x00013c8c moveq r0, 1 | r0 = 1;
| goto label_7;
| }
| if (r3 == 0xa) {
| label_7:
0x00013c90 beq 0x13b88 | goto label_3;
| }
0x00013c94 ldr r2, [pc, 8] | r2 = "libmtd";
0x00013c98 ldr r1, [pc, 0x1c] | r1 = "%s: error!: too long mtd%d device name\n";
0x00013c9c b 0x13bf4 | 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/flash_erase @ 0x13cc0 */
| #include <stdint.h>
|
; (fcn) fcn.00013cc0 () | void fcn_00013cc0 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
0x00013cc0 push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x00013cc4 mov r5, r0 | r5 = r0;
0x00013cc8 mov r1, 0 | r1 = 0;
0x00013ccc ldr r0, [pc, 0x150] | r0 = *(0x13e20);
0x00013cd0 bl 0x10b20 | r0 = open64 ();
0x00013cd4 cmn r0, 1 |
0x00013cd8 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00013cdc beq 0x13e18 | goto label_0;
| }
0x00013ce0 mov r0, 0x1000 | r0 = 0x1000;
0x00013ce4 bl 0x10a54 | r0 = malloc (r0);
0x00013ce8 subs r1, r0, 0 | r1 = r0 - 0;
| if (r1 == r0) {
0x00013cec bne 0x13d3c |
0x00013cf0 bl 0x10b5c | errno_location ();
0x00013cf4 ldr r5, [pc, 0x12c] |
0x00013cf8 ldr r2, [pc, 0x12c] | r2 = stderr;
0x00013cfc ldr r1, [pc, 0x12c] | r1 = "libmtd";
0x00013d00 ldr r4, [r0] | r4 = *(r0);
0x00013d04 ldr r0, [r5] | r0 = "_proc_mtd";
0x00013d08 bl 0x10aa8 | fprintf ("_proc_mtd", "libmtd", r2, r3, r4, "_proc_mtd")
0x00013d0c mov r0, r4 | r0 = r4;
0x00013d10 ldr r5, [r5] | r5 = "_proc_mtd";
0x00013d14 bl 0x10a0c | strerror (r0);
0x00013d18 str r4, [sp] | *(sp) = r4;
0x00013d1c ldr r3, [pc, 0x110] | r3 = "%s: error!: out of memory\n";
0x00013d20 mov r2, 8 | r2 = 8;
0x00013d24 ldr r1, [pc, 0x10c] | r1 = *(0x13e34);
0x00013d28 str r0, [sp, 4] | var_4h = r0;
0x00013d2c mov r0, r5 | r0 = r5;
0x00013d30 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x00013d34 mvn r0, 0 | r0 = ~0;
0x00013d38 bl 0x10b68 | exit (r0);
| }
0x00013d3c str r1, [r5, 0x94] | *((r5 + 0x94)) = r1;
0x00013d40 mov r2, 0x1000 | r2 = 0x1000;
0x00013d44 mov r0, r4 | r0 = r4;
0x00013d48 bl 0x10acc | r0 = read (r0, r1, r2);
0x00013d4c cmn r0, 1 |
0x00013d50 mov r7, r0 | r7 = r0;
| if (r0 != 1) {
0x00013d54 bne 0x13db8 | goto label_1;
| }
0x00013d58 bl 0x10b5c | errno_location ();
0x00013d5c ldr r7, [pc, 0xc4] |
0x00013d60 ldr r3, [pc, 0xbc] | r3 = *(0x13e20);
0x00013d64 ldr r2, [pc, 0xc0] | r2 = stderr;
0x00013d68 ldr r1, [pc, 0xcc] | r1 = "%*serror %d (%s)\n";
0x00013d6c ldr r6, [r0] | r6 = *(r0);
0x00013d70 ldr r0, [r7] | r0 = "_proc_mtd";
0x00013d74 bl 0x10aa8 | fprintf ("_proc_mtd", "%*serror %d (%s)\n", r2, r3, r4, r5, r6)
0x00013d78 mov r0, r6 | r0 = r6;
0x00013d7c ldr r7, [r7] | r7 = "_proc_mtd";
0x00013d80 bl 0x10a0c | strerror (r0);
0x00013d84 str r6, [sp] | *(sp) = r6;
0x00013d88 ldr r3, [pc, 0xa4] | r3 = "%s: error!: out of memory\n";
0x00013d8c mov r2, 8 | r2 = 8;
0x00013d90 ldr r1, [pc, 0xa0] | r1 = *(0x13e34);
0x00013d94 str r0, [sp, 4] | var_4h = r0;
0x00013d98 mov r0, r7 | r0 = r7;
0x00013d9c bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4, r5, r6)
| do {
0x00013da0 ldr r0, [r5, 0x94] | r0 = *((r5 + 0x94));
0x00013da4 bl 0x10bbc | free (r0);
0x00013da8 mov r0, r4 | r0 = r4;
0x00013dac bl 0x10ba4 | close (r0);
0x00013db0 mvn r4, 0 | r4 = ~0;
0x00013db4 b 0x13e18 | goto label_0;
| label_1:
0x00013db8 cmp r0, 0x1e |
| if (r0 >= 0x1e) {
0x00013dbc bls 0x13ddc |
0x00013dc0 ldr r6, [r5, 0x94] | r6 = *((r5 + 0x94));
0x00013dc4 mov r2, 0x1f | r2 = 0x1f;
0x00013dc8 ldr r1, [pc, 0x70] | r1 = "%s: error!: cannot read \"%s\"\n";
0x00013dcc mov r0, r6 | r0 = r6;
0x00013dd0 bl 0x10ae4 | r0 = memcmp (r0, "%s: error!: cannot read \"%s\"\n", r2);
0x00013dd4 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00013dd8 beq 0x13e00 | goto label_2;
| }
| }
0x00013ddc ldr r3, [pc, 0x5c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00013de0 ldr r0, [pc, 0x40] |
0x00013de4 str r3, [sp] | *(sp) = r3;
0x00013de8 ldr r2, [pc, 0x3c] | r2 = stderr;
0x00013dec ldr r3, [pc, 0x30] | r3 = *(0x13e20);
0x00013df0 ldr r1, [pc, 0x4c] | r1 = "dev:____size___erasesize__name";
0x00013df4 ldr r0, [r0] | r0 = "_proc_mtd";
0x00013df8 bl 0x10aa8 | fprintf ("_proc_mtd", "dev:____size___erasesize__name", r2, "%s: error!: cannot read \"%s\"\n")
0x00013dfc b 0x13da0 |
| } while (1);
| label_2:
0x00013e00 add r6, r6, 0x1f | r6 += 0x1f;
0x00013e04 mov r0, r4 | r0 = r4;
0x00013e08 str r7, [r5, 0x98] | *((r5 + 0x98)) = r7;
0x00013e0c str r6, [r5, 0x9c] | *((r5 + 0x9c)) = r6;
0x00013e10 bl 0x10ba4 | close (r0);
0x00013e14 mov r4, r8 | r4 = r8;
| label_0:
0x00013e18 mov r0, r4 | r0 = r4;
0x00013e1c add sp, sp, 8 |
0x00013e20 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/flash_erase @ 0x13e48 */
| #include <stdint.h>
|
; (fcn) fcn.00013e48 () | void fcn_00013e48 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
0x00013e48 push {r0, r1, r2, r4, r5, lr} |
0x00013e4c ldr r0, [pc, 0x74] | r0 = *(0x13ec4);
0x00013e50 mov r1, 4 | r1 = 4;
0x00013e54 bl 0x10b50 | r0 = access (r0, r1);
0x00013e58 cmp r0, 0 |
| if (r0 != 0) {
0x00013e5c moveq r0, 1 | r0 = 1;
| }
| if (r0 != 0) {
0x00013e60 beq 0x13ec0 |
0x00013e64 bl 0x10b5c | r0 = errno_location ();
0x00013e68 ldr r4, [r0] | r4 = *(r0);
0x00013e6c cmp r4, 2 |
| if (r4 != 2) {
0x00013e70 moveq r3, 0 | r3 = 0;
| }
| if (r4 != 2) {
0x00013e74 streq r3, [r0] | *(r0) = r3;
| }
| if (r4 != 2) {
0x00013e78 beq 0x13ebc |
0x00013e7c ldr r5, [pc, 0x48] |
0x00013e80 ldr r3, [pc, 0x40] | r3 = *(0x13ec4);
0x00013e84 ldr r2, [pc, 0x44] | r2 = stderr;
0x00013e88 ldr r1, [pc, 0x44] | r1 = "libmtd";
0x00013e8c ldr r0, [r5] | r0 = "_proc_mtd";
0x00013e90 bl 0x10aa8 | fprintf ("_proc_mtd", "libmtd", r2, r3, r4, "_proc_mtd")
0x00013e94 mov r0, r4 | r0 = r4;
0x00013e98 ldr r5, [r5] | r5 = "_proc_mtd";
0x00013e9c bl 0x10a0c | strerror (r0);
0x00013ea0 str r4, [sp] | *(sp) = r4;
0x00013ea4 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00013ea8 mov r2, 8 | r2 = 8;
0x00013eac ldr r1, [pc, 0x28] | r1 = *(0x13ed8);
0x00013eb0 str r0, [sp, 4] | var_4h = r0;
0x00013eb4 mov r0, r5 | r0 = r5;
0x00013eb8 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| }
0x00013ebc mov r0, 0 | r0 = 0;
| }
0x00013ec0 add sp, sp, 0xc |
0x00013ec4 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/flash_erase @ 0x13f9c */
| #include <stdint.h>
|
; (fcn) fcn.00013f9c () | void fcn_00013f9c (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_18h;
| int32_t var_70h;
| int32_t var_174h;
| int32_t var_1bch;
| r0 = arg1;
0x00013f9c push {r4, r5, r6, r7, lr} |
0x00013fa0 sub sp, sp, 0x1bc |
0x00013fa4 add r1, sp, 8 | r1 += var_8h;
0x00013fa8 mov r5, r0 | r5 = r0;
0x00013fac bl 0x10a18 | r0 = stat64 ();
0x00013fb0 subs r1, r0, 0 | r1 = r0 - 0;
| if (r1 == r0) {
0x00013fb4 beq 0x14010 | goto label_1;
| }
0x00013fb8 bl 0x10b5c | errno_location ();
0x00013fbc ldr r6, [pc, 0x158] | r6 = *(0x14118);
0x00013fc0 mov r3, r5 | r3 = r5;
0x00013fc4 ldr r2, [pc, 0x154] | r2 = stderr;
0x00013fc8 ldr r1, [pc, 0x154] | r1 = "libmtd";
0x00013fcc ldr r4, [r0] | r4 = *(r0);
0x00013fd0 ldr r0, [r6] | r0 = *(0x14118);
0x00013fd4 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00013fd8 mov r0, r4 | r0 = r4;
0x00013fdc ldr r5, [r6] | r5 = *(0x14118);
0x00013fe0 bl 0x10a0c | strerror (r0);
0x00013fe4 str r4, [sp] | *(sp) = r4;
0x00013fe8 ldr r3, [pc, 0x138] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00013fec mov r2, 8 | r2 = 8;
0x00013ff0 ldr r1, [pc, 0x134] | r1 = *(0x14128);
0x00013ff4 str r0, [sp, 4] | var_4h = r0;
0x00013ff8 mov r0, r5 | r0 = r5;
0x00013ffc bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| do {
0x00014000 mvn r4, 0 | r4 = ~0;
| label_0:
0x00014004 mov r0, r4 | r0 = r4;
0x00014008 add sp, sp, 0x1bc |
0x0001400c pop {r4, r5, r6, r7, pc} |
| label_1:
0x00014010 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00014014 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00014018 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x0001401c beq 0x14048 | goto label_2;
| }
0x00014020 bl 0x10b5c | errno_location ();
0x00014024 mov r3, 0x16 | r3 = 0x16;
0x00014028 ldr r2, [pc, 0xf0] | r2 = stderr;
0x0001402c ldr r1, [pc, 0xfc] | r1 = "%*serror %d (%s)\n";
0x00014030 str r3, [r0] | *(r0) = r3;
0x00014034 ldr r0, [pc, 0xe0] |
0x00014038 mov r3, r5 | r3 = r5;
0x0001403c ldr r0, [r0] | r0 = *(0x14118);
0x00014040 bl 0x10aa8 | fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x00014044 b 0x14000 |
| } while (1);
| label_2:
0x00014048 mov r0, r5 | r0 = r5;
0x0001404c bl 0x10b20 | r0 = open64 ();
0x00014050 cmn r0, 1 |
0x00014054 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00014058 bne 0x140a8 |
0x0001405c bl 0x10b5c | errno_location ();
0x00014060 ldr r7, [pc, 0xb4] | r7 = *(0x14118);
0x00014064 mov r3, r5 | r3 = r5;
0x00014068 ldr r2, [pc, 0xb0] | r2 = stderr;
0x0001406c ldr r1, [pc, 0xb0] | r1 = "libmtd";
0x00014070 ldr r6, [r0] | r6 = *(r0);
0x00014074 ldr r0, [r7] | r0 = *(0x14118);
0x00014078 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x0001407c mov r0, r6 | r0 = r6;
0x00014080 ldr r5, [r7] | r5 = *(0x14118);
0x00014084 bl 0x10a0c | strerror (r0);
0x00014088 str r6, [sp] | *(sp) = r6;
0x0001408c ldr r3, [pc, 0x94] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00014090 mov r2, 8 | r2 = 8;
0x00014094 ldr r1, [pc, 0x90] | r1 = *(0x14128);
0x00014098 str r0, [sp, 4] | var_4h = r0;
0x0001409c mov r0, r5 | r0 = r5;
0x000140a0 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5, r6)
0x000140a4 b 0x14004 | goto label_0;
| }
0x000140a8 add r2, sp, 0x70 | r2 += var_70h;
0x000140ac ldr r1, [pc, 0x80] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x000140b0 bl 0x109f4 | r0 = ioctl (r0, "_s:_error_:___s__is_not_a_character_device");
0x000140b4 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 < r0) {
0x000140b8 ldrge r6, [sp, 0x174] | r6 = var_174h;
| }
| if (r6 < r0) {
0x000140bc bge 0x1410c |
0x000140c0 bl 0x10b5c | r0 = errno_location ();
0x000140c4 ldr r5, [r0] | r5 = *(r0);
0x000140c8 cmp r5, 0x5f |
| if (r5 == 0x5f) {
0x000140cc beq 0x1410c | goto label_3;
| }
0x000140d0 ldr r7, [pc, 0x44] |
0x000140d4 ldr r2, [pc, 0x44] | r2 = stderr;
0x000140d8 ldr r1, [pc, 0x58] | r1 = *(0x14134);
0x000140dc ldr r0, [r7] | r0 = *(0x14118);
0x000140e0 bl 0x10aa8 | fprintf (r0, r1, r2)
0x000140e4 mov r0, r5 | r0 = r5;
0x000140e8 ldr r7, [r7] | r7 = *(0x14118);
0x000140ec bl 0x10a0c | strerror (r0);
0x000140f0 str r5, [sp] | *(sp) = r5;
0x000140f4 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000140f8 mov r2, 8 | r2 = 8;
0x000140fc ldr r1, [pc, 0x28] | r1 = *(0x14128);
0x00014100 str r0, [sp, 4] | var_4h = r0;
0x00014104 mov r0, r7 | r0 = r7;
0x00014108 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5)
| }
| label_3:
0x0001410c mov r0, r4 | r0 = r4;
0x00014110 bl 0x10ba4 | close (r0);
0x00014114 mov r4, r6 | r4 = r6;
0x00014118 b 0x14004 | 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/flash_erase @ 0x14168 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00014168 () | void fcn_00014168 (char * arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_8h_2;
| int32_t var_10h;
| int32_t var_10h_2;
| int32_t var_18h;
| int32_t var_1ch;
| int32_t var_20h;
| int32_t var_24h;
| int32_t var_28h;
| int32_t var_2ch;
| int32_t var_38h;
| int32_t var_48h;
| int32_t var_58h;
| int32_t var_58h_2;
| int32_t var_a0h;
| char * src;
| int32_t var_144h;
| r0 = arg1;
| r1 = arg2;
0x00014168 push {r4, r5, r6, r7, r8, sb, lr} |
0x0001416c sub sp, sp, 0x144 |
0x00014170 mov r2, 0 | r2 = 0;
0x00014174 mov r3, 0 | r3 = 0;
0x00014178 mov r4, r1 | r4 = r1;
0x0001417c add r1, sp, 0x38 | r1 += var_38h;
0x00014180 mov r6, r0 | r6 = r0;
0x00014184 strd r2, r3, [sp, 0x10] | __asm ("strd r2, r3, [var_10h]");
0x00014188 bl 0x10a18 | r0 = stat64 ();
0x0001418c cmp r0, 0 |
| if (r0 != 0) {
0x00014190 beq 0x141f8 |
0x00014194 bl 0x10b5c | errno_location ();
0x00014198 ldr r8, [pc, 0x450] |
0x0001419c mov r3, r6 | r3 = r6;
0x000141a0 ldr r2, [pc, 0x44c] | r2 = stderr;
0x000141a4 ldr r1, [pc, 0x44c] | r1 = "libmtd";
0x000141a8 ldr r7, [r0] | r7 = *(r0);
0x000141ac mov r5, r0 | r5 = r0;
0x000141b0 ldr r0, [r8] | r0 = *(0x145ec);
0x000141b4 bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x000141b8 mov r0, r7 | r0 = r7;
0x000141bc ldr r8, [r8] | r8 = *(0x145ec);
0x000141c0 bl 0x10a0c | strerror (r0);
0x000141c4 ldr r3, [pc, 0x430] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000141c8 str r7, [sp] | *(sp) = r7;
0x000141cc mov r2, 8 | r2 = 8;
0x000141d0 ldr r1, [pc, 0x428] | r1 = *(0x145fc);
0x000141d4 str r0, [sp, 4] | var_4h = r0;
0x000141d8 mov r0, r8 | r0 = r8;
0x000141dc bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n")
0x000141e0 ldr r3, [r5] | r3 = *(r5);
0x000141e4 cmp r3, 2 |
| if (r3 != 2) {
0x000141e8 bne 0x141f8 | goto label_5;
| }
0x000141ec ldr r1, [pc, 0x400] | r1 = stderr;
0x000141f0 ldr r0, [pc, 0x40c] | r0 = "%*serror %d (%s)\n";
0x000141f4 bl 0x10a00 | printf ("%*serror %d (%s)\n", r1);
| }
| label_5:
0x000141f8 ldr r3, [sp, 0x48] | r3 = var_48h;
0x000141fc and r3, r3, 0xf000 | r3 &= 0xf000;
0x00014200 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00014204 beq 0x14234 | goto label_6;
| }
0x00014208 bl 0x10b5c | errno_location ();
0x0001420c mov r3, 0x16 | r3 = 0x16;
0x00014210 ldr r2, [pc, 0x3dc] | r2 = stderr;
0x00014214 ldr r1, [pc, 0x3ec] | r1 = "%s: MTD subsystem is old and does not support sysfs, so MTD character device nodes have to exist\n";
0x00014218 str r3, [r0] | *(r0) = r3;
0x0001421c ldr r0, [pc, 0x3cc] |
0x00014220 mov r3, r6 | r3 = r6;
0x00014224 ldr r0, [r0] | r0 = *(0x145ec);
0x00014228 bl 0x10aa8 | fprintf (r0, "%s: MTD subsystem is old and does not support sysfs, so MTD character device nodes have to exist\n", r2, r3)
| do {
| label_0:
0x0001422c mvn r5, 0 | r5 = ~0;
0x00014230 b 0x14318 | goto label_4;
| label_6:
0x00014234 mov r2, 0x100 | r2 = 0x100;
0x00014238 mov r1, 0 | r1 = 0;
0x0001423c mov r0, r4 | r0 = r4;
0x00014240 bl 0x10b14 | memset (r0, r1, r2);
0x00014244 ldrd r8, sb, [sp, 0x58] | __asm ("ldrd r8, sb, [var_58h]");
0x00014248 mov r1, sb | r1 = sb;
0x0001424c mov r0, r8 | r0 = r8;
0x00014250 bl 0x10a3c | gnu_dev_major ();
0x00014254 mov r1, sb | r1 = sb;
0x00014258 mov r5, r0 | r5 = r0;
0x0001425c str r0, [r4, 4] | *((r4 + 4)) = r0;
0x00014260 mov r0, r8 | r0 = r8;
0x00014264 bl 0x10a78 | gnu_dev_minor ();
0x00014268 cmp r5, 0x5a |
0x0001426c str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r5 == 0x5a) {
0x00014270 beq 0x142ac | goto label_7;
| }
0x00014274 bl 0x10b5c | errno_location ();
0x00014278 mov r3, 0x16 | r3 = 0x16;
0x0001427c ldr r2, [pc, 0x370] | r2 = stderr;
0x00014280 ldr r1, [pc, 0x384] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x00014284 str r3, [r0] | *(r0) = r3;
0x00014288 mov r3, 0x5a | r3 = 0x5a;
0x0001428c str r3, [sp, 4] | var_4h = r3;
0x00014290 ldr r0, [pc, 0x358] |
0x00014294 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00014298 str r3, [sp] | *(sp) = r3;
0x0001429c mov r3, r6 | r3 = r6;
0x000142a0 ldr r0, [r0] | r0 = *(0x145ec);
0x000142a4 bl 0x10aa8 | fprintf (r0, "_s:_error_:___s__is_not_a_character_device", r2, r3)
0x000142a8 b 0x1422c |
| } while (1);
| label_7:
0x000142ac add r0, r0, r0, lsr 31 | r0 += (r0 >> 31);
0x000142b0 asr r0, r0, 1 | r0 >>= 1;
0x000142b4 str r0, [r4] | *(r4) = r0;
0x000142b8 mov r1, 0 | r1 = 0;
0x000142bc mov r0, r6 | r0 = r6;
0x000142c0 bl 0x10b20 | r0 = open64 ();
0x000142c4 cmn r0, 1 |
0x000142c8 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x000142cc bne 0x14324 |
0x000142d0 bl 0x10b5c | errno_location ();
0x000142d4 ldr r7, [pc, 0x314] | r7 = *(0x145ec);
0x000142d8 mov r3, r6 | r3 = r6;
0x000142dc ldr r2, [pc, 0x310] | r2 = stderr;
0x000142e0 ldr r1, [pc, 0x310] | r1 = "libmtd";
0x000142e4 ldr r4, [r0] | r4 = *(r0);
0x000142e8 ldr r0, [r7] | r0 = *(0x145ec);
0x000142ec bl 0x10aa8 | fprintf (r0, "libmtd", r2, r3, r4)
0x000142f0 mov r0, r4 | r0 = r4;
0x000142f4 ldr r6, [r7] | r6 = *(0x145ec);
0x000142f8 bl 0x10a0c | strerror (r0);
0x000142fc str r4, [sp] | *(sp) = r4;
0x00014300 ldr r3, [pc, 0x2f4] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00014304 mov r2, 8 | r2 = 8;
0x00014308 ldr r1, [pc, 0x2f0] | r1 = *(0x145fc);
0x0001430c str r0, [sp, 4] | var_4h = r0;
0x00014310 mov r0, r6 | r0 = r6;
0x00014314 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| label_4:
0x00014318 mov r0, r5 | r0 = r5;
0x0001431c add sp, sp, 0x144 |
0x00014320 pop {r4, r5, r6, r7, r8, sb, pc} |
| }
0x00014324 add r2, sp, 0x18 | r2 += var_18h;
0x00014328 ldr r1, [pc, 0x2e0] | r1 = "%s: error!: \"%s\" has major number %d, MTD devices have major %d\n";
0x0001432c bl 0x109f4 | r0 = ioctl (r0, "%s: error!: \"%s\" has major number %d, MTD devices have major %d\n");
0x00014330 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00014334 beq 0x14388 | goto label_8;
| }
0x00014338 bl 0x10b5c | errno_location ();
0x0001433c ldr r6, [pc, 0x2ac] |
0x00014340 ldr r2, [pc, 0x2ac] | r2 = stderr;
0x00014344 ldr r1, [pc, 0x2c8] | r1 = *(0x14610);
0x00014348 ldr r4, [r0] | r4 = *(r0);
0x0001434c ldr r0, [r6] | r0 = *(0x145ec);
0x00014350 bl 0x10aa8 | fprintf (r0, r1, r2, r3, r4, r5, r6)
0x00014354 mov r0, r4 | r0 = r4;
0x00014358 ldr r6, [r6] | r6 = *(0x145ec);
0x0001435c bl 0x10a0c | strerror (r0);
0x00014360 ldr r3, [pc, 0x294] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00014364 ldr r1, [pc, 0x294] | r1 = *(0x145fc);
0x00014368 mov r2, 8 | r2 = 8;
0x0001436c str r4, [sp] | *(sp) = r4;
0x00014370 str r0, [sp, 4] | var_4h = r0;
0x00014374 mov r0, r6 | r0 = r6;
| do {
| label_1:
0x00014378 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| label_2:
0x0001437c mov r0, r5 | r0 = r5;
0x00014380 bl 0x10ba4 | close (r0);
0x00014384 b 0x1422c | goto label_0;
| label_8:
0x00014388 add r2, sp, 0x10 | r2 += var_10h;
0x0001438c ldr r1, [pc, 0x284] | r1 = "_s:_error_:_MEMGETINFO_ioctl_request_failed";
0x00014390 mov r0, r5 | r0 = r5;
0x00014394 bl 0x109f4 | r0 = ioctl (r0, "_s:_error_:_MEMGETINFO_ioctl_request_failed");
0x00014398 cmn r0, 1 |
| if (r0 == 1) {
0x0001439c ldrbne r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
| if (r0 == 1) {
0x000143a0 orrne r3, r3, 2 | r3 |= 2;
| }
| if (r0 != 1) {
0x000143a4 bne 0x14400 | goto label_9;
| }
0x000143a8 bl 0x10b5c | r0 = errno_location ();
0x000143ac ldr r7, [r0] | r7 = *(r0);
0x000143b0 cmp r7, 0x5f |
| if (r7 != 0x5f) {
0x000143b4 streq r8, [r0] | *(r0) = r8;
| }
| if (r7 != 0x5f) {
0x000143b8 ldrbeq r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
0x000143bc biceq r3, r3, 2 | __asm ("biceq r3, r3, 2");
| if (r7 == 0x5f) {
0x000143c0 beq 0x14400 | goto label_9;
| }
0x000143c4 ldr r4, [pc, 0x224] |
0x000143c8 ldr r2, [pc, 0x224] | r2 = stderr;
0x000143cc ldr r1, [pc, 0x248] | r1 = *(0x14618);
0x000143d0 ldr r0, [r4] | r0 = *(0x145ec);
0x000143d4 bl 0x10aa8 | fprintf (r0, r1, r2, r3, r4)
0x000143d8 mov r0, r7 | r0 = r7;
0x000143dc ldr r4, [r4] | r4 = *(0x145ec);
0x000143e0 bl 0x10a0c | strerror (r0);
0x000143e4 str r7, [sp] | *(sp) = r7;
0x000143e8 ldr r3, [pc, 0x20c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000143ec mov r2, 8 | r2 = 8;
0x000143f0 ldr r1, [pc, 0x208] | r1 = *(0x145fc);
0x000143f4 str r0, [sp, 4] | var_4h = r0;
0x000143f8 mov r0, r4 | r0 = r4;
0x000143fc b 0x14378 |
| } while (1);
| label_9:
0x00014400 strb r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
0x00014404 ldr r3, [sp, 0x28] | r3 = var_28h;
0x00014408 ldrb r7, [sp, 0x18] | r7 = var_18h;
0x0001440c ldr r0, [sp, 0x20] | r0 = var_20h;
0x00014410 ldr r2, [sp, 0x24] | r2 = var_24h;
0x00014414 ldr ip, [sp, 0x2c] | ip = var_2ch;
0x00014418 mov r1, 0 | r1 = 0;
0x0001441c cmp r3, 0 |
0x00014420 str r7, [r4, 0xc] | *((r4 + 0xc)) = r7;
0x00014424 strd r0, r1, [r4, 0xd8] | __asm ("strd r0, r1, [r4, 0xd8]");
0x00014428 str r2, [r4, 0xe4] | *((r4 + 0xe4)) = r2;
0x0001442c str r3, [r4, 0xe8] | *((r4 + 0xe8)) = r3;
0x00014430 str ip, [r4, 0xf0] | *((r4 + 0xf0)) = ip;
| if (r3 > 0) {
0x00014434 bgt 0x14458 | goto label_10;
| }
0x00014438 str r3, [sp, 4] | var_4h = r3;
0x0001443c str r6, [sp] | *(sp) = r6;
0x00014440 ldr r2, [pc, 0x1ac] | r2 = stderr;
0x00014444 ldr r3, [r4] | r3 = *(r4);
0x00014448 ldr r1, [pc, 0x1d0] | r1 = "%s: error!: MEMGETBADBLOCK ioctl failed\n";
| do {
0x0001444c ldr r0, [pc, 0x19c] |
0x00014450 ldr r0, [r0] | r0 = *(0x145ec);
0x00014454 b 0x14378 | goto label_1;
| label_10:
0x00014458 cmp r2, r3 |
0x0001445c cmpge r2, 0 | __asm ("cmpge r2, 0");
| if (r2 > r3) {
0x00014460 bgt 0x1447c | goto label_11;
| }
0x00014464 str r2, [sp, 4] | var_4h = r2;
0x00014468 str r6, [sp] | *(sp) = r6;
0x0001446c ldr r2, [pc, 0x180] | r2 = stderr;
0x00014470 ldr r3, [r4] | r3 = *(r4);
0x00014474 ldr r1, [pc, 0x1a8] | r1 = "_s:_error_:_mtd_d___s__has_insane_min._I_O_unit_size__d";
0x00014478 b 0x1444c |
| } while (1);
| label_11:
0x0001447c orrs r3, r0, r1 | r3 = r0 | r1;
| if (r3 != r0) {
0x00014480 beq 0x14494 |
0x00014484 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00014488 cmp r0, r2 |
0x0001448c sbcs ip, r1, r3 | __asm ("sbcs ip, r1, r3");
| if (r0 >= r2) {
0x00014490 bge 0x144b8 | goto label_12;
| }
| }
0x00014494 strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [var_8h]");
0x00014498 ldr r0, [pc, 0x150] |
0x0001449c str r6, [sp] | *(sp) = r6;
0x000144a0 ldr r2, [pc, 0x14c] | r2 = stderr;
0x000144a4 ldr r3, [r4] | r3 = *(r4);
0x000144a8 ldr r1, [pc, 0x178] | r1 = "%s: error!: mtd%d (%s) has insane eraseblock size %d\n";
0x000144ac ldr r0, [r0] | r0 = *(0x145ec);
0x000144b0 bl 0x10aa8 | fprintf (r0, "%s: error!: mtd%d (%s) has insane eraseblock size %d\n", r2, r3, r4, r5, r6)
0x000144b4 b 0x1437c | goto label_2;
| label_12:
0x000144b8 bl 0x1484c | fcn_0001484c (r0, r1);
0x000144bc str r0, [r4, 0xe0] | *((r4 + 0xe0)) = r0;
0x000144c0 cmp r7, 8 |
| if (r7 > 8) {
| /* switch table (9 cases) at 0x144cc */
0x000144c4 ldrls pc, [pc, r7, lsl 2] | offset_0 = r7 << 2;
| pc = *((pc + offset_0));
| }
0x000144c8 b 0x1437c | goto label_2;
0x000144f0 ldr r0, [pc, 0xf8] |
0x000144f4 str r6, [sp] | *(sp) = r6;
0x000144f8 ldr r2, [pc, 0xf4] | r2 = stderr;
0x000144fc ldr r3, [r4] | r3 = *(r4);
0x00014500 ldr r1, [pc, 0x124] | r1 = "%s: error!: mtd%d (%s) has insane size %lld\n";
0x00014504 ldr r0, [r0] | r0 = *(0x145ec);
0x00014508 bl 0x10aa8 | fprintf (r0, "%s: error!: mtd%d (%s) has insane size %lld\n", r2, r3, r4, r5, r6)
0x0001450c b 0x1437c | goto label_2;
0x00014510 ldr r1, [pc, 0x118] | r1 = "_s:_error_:_mtd_d___s__is_removable_and_is_not_present";
| label_3:
0x00014514 add r0, r4, 0x10 | r0 = r4 + 0x10;
0x00014518 bl 0x109e8 | strcpy (r0, "_s:_error_:_mtd_d___s__is_removable_and_is_not_present");
0x0001451c ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x00014520 mov r0, r5 | r0 = r5;
0x00014524 tst r3, 0x400 |
| if ((r3 & 0x400) == 0) {
0x00014528 ldrbne r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
| if ((r3 & 0x400) == 0) {
0x0001452c orrne r3, r3, 1 | r3 |= 1;
| }
| if ((r3 & 0x400) == 0) {
0x00014530 strbne r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
| }
0x00014534 ldr r3, [r4, 0xe8] | r3 = *((r4 + 0xe8));
0x00014538 str r3, [r4, 0xec] | *((r4 + 0xec)) = r3;
0x0001453c bl 0x10ba4 | close (r0);
0x00014540 mov r0, r6 | r0 = r6;
0x00014544 bl 0x13f9c | r0 = fcn_00013f9c (r0);
0x00014548 bic r0, r0, r0, asr 31 | r0 = BIT_MASK (r0, r0);
0x0001454c str r0, [r4, 0xf4] | *((r4 + 0xf4)) = r0;
0x00014550 add r0, sp, 0xa0 | r0 += var_a0h;
0x00014554 bl 0x13cc0 | fcn_00013cc0 (r0);
0x00014558 subs r5, r0, 0 | r5 -= var_a0h;
| if (r5 != var_a0h) {
0x0001455c bne 0x1422c | goto label_0;
| }
| do {
0x00014560 add r0, sp, 0xa0 | r0 += var_a0h;
0x00014564 bl 0x13b5c | r0 = fcn_00013b5c (r0);
0x00014568 cmp r0, 0 |
| if (r0 == 0) {
0x0001456c bne 0x145d0 |
0x00014570 ldr r3, [pc, 0xbc] | r3 = *(0x14630);
0x00014574 ldr r0, [pc, 0x74] |
0x00014578 str r3, [sp] | *(sp) = r3;
0x0001457c ldr r2, [pc, 0x70] | r2 = stderr;
0x00014580 ldr r3, [r4] | r3 = *(r4);
0x00014584 ldr r1, [pc, 0xac] | r1 = "_proc_mtd";
0x00014588 ldr r0, [r0] | r0 = *(0x145ec);
0x0001458c bl 0x10aa8 | r0 = fprintf (r0, "_proc_mtd", r2, r3)
0x00014590 bl 0x10b5c | errno_location ();
0x00014594 mov r3, 2 | r3 = 2;
0x00014598 str r3, [r0] | *(r0) = r3;
0x0001459c b 0x1422c | goto label_0;
0x000145a0 ldr r1, [pc, 0x94] | r1 = "_s:_error_:_mtd_d_not_found_in___s_";
0x000145a4 b 0x14514 | goto label_3;
0x000145a8 ldr r1, [pc, 0x90] | r1 = "rom";
0x000145ac b 0x14514 | goto label_3;
0x000145b0 ldr r1, [pc, 0x8c] | r1 = "nor";
0x000145b4 b 0x14514 | goto label_3;
0x000145b8 ldr r1, [pc, 0x88] | r1 = *(0x14644);
0x000145bc b 0x14514 | goto label_3;
0x000145c0 ldr r1, [pc, 0x84] | r1 = "mlc-nand";
0x000145c4 b 0x14514 | goto label_3;
0x000145c8 ldr r1, [pc, 0x80] | r1 = "dataflash";
0x000145cc b 0x14514 | goto label_3;
| }
0x000145d0 ldr r3, [r4] | r3 = *(r4);
0x000145d4 ldr r2, [sp, 0xa0] | r2 = var_a0h;
0x000145d8 cmp r2, r3 |
0x000145dc bne 0x14560 |
| } while (r2 != r3);
0x000145e0 add r1, sp, 0xb0 | r1 += src;
0x000145e4 add r0, r4, 0x51 | r0 = r4 + 0x51;
0x000145e8 bl 0x109e8 | strcpy (r0, r1);
0x000145ec b 0x14318 | 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/flash_erase @ 0x10c2c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) main () | int32_t main (int32_t argc, char ** argv) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_1ch;
| int32_t var_20h;
| int32_t var_24h;
| int32_t var_28h;
| int32_t var_28h_2;
| int32_t var_30h;
| int32_t var_34h;
| int32_t var_38h;
| int32_t var_3ch;
| char * * endptr;
| int32_t var_4ch;
| int32_t var_d8h;
| int32_t var_d8h_2;
| int32_t var_124h;
| int32_t var_134h;
| int32_t var_140h;
| int32_t var_144h;
| r0 = argc;
| r1 = argv;
0x00010c2c push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00010c30 ldr fp, [pc, 0x778] | fp = "jNquVh";
0x00010c34 ldr sl, [pc, 0x778] | sl = *(0x000113b4);
0x00010c38 sub sp, sp, 0x144 |
0x00010c3c mov r4, r0 | r4 = r0;
0x00010c40 mov sb, r1 | sb = r1;
0x00010c44 mov r8, 0 | r8 = 0;
| do {
| label_0:
0x00010c48 add r5, sp, 0x140 | r5 += var_140h;
0x00010c4c mov r6, 0 | r6 = 0;
0x00010c50 str r6, [r5, -0x100]! | *((r5 -= 0x100)) = r6;
0x00010c54 ldr r3, [pc, 0x75c] | r3 = *(0x113b4);
0x00010c58 str r5, [sp] | *(sp) = r5;
0x00010c5c mov r2, fp | r2 = fp;
0x00010c60 mov r1, sb | r1 = sb;
0x00010c64 mov r0, r4 | r0 = r4;
0x00010c68 bl 0x10a24 | r0 = getopt_long ();
0x00010c6c cmn r0, 1 |
0x00010c70 mov r7, r0 | r7 = r0;
| if (r0 == 1) {
0x00010c74 beq 0x10d0c | goto label_10;
| }
0x00010c78 cmp r0, 0x68 |
| if (r0 == 0x68) {
0x00010c7c beq 0x10cd0 | goto label_11;
| }
| if (r0 > 0x68) {
0x00010c80 bgt 0x10ca0 | goto label_12;
| }
0x00010c84 cmp r0, 0x4e |
| if (r0 == 0x4e) {
0x00010c88 beq 0x10d00 | goto label_13;
| }
0x00010c8c cmp r0, 0x56 |
| if (r0 == 0x56) {
0x00010c90 beq 0x10ce4 | goto label_14;
| }
0x00010c94 cmp r0, 0x3f |
| if (r0 != 0x3f) {
0x00010c98 moveq r8, 1 | r8 = 1;
| }
0x00010c9c b 0x10c48 |
| } while (1);
| label_12:
0x00010ca0 cmp r0, 0x71 |
| if (r0 != 0x71) {
0x00010ca4 moveq r3, 1 | r3 = 1;
| }
| if (r0 == 0x71) {
0x00010ca8 streq r3, [sl, 8] | *((sl + 8)) = r3;
| goto label_15;
| }
| if (r0 == 0x71) {
| label_15:
0x00010cac beq 0x10c48 | goto label_0;
| }
0x00010cb0 cmp r0, 0x75 |
| if (r0 != 0x75) {
0x00010cb4 moveq r3, 1 | r3 = 1;
| }
| if (r0 == 0x75) {
0x00010cb8 streq r3, [sl, 0xc] | *((sl + 0xc)) = r3;
| goto label_16;
| }
| if (r0 == 0x75) {
| label_16:
0x00010cbc beq 0x10c48 | goto label_0;
| }
0x00010cc0 cmp r0, 0x6a |
| if (r0 != 0x6a) {
0x00010cc4 moveq r3, 1 | r3 = 1;
| }
| if (r0 != 0x6a) {
0x00010cc8 streq r3, [sl] | *(sl) = r3;
| }
0x00010ccc b 0x10c48 | goto label_0;
| label_11:
0x00010cd0 ldr r1, [pc, 0x6e4] | r1 = "help";
0x00010cd4 ldr r0, [pc, 0x6e4] | r0 = "flash_erase";
| do {
0x00010cd8 bl 0x10a00 | printf ("flash_erase", "help");
| label_4:
0x00010cdc mov r7, 0 | r7 = 0;
0x00010ce0 b 0x10e2c | goto label_3;
| label_14:
0x00010ce4 ldr r1, [pc, 0x6d0] | r1 = "help";
0x00010ce8 ldr r2, [pc, 0x6d4] | r2 = "Usage: %s [options] MTD_DEVICE <start offset> <block count>\nErase blocks of the specified MTD device.\nSpecify a count of 0 to erase to end of device.\n\n -j, --jffs2 format the device for jffs2\n -N, --noskipbad don't skip bad blocks\n -u, --unlock unlock sectors before erasing\n -q, --quiet do not display progress messages\n --silent same as --quiet\n --help display this help and exit\n --version output version information and exit\n";
0x00010cec ldr r0, [pc, 0x6d4] | r0 = "2.1.0";
0x00010cf0 bl 0x10a00 | printf ("2.1.0", "help", "Usage: %s [options] MTD_DEVICE <start offset> <block count>\nErase blocks of the specified MTD device.\nSpecify a count of 0 to erase to end of device.\n\n -j, --jffs2 format the device for jffs2\n -N, --noskipbad don't skip bad blocks\n -u, --unlock unlock sectors before erasing\n -q, --quiet do not display progress messages\n --silent same as --quiet\n --help display this help and exit\n --version output version information and exit\n");
0x00010cf4 ldr r1, [pc, 0x6c0] | r1 = "help";
0x00010cf8 ldr r0, [pc, 0x6cc] | r0 = "%s (mtd-utils) %s\n";
0x00010cfc b 0x10cd8 |
| } while (1);
| label_13:
0x00010d00 mov r3, 1 | r3 = 1;
0x00010d04 str r3, [sl, 4] | *((sl + 4)) = r3;
0x00010d08 b 0x10c48 | goto label_0;
| label_10:
0x00010d0c ldr sl, [pc, 0x6bc] | sl = obj.optind;
0x00010d10 ldr r3, [sl] | r3 = *(sl);
0x00010d14 sub r4, r4, r3 | r4 -= r3;
0x00010d18 cmp r4, 2 |
| if (r4 != 2) {
0x00010d1c beq 0x10d44 |
0x00010d20 cmp r4, 3 |
| if (r4 == 3) {
0x00010d24 beq 0x10d5c | goto label_17;
| }
0x00010d28 cmp r4, 1 |
0x00010d2c ldr r4, [pc, 0x6a0] | r4 = optind;
| if (r4 != 1) {
0x00010d30 bne 0x10e5c | goto label_18;
| }
| label_2:
0x00010d34 ldr r2, [pc, 0x680] | r2 = "help";
0x00010d38 ldr r1, [pc, 0x698] | r1 = stderr;
0x00010d3c ldr r0, [r4] | r0 = *(r4);
0x00010d40 bl 0x10aa8 | fprintf (r0, r1, "help")
| }
0x00010d44 ldr r3, [pc, 0x688] | r3 = optind;
0x00010d48 ldr r2, [pc, 0x66c] | r2 = "help";
0x00010d4c ldr r1, [pc, 0x688] | r1 = "%s: error!: no start erase block specified\n";
0x00010d50 ldr r0, [r3] | r0 = optind;
0x00010d54 bl 0x10aa8 | fprintf (r0, "%s: error!: no start erase block specified\n", "help", r3)
0x00010d58 b 0x10e18 | goto label_19;
| label_17:
0x00010d5c ldr r2, [sb, r3, lsl 2] | offset_0 = r3 << 2;
| r2 = *((sb + offset_0));
0x00010d60 add r3, sb, r3, lsl 2 | r3 = sb + (r3 << 2);
0x00010d64 ldr fp, [r3, 4] | fp = *((r3 + 4));
0x00010d68 ldr r4, [pc, 0x644] | r4 = "jNquVh";
0x00010d6c mov r1, r5 | r1 = r5;
0x00010d70 str r2, [r4, 0x10] | *((r4 + 0x10)) = r2;
0x00010d74 mov r0, fp | r0 = fp;
0x00010d78 mov r2, r6 | r2 = r6;
0x00010d7c bl 0x10b08 | strtoull (r0, r1, r2);
0x00010d80 ldrb r3, [fp] | r3 = *(fp);
0x00010d84 cmp r3, 0 |
0x00010d88 strd r0, r1, [sp, 0x18] | __asm ("strd r0, r1, [var_18h]");
| if (r3 != 0) {
0x00010d8c beq 0x10da0 |
0x00010d90 ldr r3, [sp, 0x40] | r3 = endptr;
0x00010d94 ldrb r3, [r3] | r3 = *(r3);
0x00010d98 cmp r3, 0 |
| if (r3 == 0) {
0x00010d9c beq 0x10dc0 | goto label_20;
| }
| }
0x00010da0 ldr r0, [pc, 0x62c] |
0x00010da4 str fp, [sp] | *(sp) = fp;
0x00010da8 ldr r3, [pc, 0x630] | r3 = "%s: error!: no erase block count specified\n";
0x00010dac ldr r2, [pc, 0x608] | r2 = "help";
0x00010db0 ldr r1, [pc, 0x62c] | r1 = "strtoull";
0x00010db4 ldr r0, [r0] | r0 = optind;
0x00010db8 bl 0x10aa8 | fprintf (r0, "strtoull", "help", "%s: error!: no erase block count specified\n")
0x00010dbc mov r8, 1 | r8 = 1;
| label_20:
0x00010dc0 ldr r3, [sl] | r3 = *(sl);
0x00010dc4 mov r2, 0 | r2 = 0;
0x00010dc8 add r3, r3, 2 | r3 += 2;
0x00010dcc ldr sl, [sb, r3, lsl 2] | offset_1 = r3 << 2;
| sl = *((sb + offset_1));
0x00010dd0 mov r1, r5 | r1 = r5;
0x00010dd4 mov r0, sl | r0 = sl;
0x00010dd8 bl 0x10a60 | strtoul (r0, r1, r2);
0x00010ddc ldrb r3, [sl] | r3 = *(sl);
0x00010de0 cmp r3, 0 |
0x00010de4 mov sb, r0 | sb = r0;
| if (r3 != 0) {
0x00010de8 beq 0x10dfc |
0x00010dec ldr r3, [sp, 0x40] | r3 = endptr;
0x00010df0 ldrb r3, [r3] | r3 = *(r3);
0x00010df4 cmp r3, 0 |
| if (r3 == 0) {
0x00010df8 beq 0x10e38 | goto label_21;
| }
| }
0x00010dfc ldr r0, [pc, 0x5d0] |
0x00010e00 str sl, [sp] | *(sp) = sl;
0x00010e04 ldr r3, [pc, 0x5dc] | r3 = "%s: error!: %s: unable to parse the number '%s'\n";
0x00010e08 ldr r2, [pc, 0x5ac] | r2 = "help";
0x00010e0c ldr r1, [pc, 0x5d0] | r1 = "strtoull";
0x00010e10 ldr r0, [r0] | r0 = optind;
0x00010e14 bl 0x10aa8 | fprintf (r0, "strtoull", "help", "%s: error!: %s: unable to parse the number '%s'\n")
| do {
| label_19:
0x00010e18 ldr r2, [pc, 0x59c] | r2 = "help";
0x00010e1c ldr r1, [pc, 0x5c8] | r1 = "strtoul";
| label_1:
0x00010e20 ldr r3, [pc, 0x5ac] | r3 = optind;
0x00010e24 ldr r0, [r3] | r0 = optind;
0x00010e28 bl 0x10aa8 | fprintf (r0, "strtoul", "help", r3)
| label_3:
0x00010e2c mov r0, r7 | r0 = r7;
0x00010e30 add sp, sp, 0x144 |
0x00010e34 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_21:
0x00010e38 cmp r8, 0 |
0x00010e3c bne 0x10e18 |
| } while (r8 != 0);
0x00010e40 bl 0x12388 | r0 = fcn_00012388 ();
0x00010e44 subs r3, r0, 0 | r3 = r0 - 0;
0x00010e48 str r3, [sp, 0x30] | var_30h = r3;
| if (r3 == r0) {
0x00010e4c bne 0x10e70 |
0x00010e50 ldr r2, [pc, 0x564] | r2 = "help";
0x00010e54 ldr r1, [pc, 0x594] | r1 = "%s: error!: Try `--help' for more information\n";
0x00010e58 b 0x10e20 | goto label_1;
| label_18:
0x00010e5c ldr r2, [pc, 0x558] | r2 = "help";
0x00010e60 ldr r1, [pc, 0x58c] | r1 = "_s:_error_:_cant_initialize_libmtd";
0x00010e64 ldr r0, [r4] | r0 = *(r4);
0x00010e68 bl 0x10aa8 | fprintf (r0, "_s:_error_:_cant_initialize_libmtd", "help")
0x00010e6c b 0x10d34 | goto label_2;
| }
0x00010e70 mov r1, 2 | r1 = 2;
0x00010e74 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00010e78 bl 0x10b20 | r0 = open64 ();
0x00010e7c subs fp, r0, 0 |
| if (fp < r0) {
0x00010e80 bge 0x10ed0 |
0x00010e84 bl 0x10b5c | errno_location ();
0x00010e88 ldr r6, [pc, 0x544] | r6 = optind;
0x00010e8c ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x00010e90 ldr r2, [pc, 0x524] | r2 = "help";
0x00010e94 ldr r1, [pc, 0x55c] | r1 = "_s:_error_:_no_MTD_device_specified";
0x00010e98 ldr r5, [r0] | r5 = *(r0);
| label_7:
0x00010e9c ldr r0, [r6] | r0 = *(r6);
0x00010ea0 bl 0x10aa8 | fprintf (r0, "_s:_error_:_no_MTD_device_specified", "help", r3, r4, r5, r6)
0x00010ea4 mov r0, r5 | r0 = r5;
0x00010ea8 ldr r4, [r6] | r4 = *(r6);
0x00010eac bl 0x10a0c | strerror (r0);
0x00010eb0 str r5, [sp] | *(sp) = r5;
0x00010eb4 ldr r3, [pc, 0x540] | r3 = "%s: error!: %s\n";
0x00010eb8 mov r2, 0xd | r2 = 0xd;
0x00010ebc ldr r1, [pc, 0x53c] | r1 = *(0x113fc);
0x00010ec0 str r0, [sp, 4] | var_4h = r0;
0x00010ec4 mov r0, r4 | r0 = r4;
0x00010ec8 bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: %s\n", r4, r5)
0x00010ecc b 0x10e2c | goto label_3;
| }
0x00010ed0 mov r2, r5 | r2 = r5;
0x00010ed4 ldr r1, [r4, 0x10] | r1 = *((r4 + 0x10));
0x00010ed8 ldr r0, [sp, 0x30] | r0 = var_30h;
0x00010edc bl 0x12c38 | r0 = fcn_00012c38 (r0, r1);
0x00010ee0 cmp r0, 0 |
| if (r0 >= 0) {
0x00010ee4 ldrlt r2, [pc, 0x4d0] | r2 = "flash_erase";
| }
| if (r0 < 0) {
0x00010ee8 ldrlt r1, [pc, 0x514] | r1 = "%s: error!: mtd_get_dev_info failed\n";
| goto label_22;
| }
| if (r0 < 0) {
| label_22:
0x00010eec blt 0x10e20 | goto label_1;
| }
0x00010ef0 ldr sl, [r4] | sl = *(r4);
0x00010ef4 ldr r8, [sp, 0x4c] | r8 = var_4ch;
0x00010ef8 cmp sl, 0 |
| if (sl == 0) {
0x00010efc beq 0x10f10 | goto label_23;
| }
0x00010f00 cmp r8, 8 |
| if (r8 != 8) {
0x00010f04 ldreq r2, [pc, 0x4b0] | r2 = "flash_erase";
| }
| if (r8 == 8) {
0x00010f08 ldreq r1, [pc, 0x4f8] | r1 = "%s: error!: JFFS2 cannot support MLC NAND.\n";
| goto label_24;
| }
| if (r8 == 8) {
| label_24:
0x00010f0c beq 0x10e20 | goto label_1;
| }
| label_23:
0x00010f10 ldr r2, [sp, 0x124] | r2 = var_124h;
0x00010f14 ldrd r0, r1, [sp, 0x18] | __asm ("ldrd r0, r1, [var_18h]");
0x00010f18 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00010f1c bl 0x14920 | fcn_00014920 (r0, r1);
0x00010f20 sub r8, r8, 4 | r8 -= 4;
0x00010f24 cmp sl, 0 |
0x00010f28 bic r8, r8, 4 | r8 = BIT_MASK (r8, 4);
| if (sl != 0) {
0x00010f2c moveq sl, 8 | sl = 8;
| }
0x00010f30 strd r0, r1, [sp, 0x28] | __asm ("strd r0, r1, [var_28h]");
0x00010f34 ldr r3, [sp, 0x28] | r3 = var_28h;
0x00010f38 str r3, [sp, 0x3c] | var_3ch = r3;
| if (sl != 0) {
0x00010f3c beq 0x10ff8 |
0x00010f40 ldr r3, [pc, 0x4c4] |
0x00010f44 ldr r2, [pc, 0x4c4] | r2 = *(0x1140c);
0x00010f48 ldr r3, [r3] | r3 = "%s: error!: JFFS2 cannot support MLC NAND.\n";
0x00010f4c ldr r0, [pc, 0x4c0] | r0 = *(0x11410);
0x00010f50 ldr r1, [pc, 0x4c0] | r1 = *(0x11414);
0x00010f54 cmp r3, r2 |
| if (r3 != r2) {
0x00010f58 moveq r1, r0 | r1 = r0;
| }
0x00010f5c strb r1, [r4, 0x14] | *((r4 + 0x14)) = r1;
0x00010f60 lsr r1, r1, 8 | r1 >>= 8;
0x00010f64 strb r1, [r4, 0x15] | *((r4 + 0x15)) = r1;
0x00010f68 ldr r1, [pc, 0x4ac] | r1 = *(0x11418);
| if (r3 == r2) {
0x00010f6c movne r1, 0x320 | r1 = 0x320;
| }
0x00010f70 strb r1, [r4, 0x16] | *((r4 + 0x16)) = r1;
0x00010f74 cmp r8, 0 |
0x00010f78 lsr r1, r1, 8 | r1 >>= 8;
0x00010f7c strb r1, [r4, 0x17] | *((r4 + 0x17)) = r1;
| if (r8 == 0) {
0x00010f80 beq 0x110d4 | goto label_25;
| }
0x00010f84 cmp r3, r2 |
| if (r3 != r2) {
0x00010f88 moveq r3, 0xc | r3 = 0xc;
| }
| if (r3 == r2) {
0x00010f8c movne r3, 0xc000000 | r3 = 0xc000000;
| }
0x00010f90 mov r2, 0 | r2 = 0;
0x00010f94 strb r3, [r4, 0x18] | *((r4 + 0x18)) = r3;
0x00010f98 mov sl, 8 | sl = 8;
0x00010f9c lsr r3, r3, 0x18 | r3 >>= 0x18;
0x00010fa0 strb r2, [r4, 0x19] | *((r4 + 0x19)) = r2;
0x00010fa4 strb r2, [r4, 0x1a] | *((r4 + 0x1a)) = r2;
0x00010fa8 strb r3, [r4, 0x1b] | *((r4 + 0x1b)) = r3;
| label_5:
0x00010fac mov r2, 8 | r2 = 8;
0x00010fb0 ldr r1, [pc, 0x468] | r1 = *(0x1141c);
0x00010fb4 mov r0, 0 | r0 = 0;
0x00010fb8 bl 0x13b34 | fcn_00013b34 (r0);
0x00010fbc ldr r2, [pc, 0x448] | r2 = "%s: error!: JFFS2 cannot support MLC NAND.\n";
0x00010fc0 ldr r1, [r2] | r1 = "%s: error!: JFFS2 cannot support MLC NAND.\n";
0x00010fc4 ldr r2, [pc, 0x444] | r2 = *(0x1140c);
0x00010fc8 cmp r1, r2 |
0x00010fcc mov r3, r0 | r3 = r0;
| if (r1 != r2) {
0x00010fd0 beq 0x10fdc |
0x00010fd4 bl 0x1496c | r0 = fcn_0001496c (r0);
0x00010fd8 mov r3, r0 | r3 = r0;
| }
0x00010fdc lsr r2, r3, 8 | r2 = r3 >> 8;
0x00010fe0 strb r3, [r4, 0x1c] | *((r4 + 0x1c)) = r3;
0x00010fe4 strb r2, [r4, 0x1d] | *((r4 + 0x1d)) = r2;
0x00010fe8 lsr r2, r3, 0x10 | r2 = r3 >> 0x10;
0x00010fec lsr r3, r3, 0x18 | r3 >>= 0x18;
0x00010ff0 strb r2, [r4, 0x1e] | *((r4 + 0x1e)) = r2;
0x00010ff4 strb r3, [r4, 0x1f] | *((r4 + 0x1f)) = r3;
| }
0x00010ff8 cmp sb, 0 |
| if (sb == 0) {
0x00010ffc bne 0x11018 |
0x00011000 ldr r2, [sp, 0x124] | r2 = var_124h;
0x00011004 ldrd r0, r1, [r5, 0xd8] | __asm ("ldrd r0, r1, [var_d8h]");
0x00011008 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x0001100c bl 0x1484c | fcn_0001484c (r0, r1);
0x00011010 ldr r3, [sp, 0x28] | r3 = var_28h;
0x00011014 sub sb, r0, r3 | sb = r0 - r3;
| }
0x00011018 ldrd r2, r3, [sp, 0x28] | __asm ("ldrd r2, r3, [var_28h]");
0x0001101c ldr r4, [pc, 0x390] | r4 = "jNquVh";
0x00011020 mov r3, 0 | r3 = 0;
0x00011024 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x00011028 ldr r2, [sp, 0x28] | r2 = var_28h;
0x0001102c mvn r3, 0x63 | r3 = ~0x63;
0x00011030 mul r2, r3, r2 | r2 = r3 * r2;
0x00011034 mov r3, 0 | r3 = 0;
0x00011038 str r2, [sp, 0x34] | var_34h = r2;
0x0001103c mov r2, 0 | r2 = 0;
0x00011040 strd r2, r3, [sp, 0x20] | __asm ("strd r2, r3, [var_24h]");
| label_6:
0x00011044 ldr r3, [sp, 0x3c] | r3 = var_3ch;
0x00011048 ldr r6, [sp, 0x18] | r6 = var_18h;
0x0001104c add r3, sb, r3 | r3 = sb + r3;
0x00011050 cmp r3, r6 |
0x00011054 str r6, [sp, 0x38] | var_38h = r6;
| if (r3 > r6) {
0x00011058 bhi 0x11108 | goto label_26;
| }
0x0001105c ldr r4, [pc, 0x350] | r4 = "jNquVh";
0x00011060 ldr r3, [r4, 8] | r3 = "help";
0x00011064 cmp r3, 0 |
| if (r3 == 0) {
0x00011068 bne 0x110b0 |
0x0001106c ldr r3, [sp, 0x124] | r3 = var_124h;
0x00011070 mov r1, sb | r1 = sb;
0x00011074 add r5, r3, 0x3fc | r5 = r3 + 0x3fc;
0x00011078 cmp r3, 0 |
0x0001107c add r5, r5, 3 | r5 += 3;
| if (r3 >= 0) {
0x00011080 movlt r3, r5 | r3 = r5;
| }
0x00011084 asr r5, r3, 0xa | r5 = r3 >> 0xa;
0x00011088 ldr r3, [sp, 0x28] | r3 = var_28h;
0x0001108c sub r6, r6, r3 | r6 -= r3;
0x00011090 mov r3, 0x64 | r3 = 0x64;
0x00011094 mul r0, r6, r3 | r0 = r6 * r3;
0x00011098 bl 0x14750 | fcn_00014750 (r0, r1);
0x0001109c ldrd r2, r3, [sp, 0x20] | __asm ("ldrd r2, r3, [var_24h]");
0x000110a0 mov r1, r5 | r1 = r5;
0x000110a4 str r0, [sp] | *(sp) = r0;
0x000110a8 ldr r0, [pc, 0x374] | r0 = *(0x11420);
0x000110ac bl 0x10a00 | printf (r0, r1, r2);
| }
0x000110b0 ldr r3, [pc, 0x370] | r3 = "\rErasing %d Kibyte @ %llx -- %2i %% complete ";
0x000110b4 ldr r0, [r3] | r0 = "\rErasing %d Kibyte @ %llx -- %2i %% complete ";
0x000110b8 bl 0x10a6c | fflush ("\rErasing %d Kibyte @ %llx -- %2i %% complete ");
0x000110bc ldr r7, [r4, 8] | r7 = *((r4 + 8));
0x000110c0 cmp r7, 0 |
| if (r7 != 0) {
0x000110c4 bne 0x10cdc | goto label_4;
| }
0x000110c8 mov r0, 0xa | r0 = 0xa;
0x000110cc bl 0x109dc | putchar (r0);
0x000110d0 b 0x10e2c | goto label_3;
| label_25:
0x000110d4 ldr sl, [sp, 0x134] | sl = var_134h;
0x000110d8 cmp r3, r2 |
| if (r3 != r2) {
0x000110dc moveq r3, 8 | r3 = 8;
| }
| if (r3 == r2) {
0x000110e0 movne r3, 0x8000000 | r3 = 0x8000000;
| }
0x000110e4 mov r2, 0 | r2 = 0;
0x000110e8 strb r3, [r4, 0x18] | *((r4 + 0x18)) = r3;
0x000110ec cmp sl, 8 |
0x000110f0 lsr r3, r3, 0x18 | r3 >>= 0x18;
0x000110f4 strb r2, [r4, 0x19] | *((r4 + 0x19)) = r2;
0x000110f8 strb r2, [r4, 0x1a] | *((r4 + 0x1a)) = r2;
0x000110fc strb r3, [r4, 0x1b] | *((r4 + 0x1b)) = r3;
| if (sl < 8) {
0x00011100 movge sl, 8 | sl = 8;
| }
0x00011104 b 0x10fac | goto label_5;
| label_26:
0x00011108 ldr r2, [sp, 0x124] | r2 = var_124h;
0x0001110c ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x00011110 ldr ip, [sp, 0x18] | ip = var_18h;
0x00011114 mul r3, r2, r3 | r3 = r2 * r3;
0x00011118 asr r1, r2, 0x1f | r1 = r2 >> 0x1f;
0x0001111c mla ip, r1, ip, r3 | __asm ("mla ip, r1, ip, r3");
0x00011120 mov r3, ip | r3 = ip;
0x00011124 ldr ip, [sp, 0x18] | ip = var_18h;
0x00011128 umull r0, r1, r2, ip | r0:r1 = r2 * ip;
0x0001112c strd r0, r1, [sp, 0x20] | __asm ("strd r0, r1, [var_24h]");
0x00011130 ldr r2, [sp, 0x24] | r2 = var_24h;
0x00011134 add r3, r3, r2 | r3 += r2;
0x00011138 str r3, [sp, 0x24] | var_24h = r3;
0x0001113c ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00011140 cmp r3, 0 |
| if (r3 != 0) {
0x00011144 bne 0x111e4 | goto label_27;
| }
0x00011148 mov r2, ip | r2 = ip;
0x0001114c mov r1, fp | r1 = fp;
0x00011150 add r0, sp, 0x40 | r0 += endptr;
0x00011154 bl 0x130c8 | r0 = fcn_000130c8 (r0, r1);
0x00011158 cmp r0, 0 |
| if (r0 <= 0) {
0x0001115c ble 0x11190 | goto label_28;
| }
0x00011160 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00011164 cmp r3, 0 |
| if (r3 != 0) {
0x00011168 bne 0x1117c | goto label_9;
| }
0x0001116c ldrd r2, r3, [sp, 0x20] | __asm ("ldrd r2, r3, [var_24h]");
0x00011170 ldr r1, [pc, 0x244] | r1 = "help";
0x00011174 ldr r0, [pc, 0x2b0] | r0 = stdout;
0x00011178 bl 0x10a00 | printf (r0, "help", r2);
| do {
| label_9:
0x0001117c ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00011180 adds r2, r2, 1 | r2++;
0x00011184 adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x00011188 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x0001118c b 0x11044 | goto label_6;
| if (r2 != r2) {
| label_28:
0x00011190 beq 0x111e4 |
0x00011194 bl 0x10b5c | r0 = errno_location ();
0x00011198 ldr r5, [r0] | r5 = *(r0);
0x0001119c cmp r5, 0x5f |
| if (r5 == 0x5f) {
0x000111a0 bne 0x111d0 |
0x000111a4 mov r3, 1 | r3 = 1;
0x000111a8 cmp r8, 0 |
0x000111ac str r3, [r4, 4] | *((r4 + 4)) = r3;
| if (r8 != 0) {
0x000111b0 bne 0x111e4 | goto label_27;
| }
0x000111b4 ldr r0, [pc, 0x218] |
0x000111b8 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x000111bc ldr r2, [pc, 0x1f8] | r2 = "help";
0x000111c0 ldr r1, [pc, 0x268] | r1 = "_s:_Skipping_bad_block_at__08llx";
0x000111c4 ldr r0, [r0] | r0 = optind;
0x000111c8 bl 0x10aa8 | fprintf (r0, "_s:_Skipping_bad_block_at__08llx", "help", r3)
0x000111cc b 0x10e2c | goto label_3;
| }
0x000111d0 ldr r6, [pc, 0x1fc] | r6 = optind;
0x000111d4 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x000111d8 ldr r2, [pc, 0x1dc] | r2 = "help";
0x000111dc ldr r1, [pc, 0x250] | r1 = "_s:_error_:__s:_Bad_block_check_not_available";
0x000111e0 b 0x10e9c | goto label_7;
| }
| label_27:
0x000111e4 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x000111e8 cmp r3, 0 |
| if (r3 == 0) {
0x000111ec bne 0x11238 |
0x000111f0 ldr r5, [sp, 0x124] | r5 = var_124h;
0x000111f4 ldr r2, [sp, 0x34] | r2 = var_34h;
0x000111f8 add r3, r5, 0x3fc | r3 = r5 + 0x3fc;
0x000111fc cmp r5, 0 |
0x00011200 add r3, r3, 3 | r3 += 3;
| if (r5 >= 0) {
0x00011204 movlt r5, r3 | r5 = r3;
| }
0x00011208 ldr r3, [sp, 0x38] | r3 = var_38h;
0x0001120c mov r0, 0x64 | r0 = 0x64;
0x00011210 mla r3, r0, r3, r2 | __asm ("mla r3, r0, r3, r2");
0x00011214 mov r1, sb | r1 = sb;
0x00011218 mov r0, r3 | r0 = r3;
0x0001121c bl 0x14750 | fcn_00014750 (r0, r1);
0x00011220 asr r5, r5, 0xa | r5 >>= 0xa;
0x00011224 ldrd r2, r3, [sp, 0x20] | __asm ("ldrd r2, r3, [var_24h]");
0x00011228 mov r1, r5 | r1 = r5;
0x0001122c str r0, [sp] | *(sp) = r0;
0x00011230 ldr r0, [pc, 0x1ec] | r0 = *(0x11420);
0x00011234 bl 0x10a00 | printf (r0, r1, r2, r3, r4, r5);
| }
0x00011238 ldr r3, [pc, 0x1e8] | r3 = "\rErasing %d Kibyte @ %llx -- %2i %% complete ";
0x0001123c ldr r0, [r3] | r0 = "\rErasing %d Kibyte @ %llx -- %2i %% complete ";
0x00011240 bl 0x10a6c | fflush ("\rErasing %d Kibyte @ %llx -- %2i %% complete ");
0x00011244 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00011248 cmp r3, 0 |
| if (r3 == 0) {
0x0001124c beq 0x112b4 | goto label_29;
| }
0x00011250 mov r2, r6 | r2 = r6;
0x00011254 mov r1, fp | r1 = fp;
0x00011258 add r0, sp, 0x40 | r0 += endptr;
0x0001125c bl 0x12e0c | r0 = fcn_00012e0c ();
0x00011260 cmp r0, 0 |
| if (r0 == 0) {
0x00011264 beq 0x112b4 | goto label_29;
| }
0x00011268 bl 0x10b5c | errno_location ();
0x0001126c ldr r6, [pc, 0x160] | r6 = optind;
0x00011270 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x00011274 ldr r2, [pc, 0x140] | r2 = "help";
0x00011278 ldr r1, [pc, 0x1b8] | r1 = "%s: error!: %s: MTD get bad block failed\n";
0x0001127c ldr r5, [r0] | r5 = *(r0);
| label_8:
0x00011280 ldr r0, [r6] | r0 = *(r6);
0x00011284 bl 0x10aa8 | fprintf (r0, "%s: error!: %s: MTD get bad block failed\n", "help", r3, r4, r5, r6)
0x00011288 mov r0, r5 | r0 = r5;
0x0001128c ldr r6, [r6] | r6 = *(r6);
0x00011290 bl 0x10a0c | strerror (r0);
0x00011294 str r5, [sp] | *(sp) = r5;
0x00011298 ldr r3, [pc, 0x15c] | r3 = "%s: error!: %s\n";
0x0001129c mov r2, 0xd | r2 = 0xd;
0x000112a0 ldr r1, [pc, 0x158] | r1 = *(0x113fc);
0x000112a4 str r0, [sp, 4] | var_4h = r0;
0x000112a8 mov r0, r6 | r0 = r6;
0x000112ac bl 0x10aa8 | fprintf (r0, r1, r2, "%s: error!: %s\n", r4, r5)
0x000112b0 b 0x1117c |
| } while (1);
| label_29:
0x000112b4 mov r3, r6 | r3 = r6;
0x000112b8 mov r2, fp | r2 = fp;
0x000112bc add r1, sp, 0x40 | r1 += endptr;
0x000112c0 ldr r0, [sp, 0x30] | r0 = var_30h;
0x000112c4 bl 0x12f94 | r0 = fcn_00012f94 ();
0x000112c8 cmp r0, 0 |
| if (r0 != 0) {
0x000112cc beq 0x112ec |
0x000112d0 bl 0x10b5c | errno_location ();
0x000112d4 ldr r6, [pc, 0xf8] | r6 = optind;
0x000112d8 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x000112dc ldr r2, [pc, 0xd8] | r2 = "help";
0x000112e0 ldr r1, [pc, 0x154] | r1 = "%s: error!: %s: MTD unlock failure\n";
0x000112e4 ldr r5, [r0] | r5 = *(r0);
0x000112e8 b 0x11280 | goto label_8;
| }
0x000112ec ldr r3, [r4] | r3 = *(r4);
0x000112f0 cmp r3, 0 |
| if (r3 == 0) {
0x000112f4 beq 0x1117c | goto label_9;
| }
0x000112f8 cmp r8, 0 |
| if (r8 == 0) {
0x000112fc bne 0x11358 |
0x00011300 mov r3, 1 | r3 = 1;
0x00011304 str r3, [sp, 0x14] | var_14h = r3;
0x00011308 ldr r3, [pc, 0x110] | r3 = *(0x1141c);
0x0001130c str sl, [sp, 0x10] | var_10h = sl;
0x00011310 str r3, [sp, 0xc] | var_ch = r3;
0x00011314 str r8, [sp, 8] | var_8h = r8;
0x00011318 str r8, [sp, 4] | var_4h = r8;
0x0001131c str r8, [sp] | *(sp) = r8;
0x00011320 mov r3, r6 | r3 = r6;
0x00011324 mov r2, fp | r2 = fp;
0x00011328 add r1, sp, 0x40 | r1 += endptr;
0x0001132c ldr r0, [sp, 0x30] | r0 = var_30h;
0x00011330 bl 0x133e0 | r0 = fcn_000133e0 (r0, r1, r2, r3, r4, r5, r6);
0x00011334 cmp r0, 0 |
| if (r0 == 0) {
0x00011338 beq 0x11394 | goto label_30;
| }
0x0001133c bl 0x10b5c | errno_location ();
0x00011340 ldr r6, [pc, 0x8c] | r6 = optind;
0x00011344 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x00011348 ldr r2, [pc, 0x6c] | r2 = "help";
0x0001134c ldr r1, [pc, 0xec] | r1 = "%s: error!: %s: MTD Erase failure\n";
0x00011350 ldr r5, [r0] | r5 = *(r0);
0x00011354 b 0x11280 | goto label_8;
| }
0x00011358 ldrd r2, r3, [sp, 0x20] | __asm ("ldrd r2, r3, [var_24h]");
0x0001135c ldr r1, [pc, 0xbc] | r1 = *(0x1141c);
0x00011360 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011364 mov r0, fp | r0 = fp;
0x00011368 mov r2, 0xc | r2 = 0xc;
0x0001136c bl 0x10a30 | r0 = pwrite64 ();
0x00011370 cmp r0, 0xc |
| if (r0 != 0xc) {
0x00011374 beq 0x11394 |
0x00011378 bl 0x10b5c | errno_location ();
0x0001137c ldr r6, [pc, 0x50] | r6 = optind;
0x00011380 ldr r3, [r4, 0x10] | r3 = *((r4 + 0x10));
0x00011384 ldr r2, [pc, 0x30] | r2 = "help";
0x00011388 ldr r1, [pc, 0xb4] | r1 = "_s:_error_:__s:_MTD_writeoob_failure";
0x0001138c ldr r5, [r0] | r5 = *(r0);
0x00011390 b 0x11280 | goto label_8;
| }
| label_30:
0x00011394 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00011398 cmp r3, 0 |
| if (r3 != 0) {
0x0001139c bne 0x1117c | goto label_9;
| }
0x000113a0 ldr r1, [pc, 0x14] | r1 = "help";
0x000113a4 ldr r0, [pc, 0x9c] | r0 = "_s:_error_:__s:_MTD_write_failure";
0x000113a8 bl 0x10a00 | printf ("_s:_error_:__s:_MTD_write_failure", "help");
0x000113ac b 0x1117c | goto label_9;
| }
[*] Function fprintf used 100 times flash_erase