[*] Binary protection state of nandwrite
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf tear down of nandwrite
; 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/nandwrite @ 0x149cc */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000149cc () | void fcn_000149cc (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;
0x000149cc push {r4, r5, r6, r7, r8, sb, lr} |
0x000149d0 sub sp, sp, 0x144 |
0x000149d4 mov r2, 0 | r2 = 0;
0x000149d8 mov r3, 0 | r3 = 0;
0x000149dc mov r4, r1 | r4 = r1;
0x000149e0 add r1, sp, 0x38 | r1 += var_38h;
0x000149e4 mov r6, r0 | r6 = r0;
0x000149e8 strd r2, r3, [sp, 0x10] | __asm ("strd r2, r3, [var_10h]");
0x000149ec bl 0x10a24 | r0 = stat64 ();
0x000149f0 cmp r0, 0 |
| if (r0 != 0) {
0x000149f4 beq 0x14a5c |
0x000149f8 bl 0x10b5c | errno_location ();
0x000149fc ldr r8, [pc, 0x450] |
0x00014a00 mov r3, r6 | r3 = r6;
0x00014a04 ldr r2, [pc, 0x44c] | r2 = stderr;
0x00014a08 ldr r1, [pc, 0x44c] | r1 = "libmtd";
0x00014a0c ldr r7, [r0] | r7 = *(r0);
0x00014a10 mov r5, r0 | r5 = r0;
0x00014a14 ldr r0, [r8] | r0 = *(0x14e50);
0x00014a18 bl 0x10ab4 | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x00014a1c mov r0, r7 | r0 = r7;
0x00014a20 ldr r8, [r8] | r8 = *(0x14e50);
0x00014a24 bl 0x10a18 | strerror (r0);
0x00014a28 ldr r3, [pc, 0x430] | r3 = "_s:_error_:_cannot_open___s_";
0x00014a2c str r7, [sp] | *(sp) = r7;
0x00014a30 mov r2, 8 | r2 = 8;
0x00014a34 ldr r1, [pc, 0x428] | r1 = *(0x14e60);
0x00014a38 str r0, [sp, 4] | var_4h = r0;
0x00014a3c mov r0, r8 | r0 = r8;
0x00014a40 bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open___s_")
0x00014a44 ldr r3, [r5] | r3 = *(r5);
0x00014a48 cmp r3, 2 |
| if (r3 != 2) {
0x00014a4c bne 0x14a5c | goto label_5;
| }
0x00014a50 ldr r1, [pc, 0x400] | r1 = stderr;
0x00014a54 ldr r0, [pc, 0x40c] | r0 = "_serror__d___s_";
0x00014a58 bl 0x10a0c | printf ("_serror__d___s_", r1)
| }
| label_5:
0x00014a5c ldr r3, [sp, 0x48] | r3 = var_48h;
0x00014a60 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00014a64 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00014a68 beq 0x14a98 | goto label_6;
| }
0x00014a6c bl 0x10b5c | errno_location ();
0x00014a70 mov r3, 0x16 | r3 = 0x16;
0x00014a74 ldr r2, [pc, 0x3dc] | r2 = stderr;
0x00014a78 ldr r1, [pc, 0x3ec] | r1 = "%s: MTD subsystem is old and does not support sysfs, so MTD character device nodes have to exist\n";
0x00014a7c str r3, [r0] | *(r0) = r3;
0x00014a80 ldr r0, [pc, 0x3cc] |
0x00014a84 mov r3, r6 | r3 = r6;
0x00014a88 ldr r0, [r0] | r0 = *(0x14e50);
0x00014a8c bl 0x10ab4 | 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:
0x00014a90 mvn r5, 0 | r5 = ~0;
0x00014a94 b 0x14b7c | goto label_4;
| label_6:
0x00014a98 mov r2, 0x100 | r2 = 0x100;
0x00014a9c mov r1, 0 | r1 = 0;
0x00014aa0 mov r0, r4 | r0 = r4;
0x00014aa4 bl 0x10b14 | memset (r0, r1, r2);
0x00014aa8 ldrd r8, sb, [sp, 0x58] | __asm ("ldrd r8, sb, [var_58h]");
0x00014aac mov r1, sb | r1 = sb;
0x00014ab0 mov r0, r8 | r0 = r8;
0x00014ab4 bl 0x10a3c | gnu_dev_major ();
0x00014ab8 mov r1, sb | r1 = sb;
0x00014abc mov r5, r0 | r5 = r0;
0x00014ac0 str r0, [r4, 4] | *((r4 + 4)) = r0;
0x00014ac4 mov r0, r8 | r0 = r8;
0x00014ac8 bl 0x10a78 | gnu_dev_minor ();
0x00014acc cmp r5, 0x5a |
0x00014ad0 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r5 == 0x5a) {
0x00014ad4 beq 0x14b10 | goto label_7;
| }
0x00014ad8 bl 0x10b5c | errno_location ();
0x00014adc mov r3, 0x16 | r3 = 0x16;
0x00014ae0 ldr r2, [pc, 0x370] | r2 = stderr;
0x00014ae4 ldr r1, [pc, 0x384] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x00014ae8 str r3, [r0] | *(r0) = r3;
0x00014aec mov r3, 0x5a | r3 = 0x5a;
0x00014af0 str r3, [sp, 4] | var_4h = r3;
0x00014af4 ldr r0, [pc, 0x358] |
0x00014af8 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00014afc str r3, [sp] | *(sp) = r3;
0x00014b00 mov r3, r6 | r3 = r6;
0x00014b04 ldr r0, [r0] | r0 = *(0x14e50);
0x00014b08 bl 0x10ab4 | fprintf (r0, "_s:_error_:___s__is_not_a_character_device", r2, r3)
0x00014b0c b 0x14a90 |
| } while (1);
| label_7:
0x00014b10 add r0, r0, r0, lsr 31 | r0 += (r0 >> 31);
0x00014b14 asr r0, r0, 1 | r0 >>= 1;
0x00014b18 str r0, [r4] | *(r4) = r0;
0x00014b1c mov r1, 0 | r1 = 0;
0x00014b20 mov r0, r6 | r0 = r6;
0x00014b24 bl 0x10b20 | r0 = open64 ();
0x00014b28 cmn r0, 1 |
0x00014b2c mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x00014b30 bne 0x14b88 |
0x00014b34 bl 0x10b5c | errno_location ();
0x00014b38 ldr r7, [pc, 0x314] | r7 = *(0x14e50);
0x00014b3c mov r3, r6 | r3 = r6;
0x00014b40 ldr r2, [pc, 0x310] | r2 = stderr;
0x00014b44 ldr r1, [pc, 0x310] | r1 = "libmtd";
0x00014b48 ldr r4, [r0] | r4 = *(r0);
0x00014b4c ldr r0, [r7] | r0 = *(0x14e50);
0x00014b50 bl 0x10ab4 | fprintf (r0, "libmtd", r2, r3, r4)
0x00014b54 mov r0, r4 | r0 = r4;
0x00014b58 ldr r6, [r7] | r6 = *(0x14e50);
0x00014b5c bl 0x10a18 | strerror (r0);
0x00014b60 str r4, [sp] | *(sp) = r4;
0x00014b64 ldr r3, [pc, 0x2f4] | r3 = "_s:_error_:_cannot_open___s_";
0x00014b68 mov r2, 8 | r2 = 8;
0x00014b6c ldr r1, [pc, 0x2f0] | r1 = *(0x14e60);
0x00014b70 str r0, [sp, 4] | var_4h = r0;
0x00014b74 mov r0, r6 | r0 = r6;
0x00014b78 bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open___s_", r4)
| label_4:
0x00014b7c mov r0, r5 | r0 = r5;
0x00014b80 add sp, sp, 0x144 |
0x00014b84 pop {r4, r5, r6, r7, r8, sb, pc} |
| }
0x00014b88 add r2, sp, 0x18 | r2 += var_18h;
0x00014b8c ldr r1, [pc, 0x2e0] | r1 = "%s: error!: \"%s\" has major number %d, MTD devices have major %d\n";
0x00014b90 bl 0x10a00 | r0 = ioctl (r0, "%s: error!: \"%s\" has major number %d, MTD devices have major %d\n");
0x00014b94 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00014b98 beq 0x14bec | goto label_8;
| }
0x00014b9c bl 0x10b5c | errno_location ();
0x00014ba0 ldr r6, [pc, 0x2ac] |
0x00014ba4 ldr r2, [pc, 0x2ac] | r2 = stderr;
0x00014ba8 ldr r1, [pc, 0x2c8] | r1 = *(0x14e74);
0x00014bac ldr r4, [r0] | r4 = *(r0);
0x00014bb0 ldr r0, [r6] | r0 = *(0x14e50);
0x00014bb4 bl 0x10ab4 | fprintf (r0, r1, r2, r3, r4, r5, r6)
0x00014bb8 mov r0, r4 | r0 = r4;
0x00014bbc ldr r6, [r6] | r6 = *(0x14e50);
0x00014bc0 bl 0x10a18 | strerror (r0);
0x00014bc4 ldr r3, [pc, 0x294] | r3 = "_s:_error_:_cannot_open___s_";
0x00014bc8 ldr r1, [pc, 0x294] | r1 = *(0x14e60);
0x00014bcc mov r2, 8 | r2 = 8;
0x00014bd0 str r4, [sp] | *(sp) = r4;
0x00014bd4 str r0, [sp, 4] | var_4h = r0;
0x00014bd8 mov r0, r6 | r0 = r6;
| do {
| label_1:
0x00014bdc bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open___s_", r4)
| label_2:
0x00014be0 mov r0, r5 | r0 = r5;
0x00014be4 bl 0x10bbc | close (r0);
0x00014be8 b 0x14a90 | goto label_0;
| label_8:
0x00014bec add r2, sp, 0x10 | r2 += var_10h;
0x00014bf0 ldr r1, [pc, 0x284] | r1 = "_s:_error_:_MEMGETINFO_ioctl_request_failed";
0x00014bf4 mov r0, r5 | r0 = r5;
0x00014bf8 bl 0x10a00 | r0 = ioctl (r0, "_s:_error_:_MEMGETINFO_ioctl_request_failed");
0x00014bfc cmn r0, 1 |
| if (r0 == 1) {
0x00014c00 ldrbne r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
| if (r0 == 1) {
0x00014c04 orrne r3, r3, 2 | r3 |= 2;
| }
| if (r0 != 1) {
0x00014c08 bne 0x14c64 | goto label_9;
| }
0x00014c0c bl 0x10b5c | r0 = errno_location ();
0x00014c10 ldr r7, [r0] | r7 = *(r0);
0x00014c14 cmp r7, 0x5f |
| if (r7 != 0x5f) {
0x00014c18 streq r8, [r0] | *(r0) = r8;
| }
| if (r7 != 0x5f) {
0x00014c1c ldrbeq r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
0x00014c20 biceq r3, r3, 2 | __asm ("biceq r3, r3, 2");
| if (r7 == 0x5f) {
0x00014c24 beq 0x14c64 | goto label_9;
| }
0x00014c28 ldr r4, [pc, 0x224] |
0x00014c2c ldr r2, [pc, 0x224] | r2 = stderr;
0x00014c30 ldr r1, [pc, 0x248] | r1 = *(0x14e7c);
0x00014c34 ldr r0, [r4] | r0 = *(0x14e50);
0x00014c38 bl 0x10ab4 | fprintf (r0, r1, r2, r3, r4)
0x00014c3c mov r0, r7 | r0 = r7;
0x00014c40 ldr r4, [r4] | r4 = *(0x14e50);
0x00014c44 bl 0x10a18 | strerror (r0);
0x00014c48 str r7, [sp] | *(sp) = r7;
0x00014c4c ldr r3, [pc, 0x20c] | r3 = "_s:_error_:_cannot_open___s_";
0x00014c50 mov r2, 8 | r2 = 8;
0x00014c54 ldr r1, [pc, 0x208] | r1 = *(0x14e60);
0x00014c58 str r0, [sp, 4] | var_4h = r0;
0x00014c5c mov r0, r4 | r0 = r4;
0x00014c60 b 0x14bdc |
| } while (1);
| label_9:
0x00014c64 strb r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
0x00014c68 ldr r3, [sp, 0x28] | r3 = var_28h;
0x00014c6c ldrb r7, [sp, 0x18] | r7 = var_18h;
0x00014c70 ldr r0, [sp, 0x20] | r0 = var_20h;
0x00014c74 ldr r2, [sp, 0x24] | r2 = var_24h;
0x00014c78 ldr ip, [sp, 0x2c] | ip = var_2ch;
0x00014c7c mov r1, 0 | r1 = 0;
0x00014c80 cmp r3, 0 |
0x00014c84 str r7, [r4, 0xc] | *((r4 + 0xc)) = r7;
0x00014c88 strd r0, r1, [r4, 0xd8] | __asm ("strd r0, r1, [r4, 0xd8]");
0x00014c8c str r2, [r4, 0xe4] | *((r4 + 0xe4)) = r2;
0x00014c90 str r3, [r4, 0xe8] | *((r4 + 0xe8)) = r3;
0x00014c94 str ip, [r4, 0xf0] | *((r4 + 0xf0)) = ip;
| if (r3 > 0) {
0x00014c98 bgt 0x14cbc | goto label_10;
| }
0x00014c9c str r3, [sp, 4] | var_4h = r3;
0x00014ca0 str r6, [sp] | *(sp) = r6;
0x00014ca4 ldr r2, [pc, 0x1ac] | r2 = stderr;
0x00014ca8 ldr r3, [r4] | r3 = *(r4);
0x00014cac ldr r1, [pc, 0x1d0] | r1 = "%s: error!: MEMGETBADBLOCK ioctl failed\n";
| do {
0x00014cb0 ldr r0, [pc, 0x19c] |
0x00014cb4 ldr r0, [r0] | r0 = *(0x14e50);
0x00014cb8 b 0x14bdc | goto label_1;
| label_10:
0x00014cbc cmp r2, r3 |
0x00014cc0 cmpge r2, 0 | __asm ("cmpge r2, 0");
| if (r2 > r3) {
0x00014cc4 bgt 0x14ce0 | goto label_11;
| }
0x00014cc8 str r2, [sp, 4] | var_4h = r2;
0x00014ccc str r6, [sp] | *(sp) = r6;
0x00014cd0 ldr r2, [pc, 0x180] | r2 = stderr;
0x00014cd4 ldr r3, [r4] | r3 = *(r4);
0x00014cd8 ldr r1, [pc, 0x1a8] | r1 = "_s:_error_:_mtd_d___s__has_insane_min._I_O_unit_size__d";
0x00014cdc b 0x14cb0 |
| } while (1);
| label_11:
0x00014ce0 orrs r3, r0, r1 | r3 = r0 | r1;
| if (r3 != r0) {
0x00014ce4 beq 0x14cf8 |
0x00014ce8 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00014cec cmp r0, r2 |
0x00014cf0 sbcs ip, r1, r3 | __asm ("sbcs ip, r1, r3");
| if (r0 >= r2) {
0x00014cf4 bge 0x14d1c | goto label_12;
| }
| }
0x00014cf8 strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [var_8h]");
0x00014cfc ldr r0, [pc, 0x150] |
0x00014d00 str r6, [sp] | *(sp) = r6;
0x00014d04 ldr r2, [pc, 0x14c] | r2 = stderr;
0x00014d08 ldr r3, [r4] | r3 = *(r4);
0x00014d0c ldr r1, [pc, 0x178] | r1 = "%s: error!: mtd%d (%s) has insane eraseblock size %d\n";
0x00014d10 ldr r0, [r0] | r0 = *(0x14e50);
0x00014d14 bl 0x10ab4 | fprintf (r0, "%s: error!: mtd%d (%s) has insane eraseblock size %d\n", r2, r3, r4, r5, r6)
0x00014d18 b 0x14be0 | goto label_2;
| label_12:
0x00014d1c bl 0x150b0 | fcn_000150b0 (r0);
0x00014d20 str r0, [r4, 0xe0] | *((r4 + 0xe0)) = r0;
0x00014d24 cmp r7, 8 |
| if (r7 > 8) {
| /* switch table (9 cases) at 0x14d30 */
0x00014d28 ldrls pc, [pc, r7, lsl 2] | offset_0 = r7 << 2;
| pc = *((pc + offset_0));
| }
0x00014d2c b 0x14be0 | goto label_2;
0x00014d54 ldr r0, [pc, 0xf8] |
0x00014d58 str r6, [sp] | *(sp) = r6;
0x00014d5c ldr r2, [pc, 0xf4] | r2 = stderr;
0x00014d60 ldr r3, [r4] | r3 = *(r4);
0x00014d64 ldr r1, [pc, 0x124] | r1 = "%s: error!: mtd%d (%s) has insane size %lld\n";
0x00014d68 ldr r0, [r0] | r0 = *(0x14e50);
0x00014d6c bl 0x10ab4 | fprintf (r0, "%s: error!: mtd%d (%s) has insane size %lld\n", r2, r3, r4, r5, r6)
0x00014d70 b 0x14be0 | goto label_2;
0x00014d74 ldr r1, [pc, 0x118] | r1 = "_s:_error_:_mtd_d___s__is_removable_and_is_not_present";
| label_3:
0x00014d78 add r0, r4, 0x10 | r0 = r4 + 0x10;
0x00014d7c bl 0x109f4 | strcpy (r0, "_s:_error_:_mtd_d___s__is_removable_and_is_not_present");
0x00014d80 ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x00014d84 mov r0, r5 | r0 = r5;
0x00014d88 tst r3, 0x400 |
| if ((r3 & 0x400) == 0) {
0x00014d8c ldrbne r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
| if ((r3 & 0x400) == 0) {
0x00014d90 orrne r3, r3, 1 | r3 |= 1;
| }
| if ((r3 & 0x400) == 0) {
0x00014d94 strbne r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
| }
0x00014d98 ldr r3, [r4, 0xe8] | r3 = *((r4 + 0xe8));
0x00014d9c str r3, [r4, 0xec] | *((r4 + 0xec)) = r3;
0x00014da0 bl 0x10bbc | close (r0);
0x00014da4 mov r0, r6 | r0 = r6;
0x00014da8 bl 0x14800 | r0 = fcn_00014800 (r0);
0x00014dac bic r0, r0, r0, asr 31 | r0 = BIT_MASK (r0, r0);
0x00014db0 str r0, [r4, 0xf4] | *((r4 + 0xf4)) = r0;
0x00014db4 add r0, sp, 0xa0 | r0 += var_a0h;
0x00014db8 bl 0x14524 | fcn_00014524 (r0);
0x00014dbc subs r5, r0, 0 | r5 -= var_a0h;
| if (r5 != var_a0h) {
0x00014dc0 bne 0x14a90 | goto label_0;
| }
| do {
0x00014dc4 add r0, sp, 0xa0 | r0 += var_a0h;
0x00014dc8 bl 0x143c0 | r0 = fcn_000143c0 (r0);
0x00014dcc cmp r0, 0 |
| if (r0 == 0) {
0x00014dd0 bne 0x14e34 |
0x00014dd4 ldr r3, [pc, 0xbc] | r3 = *(0x14e94);
0x00014dd8 ldr r0, [pc, 0x74] |
0x00014ddc str r3, [sp] | *(sp) = r3;
0x00014de0 ldr r2, [pc, 0x70] | r2 = stderr;
0x00014de4 ldr r3, [r4] | r3 = *(r4);
0x00014de8 ldr r1, [pc, 0xac] | r1 = "_proc_mtd";
0x00014dec ldr r0, [r0] | r0 = *(0x14e50);
0x00014df0 bl 0x10ab4 | r0 = fprintf (r0, "_proc_mtd", r2, r3)
0x00014df4 bl 0x10b5c | errno_location ();
0x00014df8 mov r3, 2 | r3 = 2;
0x00014dfc str r3, [r0] | *(r0) = r3;
0x00014e00 b 0x14a90 | goto label_0;
0x00014e04 ldr r1, [pc, 0x94] | r1 = "_s:_error_:_mtd_d_not_found_in___s_";
0x00014e08 b 0x14d78 | goto label_3;
0x00014e0c ldr r1, [pc, 0x90] | r1 = "rom";
0x00014e10 b 0x14d78 | goto label_3;
0x00014e14 ldr r1, [pc, 0x8c] | r1 = "nor";
0x00014e18 b 0x14d78 | goto label_3;
0x00014e1c ldr r1, [pc, 0x88] | r1 = *(0x14ea8);
0x00014e20 b 0x14d78 | goto label_3;
0x00014e24 ldr r1, [pc, 0x84] | r1 = "mlc-nand";
0x00014e28 b 0x14d78 | goto label_3;
0x00014e2c ldr r1, [pc, 0x80] | r1 = "dataflash";
0x00014e30 b 0x14d78 | goto label_3;
| }
0x00014e34 ldr r3, [r4] | r3 = *(r4);
0x00014e38 ldr r2, [sp, 0xa0] | r2 = var_a0h;
0x00014e3c cmp r2, r3 |
0x00014e40 bne 0x14dc4 |
| } while (r2 != r3);
0x00014e44 add r1, sp, 0xb0 | r1 += src;
0x00014e48 add r0, r4, 0x51 | r0 = r4 + 0x51;
0x00014e4c bl 0x109f4 | strcpy (r0, r1);
0x00014e50 b 0x14b7c | 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/nandwrite @ 0x10c44 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main (char ** envp, 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_18h_2;
| int32_t var_20h;
| int32_t var_20h_2;
| int32_t fildes;
| int32_t fd;
| char * format;
| size_t size;
| int32_t var_38h;
| int32_t var_38h_2;
| int32_t var_40h;
| int32_t var_44h;
| int32_t var_48h;
| int32_t var_4ch;
| int32_t var_50h;
| int32_t var_80h;
| int32_t var_80h_2;
| int32_t var_b8h;
| int32_t var_190h;
| int32_t var_0h_2;
| char * var_19ch;
| int32_t var_1a0h;
| int32_t var_1a8h;
| int32_t var_1b8h;
| int32_t var_1bch;
| r0 = argc;
| r1 = argv;
0x00010c44 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00010c48 ldr sl, [pc, 0xe64] | sl = "version";
0x00010c4c ldr r5, [pc, 0xe64] | r5 = "version";
0x00010c50 ldr r7, [pc, 0xe64] | r7 = *(0x11ab8);
0x00010c54 sub sp, sp, 0x1bc |
0x00010c58 mov r3, 0 | r3 = 0;
0x00010c5c mov r6, r0 | r6 = r0;
0x00010c60 mov sb, r1 | sb = r1;
0x00010c64 str r3, [sp, 0x50] | var_50h = r3;
| do {
| label_0:
0x00010c68 add r8, sp, 0x1b8 | r8 += var_1b8h;
0x00010c6c mov fp, 0 |
0x00010c70 str fp, [r8, -0x100]! | *((r8 -= 0x100)) = fp;
0x00010c74 mov r3, sl | r3 = sl;
0x00010c78 str r8, [sp] | *(sp) = r8;
0x00010c7c ldr r2, [pc, 0xe3c] | r2 = optarg;
0x00010c80 mov r1, sb | r1 = sb;
0x00010c84 mov r0, r6 | r0 = r6;
0x00010c88 bl 0x10a30 | r0 = getopt_long ();
0x00010c8c cmn r0, 1 |
| if (r0 == 1) {
0x00010c90 beq 0x10e1c | goto label_26;
| }
0x00010c94 cmp r0, 0x68 |
| if (r0 == 0x68) {
0x00010c98 beq 0x10e08 | goto label_27;
| }
| if (r0 > 0x68) {
0x00010c9c bgt 0x10d4c | goto label_28;
| }
0x00010ca0 cmp r0, 0x4f |
| if (r0 == 0x4f) {
0x00010ca4 beq 0x10dd8 | goto label_29;
| }
| if (r0 > 0x4f) {
0x00010ca8 bgt 0x10d10 | goto label_30;
| }
0x00010cac cmp r0, 0x3f |
| if (r0 != 0x3f) {
0x00010cb0 ldreq r3, [sp, 0x50] | r3 = var_50h;
| }
| if (r0 != 0x3f) {
0x00010cb4 addeq r3, r3, 1 | r3++;
| }
| if (r0 != 0x3f) {
0x00010cb8 streq r3, [sp, 0x50] | var_50h = r3;
| }
0x00010cbc beq 0x10c68 |
| } while (r0 == 0x3f);
0x00010cc0 cmp r0, 0x4e |
| if (r0 != 0x4e) {
0x00010cc4 moveq r3, 1 | r3 = 1;
| }
| if (r0 == 0x4e) {
0x00010cc8 strbeq r3, [r5, 0x13] | *((r5 + 0x13)) = r3;
| goto label_31;
| }
| if (r0 == 0x4e) {
| label_31:
0x00010ccc beq 0x10c68 | goto label_0;
| }
0x00010cd0 cmp r0, fp |
| if (r0 != fp) {
0x00010cd4 bne 0x10c68 | goto label_0;
| }
0x00010cd8 ldr r3, [sp, 0xb8] | r3 = var_b8h;
0x00010cdc cmp r3, 2 |
| if (r3 == 2) {
0x00010ce0 beq 0x10dc4 | goto label_32;
| }
0x00010ce4 cmp r3, 3 |
| if (r3 != 3) {
0x00010ce8 moveq r3, 1 | r3 = 1;
| }
| if (r3 == 3) {
0x00010cec strbeq r3, [r5, 0x10] | *((r5 + 0x10)) = r3;
| goto label_33;
| }
| if (r3 == 3) {
| label_33:
0x00010cf0 beq 0x10c68 | goto label_0;
| }
0x00010cf4 cmp r3, 1 |
| if (r3 != 1) {
0x00010cf8 bne 0x10c68 | goto label_0;
| }
0x00010cfc add r1, sp, 0x50 | r1 += var_50h;
0x00010d00 ldr r0, [r7] | r0 = *(r7);
0x00010d04 bl 0x11d6c | fcn_00011d6c (r0, r1);
0x00010d08 strd r0, r1, [r5] | __asm ("strd r0, r1, [r5]");
0x00010d0c b 0x10c68 | goto label_0;
| label_30:
0x00010d10 cmp r0, 0x61 |
| if (r0 == 0x61) {
0x00010d14 beq 0x10dfc | goto label_34;
| }
0x00010d18 cmp r0, 0x62 |
| if (r0 == 0x62) {
0x00010d1c beq 0x10de8 | goto label_35;
| }
0x00010d20 cmp r0, 0x56 |
| if (r0 != 0x56) {
0x00010d24 bne 0x10c68 | goto label_0;
| }
0x00010d28 ldr r1, [pc, 0xe38] | r1 = "Marking block at %08llx bad\n";
0x00010d2c ldr r2, [pc, 0xd90] | r2 = "hb:mnNoOpqs:akV";
0x00010d30 ldr r0, [pc, 0xd90] | r0 = "2.1.0";
0x00010d34 bl 0x10a0c | printf ("2.1.0", "Marking block at %08llx bad\n", "hb:mnNoOpqs:akV")
0x00010d38 ldr r1, [pc, 0xe28] | r1 = "Marking block at %08llx bad\n";
0x00010d3c ldr r0, [pc, 0xd88] | r0 = "%s (mtd-utils) %s\n";
0x00010d40 bl 0x10a0c | printf ("%s (mtd-utils) %s\n", "Marking block at %08llx bad\n")
| label_1:
0x00010d44 mov r0, fp | r0 = fp;
| label_2:
0x00010d48 bl 0x10b68 | r0 = exit (r0);
| label_28:
0x00010d4c cmp r0, 0x6f |
| if (r0 != 0x6f) {
0x00010d50 moveq r3, 1 | r3 = 1;
| }
| if (r0 == 0x6f) {
0x00010d54 strbeq r3, [r5, 0x15] | *((r5 + 0x15)) = r3;
| goto label_36;
| }
| if (r0 == 0x6f) {
| label_36:
0x00010d58 beq 0x10c68 | goto label_0;
| }
| if (r0 > 0x6f) {
0x00010d5c bgt 0x10d8c | goto label_37;
| }
0x00010d60 cmp r0, 0x6d |
| if (r0 != 0x6d) {
0x00010d64 moveq r3, 1 | r3 = 1;
| }
| if (r0 == 0x6d) {
0x00010d68 strbeq r3, [r5, 0x14] | *((r5 + 0x14)) = r3;
| goto label_38;
| }
| if (r0 == 0x6d) {
| label_38:
0x00010d6c beq 0x10c68 | goto label_0;
| }
| if (r0 <= 0x6d) {
0x00010d70 movgt r3, 1 | r3 = 1;
| }
| if (r0 > 0x6d) {
0x00010d74 strbgt r3, [r5, 0x12] | *((r5 + 0x12)) = r3;
| goto label_39;
| }
| if (r0 > 0x6d) {
| label_39:
0x00010d78 bgt 0x10c68 | goto label_0;
| }
0x00010d7c cmp r0, 0x6b |
| if (r0 != 0x6b) {
0x00010d80 moveq r3, 1 | r3 = 1;
| }
| if (r0 != 0x6b) {
0x00010d84 strbeq r3, [r5, 0x21] | *((r5 + 0x21)) = r3;
| }
0x00010d88 b 0x10c68 | goto label_0;
| label_37:
0x00010d8c cmp r0, 0x71 |
| if (r0 != 0x71) {
0x00010d90 moveq r3, 1 | r3 = 1;
| }
| if (r0 == 0x71) {
0x00010d94 strbeq r3, [r5, 0x11] | *((r5 + 0x11)) = r3;
| goto label_40;
| }
| if (r0 == 0x71) {
| label_40:
0x00010d98 beq 0x10c68 | goto label_0;
| }
| if (r0 >= 0x71) {
0x00010d9c movlt r3, 1 | r3 = 1;
| }
| if (r0 < 0x71) {
0x00010da0 strblt r3, [r5, 0x17] | *((r5 + 0x17)) = r3;
| goto label_41;
| }
| if (r0 < 0x71) {
| label_41:
0x00010da4 blt 0x10c68 | goto label_0;
| }
0x00010da8 cmp r0, 0x73 |
| if (r0 != 0x73) {
0x00010dac bne 0x10c68 | goto label_0;
| }
0x00010db0 add r1, sp, 0x50 | r1 += var_50h;
0x00010db4 ldr r0, [r7] | r0 = *(r7);
0x00010db8 bl 0x11d6c | fcn_00011d6c (r0, r1);
0x00010dbc strd r0, r1, [r5, 0x18] | __asm ("strd r0, r1, [r5, 0x18]");
0x00010dc0 b 0x10c68 | goto label_0;
| label_32:
0x00010dc4 add r1, sp, 0x50 | r1 += var_50h;
0x00010dc8 ldr r0, [r7] | r0 = *(r7);
0x00010dcc bl 0x11d6c | fcn_00011d6c (r0, r1);
0x00010dd0 strd r0, r1, [r5, 8] | __asm ("strd r0, r1, [r5, 8]");
0x00010dd4 b 0x10c68 | goto label_0;
| label_29:
0x00010dd8 mov r3, 1 | r3 = 1;
0x00010ddc strb r3, [r5, 0x15] | *((r5 + 0x15)) = r3;
0x00010de0 strb r3, [r5, 0x16] | *((r5 + 0x16)) = r3;
0x00010de4 b 0x10c68 | goto label_0;
| label_35:
0x00010de8 ldr r0, [r7] | r0 = *(r7);
0x00010dec bl 0x10b74 | atoi (r0);
0x00010df0 ldr r3, [pc, 0xcd8] | r3 = "Copyright__C__2003_Thomas_Gleixner__1_s_comes_with_NO_WARRANTYto_the_extent_permitted_by_law.You_may_redistribute_copies_of__1_sunder_the_terms_of_the_GNU_General_Public_Licence.See_the_file__COPYING_for_more_information.";
0x00010df4 str r0, [r3] | *(r3) = r0;
0x00010df8 b 0x10c68 | goto label_0;
| label_34:
0x00010dfc mov r3, 1 | r3 = 1;
0x00010e00 strb r3, [r5, 0x20] | *((r5 + 0x20)) = r3;
0x00010e04 b 0x10c68 | goto label_0;
| label_27:
0x00010e08 ldr r3, [pc, 0xcc4] | r3 = *(0x11ad0);
0x00010e0c ldr r0, [pc, 0xcc4] | r0 = stdout;
0x00010e10 ldr r1, [r3] | r1 = *(0x11ad0);
0x00010e14 bl 0x10b98 | fputs (r0, r1);
0x00010e18 b 0x10d44 | goto label_1;
| label_26:
0x00010e1c ldr ip, [pc, 0xc94] | ip = *(0x00011ab8);
0x00010e20 ldrd r2, r3, [ip, 0x18] | __asm ("ldrd r2, r3, [ip, 0x18]");
0x00010e24 mov r7, ip | r7 = ip;
0x00010e28 cmp r2, 0 |
0x00010e2c sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 >= 0) {
0x00010e30 bge 0x10e54 | goto label_42;
| }
0x00010e34 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00010e38 ldr r3, [pc, 0xd20] | r3 = "_s:_error_:__s:_MTD_Erase_failure";
0x00010e3c ldr r2, [pc, 0xd24] | r2 = "Marking block at %08llx bad\n";
0x00010e40 ldr r1, [pc, 0xc94] | r1 = "Usage: nandwrite [OPTION] MTD_DEVICE [INPUTFILE|-]\nWrites to the specified MTD device.\n\n -a, --autoplace Use auto OOB layout\n -k, --skip-all-ffs Skip pages that contain only 0xff bytes\n -m, --markbad Mark blocks bad if write fails\n -n, --noecc Write without ecc\n -N, --noskipbad Write without bad block skipping\n -o, --oob Input contains oob data\n -O, --onlyoob Input contains oob data and only write the oob part\n -s addr, --start=addr Set output start address (default is 0)\n --skip-bad-blocks-to-start Skip bad blocks when seeking to the start address\n -p, --pad Pad writes to page size\n -b, --blockalign=1|2|4 Set multiple of eraseblocks to align to\n --input-skip=length Skip |length| bytes of the input file\n --input-size=length Only read |length| bytes of the input file\n -q, --quiet Don't display progress messages\n -h, --help Display this help and exit\n -V, --version Output version information and exit\n";
0x00010e44 ldr r0, [r3] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x00010e48 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "Usage: nandwrite [OPTION] MTD_DEVICE [INPUTFILE|-]\nWrites to the specified MTD device.\n\n -a, --autoplace Use auto OOB layout\n -k, --skip-all-ffs Skip pages that contain only 0xff bytes\n -m, --markbad Mark blocks bad if write fails\n -n, --noecc Write without ecc\n -N, --noskipbad Write without bad block skipping\n -o, --oob Input contains oob data\n -O, --onlyoob Input contains oob data and only write the oob part\n -s addr, --start=addr Set output start address (default is 0)\n --skip-bad-blocks-to-start Skip bad blocks when seeking to the start address\n -p, --pad Pad writes to page size\n -b, --blockalign=1|2|4 Set multiple of eraseblocks to align to\n --input-skip=length Skip |length| bytes of the input file\n --input-size=length Only read |length| bytes of the input file\n -q, --quiet Don't display progress messages\n -h, --help Display this help and exit\n -V, --version Output version information and exit\n", r2, "_s:_error_:__s:_MTD_Erase_failure")
| do {
| label_4:
0x00010e4c mvn r0, 0 | r0 = ~0;
0x00010e50 b 0x10d48 | goto label_2;
| label_42:
0x00010e54 ldr r5, [pc, 0xc74] | r5 = "Copyright__C__2003_Thomas_Gleixner__1_s_comes_with_NO_WARRANTYto_the_extent_permitted_by_law.You_may_redistribute_copies_of__1_sunder_the_terms_of_the_GNU_General_Public_Licence.See_the_file__COPYING_for_more_information.";
0x00010e58 ldr lr, [r5] | lr = "Copyright__C__2003_Thomas_Gleixner__1_s_comes_with_NO_WARRANTYto_the_extent_permitted_by_law.You_may_redistribute_copies_of__1_sunder_the_terms_of_the_GNU_General_Public_Licence.See_the_file__COPYING_for_more_information.";
0x00010e5c cmp lr, 0 |
| if (lr > 0) {
0x00010e60 bgt 0x10e80 | goto label_43;
| }
0x00010e64 ldr r2, [pc, 0xcfc] | r2 = "Marking block at %08llx bad\n";
0x00010e68 ldr r1, [pc, 0xc70] | r1 = "_s:_error_:_Cant_specify_negative_device_offset_with_option__s:__lld";
0x00010e6c mov r3, lr | r3 = lr;
| label_3:
0x00010e70 ldr r0, [pc, 0xce8] |
0x00010e74 ldr r0, [r0] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x00010e78 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "_s:_error_:_Cant_specify_negative_device_offset_with_option__s:__lld", "Marking block at %08llx bad\n", r3)
0x00010e7c b 0x10e4c |
| } while (1);
| label_43:
0x00010e80 subs r0, lr, 1 | r0 = lr - 1;
0x00010e84 asr fp, lr, 0x1f |
0x00010e88 sbc r1, fp, 0 | __asm ("sbc r1, envp");
0x00010e8c and r2, lr, r0 | r2 = lr & r0;
0x00010e90 and r3, fp, r1 | r3 = fp & r1;
0x00010e94 orrs r3, r2, r3 | r3 = r2 | r3;
| if (r3 != r2) {
0x00010e98 bne 0x10ed8 | goto label_44;
| }
0x00010e9c ldrb r3, [ip, 0x20] | r3 = *((ip + 0x20));
0x00010ea0 cmp r3, 0 |
0x00010ea4 bne 0x10ee8 |
| while (r3 == 0) {
0x00010ea8 ldrb r3, [r7, 0x16] | r3 = *((r7 + 0x16));
0x00010eac cmp r3, 0 |
| if (r3 != 0) {
0x00010eb0 bne 0x10f0c | goto label_45;
| }
0x00010eb4 ldrb r3, [r7, 0x17] | r3 = *((r7 + 0x17));
0x00010eb8 cmp r3, 0 |
| if (r3 == 0) {
0x00010ebc beq 0x10f0c | goto label_45;
| }
0x00010ec0 ldrb r3, [r7, 0x15] | r3 = *((r7 + 0x15));
0x00010ec4 cmp r3, 0 |
| if (r3 == 0) {
0x00010ec8 beq 0x10f0c | goto label_45;
| }
0x00010ecc ldr r2, [pc, 0xc94] | r2 = "Marking block at %08llx bad\n";
0x00010ed0 ldr r1, [pc, 0xc0c] | r1 = "%s: error!: Can't specify negative or zero blockalign with option -b: %d\n";
0x00010ed4 b 0x10efc | goto label_5;
| label_44:
0x00010ed8 mov r3, lr | r3 = lr;
0x00010edc ldr r2, [pc, 0xc84] | r2 = "Marking block at %08llx bad\n";
0x00010ee0 ldr r1, [pc, 0xc00] | r1 = "_s:_error_:_Cant_pad_when_oob_data_is_present";
0x00010ee4 b 0x10e70 | goto label_3;
0x00010ee8 ldrb r3, [ip, 0x12] | r3 = *((ip + 0x12));
0x00010eec cmp r3, 0 |
0x00010ef0 beq 0x10ea8 |
| }
0x00010ef4 ldr r2, [pc, 0xc6c] | r2 = "Marking block at %08llx bad\n";
0x00010ef8 ldr r1, [pc, 0xbec] | r1 = "%s: error!: Can't specify a non-power-of-two blockalign with option -b: %d\n";
| do {
| label_5:
0x00010efc ldr r3, [pc, 0xc5c] | r3 = "_s:_error_:__s:_MTD_Erase_failure";
0x00010f00 ldr r0, [r3] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
| label_6:
0x00010f04 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "%s: error!: Can't specify a non-power-of-two blockalign with option -b: %d\n", "Marking block at %08llx bad\n", "_s:_error_:__s:_MTD_Erase_failure")
0x00010f08 b 0x10e4c | goto label_4;
| label_45:
0x00010f0c ldr r3, [pc, 0xbdc] |
0x00010f10 ldr r3, [r3] | r3 = "%s: error!: Autoplacement and no-ECC are mutually exclusive\n";
0x00010f14 sub r6, r6, r3 | r6 -= r3;
0x00010f18 sub r1, r6, 1 | r1 = r6 - 1;
0x00010f1c cmp r1, 1 |
0x00010f20 add r2, sb, r3, lsl 2 | r2 = sb + (r3 << 2);
| if (r1 <= 1) {
0x00010f24 bhi 0x10f34 |
0x00010f28 ldr r1, [sp, 0x50] | r1 = var_50h;
0x00010f2c cmp r1, 0 |
| if (r1 == 0) {
0x00010f30 beq 0x10f4c | goto label_46;
| }
| }
0x00010f34 ldr r3, [pc, 0xc24] | r3 = "_s:_error_:__s:_MTD_Erase_failure";
0x00010f38 ldr r0, [pc, 0xb98] | r0 = stdout;
0x00010f3c ldr r1, [r3] | r1 = "_s:_error_:__s:_MTD_Erase_failure";
0x00010f40 bl 0x10b98 | fputs (r0, "_s:_error_:__s:_MTD_Erase_failure");
0x00010f44 mov r0, 1 | r0 = 1;
0x00010f48 b 0x10d48 | goto label_2;
| label_46:
0x00010f4c cmp r6, 2 |
0x00010f50 ldr r0, [sb, r3, lsl 2] | offset_0 = r3 << 2;
| r0 = *((sb + offset_0));
| if (r6 != 2) {
0x00010f54 ldreq r3, [r2, 4] | r3 = *((r2 + 4));
| }
| if (r6 == 2) {
0x00010f58 ldrne r3, [pc, 0xb94] | r3 = *((pc + 0xb94));
| }
0x00010f5c mov r1, 2 | r1 = 2;
0x00010f60 str r0, [r7, 0x24] | *((r7 + 0x24)) = r0;
0x00010f64 str r3, [r7, 0x28] | *((r7 + 0x28)) = r3;
0x00010f68 bl 0x10b20 | r0 = open64 ();
0x00010f6c cmn r0, 1 |
0x00010f70 str r0, [sp, 0x2c] | fd = r0;
| if (r0 == 1) {
0x00010f74 bne 0x10fc4 |
0x00010f78 bl 0x10b5c | errno_location ();
0x00010f7c ldr r5, [pc, 0xbdc] | r5 = "_s:_error_:__s:_MTD_Erase_failure";
0x00010f80 ldr r3, [r7, 0x24] | r3 = *((r7 + 0x24));
0x00010f84 ldr r2, [pc, 0xbdc] | r2 = "Marking block at %08llx bad\n";
0x00010f88 ldr r1, [pc, 0xb68] | r1 = *(0x11af4);
0x00010f8c ldr r4, [r0] | r4 = *(r0);
0x00010f90 ldr r0, [r5] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x00010f94 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", r1, "Marking block at %08llx bad\n", r3, r4, "_s:_error_:__s:_MTD_Erase_failure")
| label_7:
0x00010f98 mov r0, r4 | r0 = r4;
0x00010f9c ldr r5, [r5] | r5 = *(r5);
0x00010fa0 bl 0x10a18 | strerror (r0);
0x00010fa4 str r4, [sp] | *(sp) = r4;
0x00010fa8 ldr r3, [pc, 0xbc0] | r3 = "_s:_error_:__s:_MTD_Mark_bad_block_failure";
0x00010fac mov r2, 0xb | r2 = 0xb;
0x00010fb0 ldr r1, [pc, 0xbbc] | r1 = *(0x11b70);
0x00010fb4 str r0, [sp, 4] | var_4h = r0;
0x00010fb8 mov r0, r5 | r0 = r5;
0x00010fbc bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:__s:_MTD_Mark_bad_block_failure", r4)
0x00010fc0 b 0x10e4c | goto label_4;
| }
0x00010fc4 bl 0x12c14 | r0 = fcn_00012c14 ();
0x00010fc8 subs r3, r0, 0 | r3 = r0 - 0;
0x00010fcc str r3, [sp, 0x44] | var_44h = r3;
| if (r3 != r0) {
0x00010fd0 ldreq r2, [pc, 0xb90] | r2 = "nandwrite";
| }
| if (r3 != r0) {
0x00010fd4 ldreq r1, [pc, 0xb20] | r1 = "%s: error!: can't initialize libmtd\n";
| }
0x00010fd8 beq 0x10efc |
| } while (r3 == r0);
0x00010fdc mov r2, r8 | r2 = r8;
0x00010fe0 ldr r1, [r7, 0x24] | r1 = *((r7 + 0x24));
0x00010fe4 bl 0x134c4 | r0 = fcn_000134c4 (r0, r1);
0x00010fe8 cmp r0, 0 |
| if (r0 >= 0) {
0x00010fec ldrlt r2, [pc, 0xb74] | r2 = "nandwrite";
| }
| if (r0 < 0) {
0x00010ff0 ldrlt r1, [pc, 0xb08] | r1 = "%s: error!: mtd_get_dev_info failed\n";
| goto label_47;
| }
| if (r0 < 0) {
| label_47:
0x00010ff4 blt 0x10efc | goto label_5;
| }
0x00010ff8 ldr r1, [sp, 0x1a0] | r1 = var_1a0h;
0x00010ffc ldrd r2, r3, [r7, 0x18] | __asm ("ldrd r2, r3, [r7, 0x18]");
0x00011000 ldr sb, [r5] | sb = *(r5);
0x00011004 sub r0, r1, 1 | r0 = r1 - 1;
0x00011008 and r4, r2, r0 | r4 = r2 & r0;
0x0001100c and r5, r3, r0, asr 31 | r5 = r3 & (r0 >> 31);
0x00011010 orrs r3, r4, r5 | r3 = r4 | r5;
0x00011014 ldr r8, [sp, 0x19c] | r8 = var_19ch;
| if (r3 == r4) {
0x00011018 movne r3, r1 | r3 = r1;
| }
| if (r3 == r4) {
0x0001101c ldrne r2, [pc, 0xb44] | r2 = "nandwrite";
| }
| if (r3 != r4) {
0x00011020 ldrne r1, [pc, 0xadc] | r1 = "%s: error!: The start address is not page-aligned !\nThe pagesize of this NAND Flash is 0x%x.\n\n";
| goto label_48;
| }
| if (r3 != r4) {
| label_48:
0x00011024 bne 0x10e70 | goto label_3;
| }
0x00011028 ldrb r3, [r7, 0x12] | r3 = *((r7 + 0x12));
0x0001102c cmp r3, 0 |
| if (r3 != 0) {
0x00011030 ldrbeq r3, [r7, 0x20] | r3 = *((r7 + 0x20));
| }
| if (r3 != 0) {
0x00011034 beq 0x11054 |
0x00011038 mov r2, 3 | r2 = 3;
0x0001103c ldr r1, [pc, 0xac4] | r1 = "%s: error!: The start address is not page-aligned !\nThe pagesize of this NAND Flash is 0x%x.\n\n";
0x00011040 ldr r0, [sp, 0x2c] | r0 = fd;
0x00011044 bl 0x10a00 | r0 = ioctl (r0, "%s: error!: The start address is not page-aligned !\nThe pagesize of this NAND Flash is 0x%x.\n\n");
0x00011048 cmp r0, 0 |
| if (r0 != 0) {
0x0001104c bne 0x110b4 | goto label_49;
| }
0x00011050 mov r3, 2 | r3 = 2;
| }
0x00011054 ldr r4, [r7, 0x28] | r4 = *((r7 + 0x28));
0x00011058 ldr r1, [pc, 0xa94] | r1 = optind;
0x0001105c mov r0, r4 | r0 = r4;
0x00011060 str r3, [sp, 0x48] | var_48h = r3;
0x00011064 bl 0x10b38 | r0 = strcmp (r0, r1);
0x00011068 subs r3, r0, 0 | r3 = r0 - 0;
0x0001106c str r3, [sp, 0x28] | fildes = r3;
| if (r3 == r0) {
0x00011070 beq 0x110e0 | goto label_50;
| }
0x00011074 mov r1, 0 | r1 = 0;
0x00011078 mov r0, r4 | r0 = r4;
0x0001107c bl 0x10b20 | r0 = open64 ();
0x00011080 cmn r0, 1 |
0x00011084 str r0, [sp, 0x28] | fildes = r0;
| if (r0 != 1) {
0x00011088 bne 0x110e0 | goto label_50;
| }
0x0001108c ldr r0, [r7, 0x28] | r0 = *((r7 + 0x28));
0x00011090 bl 0x10a54 | perror (r0);
0x00011094 mov r2, 0 | r2 = 0;
0x00011098 mov r3, 0 | r3 = 0;
0x0001109c strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
| label_8:
0x000110a0 mov r4, 0 | r4 = 0;
| label_9:
0x000110a4 mov fp, r4 |
0x000110a8 mov r7, r4 | r7 = r4;
| label_16:
0x000110ac mov r5, 1 | r5 = 1;
0x000110b0 b 0x113d8 | goto label_15;
| label_49:
0x000110b4 bl 0x10b5c | errno_location ();
0x000110b8 ldr r5, [pc, 0xaa0] | r5 = "_s:_error_:__s:_MTD_Erase_failure";
0x000110bc ldr r2, [pc, 0xaa4] | r2 = "Marking block at %08llx bad\n";
0x000110c0 ldr r4, [r0] | r4 = *(r0);
0x000110c4 ldr r0, [r5] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x000110c8 cmp r4, 0x19 |
| if (r4 == 0x19) {
0x000110cc ldreq r1, [pc, 0xa38] | r1 = "%s: error!: ioctl MTDFILEMODE is missing\n";
| goto label_51;
| }
| if (r4 == 0x19) {
| label_51:
0x000110d0 beq 0x10f04 | goto label_6;
| }
0x000110d4 ldr r1, [pc, 0xa34] | r1 = "%s: error!: ioctl MTDFILEMODE is missing\n";
| label_14:
0x000110d8 bl 0x10ab4 | fprintf (r0, "%s: error!: ioctl MTDFILEMODE is missing\n")
0x000110dc b 0x10f98 | goto label_7;
| label_50:
0x000110e0 ldrb r3, [r7, 0x15] | r3 = *((r7 + 0x15));
0x000110e4 ldr r2, [sp, 0x1a0] | r2 = var_1a0h;
0x000110e8 cmp r3, 0 |
| if (r3 == 0) {
0x000110ec ldrne r3, [sp, 0x1a8] | r3 = var_1a8h;
| }
0x000110f0 add r3, r2, r3 | r3 = r2 + r3;
0x000110f4 str r3, [sp, 0x34] | size = r3;
0x000110f8 ldrd r2, r3, [r7, 8] | __asm ("ldrd r2, r3, [r7, 8]");
0x000110fc strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x00011100 ldr r3, [sp, 0x28] | r3 = fildes;
0x00011104 cmp r3, 0 |
0x00011108 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
| if (r3 == 0) {
0x0001110c bne 0x11144 |
0x00011110 orrs r3, r2, r3 | r3 = r2 | r3;
| if (r3 != r2) {
0x00011114 ldreq r2, [sp, 0x34] | r2 = size;
| }
0x00011118 asreq r3, r2, 0x1f | __asm ("asreq r3, r2, 0x1f");
0x0001111c strdeq r2, r3, [sp, 0x18] | __asm ("strdeq r2, r3, [var_18h]");
0x00011120 ldrd r2, r3, [r7] | __asm ("ldrd r2, r3, [r7]");
0x00011124 orrs r3, r2, r3 | r3 = r2 | r3;
| if (r3 == r2) {
0x00011128 beq 0x1123c | goto label_52;
| }
0x0001112c ldr r3, [pc, 0xa2c] | r3 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011130 ldr r2, [pc, 0xa30] | r2 = "Marking block at %08llx bad\n";
0x00011134 ldr r1, [pc, 0x9d8] | r1 = "%s: error!: MTDFILEMODE\n";
0x00011138 ldr r0, [r3] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x0001113c bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "%s: error!: MTDFILEMODE\n", "Marking block at %08llx bad\n", "_s:_error_:__s:_MTD_Erase_failure")
0x00011140 b 0x110a0 | goto label_8;
| }
0x00011144 orrs r3, r2, r3 | r3 = r2 | r3;
| if (r3 != r2) {
0x00011148 bne 0x111b8 | goto label_53;
| }
0x0001114c add r1, sp, 0x50 | r1 += var_50h;
0x00011150 ldr r0, [sp, 0x28] | r0 = fildes;
0x00011154 bl 0x10a90 | r0 = fstat64 ();
0x00011158 cmp r0, 0 |
| if (r0 == 0) {
0x0001115c beq 0x111a4 | goto label_54;
| }
0x00011160 bl 0x10b5c | errno_location ();
0x00011164 ldr r5, [pc, 0x9f4] |
0x00011168 ldr r2, [pc, 0x9f8] | r2 = "Marking block at %08llx bad\n";
0x0001116c ldr r1, [pc, 0x9a4] | r1 = "_s:_error_:_seeking_stdin_not_supported";
0x00011170 ldr r4, [r0] | r4 = *(r0);
0x00011174 ldr r0, [r5] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011178 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "_s:_error_:_seeking_stdin_not_supported", "Marking block at %08llx bad\n", r3, r4, "_s:_error_:__s:_MTD_Erase_failure")
0x0001117c ldr r5, [r5] | r5 = "_s:_error_:__s:_MTD_Erase_failure";
| do {
0x00011180 mov r0, r4 | r0 = r4;
0x00011184 bl 0x10a18 | strerror (r0);
0x00011188 str r4, [sp] | *(sp) = r4;
0x0001118c ldr r3, [pc, 0x9dc] | r3 = "_s:_error_:__s:_MTD_Mark_bad_block_failure";
0x00011190 mov r2, 0xb | r2 = 0xb;
0x00011194 ldr r1, [pc, 0x9d8] | r1 = *(0x11b70);
0x00011198 str r0, [sp, 4] | var_4h = r0;
0x0001119c mov r0, r5 | r0 = r5;
0x000111a0 b 0x11234 | goto label_55;
| label_54:
0x000111a4 ldrd r0, r1, [sp, 0x80] | __asm ("ldrd r0, r1, [var_80h]");
0x000111a8 ldrd r2, r3, [r7] | __asm ("ldrd r2, r3, [r7]");
0x000111ac subs r0, r0, r2 | r0 -= r2;
0x000111b0 sbc r1, r1, r3 | __asm ("sbc r1, r1, r3");
0x000111b4 strd r0, r1, [sp, 0x18] | __asm ("strd r0, r1, [var_18h]");
| label_53:
0x000111b8 ldrd r4, r5, [r7] | __asm ("ldrd r4, r5, [r7]");
0x000111bc orrs r3, r4, r5 | r3 = r4 | r5;
| if (r3 != r4) {
0x000111c0 beq 0x1123c |
0x000111c4 mov r6, 1 | r6 = 1;
0x000111c8 mov r2, r4 | r2 = r4;
0x000111cc mov r3, r5 | r3 = r5;
0x000111d0 str r6, [sp] | *(sp) = r6;
0x000111d4 ldr r0, [sp, 0x28] | r0 = fildes;
0x000111d8 bl 0x10b8c | lseek64 ();
0x000111dc mvn r3, 0 | r3 = ~0;
0x000111e0 mvn r2, 0 | r2 = ~0;
0x000111e4 cmp r1, r3 |
0x000111e8 cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| if (r1 != r3) {
0x000111ec bne 0x1123c | goto label_52;
| }
0x000111f0 bl 0x10b5c | errno_location ();
0x000111f4 ldr r8, [pc, 0x964] | r8 = "_s:_error_:__s:_MTD_Erase_failure";
0x000111f8 ldr r2, [pc, 0x968] | r2 = "Marking block at %08llx bad\n";
0x000111fc ldr r1, [pc, 0x918] | r1 = "%s: error!: unable to stat input image\n";
0x00011200 ldr r7, [r0] | r7 = *(r0);
0x00011204 strd r4, r5, [sp] | __asm ("strd r4, r5, [sp]");
0x00011208 ldr r0, [r8] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x0001120c bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "%s: error!: unable to stat input image\n", "Marking block at %08llx bad\n", r3, r4)
0x00011210 mov r0, r7 | r0 = r7;
0x00011214 ldr r4, [r8] | r4 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011218 bl 0x10a18 | strerror (r0);
0x0001121c ldr r3, [pc, 0x94c] | r3 = "_s:_error_:__s:_MTD_Mark_bad_block_failure";
0x00011220 ldr r1, [pc, 0x94c] | r1 = *(0x11b70);
0x00011224 mov r2, 0xb | r2 = 0xb;
0x00011228 str r7, [sp] | *(sp) = r7;
0x0001122c str r0, [sp, 4] | var_4h = r0;
0x00011230 mov r0, r4 | r0 = r4;
| label_55:
0x00011234 bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:__s:_MTD_Mark_bad_block_failure")
0x00011238 b 0x110a0 | goto label_8;
| }
| label_52:
0x0001123c ldrb r4, [r7, 0x17] | r4 = *((r7 + 0x17));
0x00011240 cmp r4, 0 |
| if (r4 == 0) {
0x00011244 bne 0x11274 |
0x00011248 ldr r2, [sp, 0x34] | r2 = size;
0x0001124c ldrd r0, r1, [sp, 0x18] | __asm ("ldrd r0, r1, [var_18h]");
0x00011250 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011254 bl 0x150b0 | fcn_000150b0 (r0);
0x00011258 orrs r3, r2, r3 | r3 = r2 | r3;
| if (r3 == r2) {
0x0001125c beq 0x11274 | goto label_56;
| }
0x00011260 ldr r3, [pc, 0x8f8] | r3 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011264 ldr r0, [pc, 0x8b4] | r0 = "%s: error!: lseek input by %lld failed\n";
0x00011268 ldr r1, [r3] | r1 = "_s:_error_:__s:_MTD_Erase_failure";
0x0001126c bl 0x10b98 | fputs ("%s: error!: lseek input by %lld failed\n", "_s:_error_:__s:_MTD_Erase_failure");
0x00011270 b 0x110a4 | goto label_9;
| }
| label_56:
0x00011274 ldrb r5, [r7, 0x10] | r5 = *((r7 + 0x10));
0x00011278 mul r3, sb, r8 | r3 = sb * r8;
0x0001127c cmp r5, 0 |
0x00011280 str r3, [sp, 0x30] | format = r3;
| if (r5 != 0) {
0x00011284 bne 0x114a4 | goto label_57;
| }
| label_10:
0x00011288 ldr r2, [sp, 0x34] | r2 = size;
0x0001128c add r3, sp, 0x190 | r3 += var_190h;
0x00011290 ldrd r4, r5, [r3] | __asm ("ldrd r4, r5, [r3]");
0x00011294 ldr r7, [sp, 0x1a0] | r7 = var_1a0h;
0x00011298 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x0001129c ldrd r0, r1, [sp, 0x18] | __asm ("ldrd r0, r1, [var_18h]");
0x000112a0 bl 0x150b0 | fcn_000150b0 (r0);
0x000112a4 asr sb, r7, 0x1f | sb = r7 >> 0x1f;
0x000112a8 ldr r6, [pc, 0x808] | r6 = "version";
0x000112ac mul r3, r0, sb | r3 = r0 * sb;
0x000112b0 umull r8, sb, r0, r7 | r8:sb = r0 * r7;
0x000112b4 mla r2, r7, r1, r3 | __asm ("mla r2, r7, r1, r3");
0x000112b8 add sb, r2, sb | sb = r2 + sb;
0x000112bc ldrd r2, r3, [r6, 0x18] | __asm ("ldrd r2, r3, [r6, 0x18]");
0x000112c0 subs r0, r4, r2 | r0 = r4 - r2;
0x000112c4 sbc r1, r5, r3 | __asm ("sbc r1, r5, r3");
0x000112c8 cmp r0, r8 |
0x000112cc sbcs r3, r1, sb | __asm ("sbcs r3, r1, sb");
| if (r0 >= r8) {
0x000112d0 bge 0x114b8 | goto label_58;
| }
0x000112d4 ldr r3, [sp, 0x1a8] | r3 = var_1a8h;
0x000112d8 ldr r6, [pc, 0x880] | r6 = "_s:_error_:__s:_MTD_Erase_failure";
0x000112dc str r3, [sp, 4] | var_4h = r3;
0x000112e0 ldr r3, [sp, 0x34] | r3 = size;
0x000112e4 strd r4, r5, [sp, 8] | __asm ("strd r4, r5, [var_ch]");
0x000112e8 ldr r1, [pc, 0x834] | r1 = "Input file is not page-aligned. Use the padding option.\n";
0x000112ec str r3, [sp] | *(sp) = r3;
0x000112f0 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x000112f4 ldr r0, [r6] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x000112f8 bl 0x10ab4 | r0 = fprintf ("_s:_error_:__s:_MTD_Erase_failure", "Input file is not page-aligned. Use the padding option.\n", r2, r3, r4, r5, "_s:_error_:__s:_MTD_Erase_failure")
0x000112fc bl 0x10b5c | errno_location ();
0x00011300 ldr r2, [pc, 0x860] | r2 = "Marking block at %08llx bad\n";
0x00011304 ldr r1, [pc, 0x81c] | r1 = "Image__lld_bytes__NAND_page__d_bytes__OOB_area__d_bytes__device_size__lld_bytes";
0x00011308 ldr r4, [r0] | r4 = "_s:_error_:__s:_MTD_Erase_failure";
0x0001130c ldr r0, [r6] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011310 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "Image__lld_bytes__NAND_page__d_bytes__OOB_area__d_bytes__device_size__lld_bytes", "Marking block at %08llx bad\n", r3, "_s:_error_:__s:_MTD_Erase_failure")
0x00011314 ldr r5, [r6] | r5 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011318 b 0x11180 |
| } while (1);
| do {
0x0001131c ldr r2, [sp, 0x19c] | r2 = var_19ch;
0x00011320 mov r0, r6 | r0 = r6;
0x00011324 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011328 mov r1, r7 | r1 = r7;
0x0001132c bl 0x150b0 | fcn_000150b0 (r0);
0x00011330 ldr r1, [sp, 0x2c] | r1 = fd;
0x00011334 add r2, r8, r0 | r2 = r8 + r0;
0x00011338 add r0, sp, 0xb8 | r0 += var_b8h;
0x0001133c bl 0x13954 | r0 = fcn_00013954 (r0, r1);
0x00011340 cmp r0, 0 |
| if (r0 != 0) {
0x00011344 bne 0x1137c | goto label_59;
| }
0x00011348 add r8, r8, 1 | r8++;
| label_11:
0x0001134c ldr r3, [sb] | r3 = *(sb);
0x00011350 cmp r8, r3 |
0x00011354 blt 0x1131c |
| } while (r8 < r3);
| label_12:
0x00011358 ldr r3, [sp, 0x30] | r3 = format;
0x0001135c adds r6, r6, r3 | r6 += r3;
0x00011360 adc r7, r7, r3, asr 31 | __asm ("adc r7, r7, r3, asr 31");
| label_13:
0x00011364 ldrd r2, r3, [r4, 0x18] | __asm ("ldrd r2, r3, [r4, 0x18]");
0x00011368 cmp r6, r2 |
0x0001136c sbcs r3, r7, r3 | __asm ("sbcs r3, r7, r3");
| if (r6 >= r2) {
0x00011370 bge 0x11288 | goto label_10;
| }
0x00011374 mov r8, 0 | r8 = 0;
0x00011378 b 0x1134c | goto label_11;
| if (r6 < r2) {
| label_59:
0x0001137c bge 0x1144c |
0x00011380 bl 0x10b5c | errno_location ();
0x00011384 ldr r6, [pc, 0x7d4] |
0x00011388 ldr r3, [pc, 0x728] |
0x0001138c ldr r2, [pc, 0x7d4] | r2 = "Marking block at %08llx bad\n";
0x00011390 ldr r3, [r3, 0x24] | r3 = "Usage: nandwrite [OPTION] MTD_DEVICE [INPUTFILE|-]\nWrites to the specified MTD device.\n\n -a, --autoplace Use auto OOB layout\n -k, --skip-all-ffs Skip pages that contain only 0xff bytes\n -m, --markbad Mark blocks bad if write fails\n -n, --noecc Write without ecc\n -N, --noskipbad Write without bad block skipping\n -o, --oob Input contains oob data\n -O, --onlyoob Input contains oob data and only write the oob part\n -s addr, --start=addr Set output start address (default is 0)\n --skip-bad-blocks-to-start Skip bad blocks when seeking to the start address\n -p, --pad Pad writes to page size\n -b, --blockalign=1|2|4 Set multiple of eraseblocks to align to\n --input-skip=length Skip |length| bytes of the input file\n --input-size=length Only read |length| bytes of the input file\n -q, --quiet Don't display progress messages\n -h, --help Display this help and exit\n -V, --version Output version information and exit\n";
0x00011394 ldr r1, [pc, 0x790] | r1 = "%s: error!: Input file does not fit into device\n";
0x00011398 ldr r4, [r0] | r4 = *(r0);
0x0001139c ldr r0, [r6] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x000113a0 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "%s: error!: Input file does not fit into device\n", "Marking block at %08llx bad\n", "version", r4, r5, "_s:_error_:__s:_MTD_Erase_failure")
0x000113a4 mov r0, r4 | r0 = r4;
0x000113a8 ldr r6, [r6] | r6 = "_s:_error_:__s:_MTD_Erase_failure";
0x000113ac bl 0x10a18 | strerror (r0);
0x000113b0 str r4, [sp] | *(sp) = r4;
0x000113b4 ldr r3, [pc, 0x7b4] | r3 = "_s:_error_:__s:_MTD_Mark_bad_block_failure";
0x000113b8 mov r2, 0xb | r2 = 0xb;
0x000113bc ldr r1, [pc, 0x7b0] | r1 = *(0x11b70);
0x000113c0 mov r4, 0 | r4 = 0;
0x000113c4 mov fp, r4 |
0x000113c8 mov r7, r4 | r7 = r4;
0x000113cc str r0, [sp, 4] | var_4h = r0;
0x000113d0 mov r0, r6 | r0 = r6;
0x000113d4 bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:__s:_MTD_Mark_bad_block_failure", r4)
| label_15:
0x000113d8 ldr r0, [sp, 0x28] | r0 = fildes;
0x000113dc bl 0x10bbc | close (r0);
0x000113e0 ldr r0, [sp, 0x44] | r0 = var_44h;
0x000113e4 bl 0x12b98 | fcn_00012b98 (r0);
0x000113e8 mov r0, r7 | r0 = r7;
0x000113ec bl 0x10bd4 | free (r0);
0x000113f0 ldr r0, [sp, 0x2c] | r0 = fd;
0x000113f4 bl 0x10bbc | close (r0);
0x000113f8 cmp r5, 0 |
| if (r5 == 0) {
0x000113fc bne 0x11434 |
0x00011400 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00011404 cmp r2, 1 |
0x00011408 ldr r2, [sp, 0x28] | r2 = fildes;
0x0001140c sbcs r3, r3, 0 | __asm ("sbcs r3, r3, 0");
| if (r2 < 1) {
0x00011410 movge r3, 1 | r3 = 1;
| }
| if (r2 >= 1) {
0x00011414 movlt r3, 0 | r3 = 0;
| }
0x00011418 cmp r2, 0 |
| if (r2 != 0) {
0x0001141c moveq r3, 0 | r3 = 0;
| }
0x00011420 cmp r3, 0 |
| if (r3 != 0) {
0x00011424 bne 0x11434 | goto label_60;
| }
0x00011428 add r7, r7, fp | r7 += fp;
0x0001142c cmp r4, r7 |
| if (r4 >= r7) {
0x00011430 bhs 0x11c30 | goto label_61;
| }
| }
| label_60:
0x00011434 bl 0x10b5c | errno_location ();
0x00011438 ldr r5, [pc, 0x720] | r5 = "_s:_error_:__s:_MTD_Erase_failure";
0x0001143c ldr r2, [pc, 0x724] | r2 = "Marking block at %08llx bad\n";
0x00011440 ldr r1, [pc, 0x6e8] | r1 = "_s:_error_:__s:_MTD_get_bad_block_failed";
0x00011444 ldr r4, [r0] | r4 = *(r0);
0x00011448 b 0x11504 | goto label_62;
| }
0x0001144c cmp r0, 1 |
| if (r0 != 1) {
0x00011450 bne 0x11358 | goto label_12;
| }
0x00011454 ldrb r3, [r4, 0x11] | r3 = *((r4 + 0x11));
0x00011458 cmp r3, 0 |
| if (r3 == 0) {
0x0001145c bne 0x11484 |
0x00011460 strd r6, r7, [sp, 8] | __asm ("strd r6, r7, [var_ch]");
0x00011464 ldr r0, [pc, 0x6f4] |
0x00011468 ldr r3, [sb] | r3 = *(sb);
0x0001146c mov r2, r6 | r2 = r6;
0x00011470 str r3, [sp] | *(sp) = r3;
0x00011474 ldr r1, [pc, 0x6b8] | r1 = "_s:_error_:_Data_was_only_partially_written_due_to_error";
0x00011478 mov r3, r7 | r3 = r7;
0x0001147c ldr r0, [r0] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011480 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "_s:_error_:_Data_was_only_partially_written_due_to_error", r2, r3, r4, r5, r6)
| }
0x00011484 ldrd r2, r3, [r4, 0x18] | __asm ("ldrd r2, r3, [r4, 0x18]");
0x00011488 ldr r1, [sp, 0x30] | r1 = format;
0x0001148c adds sl, r2, r1 | sl = r2 + r1;
0x00011490 adc fp, r3, r1, asr 31 | __asm ("adc fp, r3, r1, asr 31");
0x00011494 mov r2, sl | r2 = sl;
0x00011498 mov r3, fp | r3 = fp;
0x0001149c strd r2, r3, [r4, 0x18] | __asm ("strd r2, r3, [r4, 0x18]");
0x000114a0 b 0x11358 | goto label_12;
| label_57:
0x000114a4 mov r6, 0 | r6 = 0;
0x000114a8 mov r7, 0 | r7 = 0;
0x000114ac ldr r4, [pc, 0x604] | r4 = "version";
0x000114b0 ldr sb, [pc, 0x618] | sb = *(0x00011ad0);
0x000114b4 b 0x11364 | goto label_13;
| label_58:
0x000114b8 mov r1, r7 | r1 = r7;
0x000114bc ldr r0, [sp, 0x30] | r0 = format;
0x000114c0 bl 0x14fb4 | fcn_00014fb4 (r0, r1);
0x000114c4 ldr r4, [sp, 0x34] | r4 = size;
0x000114c8 mul r4, r0, r4 | r4 = r0 * r4;
0x000114cc mov r0, r4 | r0 = r4;
0x000114d0 bl 0x10a60 | malloc (r0);
0x000114d4 adds r5, r4, 0 | r5 = r4 + 0;
| if (r5 == r4) {
0x000114d8 movne r5, 1 | r5 = 1;
| }
0x000114dc cmp r0, 0 |
| if (r0 == 0) {
0x000114e0 movne r5, 0 | r5 = 0;
| }
0x000114e4 cmp r5, 0 |
0x000114e8 mov r7, r0 | r7 = r0;
| if (r5 != 0) {
0x000114ec beq 0x1150c |
0x000114f0 bl 0x10b5c | errno_location ();
0x000114f4 ldr r5, [pc, 0x664] | r5 = "_s:_error_:__s:_MTD_Erase_failure";
0x000114f8 ldr r2, [pc, 0x668] | r2 = "Marking block at %08llx bad\n";
0x000114fc ldr r1, [pc, 0x634] | r1 = "Bad_block_at__llx___u_block_s__from__llx_will_be_skipped";
0x00011500 ldr r4, [r0] | r4 = *(r0);
| label_62:
0x00011504 ldr r0, [r5] | r0 = *(r5);
0x00011508 b 0x110d8 | goto label_14;
| }
0x0001150c mov r1, r4 | r1 = r4;
0x00011510 mov fp, r5 |
0x00011514 mov r4, r5 | r4 = r5;
0x00011518 mvn r8, 0 | r8 = ~0;
0x0001151c mvn sb, 0 | sb = ~0;
0x00011520 bl 0x11d54 | fcn_00011d54 (r0, r1);
0x00011524 str r5, [sp, 0x40] | var_40h = r5;
| label_23:
0x00011528 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x0001152c cmp r2, 1 |
0x00011530 sbcs r3, r3, 0 | __asm ("sbcs r3, r3, 0");
| if (r2 >= 1) {
0x00011534 bge 0x11544 | goto label_63;
| }
0x00011538 add r3, r7, fp | r3 = r7 + fp;
0x0001153c cmp r4, r3 |
| if (r4 >= r3) {
0x00011540 bhs 0x113d8 | goto label_15;
| }
| label_63:
0x00011544 add r3, sp, 0x190 | r3 += var_190h;
0x00011548 ldrd r0, r1, [r6, 0x18] | __asm ("ldrd r0, r1, [r6, 0x18]");
0x0001154c ldrd r2, r3, [r3] | __asm ("ldrd r2, r3, [r3]");
0x00011550 cmp r0, r2 |
0x00011554 sbcs r3, r1, r3 | __asm ("sbcs r3, r1, r3");
| if (r0 >= r2) {
0x00011558 bge 0x113d8 | goto label_15;
| }
0x0001155c ldr r3, [sp, 0x30] | r3 = format;
0x00011560 rsb sl, r3, 0 | sl = r3 - ;
0x00011564 mov r2, sl | r2 = sl;
0x00011568 asr r3, sl, 0x1f | r3 = sl >> 0x1f;
0x0001156c strd r2, r3, [sp, 0x38] | __asm ("strd r2, r3, [var_38h]");
0x00011570 b 0x115e0 |
| while (r1 != sb) {
0x00011574 cmp r4, r7 |
| if (r4 != r7) {
0x00011578 beq 0x1158c |
0x0001157c mov r1, fp | r1 = fp;
0x00011580 mov r0, r7 | r0 = r7;
0x00011584 bl 0x11d54 | fcn_00011d54 (r0, r1);
0x00011588 mov fp, 0 |
| }
0x0001158c ldrb r3, [r6, 0x11] | r3 = *((r6 + 0x11));
0x00011590 cmp r3, 0 |
| if (r3 == 0) {
0x00011594 bne 0x115c8 |
0x00011598 ldr r2, [sp, 0x30] | r2 = format;
0x0001159c ldrd r0, r1, [sp, 0x20] | __asm ("ldrd r0, r1, [var_20h]");
0x000115a0 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x000115a4 bl 0x150b0 | fcn_000150b0 (r0);
0x000115a8 ldrd r2, r3, [sp, 0x20] | __asm ("ldrd r2, r3, [var_20h]");
0x000115ac strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x000115b0 mov r2, r0 | r2 = r0;
0x000115b4 ldr r0, [pc, 0x518] |
0x000115b8 mov r3, r1 | r3 = r1;
0x000115bc ldr r0, [r0] | r0 = *(0x11ad0);
0x000115c0 ldr r1, [pc, 0x574] | r1 = "_s:_error_:_out_of_memory";
0x000115c4 bl 0x10ab4 | fprintf (r0, "_s:_error_:_out_of_memory", r2, r3)
| }
0x000115c8 ldrb r4, [r6, 0x13] | r4 = *((r6 + 0x13));
0x000115cc cmp r4, 0 |
| if (r4 != 0) {
0x000115d0 ldreq r8, [pc, 0x4f8] | r8 = *(0x00011ad0);
| }
| if (r4 == 0) {
0x000115d4 beq 0x117a0 | goto label_64;
| }
| label_17:
0x000115d8 ldrd r8, sb, [sp, 0x20] | __asm ("ldrd r8, sb, [var_20h]");
0x000115dc mov r4, r7 | r4 = r7;
0x000115e0 ldrd r2, r3, [r6, 0x18] | __asm ("ldrd r2, r3, [r6, 0x18]");
0x000115e4 ldrd r0, r1, [sp, 0x38] | __asm ("ldrd r0, r1, [var_38h]");
0x000115e8 and r1, r1, r3 | r1 &= r3;
0x000115ec and r0, r0, r2 | r0 &= r2;
0x000115f0 cmp r1, sb |
0x000115f4 cmpeq r0, r8 | __asm ("cmpeq r0, r8");
0x000115f8 strd r0, r1, [sp, 0x20] | __asm ("strd r0, r1, [var_20h]");
0x000115fc mov r2, r0 | r2 = r0;
0x00011600 bne 0x11574 |
| }
0x00011604 ldr sb, [sp, 0x1a0] | sb = var_1a0h;
0x00011608 add sl, r7, fp | sl = r7 + fp;
0x0001160c add r3, r4, sb | r3 = r4 + sb;
0x00011610 cmp sl, r3 |
| if (sl >= r3) {
0x00011614 sublo sl, sl, r4 | sl -= r4;
| }
| if (sl >= r3) {
0x00011618 movlo r2, 0 | r2 = 0;
| }
| if (sl >= r3) {
0x0001161c movlo r8, sl | r8 = sl;
| }
| if (sl <= r3) {
0x00011620 blo 0x118ac | goto label_65;
| }
| label_19:
0x00011624 ldrb r3, [r6, 0x15] | r3 = *((r6 + 0x15));
0x00011628 cmp r3, 0 |
0x0001162c str r3, [sp, 0x38] | var_38h = r3;
| if (r3 != 0) {
0x00011630 beq 0x11660 |
0x00011634 ldr r3, [sp, 0x1a0] | r3 = var_1a0h;
0x00011638 ldr sb, [sp, 0x1a8] | sb = var_1a8h;
0x0001163c add r3, r4, r3 | r3 = r4 + r3;
0x00011640 add sl, r7, fp | sl = r7 + fp;
0x00011644 str r3, [sp, 0x40] | var_40h = r3;
0x00011648 add r3, r3, sb | r3 += sb;
0x0001164c cmp sl, r3 |
| if (sl >= r3) {
0x00011650 ldrlo r3, [sp, 0x40] | r3 = var_40h;
| }
| if (sl >= r3) {
0x00011654 sublo sl, sl, r3 | sl -= r3;
| }
| if (sl >= r3) {
0x00011658 movlo r8, sl | r8 = sl;
| }
| if (sl <= r3) {
0x0001165c blo 0x11998 | goto label_66;
| }
| }
| label_21:
0x00011660 ldrb r3, [r6, 0x21] | r3 = *((r6 + 0x21));
0x00011664 cmp r3, 0 |
| if (r3 != 0) {
0x00011668 beq 0x116a8 |
0x0001166c ldr r2, [sp, 0x1a0] | r2 = var_1a0h;
0x00011670 cmp r2, 0 |
0x00011674 cmpne r4, 0 | __asm ("cmpne r4, 0");
| if (r2 == 0) {
0x00011678 beq 0x116a8 | goto label_67;
| }
0x0001167c ldrb r3, [r4] | r3 = *(r4);
0x00011680 cmp r3, 0xff |
| if (r3 != 0xff) {
0x00011684 bne 0x116a8 | goto label_67;
| }
0x00011688 cmp r2, 1 |
| if (r2 == 1) {
0x0001168c beq 0x11c10 | goto label_68;
| }
0x00011690 sub r2, r2, 1 | r2--;
0x00011694 add r1, r4, 1 | r1 = r4 + 1;
0x00011698 mov r0, r4 | r0 = r4;
0x0001169c bl 0x10af0 | r0 = memcmp (r0, r1, r2);
0x000116a0 cmp r0, 0 |
| if (r0 == 0) {
0x000116a4 beq 0x11c10 | goto label_68;
| }
| }
| label_67:
0x000116a8 ldr r2, [sp, 0x19c] | r2 = var_19ch;
0x000116ac ldrd r0, r1, [r6, 0x18] | __asm ("ldrd r0, r1, [r6, 0x18]");
0x000116b0 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x000116b4 bl 0x150b0 | fcn_000150b0 (r0);
0x000116b8 ldrb r1, [r6, 0x16] | r1 = *((r6 + 0x16));
0x000116bc ldr r8, [sp, 0x48] | r8 = var_48h;
0x000116c0 cmp r1, 0 |
0x000116c4 ldrb r1, [r6, 0x15] | r1 = *((r6 + 0x15));
| if (r1 == 0) {
0x000116c8 movne ip, 0 |
| }
| if (r1 != 0) {
0x000116cc ldreq ip, [sp, 0x1a0] | ip = var_1a0h;
| }
| if (r1 != 0) {
0x000116d0 moveq lr, r4 | lr = r4;
| }
0x000116d4 str r8, [sp, 0x14] | var_14h = r8;
| if (r1 == 0) {
0x000116d8 movne lr, ip | lr = ip;
| }
0x000116dc cmp r1, 0 |
0x000116e0 mov r3, r0 | r3 = r0;
| if (r1 == 0) {
0x000116e4 ldrne r1, [sp, 0x1a8] | r1 = var_1a8h;
| }
| if (r1 == 0) {
0x000116e8 ldrne r0, [sp, 0x40] | r0 = var_40h;
| }
| if (r1 != 0) {
0x000116ec moveq r0, r1 | r0 = r1;
| }
0x000116f0 str r1, [sp, 0x10] | var_10h = r1;
0x000116f4 str r0, [sp, 0xc] | var_ch = r0;
0x000116f8 stm sp, {r2, lr} | *(sp) = r2;
| *((sp + 4)) = lr;
0x000116fc ldr r0, [sp, 0x44] | r0 = var_44h;
0x00011700 str ip, [sp, 8] | var_8h = ip;
0x00011704 ldr r2, [sp, 0x2c] | r2 = fd;
0x00011708 add r1, sp, 0xb8 | r1 += var_b8h;
0x0001170c bl 0x13c6c | r0 = fcn_00013c6c (r0, r1, r2, r3, r4, r5, r6);
0x00011710 cmp r0, 0 |
| if (r0 == 0) {
0x00011714 beq 0x11c10 | goto label_68;
| }
0x00011718 bl 0x10b5c | errno_location ();
0x0001171c ldr r8, [pc, 0x43c] | r8 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011720 ldr sl, [r0] | sl = *(r0);
0x00011724 mov sb, r0 | sb = r0;
0x00011728 cmp sl, 5 |
0x0001172c ldr r0, [r8] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
| if (sl == 5) {
0x00011730 beq 0x119e4 | goto label_69;
| }
0x00011734 ldr r3, [pc, 0x37c] |
0x00011738 ldr r2, [pc, 0x428] | r2 = "Marking block at %08llx bad\n";
0x0001173c ldr r3, [r3, 0x24] | r3 = "Usage: nandwrite [OPTION] MTD_DEVICE [INPUTFILE|-]\nWrites to the specified MTD device.\n\n -a, --autoplace Use auto OOB layout\n -k, --skip-all-ffs Skip pages that contain only 0xff bytes\n -m, --markbad Mark blocks bad if write fails\n -n, --noecc Write without ecc\n -N, --noskipbad Write without bad block skipping\n -o, --oob Input contains oob data\n -O, --onlyoob Input contains oob data and only write the oob part\n -s addr, --start=addr Set output start address (default is 0)\n --skip-bad-blocks-to-start Skip bad blocks when seeking to the start address\n -p, --pad Pad writes to page size\n -b, --blockalign=1|2|4 Set multiple of eraseblocks to align to\n --input-skip=length Skip |length| bytes of the input file\n --input-size=length Only read |length| bytes of the input file\n -q, --quiet Don't display progress messages\n -h, --help Display this help and exit\n -V, --version Output version information and exit\n";
0x00011740 ldr r1, [pc, 0x3f8] | r1 = "Writing data to block %lld at offset 0x%llx\n";
0x00011744 bl 0x10ab4 | fprintf (r0, "Writing data to block %lld at offset 0x%llx\n", "Marking block at %08llx bad\n", "version")
0x00011748 mov r0, sl | r0 = sl;
0x0001174c ldr r5, [r8] | r5 = *(r8);
0x00011750 bl 0x10a18 | strerror (r0);
0x00011754 str sl, [sp] | *(sp) = sl;
0x00011758 ldr r3, [pc, 0x410] | r3 = "_s:_error_:__s:_MTD_Mark_bad_block_failure";
0x0001175c mov r2, 0xb | r2 = 0xb;
0x00011760 ldr r1, [pc, 0x40c] | r1 = *(0x11b70);
0x00011764 str r0, [sp, 4] | var_4h = r0;
0x00011768 mov r0, r5 | r0 = r5;
0x0001176c bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:__s:_MTD_Mark_bad_block_failure")
0x00011770 b 0x110ac | goto label_16;
| do {
0x00011774 ldr r2, [sp, 0x19c] | r2 = var_19ch;
0x00011778 ldrd r0, r1, [sp, 0x20] | __asm ("ldrd r0, r1, [var_20h]");
0x0001177c asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011780 bl 0x150b0 | fcn_000150b0 (r0);
0x00011784 ldr r1, [sp, 0x2c] | r1 = fd;
0x00011788 add r2, r4, r0 | r2 = r4 + r0;
0x0001178c add r0, sp, 0xb8 | r0 += var_b8h;
0x00011790 bl 0x13954 | r0 = fcn_00013954 (r0, r1);
0x00011794 cmp r0, 0 |
| if (r0 != 0) {
0x00011798 bne 0x117b0 | goto label_70;
| }
0x0001179c add r4, r4, 1 | r4++;
| label_64:
0x000117a0 ldr r3, [r8] | r3 = *(r8);
0x000117a4 cmp r4, r3 |
0x000117a8 blt 0x11774 |
| } while (r4 < r3);
0x000117ac b 0x115d8 | goto label_17;
| if (r4 < r3) {
| label_70:
0x000117b0 bge 0x11804 |
0x000117b4 bl 0x10b5c | errno_location ();
0x000117b8 ldr r5, [pc, 0x3a0] |
0x000117bc ldr r3, [r6, 0x24] | r3 = *((r6 + 0x24));
0x000117c0 ldr r2, [pc, 0x3a0] | r2 = "Marking block at %08llx bad\n";
0x000117c4 ldr r1, [pc, 0x360] | r1 = "%s: error!: Input file does not fit into device\n";
0x000117c8 ldr r4, [r0] | r4 = *(r0);
0x000117cc ldr r0, [r5] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x000117d0 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "%s: error!: Input file does not fit into device\n", "Marking block at %08llx bad\n", r3, r4, "_s:_error_:__s:_MTD_Erase_failure")
0x000117d4 mov r0, r4 | r0 = r4;
0x000117d8 ldr r5, [r5] | r5 = "_s:_error_:__s:_MTD_Erase_failure";
0x000117dc bl 0x10a18 | strerror (r0);
0x000117e0 str r4, [sp] | *(sp) = r4;
0x000117e4 ldr r3, [pc, 0x384] | r3 = "_s:_error_:__s:_MTD_Mark_bad_block_failure";
0x000117e8 mov r2, 0xb | r2 = 0xb;
0x000117ec ldr r1, [pc, 0x380] | r1 = *(0x11b70);
0x000117f0 str r0, [sp, 4] | var_4h = r0;
0x000117f4 mov r0, r5 | r0 = r5;
0x000117f8 bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:__s:_MTD_Mark_bad_block_failure", r4)
| label_18:
0x000117fc mov r4, r7 | r4 = r7;
0x00011800 b 0x110ac | goto label_16;
| }
0x00011804 cmp r0, 1 |
| if (r0 != 1) {
0x00011808 bne 0x115d8 | goto label_17;
| }
0x0001180c ldrb r3, [r6, 0x11] | r3 = *((r6 + 0x11));
0x00011810 cmp r3, 0 |
| if (r3 == 0) {
0x00011814 bne 0x11834 |
0x00011818 ldr r3, [r8] | r3 = *(r8);
0x0001181c ldr r0, [pc, 0x33c] |
0x00011820 str r3, [sp] | *(sp) = r3;
0x00011824 ldr r1, [pc, 0x318] | r1 = "%s: error!: %s: MTD write failure\n";
0x00011828 ldrd r2, r3, [sp, 0x20] | __asm ("ldrd r2, r3, [var_20h]");
0x0001182c ldr r0, [r0] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011830 bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "%s: error!: %s: MTD write failure\n", r2, r3)
| }
0x00011834 ldr r3, [sp, 0x30] | r3 = format;
0x00011838 ldrd r0, r1, [sp, 0x20] | __asm ("ldrd r0, r1, [var_20h]");
0x0001183c adds r0, r0, r3 | r0 += r3;
0x00011840 adc r1, r1, r3, asr 31 | __asm ("adc r1, r1, r3, asr 31");
0x00011844 add r3, sp, 0x190 | r3 += var_190h;
0x00011848 ldrd r2, r3, [r3] | __asm ("ldrd r2, r3, [r3]");
0x0001184c strd r0, r1, [r6, 0x18] | __asm ("strd r0, r1, [r6, 0x18]");
0x00011850 cmp r2, r0 |
0x00011854 sbcs r3, r3, r1 | __asm ("sbcs r3, r3, r1");
| if (r2 >= r0) {
0x00011858 bge 0x115d8 | goto label_17;
| }
0x0001185c ldr r3, [pc, 0x2fc] | r3 = "_s:_error_:__s:_MTD_Erase_failure";
0x00011860 ldr r2, [pc, 0x300] | r2 = "Marking block at %08llx bad\n";
0x00011864 ldr r1, [pc, 0x2dc] | r1 = "Bad_block_at__llx___u_block_s__will_be_skipped";
0x00011868 ldr r0, [r3] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x0001186c bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "Bad_block_at__llx___u_block_s__will_be_skipped", "Marking block at %08llx bad\n", "_s:_error_:__s:_MTD_Erase_failure")
0x00011870 b 0x117fc | goto label_18;
| do {
0x00011874 sub r3, sb, r8 | r3 = sb - r8;
0x00011878 mov r2, r3 | r2 = r3;
0x0001187c add r1, r4, r8 | r1 = r4 + r8;
0x00011880 ldr r0, [sp, 0x28] | r0 = fildes;
0x00011884 str r3, [sp, 0x38] | var_38h = r3;
0x00011888 bl 0x10ad8 | read (r0, r1, r2);
0x0001188c ldr r3, [sp, 0x38] | r3 = var_38h;
0x00011890 subs r2, r0, 0 | r2 = r0 - 0;
| if (r2 == r0) {
0x00011894 beq 0x118c0 | goto label_71;
| }
| if (r2 < r0) {
0x00011898 bge 0x118a8 |
0x0001189c ldr r0, [pc, 0x2a8] | r0 = "_s:_error_:_too_many_bad_blocks__cannot_complete_request";
0x000118a0 bl 0x10a54 | perror ("_s:_error_:_too_many_bad_blocks__cannot_complete_request");
0x000118a4 b 0x110ac | goto label_16;
| }
0x000118a8 add r8, r8, r2 | r8 += r2;
| label_65:
0x000118ac cmp sb, r8 |
0x000118b0 bhi 0x11874 |
| } while (sb > r8);
0x000118b4 cmp r8, 0 |
| if (r8 == 0) {
0x000118b8 bne 0x11918 |
0x000118bc b 0x118c8 | goto label_72;
| label_71:
0x000118c0 cmp r8, 0 |
| if (r8 == 0) {
0x000118c4 bne 0x118e0 |
| label_72:
0x000118c8 ldr r3, [sp, 0x28] | r3 = fildes;
0x000118cc cmp r3, 0 |
| if (r3 != 0) {
0x000118d0 moveq r2, 0 | r2 = 0;
| }
| if (r3 != 0) {
0x000118d4 moveq r3, 0 | r3 = 0;
| }
0x000118d8 strdeq r2, r3, [sp, 0x18] | __asm ("strdeq r2, r3, [var_18h]");
0x000118dc b 0x113d8 | goto label_15;
| }
0x000118e0 ldrb r1, [r6, 0x17] | r1 = *((r6 + 0x17));
0x000118e4 cmp r1, 0 |
| if (r1 == 0) {
0x000118e8 bne 0x11904 |
0x000118ec mov r2, r3 | r2 = r3;
0x000118f0 ldr r3, [pc, 0x268] | r3 = "_s:_error_:__s:_MTD_Erase_failure";
0x000118f4 ldr r1, [pc, 0x254] | r1 = "File_I_O_error_on_input";
0x000118f8 ldr r0, [r3] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x000118fc bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "File_I_O_error_on_input", r2, "_s:_error_:__s:_MTD_Erase_failure")
0x00011900 b 0x110ac | goto label_16;
| }
0x00011904 mov r1, r3 | r1 = r3;
0x00011908 add r0, r4, r8 | r0 = r4 + r8;
0x0001190c str r2, [sp, 0x38] | var_38h = r2;
0x00011910 bl 0x11d54 | fcn_00011d54 (r0, r1);
0x00011914 ldr r2, [sp, 0x38] | r2 = var_38h;
| }
0x00011918 ldr r3, [sp, 0x28] | r3 = fildes;
0x0001191c add sb, sb, fp | sb += fp;
0x00011920 cmp r3, 0 |
0x00011924 sub fp, sb, sl |
| if (r3 != 0) {
0x00011928 beq 0x11944 |
0x0001192c ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00011930 sub r8, r8, sl | r8 -= sl;
0x00011934 subs r2, r2, r8 | r2 -= r8;
0x00011938 sbc r3, r3, 0 | __asm ("sbc r3, r3, 0");
| label_20:
0x0001193c strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x00011940 b 0x11624 | goto label_19;
| }
0x00011944 cmp r2, 0 |
| if (r2 != 0) {
0x00011948 bne 0x11624 | goto label_19;
| }
0x0001194c mov r2, 0 | r2 = 0;
0x00011950 mov r3, 0 | r3 = 0;
0x00011954 b 0x1193c | goto label_20;
| do {
0x00011958 sub r3, sb, r8 | r3 = sb - r8;
0x0001195c mov r2, r3 | r2 = r3;
0x00011960 str r3, [sp, 0x4c] | var_4ch = r3;
0x00011964 ldr r3, [sp, 0x40] | r3 = var_40h;
0x00011968 ldr r0, [sp, 0x28] | r0 = fildes;
0x0001196c add r1, r3, r8 | r1 = r3 + r8;
0x00011970 bl 0x10ad8 | read (r0, r1, r2);
0x00011974 ldr r3, [sp, 0x4c] | r3 = var_4ch;
0x00011978 cmp r0, 0 |
| if (r0 == 0) {
0x0001197c beq 0x119cc | goto label_73;
| }
| if (r0 < 0) {
0x00011980 bge 0x11994 |
0x00011984 ldr r0, [pc, 0x1c0] | r0 = "_s:_error_:_too_many_bad_blocks__cannot_complete_request";
0x00011988 bl 0x10a54 | perror ("_s:_error_:_too_many_bad_blocks__cannot_complete_request");
| label_22:
0x0001198c ldr r5, [sp, 0x38] | r5 = var_38h;
0x00011990 b 0x113d8 | goto label_15;
| }
0x00011994 add r8, r8, r0 | r8 += r0;
| label_66:
0x00011998 cmp sb, r8 |
0x0001199c bhi 0x11958 |
| } while (sb > r8);
0x000119a0 ldr r3, [sp, 0x28] | r3 = fildes;
0x000119a4 add sb, sb, fp | sb += fp;
0x000119a8 cmp r3, 0 |
0x000119ac sub fp, sb, sl |
| if (r3 == 0) {
0x000119b0 beq 0x11660 | goto label_21;
| }
0x000119b4 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x000119b8 sub r8, r8, sl | r8 -= sl;
0x000119bc subs r2, r2, r8 | r2 -= r8;
0x000119c0 sbc r3, r3, 0 | __asm ("sbc r3, r3, 0");
0x000119c4 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x000119c8 b 0x11660 | goto label_21;
| label_73:
0x000119cc mov r2, r3 | r2 = r3;
0x000119d0 ldr r3, [pc, 0x188] | r3 = "_s:_error_:__s:_MTD_Erase_failure";
0x000119d4 ldr r1, [pc, 0x178] | r1 = "Unexpected_EOF._Expecting_at_least__zu_more_bytes._Use_the_padding_option.";
0x000119d8 ldr r0, [r3] | r0 = "_s:_error_:__s:_MTD_Erase_failure";
0x000119dc bl 0x10ab4 | fprintf ("_s:_error_:__s:_MTD_Erase_failure", "Unexpected_EOF._Expecting_at_least__zu_more_bytes._Use_the_padding_option.", r2, "_s:_error_:__s:_MTD_Erase_failure")
0x000119e0 b 0x1198c | goto label_22;
| label_69:
0x000119e4 ldr r1, [sp, 0x30] | r1 = format;
0x000119e8 ldrd r2, r3, [sp, 0x20] | __asm ("ldrd r2, r3, [var_20h]");
0x000119ec adds r2, r2, r1 | r2 += r1;
0x000119f0 adc r3, r3, r1, asr 31 | __asm ("adc r3, r3, r1, asr 31");
0x000119f4 strd r2, r3, [sp, 0x38] | __asm ("strd r2, r3, [var_38h]");
0x000119f8 ldr r1, [pc, 0x158] | r1 = "Unexpected_EOF._Expecting_at_least__zu_more_bytes_for_OOB";
0x000119fc subs r2, r2, 1 | r2--;
0x00011a00 sbc r3, r3, 0 | __asm ("sbc r3, r3, 0");
0x00011a04 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011a08 ldrd r2, r3, [sp, 0x20] | __asm ("ldrd r2, r3, [var_20h]");
0x00011a0c bl 0x10ab4 | fprintf (r0, r1, r2, r3)
0x00011a10 ldr r2, [sp, 0x19c] | r2 = var_19ch;
0x00011a14 ldrd r0, r1, [sp, 0x20] | __asm ("ldrd r0, r1, [var_20h]");
0x00011a18 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011a1c bl 0x150b0 | fcn_000150b0 (r0);
0x00011a20 ldr r3, [pc, 0xa8] |
0x00011a24 ldr r2, [sp, 0x2c] | r2 = fd;
0x00011a28 ldr r3, [r3] | r3 = "Copyright__C__2003_Thomas_Gleixner__1_s_comes_with_NO_WARRANTYto_the_extent_permitted_by_law.You_may_redistribute_copies_of__1_sunder_the_terms_of_the_GNU_General_Public_Licence.See_the_file__COPYING_for_more_information.";
0x00011a2c add r1, sp, 0xb8 | r1 += var_b8h;
0x00011a30 str r3, [sp] | *(sp) = r3;
0x00011a34 mov r3, r0 | r3 = r0;
0x00011a38 ldr r0, [sp, 0x44] | r0 = var_44h;
0x00011a3c bl 0x136bc | r0 = fcn_000136bc (r0, r1, r2);
0x00011a40 cmp r0, 0 |
0x00011a44 bne 0x11a68 |
| while (r4 == 5) {
0x00011a48 ldrb r8, [r6, 0x14] | r8 = *((r6 + 0x14));
0x00011a4c cmp r8, 0 |
| if (r8 != 0) {
0x00011a50 bne 0x11b78 | goto label_74;
| }
| label_24:
0x00011a54 ldrd r2, r3, [sp, 0x38] | __asm ("ldrd r2, r3, [var_38h]");
0x00011a58 mov r4, r7 | r4 = r7;
0x00011a5c strd r2, r3, [r6, 0x18] | __asm ("strd r2, r3, [r6, 0x18]");
| label_25:
0x00011a60 ldrd r8, sb, [sp, 0x20] | __asm ("ldrd r8, sb, [var_20h]");
0x00011a64 b 0x11528 | goto label_23;
0x00011a68 ldr r4, [sb] | r4 = *(sb);
0x00011a6c ldr r3, [r6, 0x24] | r3 = *((r6 + 0x24));
0x00011a70 ldr r2, [pc, 0xf0] | r2 = "Marking block at %08llx bad\n";
0x00011a74 ldr r1, [pc, 0xe0] | r1 = "Erasing_failed_write_from__08llx_to__08llx";
0x00011a78 ldr r0, [r8] | r0 = *(r8);
0x00011a7c bl 0x10ab4 | fprintf (r0, "Erasing_failed_write_from__08llx_to__08llx", "Marking block at %08llx bad\n", r3, r4)
0x00011a80 mov r0, r4 | r0 = r4;
0x00011a84 ldr r8, [r8] | r8 = *(r8);
0x00011a88 bl 0x10a18 | strerror (r0);
0x00011a8c str r4, [sp] | *(sp) = r4;
0x00011a90 ldr r3, [pc, 0xd8] | r3 = "_s:_error_:__s:_MTD_Mark_bad_block_failure";
0x00011a94 mov r2, 0xb | r2 = 0xb;
0x00011a98 ldr r1, [pc, 0xd4] | r1 = *(0x11b70);
0x00011a9c str r0, [sp, 4] | var_4h = r0;
0x00011aa0 mov r0, r8 | r0 = r8;
0x00011aa4 bl 0x10ab4 | fprintf (r0, r1, r2, "_s:_error_:__s:_MTD_Mark_bad_block_failure", r4)
0x00011aa8 cmp r4, 5 |
0x00011aac beq 0x11a48 |
| }
0x00011ab0 b 0x117fc | goto label_18;
| label_74:
0x00011b78 ldr r1, [sp, 0x19c] | r1 = var_19ch;
0x00011b7c ldrd r2, r3, [r6, 0x18] | __asm ("ldrd r2, r3, [r6, 0x18]");
0x00011b80 ldr r4, [pc, -0x28] | r4 = obj.stderr;
0x00011b84 rsb r1, r1, 0 | r1 -= ;
0x00011b88 and r2, r2, r1 | r2 &= r1;
0x00011b8c and r3, r3, r1, asr 31 | r3 &= (r1 >> 31);
0x00011b90 ldr r0, [r4] | r0 = *(r4);
0x00011b94 ldr r1, [pc, -0x38] | r1 = "Marking block at %08llx bad\n";
0x00011b98 bl 0x10ab4 | fprintf (r0, r1, r2, r3, r4)
0x00011b9c ldr r2, [sp, 0x19c] | r2 = var_19ch;
0x00011ba0 ldrd r0, r1, [r6, 0x18] | __asm ("ldrd r0, r1, [r6, 0x18]");
0x00011ba4 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011ba8 bl 0x150b0 | fcn_000150b0 (r0);
0x00011bac ldr r1, [sp, 0x2c] | r1 = fd;
0x00011bb0 mov r2, r0 | r2 = r0;
0x00011bb4 add r0, sp, 0xb8 | r0 += var_b8h;
0x00011bb8 bl 0x139c4 | r0 = fcn_000139c4 (r0, r1);
0x00011bbc cmp r0, 0 |
| if (r0 == 0) {
0x00011bc0 beq 0x11a54 | goto label_24;
| }
0x00011bc4 ldr r5, [sb] | r5 = *(sb);
0x00011bc8 ldr r3, [r6, 0x24] | r3 = *((r6 + 0x24));
0x00011bcc ldr r2, [pc, -0x6c] | r2 = "nandwrite";
0x00011bd0 ldr r1, [pc, -0x6c] | r1 = "_s:_error_:__s:_MTD_Mark_bad_block_failure";
0x00011bd4 ldr r0, [r4] | r0 = *(r4);
0x00011bd8 bl 0x10ab4 | fprintf (r0, "_s:_error_:__s:_MTD_Mark_bad_block_failure", "nandwrite", r3, r4, r5)
0x00011bdc mov r0, r5 | r0 = r5;
0x00011be0 ldr r4, [r4] | r4 = *(r4);
0x00011be4 bl 0x10a18 | strerror (r0);
0x00011be8 str r5, [sp] | *(sp) = r5;
0x00011bec ldr r3, [pc, -0x84] | r3 = *(0x00011b70);
0x00011bf0 mov r2, 0xb | r2 = 0xb;
0x00011bf4 ldr r1, [pc, -0x88] | r1 = "_serror__d___s_";
0x00011bf8 mov r5, r8 | r5 = r8;
0x00011bfc str r0, [sp, 4] | var_4h = r0;
0x00011c00 mov r0, r4 | r0 = r4;
0x00011c04 bl 0x10ab4 | fprintf (r0, "_serror__d___s_", r2, r3, r4, r5)
0x00011c08 mov r4, r7 | r4 = r7;
0x00011c0c b 0x113d8 | goto label_15;
| label_68:
0x00011c10 ldrd r2, r3, [r6, 0x18] | __asm ("ldrd r2, r3, [r6, 0x18]");
0x00011c14 ldr r1, [sp, 0x1a0] | r1 = var_1a0h;
0x00011c18 adds r8, r2, r1 | r8 = r2 + r1;
0x00011c1c adc sb, r3, r1, asr 31 | __asm ("adc sb, r3, r1, asr 31");
0x00011c20 ldr r3, [sp, 0x34] | r3 = size;
0x00011c24 strd r8, sb, [r6, 0x18] | __asm ("strd r8, sb, [r6, 0x18]");
0x00011c28 add r4, r4, r3 | r4 += r3;
0x00011c2c b 0x11a60 | goto label_25;
| label_61:
0x00011c30 mov r0, r5 | r0 = r5;
0x00011c34 add sp, sp, 0x1bc |
0x00011c38 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
[*] Function printf used 46 times nandwrite