[*] Binary protection state of nanddump
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of nanddump
; 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/nanddump @ 0x10c14 */
| #include <stdint.h>
|
; (fcn) fcn.00010c14 () | void fcn_00010c14 () {
| int32_t var_0h_3;
| int32_t var_68h;
| int32_t var_1b8h;
| int32_t var_0h;
| int32_t var_4h;
| /* [10] -r-x section size 17820 named .text */
0x00010c14 push {r0, r1, r2, lr} |
0x00010c18 bl 0x10b9c | errno_location ();
0x00010c1c ldr r5, [pc, 0x40] |
0x00010c20 ldr r2, [pc, 0x40] | r2 = stderr;
0x00010c24 ldr r1, [pc, 0x40] | r1 = "nanddump";
0x00010c28 ldr r4, [r0] | r4 = *(r0);
0x00010c2c ldr r0, [r5] | r0 = *(0x10c60);
0x00010c30 bl 0x10ae8 | fprintf (r0, "nanddump", r2, r3, r4, r5)
0x00010c34 mov r0, r4 | r0 = r4;
0x00010c38 ldr r5, [r5] | r5 = *(0x10c60);
0x00010c3c bl 0x10a4c | strerror (r0);
0x00010c40 str r4, [sp] | *(sp) = r4;
0x00010c44 ldr r3, [pc, 0x24] | r3 = "%s: error!: out of memory\n";
0x00010c48 mov r2, 0xa | r2 = 0xa;
0x00010c4c ldr r1, [pc, 0x20] | r1 = *(0x10c70);
0x00010c50 str r0, [sp, 4] | var_4h = r0;
0x00010c54 mov r0, r5 | r0 = r5;
0x00010c58 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x00010c5c mvn r0, 0 | r0 = ~0;
0x00010c60 bl 0x10ba8 | exit (r0);
0x00010c64 ldrdeq r7, r8, [r2], -r0 | __asm ("ldrdeq r7, r8, [r2], -r0");
0x00010c68 ldrdeq r5, r6, [r1], -fp | __asm ("ldrdeq r5, r6, [r1], -fp");
| if (? != ?) {
0x00010c6c andeq r5, r1, r5, lsl r3 | r5 = r1 & (r5 << r3);
| }
| if (? != ?) {
0x00010c70 andeq r5, r1, r3, ror 30 | r5 = r1 & (r3 >>> 30);
| }
| /* 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. */
0x00010c74 andeq r5, r1, r0, lsr r3 | return r5 = r1 & (r0 >> r3);
| }
; 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/nanddump @ 0x10c78 */
| #include <stdint.h>
|
; (fcn) fcn.00010c78 () | void fcn_00010c78 () {
| int32_t var_0h_2;
| int32_t var_4h_2;
0x00010c78 push {r0, r1, r2, lr} |
0x00010c7c bl 0x10b9c | errno_location ();
0x00010c80 ldr r5, [pc, 0x40] |
0x00010c84 ldr r2, [pc, 0x40] | r2 = stderr;
0x00010c88 ldr r1, [pc, 0x40] | r1 = "libmtd";
0x00010c8c ldr r4, [r0] | r4 = *(r0);
0x00010c90 ldr r0, [r5] | r0 = *(0x10cc4);
0x00010c94 bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x00010c98 mov r0, r4 | r0 = r4;
0x00010c9c ldr r5, [r5] | r5 = *(0x10cc4);
0x00010ca0 bl 0x10a4c | strerror (r0);
0x00010ca4 str r4, [sp] | *(sp) = r4;
0x00010ca8 ldr r3, [pc, 0x24] | r3 = "%s: error!: out of memory\n";
0x00010cac mov r2, 8 | r2 = 8;
0x00010cb0 ldr r1, [pc, 0x20] | r1 = *(0x10cd4);
0x00010cb4 str r0, [sp, 4] | var_4h_2 = r0;
0x00010cb8 mov r0, r5 | r0 = r5;
0x00010cbc bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x00010cc0 mvn r0, 0 | r0 = ~0;
0x00010cc4 bl 0x10ba8 | exit (r0);
0x00010cc8 ldrdeq r7, r8, [r2], -r0 | __asm ("ldrdeq r7, r8, [r2], -r0");
| if (? != ?) {
0x00010ccc andeq r5, r1, sl, lsl lr | r5 = r1 & (sl << lr);
| }
| if (? != ?) {
0x00010cd0 andeq r5, r1, r5, lsl r3 | r5 = r1 & (r5 << r3);
| }
| if (? != ?) {
0x00010cd4 andeq r5, r1, r3, ror 30 | r5 = r1 & (r3 >>> 30);
| }
| /* 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. */
0x00010cd8 andeq r5, r1, r0, lsr r3 | return r5 = r1 & (r0 >> r3);
| }
; 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/nanddump @ 0x119dc */
| #include <stdint.h>
|
; (fcn) fcn.000119dc () | void fcn_000119dc (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| char * * endptr;
| int32_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x000119dc push {r4, r5, r6, r7, lr} |
0x000119e0 sub sp, sp, 0x14 |
0x000119e4 mov r5, r1 | r5 = r1;
0x000119e8 mov r2, 0 | r2 = 0;
0x000119ec add r1, sp, 0xc | r1 += endptr;
0x000119f0 mov r4, r0 | r4 = r0;
0x000119f4 bl 0x10aac | strtoll (r0, r1, r2);
0x000119f8 ldrb r3, [r4] | r3 = *(r4);
0x000119fc cmp r3, 0 |
0x00011a00 mov r6, r0 | r6 = r0;
0x00011a04 mov r7, r1 | r7 = r1;
| if (r3 != 0) {
0x00011a08 beq 0x11a1c |
0x00011a0c ldr r3, [sp, 0xc] | r3 = endptr;
0x00011a10 ldrb r3, [r3] | r3 = *(r3);
0x00011a14 cmp r3, 0 |
| if (r3 == 0) {
0x00011a18 beq 0x11a40 | goto label_0;
| }
| }
0x00011a1c ldr r0, [pc, 0x2c] |
0x00011a20 str r4, [sp] | *(sp) = r4;
0x00011a24 ldr r3, [pc, 0x28] | r3 = stderr;
0x00011a28 ldr r2, [pc, 0x28] | r2 = "strtoll";
0x00011a2c ldr r1, [pc, 0x28] | r1 = "nanddump";
0x00011a30 ldr r0, [r0] | r0 = *(0x11a4c);
0x00011a34 bl 0x10ae8 | fprintf (r0, "nanddump", "strtoll", r3, r4)
0x00011a38 mov r3, 1 | r3 = 1;
0x00011a3c str r3, [r5] | *(r5) = r3;
| label_0:
0x00011a40 mov r0, r6 | r0 = r6;
0x00011a44 mov r1, r7 | r1 = r7;
0x00011a48 add sp, sp, 0x14 |
0x00011a4c 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/nanddump @ 0x11a60 */
| #include <stdint.h>
|
; (fcn) fcn.00011a60 () | void fcn_00011a60 (int32_t arg1, char * arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
| r1 = arg2;
0x00011a60 push {r0, r1, r4, r5, r6, lr} |
0x00011a64 mov r6, r0 | r6 = r0;
0x00011a68 mov r5, r1 | r5 = r1;
0x00011a6c mov r4, r2 | r4 = r2;
| do {
0x00011a70 cmp r4, 0 |
| if (r4 != 0) {
0x00011a74 beq 0x11ad8 |
0x00011a78 mov r2, r4 | r2 = r4;
0x00011a7c mov r1, r5 | r1 = r5;
0x00011a80 mov r0, r6 | r0 = r6;
0x00011a84 bl 0x10adc | r0 = write (r0, r1, r2);
0x00011a88 cmp r0, 0 |
| if (r0 >= 0) {
0x00011a8c bge 0x11ae4 | goto label_0;
| }
0x00011a90 bl 0x10b9c | errno_location ();
0x00011a94 ldr r6, [pc, 0x54] |
0x00011a98 ldr r2, [pc, 0x54] | r2 = stderr;
0x00011a9c ldr r1, [pc, 0x54] | r1 = "nanddump";
0x00011aa0 ldr r5, [r0] | r5 = *(r0);
0x00011aa4 ldr r0, [r6] | r0 = *(0x11aec);
0x00011aa8 bl 0x10ae8 | fprintf (r0, "nanddump", r2, r3, r4, r5, r6)
0x00011aac mov r0, r5 | r0 = r5;
0x00011ab0 ldr r6, [r6] | r6 = *(0x11aec);
0x00011ab4 bl 0x10a4c | strerror (r0);
0x00011ab8 str r5, [sp] | *(sp) = r5;
0x00011abc ldr r3, [pc, 0x38] | r3 = "_s:_error_:_Unable_to_write_to_output";
0x00011ac0 mov r2, 0xa | r2 = 0xa;
0x00011ac4 ldr r1, [pc, 0x34] | r1 = *(0x11afc);
0x00011ac8 rsb r4, r5, 0 | r4 = r5 - ;
0x00011acc str r0, [sp, 4] | var_4h = r0;
0x00011ad0 mov r0, r6 | r0 = r6;
0x00011ad4 bl 0x10ae8 | fprintf (r0, r1, r2, "_s:_error_:_Unable_to_write_to_output", r4, r5)
| }
0x00011ad8 mov r0, r4 | r0 = r4;
0x00011adc add sp, sp, 8 |
0x00011ae0 pop {r4, r5, r6, pc} |
| label_0:
0x00011ae4 add r5, r5, r0 | r5 += r0;
0x00011ae8 sub r4, r4, r0 | r4 -= r0;
0x00011aec b 0x11a70 |
| } while (1);
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/nanddump @ 0x11c74 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00011c74 () | void fcn_00011c74 (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;
0x00011c74 push {r4, r5, r6, r7, r8, fp, lr} |
0x00011c78 add fp, sp, 0x18 |
0x00011c7c sub sp, sp, 0x114 |
0x00011c80 mov r5, r0 | r5 = r0;
0x00011c84 ldr r0, [r0, 0xc] | r0 = *((r0 + 0xc));
0x00011c88 bl 0x10bb4 | r0 = strlen (r0);
0x00011c8c add r0, r0, 0x11 | r0 += 0x11;
0x00011c90 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00011c94 sub sp, sp, r0 |
0x00011c98 ldr r0, [r5] | r0 = *(r5);
0x00011c9c bl 0x10b6c | r0 = opendir ();
0x00011ca0 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00011ca4 addne r7, sp, 8 | r7 += var_8h;
| }
| if (r4 == r0) {
0x00011ca8 ldrne r8, [pc, 0x1a0] | r8 = "mtd_d_s";
| }
| if (r4 != r0) {
0x00011cac bne 0x11d08 | goto label_3;
| }
0x00011cb0 bl 0x10b9c | r0 = errno_location ();
0x00011cb4 ldr r6, [r0] | r6 = *(r0);
0x00011cb8 cmp r6, 2 |
| if (r6 != 2) {
0x00011cbc streq r4, [r0] | *(r0) = r4;
| }
| if (r6 == 2) {
0x00011cc0 beq 0x11d60 | goto label_1;
| }
0x00011cc4 ldr r4, [pc, 0x188] |
0x00011cc8 ldr r3, [r5] | r3 = *(r5);
0x00011ccc ldr r2, [pc, 0x184] | r2 = stderr;
0x00011cd0 ldr r1, [pc, 0x184] | r1 = "libmtd";
0x00011cd4 ldr r0, [r4] | r0 = "mtd_d_s";
0x00011cd8 bl 0x10ae8 | fprintf ("mtd_d_s", "libmtd", r2, r3, "mtd_d_s")
0x00011cdc mov r0, r6 | r0 = r6;
0x00011ce0 ldr r4, [r4] | r4 = "mtd_d_s";
0x00011ce4 bl 0x10a4c | strerror (r0);
0x00011ce8 ldr r3, [pc, 0x170] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00011cec ldr r1, [pc, 0x170] | r1 = *(0x11e60);
0x00011cf0 mov r2, 8 | r2 = 8;
0x00011cf4 str r6, [sp] | *(sp) = r6;
0x00011cf8 str r0, [sp, 4] | var_4h = r0;
0x00011cfc mov r0, r4 | r0 = r4;
| label_0:
0x00011d00 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5, r6)
0x00011d04 b 0x11d5c |
| while (r0 != 1) {
| label_3:
0x00011d08 mov r0, r4 | r0 = r4;
0x00011d0c bl 0x10b18 | r0 = readdir64 ();
0x00011d10 cmp r0, 0 |
| if (r0 == 0) {
0x00011d14 beq 0x11de4 | goto label_4;
| }
0x00011d18 add r6, r0, 0x13 | r6 = r0 + 0x13;
0x00011d1c mov r0, r6 | r0 = r6;
0x00011d20 bl 0x10bb4 | r0 = strlen (r0);
0x00011d24 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00011d28 bls 0x11d6c |
0x00011d2c ldr r0, [pc, 0x120] |
0x00011d30 str r6, [sp] | *(sp) = r6;
0x00011d34 ldr r2, [pc, 0x11c] | r2 = stderr;
0x00011d38 ldr r3, [r5] | r3 = *(r5);
0x00011d3c ldr r1, [pc, 0x124] | r1 = "_serror__d___s_";
0x00011d40 ldr r0, [r0] | r0 = "mtd_d_s";
0x00011d44 bl 0x10ae8 | r0 = fprintf ("mtd_d_s", "_serror__d___s_", r2, r3, r4, r5, r6)
0x00011d48 bl 0x10b9c | errno_location ();
0x00011d4c mov r3, 0x16 | r3 = 0x16;
0x00011d50 str r3, [r0] | *(r0) = r3;
0x00011d54 mov r0, r4 | r0 = r4;
0x00011d58 bl 0x10bd8 | closedir ();
0x00011d5c mvn r4, 0 | r4 = ~0;
| label_1:
0x00011d60 mov r0, r4 | r0 = r4;
0x00011d64 sub sp, fp, 0x18 |
0x00011d68 pop {r4, r5, r6, r7, r8, fp, pc} |
| }
0x00011d6c sub r3, fp, 0x11c | r3 -= var_11ch;
0x00011d70 sub r2, fp, 0x120 | r2 -= var_120h;
0x00011d74 mov r1, r8 | r1 = r8;
0x00011d78 mov r0, r6 | r0 = r6;
0x00011d7c bl 0x10b30 | r0 = sscanf (r0, r1, r2);
0x00011d80 cmp r0, 1 |
0x00011d84 bne 0x11d08 |
| }
0x00011d88 ldr r6, [fp, -0x120] | r6 = var_120h;
| do {
0x00011d8c mov r0, r4 | r0 = r4;
0x00011d90 bl 0x10bd8 | r0 = closedir ();
0x00011d94 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00011d98 beq 0x11dec | goto label_5;
| }
0x00011d9c bl 0x10b9c | errno_location ();
0x00011da0 ldr r6, [pc, 0xac] | r6 = "mtd_d_s";
0x00011da4 ldr r3, [r5] | r3 = *(r5);
0x00011da8 ldr r2, [pc, 0xa8] | r2 = stderr;
0x00011dac ldr r1, [pc, 0xb8] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x00011db0 ldr r4, [r0] | r4 = *(r0);
0x00011db4 ldr r0, [r6] | r0 = "mtd_d_s";
0x00011db8 bl 0x10ae8 | fprintf ("mtd_d_s", "%s: error!: invalid entry in %s: \"%s\"\n", r2, r3, r4, r5, "mtd_d_s")
0x00011dbc ldr r5, [r6] | r5 = "mtd_d_s";
| label_2:
0x00011dc0 mov r0, r4 | r0 = r4;
0x00011dc4 bl 0x10a4c | strerror (r0);
0x00011dc8 str r4, [sp] | *(sp) = r4;
0x00011dcc ldr r3, [pc, 0x8c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00011dd0 mov r2, 8 | r2 = 8;
0x00011dd4 ldr r1, [pc, 0x88] | r1 = *(0x11e60);
0x00011dd8 str r0, [sp, 4] | var_4h = r0;
0x00011ddc mov r0, r5 | r0 = r5;
0x00011de0 b 0x11d00 | goto label_0;
| label_4:
0x00011de4 mvn r6, 0 | r6 = ~0;
0x00011de8 b 0x11d8c |
| } while (1);
| label_5:
0x00011dec cmn r6, 1 |
| if (r6 == 1) {
0x00011df0 beq 0x11d60 | goto label_1;
| }
0x00011df4 mov r2, r6 | r2 = r6;
0x00011df8 ldr r1, [r5, 0xc] | r1 = *((r5 + 0xc));
0x00011dfc mov r0, r7 | r0 = r7;
0x00011e00 bl 0x10b84 | sprintf (r0, r1, r2);
0x00011e04 mov r1, 0x80000 | r1 = 0x80000;
0x00011e08 mov r0, r7 | r0 = r7;
0x00011e0c bl 0x10b60 | r0 = open64 ();
0x00011e10 cmn r0, 1 |
| if (r0 == 1) {
0x00011e14 beq 0x11d60 | goto label_1;
| }
0x00011e18 bl 0x10bf0 | r0 = close (r0);
0x00011e1c cmp r0, 0 |
| if (r0 == 0) {
0x00011e20 moveq r4, 1 | r4 = 1;
| goto label_6;
| }
| if (r0 == 0) {
| label_6:
0x00011e24 beq 0x11d60 | goto label_1;
| }
0x00011e28 bl 0x10b9c | errno_location ();
0x00011e2c ldr r5, [pc, 0x20] |
0x00011e30 mov r3, r7 | r3 = r7;
0x00011e34 ldr r2, [pc, 0x1c] | r2 = stderr;
0x00011e38 ldr r1, [pc, 0x30] | r1 = "_s:_error_:_closedir_failed_on___s_";
0x00011e3c ldr r4, [r0] | r4 = *(r0);
0x00011e40 ldr r0, [r5] | r0 = "mtd_d_s";
0x00011e44 bl 0x10ae8 | fprintf ("mtd_d_s", "_s:_error_:_closedir_failed_on___s_", r2, r3, r4, "mtd_d_s")
0x00011e48 ldr r5, [r5] | r5 = "mtd_d_s";
0x00011e4c b 0x11dc0 | 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/nanddump @ 0x11e74 */
| #include <stdint.h>
|
; (fcn) fcn.00011e74 () | void fcn_00011e74 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| void * buf;
| int32_t var_10h;
| r0 = arg1;
| r1 = arg2;
0x00011e74 push {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr} |
0x00011e78 mov r8, r1 | r8 = r1;
0x00011e7c mov r1, 0x80000 | r1 = 0x80000;
0x00011e80 mov r5, r0 | r5 = r0;
0x00011e84 mov r7, r2 | r7 = r2;
0x00011e88 bl 0x10b60 | r0 = open64 ();
0x00011e8c cmn r0, 1 |
0x00011e90 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00011e94 beq 0x11fdc | goto label_2;
| }
0x00011e98 mov r2, r7 | r2 = r7;
0x00011e9c mov r1, r8 | r1 = r8;
0x00011ea0 bl 0x10b0c | r0 = read (r0, r1, r2);
0x00011ea4 cmn r0, 1 |
0x00011ea8 mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x00011eac bne 0x11f04 | goto label_3;
| }
| label_0:
0x00011eb0 bl 0x10b9c | errno_location ();
0x00011eb4 ldr r7, [pc, 0x12c] | r7 = *(0x11fe4);
0x00011eb8 mov r3, r5 | r3 = r5;
0x00011ebc ldr r2, [pc, 0x128] | r2 = stderr;
0x00011ec0 ldr r1, [pc, 0x128] | r1 = "libmtd";
0x00011ec4 ldr r6, [r0] | r6 = *(r0);
0x00011ec8 ldr r0, [r7] | r0 = *(0x11fe4);
0x00011ecc bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00011ed0 mov r0, r6 | r0 = r6;
0x00011ed4 ldr r5, [r7] | r5 = *(0x11fe4);
0x00011ed8 bl 0x10a4c | strerror (r0);
0x00011edc str r6, [sp] | *(sp) = r6;
0x00011ee0 ldr r3, [pc, 0x10c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00011ee4 mov r2, 8 | r2 = 8;
0x00011ee8 ldr r1, [pc, 0x108] | r1 = *(0x11ff4);
0x00011eec str r0, [sp, 4] | var_4h = r0;
0x00011ef0 mov r0, r5 | r0 = r5;
0x00011ef4 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x00011ef8 mov r0, r4 | r0 = r4;
0x00011efc bl 0x10bf0 | close (r0);
0x00011f00 b 0x11fd8 | goto label_4;
| label_3:
0x00011f04 cmp r7, r0 |
| if (r7 != r0) {
0x00011f08 bne 0x11f34 | goto label_5;
| }
0x00011f0c ldr r0, [pc, 0xd4] |
0x00011f10 mov r3, r5 | r3 = r5;
0x00011f14 ldr r2, [pc, 0xd0] | r2 = stderr;
0x00011f18 ldr r1, [pc, 0xdc] | r1 = "_serror__d___s_";
0x00011f1c ldr r0, [r0] | r0 = *(0x11fe4);
0x00011f20 bl 0x10ae8 | r0 = fprintf (r0, "_serror__d___s_", r2, r3)
| label_1:
0x00011f24 bl 0x10b9c | errno_location ();
0x00011f28 mov r3, 0x16 | r3 = 0x16;
0x00011f2c str r3, [r0] | *(r0) = r3;
0x00011f30 b 0x11ef8 |
| } while (1);
| label_5:
0x00011f34 mov r3, 0 | r3 = 0;
0x00011f38 strb r3, [r8, r0] | *((r8 + r0)) = r3;
0x00011f3c mov r2, 1 | r2 = 1;
0x00011f40 add r1, sp, 0xc | r1 += buf;
0x00011f44 mov r0, r4 | r0 = r4;
0x00011f48 bl 0x10b0c | r0 = read (r0, r1, r2);
0x00011f4c cmp r0, 1 |
| if (r0 == 1) {
0x00011f50 beq 0x11eb0 | goto label_0;
| }
0x00011f54 cmp r0, 0 |
| if (r0 != 0) {
0x00011f58 beq 0x11f7c |
0x00011f5c ldr r0, [pc, 0x84] |
0x00011f60 str r7, [sp] | *(sp) = r7;
0x00011f64 mov r3, r5 | r3 = r5;
0x00011f68 ldr r2, [pc, 0x7c] | r2 = stderr;
0x00011f6c ldr r1, [pc, 0x8c] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x00011f70 ldr r0, [r0] | r0 = *(0x11fe4);
0x00011f74 bl 0x10ae8 | fprintf (r0, "%s: error!: contents of \"%s\" is too long\n", r2, r3)
0x00011f78 b 0x11f24 | goto label_1;
| }
0x00011f7c mov r0, r4 | r0 = r4;
0x00011f80 bl 0x10bf0 | r0 = close (r0);
0x00011f84 cmp r0, 0 |
| if (r0 != 0) {
0x00011f88 moveq r4, r6 | r4 = r6;
| }
| if (r0 != 0) {
0x00011f8c beq 0x11fdc |
0x00011f90 bl 0x10b9c | errno_location ();
0x00011f94 ldr r6, [pc, 0x4c] | r6 = *(0x11fe4);
0x00011f98 mov r3, r5 | r3 = r5;
0x00011f9c ldr r2, [pc, 0x48] | r2 = stderr;
0x00011fa0 ldr r1, [pc, 0x5c] | r1 = "%s: error!: file \"%s\" contains too much data (> %d bytes)\n";
0x00011fa4 ldr r4, [r0] | r4 = *(r0);
0x00011fa8 ldr r0, [r6] | r0 = *(0x11fe4);
0x00011fac bl 0x10ae8 | fprintf (r0, "%s: error!: file \"%s\" contains too much data (> %d bytes)\n", r2, r3, r4, r5, r6)
0x00011fb0 mov r0, r4 | r0 = r4;
0x00011fb4 ldr r5, [r6] | r5 = *(0x11fe4);
0x00011fb8 bl 0x10a4c | strerror (r0);
0x00011fbc str r4, [sp] | *(sp) = r4;
0x00011fc0 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00011fc4 mov r2, 8 | r2 = 8;
0x00011fc8 ldr r1, [pc, 0x28] | r1 = *(0x11ff4);
0x00011fcc str r0, [sp, 4] | var_4h = r0;
0x00011fd0 mov r0, r5 | r0 = r5;
0x00011fd4 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x00011fd8 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00011fdc mov r0, r4 | r0 = r4;
0x00011fe0 add sp, sp, 0x10 |
0x00011fe4 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/nanddump @ 0x12008 */
| #include <stdint.h>
|
; (fcn) fcn.00012008 () | void fcn_00012008 (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;
0x00012008 push {r4, r5, r6, r7, lr} |
0x0001200c sub sp, sp, 0x4c |
0x00012010 mov r5, r0 | r5 = r0;
0x00012014 mov r2, 0x32 | r2 = 0x32;
0x00012018 mov r6, r1 | r6 = r1;
0x0001201c add r0, sp, 0x14 | r0 += buf;
0x00012020 mov r1, 0 | r1 = 0;
0x00012024 bl 0x10b54 | memset (r0, r1, r2);
0x00012028 mov r1, 0x80000 | r1 = 0x80000;
0x0001202c mov r0, r5 | r0 = r5;
0x00012030 bl 0x10b60 | r0 = open64 ();
0x00012034 cmn r0, 1 |
0x00012038 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x0001203c beq 0x12188 | goto label_2;
| }
0x00012040 mov r2, 0x32 | r2 = 0x32;
0x00012044 add r1, sp, 0x14 | r1 += buf;
0x00012048 bl 0x10b0c | r0 = read (r0, r1, r2);
0x0001204c cmn r0, 1 |
| if (r0 != 1) {
0x00012050 bne 0x120a8 | goto label_3;
| }
0x00012054 bl 0x10b9c | errno_location ();
0x00012058 ldr r7, [pc, 0x134] | r7 = *(0x12190);
0x0001205c mov r3, r5 | r3 = r5;
0x00012060 ldr r2, [pc, 0x130] | r2 = stderr;
0x00012064 ldr r1, [pc, 0x130] | r1 = "libmtd";
0x00012068 ldr r6, [r0] | r6 = *(r0);
0x0001206c ldr r0, [r7] | r0 = *(0x12190);
0x00012070 bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00012074 mov r0, r6 | r0 = r6;
0x00012078 ldr r5, [r7] | r5 = *(0x12190);
0x0001207c bl 0x10a4c | strerror (r0);
0x00012080 str r6, [sp] | *(sp) = r6;
0x00012084 ldr r3, [pc, 0x114] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00012088 mov r2, 8 | r2 = 8;
0x0001208c ldr r1, [pc, 0x110] | r1 = *(0x121a0);
0x00012090 str r0, [sp, 4] | var_4h = r0;
0x00012094 mov r0, r5 | r0 = r5;
0x00012098 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x0001209c mov r0, r4 | r0 = r4;
0x000120a0 bl 0x10bf0 | close (r0);
0x000120a4 b 0x12184 | goto label_4;
| label_3:
0x000120a8 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x000120ac bne 0x120d8 | goto label_5;
| }
0x000120b0 ldr r2, [pc, 0xe0] | r2 = stderr;
0x000120b4 ldr r1, [pc, 0xec] | r1 = "_serror__d___s_";
0x000120b8 mov r3, r5 | r3 = r5;
| label_0:
0x000120bc ldr r0, [pc, 0xd0] |
0x000120c0 ldr r0, [r0] | r0 = *(0x12190);
0x000120c4 bl 0x10ae8 | r0 = fprintf (r0, "_serror__d___s_", r2, r3)
| label_1:
0x000120c8 bl 0x10b9c | errno_location ();
0x000120cc mov r3, 0x16 | r3 = 0x16;
0x000120d0 str r3, [r0] | *(r0) = r3;
0x000120d4 b 0x1209c |
| } while (1);
| label_5:
0x000120d8 mov r2, r6 | r2 = r6;
0x000120dc ldr r1, [pc, 0xc8] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x000120e0 add r0, sp, 0x14 | r0 += buf;
0x000120e4 bl 0x10b30 | r0 = sscanf (r0, "%s: error!: contents of \"%s\" is too long\n", r2);
0x000120e8 cmp r0, 1 |
| if (r0 == 1) {
0x000120ec movne r3, r5 | r3 = r5;
| }
| if (r0 == 1) {
0x000120f0 ldrne r2, [pc, 0xa0] | r2 = "libmtd";
| }
| if (r0 != 1) {
0x000120f4 ldrne r1, [pc, 0xb4] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
| goto label_6;
| }
| if (r0 != 1) {
| label_6:
0x000120f8 bne 0x120bc | goto label_0;
| }
0x000120fc ldrd r2, r3, [r6] | __asm ("ldrd r2, r3, [r6]");
0x00012100 cmp r2, 0 |
0x00012104 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x00012108 bge 0x1212c |
0x0001210c strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00012110 ldr r3, [pc, 0x7c] | r3 = *(0x12190);
0x00012114 str r5, [sp, 8] | var_8h = r5;
0x00012118 ldr r2, [pc, 0x78] | r2 = stderr;
0x0001211c ldr r1, [pc, 0x90] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
0x00012120 ldr r0, [r3] | r0 = *(0x12190);
0x00012124 bl 0x10ae8 | fprintf (r0, "_s:_error_:_cannot_read_integer_from___s_", r2, r3, r4, r5)
0x00012128 b 0x120c8 | goto label_1;
| }
0x0001212c mov r0, r4 | r0 = r4;
0x00012130 bl 0x10bf0 | r0 = close (r0);
0x00012134 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00012138 beq 0x12188 |
0x0001213c bl 0x10b9c | errno_location ();
0x00012140 ldr r6, [pc, 0x4c] | r6 = *(0x12190);
0x00012144 mov r3, r5 | r3 = r5;
0x00012148 ldr r2, [pc, 0x48] | r2 = stderr;
0x0001214c ldr r1, [pc, 0x64] | r1 = "_s:_error_:_negative_value__lld_in___s_";
0x00012150 ldr r4, [r0] | r4 = *(r0);
0x00012154 ldr r0, [r6] | r0 = *(0x12190);
0x00012158 bl 0x10ae8 | fprintf (r0, "_s:_error_:_negative_value__lld_in___s_", r2, r3, r4, r5, r6)
0x0001215c mov r0, r4 | r0 = r4;
0x00012160 ldr r5, [r6] | r5 = *(0x12190);
0x00012164 bl 0x10a4c | strerror (r0);
0x00012168 str r4, [sp] | *(sp) = r4;
0x0001216c ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00012170 mov r2, 8 | r2 = 8;
0x00012174 ldr r1, [pc, 0x28] | r1 = *(0x121a0);
0x00012178 str r0, [sp, 4] | var_4h = r0;
0x0001217c mov r0, r5 | r0 = r5;
0x00012180 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x00012184 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00012188 mov r0, r4 | r0 = r4;
0x0001218c add sp, sp, 0x4c |
0x00012190 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/nanddump @ 0x121bc */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000121bc () | void fcn_000121bc (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;
0x000121bc push {r4, r5, r6, r7, fp, lr} |
0x000121c0 add fp, sp, 0x14 |
0x000121c4 sub sp, sp, 0x18 |
0x000121c8 mov r7, r1 | r7 = r1;
0x000121cc mov r6, r0 | r6 = r0;
0x000121d0 mov r5, r2 | r5 = r2;
0x000121d4 bl 0x10bb4 | strlen (r0);
0x000121d8 mov r2, r7 | r2 = r7;
0x000121dc mov r1, r6 | r1 = r6;
0x000121e0 add r0, r0, 0x39 | r0 += 0x39;
0x000121e4 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000121e8 sub sp, sp, r0 |
0x000121ec add r4, sp, 0x10 | r4 += s;
0x000121f0 mov r0, r4 | r0 = r4;
0x000121f4 bl 0x10b84 | sprintf (r0, r1, r2);
0x000121f8 sub r1, fp, 0x1c | r1 -= s;
0x000121fc mov r0, r4 | r0 = r4;
0x00012200 bl 0x12008 | r0 = fcn_00012008 (r0, r1);
0x00012204 cmp r0, 0 |
| if (r0 == 0) {
0x00012208 bne 0x12248 |
0x0001220c ldrd r2, r3, [fp, -0x1c] | __asm ("ldrd r2, r3, [s]");
0x00012210 cmp r2, 0x80000000 |
0x00012214 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 >= 0x80000000) {
0x00012218 strlt r2, [r5] | *(r5) = r2;
| }
| if (r2 < 0x80000000) {
0x0001221c blt 0x1224c | goto label_0;
| }
0x00012220 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00012224 ldr r3, [pc, 0x28] | r3 = *(0x12250);
0x00012228 str r4, [sp, 8] | var_8h = r4;
0x0001222c ldr r2, [pc, 0x24] | r2 = stderr;
0x00012230 ldr r0, [r3] | r0 = *(0x12250);
0x00012234 ldr r1, [pc, 0x20] | r1 = "libmtd";
0x00012238 bl 0x10ae8 | r0 = fprintf (r0, "libmtd", r2, r3, r4)
0x0001223c bl 0x10b9c | errno_location ();
0x00012240 mov r3, 0x16 | r3 = 0x16;
0x00012244 str r3, [r0] | *(r0) = r3;
| }
0x00012248 mvn r0, 0 | r0 = ~0;
| label_0:
0x0001224c sub sp, fp, 0x14 |
0x00012250 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/nanddump @ 0x12260 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012260 () | void fcn_00012260 (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;
0x00012260 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012264 ldr r8, [pc, 0x2d0] | r8 = *(0x12538);
0x00012268 sub sp, sp, 0x54 |
0x0001226c mov r4, r1 | r4 = r1;
0x00012270 mov r5, r0 | r5 = r0;
0x00012274 mov r1, 0 | r1 = 0;
0x00012278 mov sb, r2 | sb = r2;
0x0001227c add r0, sp, 0x38 | r0 += s;
0x00012280 mov r2, 0x18 | r2 = 0x18;
0x00012284 ldrd sl, fp, [sp, 0x78] | __asm ("ldrd sl, fp, [arg_78h]");
0x00012288 bl 0x10b54 | memset (r0, r1, r2);
0x0001228c mov r3, 0 | r3 = 0;
0x00012290 ldr r2, [sp, 0x8c] | r2 = *(request);
0x00012294 str r3, [sp, 0x2c] | var_2ch = r3;
0x00012298 str r3, [sp, 0x30] | var_30h = r3;
0x0001229c str r3, [sp, 0x34] | var_34h = r3;
0x000122a0 ldr r3, [pc, 0x298] | r3 = "MEMREADOOB64";
0x000122a4 cmp r2, r3 |
0x000122a8 ldr r2, [pc, 0x294] | r2 = *(0x12540);
0x000122ac ldr r3, [pc, 0x294] | r3 = "MEMREADOOB";
| if (r2 != r3) {
0x000122b0 moveq r3, r2 | r3 = r2;
| }
0x000122b4 str r3, [sp, 0x24] | var_24h = r3;
0x000122b8 ldr r3, [pc, 0x28c] | r3 = "MEMWRITEOOB";
0x000122bc ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
| if (r2 == r3) {
0x000122c0 movne r8, r3 | r8 = r3;
| }
0x000122c4 ldr r3, [r4, 0xe0] | r3 = *((r4 + 0xe0));
0x000122c8 smull r0, r1, r3, r2 | r0:r1 = r3 * r2;
0x000122cc cmp r1, fp |
0x000122d0 cmpeq r0, sl | __asm ("cmpeq r0, sl");
| if (r1 > fp) {
0x000122d4 bhi 0x1231c | goto label_2;
| }
0x000122d8 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x000122dc ldr r2, [pc, 0x26c] | r2 = "MEMWRITEOOB64";
0x000122e0 str r3, [sp, 0xc] | var_ch = r3;
0x000122e4 ldr r3, [r4] | r3 = *(r4);
0x000122e8 ldr r1, [pc, 0x264] | r1 = "libmtd";
0x000122ec str r3, [sp, 8] | var_8h = r3;
0x000122f0 ldr r3, [pc, 0x260] | r3 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x000122f4 strd sl, fp, [sp] | __asm ("strd sl, fp, [sp]");
0x000122f8 ldr r0, [r3] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x000122fc bl 0x10ae8 | r0 = fprintf (r0, "libmtd", "MEMWRITEOOB64", r3)
| do {
| label_1:
0x00012300 bl 0x10b9c | errno_location ();
0x00012304 mvn r7, 0 | r7 = ~0;
0x00012308 mov r3, 0x16 | r3 = 0x16;
0x0001230c str r3, [r0] | *(r0) = r3;
| label_0:
0x00012310 mov r0, r7 | r0 = r7;
0x00012314 add sp, sp, 0x54 |
0x00012318 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_2:
0x0001231c ldr r3, [r4, 0xe8] | r3 = *((r4 + 0xe8));
0x00012320 ldrd r0, r1, [sp, 0x80] | __asm ("ldrd r0, r1, [arg_80h]");
0x00012324 ldr r2, [r4, 0xf0] | r2 = *((r4 + 0xf0));
0x00012328 sub r3, r3, 1 | r3--;
0x0001232c and r3, r3, sl | r3 &= sl;
0x00012330 adds r0, r0, r3 | r0 += r3;
0x00012334 adc r1, r1, r3, asr 31 | __asm ("adc r1, r1, r3, asr 31");
0x00012338 mov r6, r0 | r6 = r0;
0x0001233c mov r7, r1 | r7 = r1;
0x00012340 ldr r0, [sp, 0x80] | r0 = *(arg_80h);
0x00012344 asr r1, r2, 0x1f | r1 = r2 >> 0x1f;
0x00012348 ldr ip, [sp, 0x84] | ip = *(arg_84h);
0x0001234c cmp r7, r1 |
0x00012350 cmpeq r6, r2 | __asm ("cmpeq r6, r2");
| if (r7 <= r1) {
0x00012354 movhi r1, 1 | r1 = 1;
| }
| if (r7 > r1) {
0x00012358 movls r1, 0 | r1 = 0;
| }
0x0001235c orrs r0, r0, ip | r0 |= ip;
| if (r0 != r0) {
0x00012360 moveq r1, 1 | r1 = 1;
| }
0x00012364 cmp r1, 0 |
| if (r1 == 0) {
0x00012368 beq 0x123a0 | goto label_3;
| }
0x0001236c str r2, [sp, 0x18] | var_18h = r2;
0x00012370 ldr r2, [r4] | r2 = *(r4);
0x00012374 str r3, [sp, 0x10] | var_10h = r3;
0x00012378 str r2, [sp, 0x14] | var_14h = r2;
0x0001237c ldrd r2, r3, [sp, 0x80] | __asm ("ldrd r2, r3, [arg_80h]");
0x00012380 ldr r1, [pc, 0x1d4] | r1 = stderr;
0x00012384 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00012388 ldr r3, [pc, 0x1c8] | r3 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x0001238c strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x00012390 ldr r2, [pc, 0x1b8] | r2 = "MEMWRITEOOB64";
0x00012394 ldr r0, [r3] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012398 bl 0x10ae8 | fprintf ("%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n", r1, r2, r3)
0x0001239c b 0x12300 |
| } while (1);
| label_3:
0x000123a0 ldr r3, [sp, 0x80] | r3 = *(arg_80h);
0x000123a4 strd sl, fp, [sp, 0x38] | __asm ("strd sl, fp, [s]");
0x000123a8 str r3, [sp, 0x44] | var_44h = r3;
0x000123ac ldr r3, [sp, 0x88] | r3 = *(arg_88h);
0x000123b0 str r1, [sp, 0x4c] | var_4ch = r1;
0x000123b4 str r3, [sp, 0x48] | var_48h = r3;
0x000123b8 ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x000123bc tst r3, 2 |
| if ((r3 & 2) != 0) {
0x000123c0 bne 0x1246c | goto label_4;
| }
0x000123c4 add r2, sp, 0x38 | r2 += s;
0x000123c8 ldr r1, [sp, 0x8c] | r1 = *(request);
0x000123cc mov r0, sb | r0 = sb;
0x000123d0 bl 0x10a34 | r0 = ioctl (r0, r1);
0x000123d4 subs r7, r0, 0 | r7 = r0 - 0;
| if (r7 == r0) {
0x000123d8 beq 0x12310 | goto label_0;
| }
0x000123dc bl 0x10b9c | r0 = errno_location ();
0x000123e0 ldr r7, [r0] | r7 = *(r0);
0x000123e4 cmp r7, 0x19 |
| if (r7 == 0x19) {
0x000123e8 bne 0x123f8 |
0x000123ec ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x000123f0 tst r3, 6 |
| if ((r3 & 6) == 0) {
0x000123f4 beq 0x1245c | goto label_5;
| }
| }
0x000123f8 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x000123fc mov r0, sl | r0 = sl;
0x00012400 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00012404 mov r1, fp | r1 = fp;
0x00012408 bl 0x15008 | fcn_00015008 (r0, r1);
0x0001240c ldr r6, [pc, 0x144] | r6 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012410 strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x00012414 ldr r2, [pc, 0x134] | r2 = "MEMWRITEOOB64";
0x00012418 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x0001241c ldr r3, [r4] | r3 = *(r4);
0x00012420 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";
0x00012424 str r3, [sp] | *(sp) = r3;
0x00012428 mov r3, r8 | r3 = r8;
0x0001242c ldr r0, [r6] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012430 bl 0x10ae8 | 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")
0x00012434 mov r0, r7 | r0 = r7;
0x00012438 ldr r8, [r6] | r8 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x0001243c bl 0x10a4c | strerror (r0);
0x00012440 str r7, [sp] | *(sp) = r7;
0x00012444 ldr r3, [pc, 0x118] | r3 = "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_";
0x00012448 mov r2, 8 | r2 = 8;
0x0001244c ldr r1, [pc, 0x114] | r1 = *(0x12564);
0x00012450 str r0, [sp, 4] | var_4h = r0;
0x00012454 mov r0, r8 | r0 = r8;
0x00012458 bl 0x10ae8 | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_")
| label_5:
0x0001245c ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x00012460 bic r3, r3, 4 | r3 = BIT_MASK (r3, 4);
0x00012464 orr r3, r3, 2 | r3 |= 2;
0x00012468 strb r3, [r5, 0x34] | *((r5 + 0x34)) = r3;
| label_4:
0x0001246c ldrd r2, r3, [sp, 0x38] | __asm ("ldrd r2, r3, [s]");
0x00012470 mov r1, 0 | r1 = 0;
0x00012474 mvn r0, 0 | r0 = ~0;
0x00012478 cmp r3, r1 |
0x0001247c cmpeq r2, r0 | __asm ("cmpeq r2, r0");
| if (r3 >= r1) {
0x00012480 bls 0x124a0 |
0x00012484 ldr r0, [pc, 0xcc] |
0x00012488 mvn r3, 0 | r3 = ~0;
0x0001248c ldr r2, [pc, 0xbc] | r2 = "MEMWRITEOOB64";
0x00012490 ldr r1, [pc, 0xd4] | r1 = "_serror__d___s_";
0x00012494 ldr r0, [r0] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012498 bl 0x10ae8 | fprintf ("%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n", "_serror__d___s_", "MEMWRITEOOB64", r3)
0x0001249c b 0x12300 | goto label_1;
| }
0x000124a0 ldr r3, [sp, 0x44] | r3 = var_44h;
0x000124a4 str r2, [sp, 0x2c] | var_2ch = r2;
0x000124a8 str r3, [sp, 0x30] | var_30h = r3;
0x000124ac ldr r3, [sp, 0x88] | r3 = *(arg_88h);
0x000124b0 add r2, sp, 0x2c | r2 += var_2ch;
0x000124b4 ldr r1, [sp, 0x90] | r1 = *(arg_90h);
0x000124b8 mov r0, sb | r0 = sb;
0x000124bc str r3, [sp, 0x34] | var_34h = r3;
0x000124c0 bl 0x10a34 | r0 = ioctl (r0, r1);
0x000124c4 subs r7, r0, 0 | r7 = r0 - 0;
| if (r7 >= r0) {
0x000124c8 bge 0x12310 | goto label_0;
| }
0x000124cc bl 0x10b9c | errno_location ();
0x000124d0 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x000124d4 mov r1, fp | r1 = fp;
0x000124d8 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x000124dc ldr r8, [pc, 0x74] | r8 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x000124e0 ldr r5, [r0] | r5 = *(r0);
0x000124e4 mov r0, sl | r0 = sl;
0x000124e8 bl 0x15008 | fcn_00015008 (r0, r1);
0x000124ec strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x000124f0 ldr r2, [pc, 0x58] | r2 = "MEMWRITEOOB64";
0x000124f4 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x000124f8 ldr r3, [r4] | r3 = *(r4);
0x000124fc 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";
0x00012500 str r3, [sp] | *(sp) = r3;
0x00012504 ldr r3, [sp, 0x24] | r3 = var_24h;
0x00012508 ldr r0, [r8] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x0001250c bl 0x10ae8 | 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)
0x00012510 mov r0, r5 | r0 = r5;
0x00012514 ldr r4, [r8] | r4 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012518 bl 0x10a4c | strerror (r0);
0x0001251c str r5, [sp] | *(sp) = r5;
0x00012520 ldr r3, [pc, 0x3c] | r3 = "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_";
0x00012524 mov r2, 8 | r2 = 8;
0x00012528 ldr r1, [pc, 0x38] | r1 = *(0x12564);
0x0001252c str r0, [sp, 4] | var_4h = r0;
0x00012530 mov r0, r4 | r0 = r4;
0x00012534 bl 0x10ae8 | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_", r4, r5)
0x00012538 b 0x12310 | 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/nanddump @ 0x12570 */
| #include <stdint.h>
|
; (fcn) fcn.00012570 () | void fcn_00012570 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| r0 = arg1;
| r1 = arg2;
0x00012570 subs r3, r1, 0 | r3 = r1 - 0;
0x00012574 push {r0, r1, r2, lr} |
0x00012578 ldr r2, [r0, 0xe0] | r2 = *((r0 + 0xe0));
| if (r3 >= r1) {
0x0001257c blt 0x1258c |
0x00012580 cmp r3, r2 |
| if (r3 >= r2) {
0x00012584 movlt r0, 0 | r0 = 0;
| }
| if (r3 < r2) {
0x00012588 blt 0x125bc | goto label_0;
| }
| }
0x0001258c str r2, [sp, 4] | var_4h = r2;
0x00012590 ldr r2, [r0] | r2 = *(r0);
0x00012594 ldr r0, [pc, 0x28] |
0x00012598 str r2, [sp] | *(sp) = r2;
0x0001259c ldr r1, [pc, 0x24] | r1 = stderr;
0x000125a0 ldr r2, [pc, 0x24] | r2 = "_s:_error_:_bad_eraseblock_number__d__mtd_d_has__d_eraseblocks";
0x000125a4 ldr r0, [r0] | r0 = *(0x125c0);
0x000125a8 bl 0x10ae8 | r0 = fprintf (r0, r1, r2)
0x000125ac bl 0x10b9c | errno_location ();
0x000125b0 mov r3, 0x16 | r3 = 0x16;
0x000125b4 str r3, [r0] | *(r0) = r3;
0x000125b8 mvn r0, 0 | r0 = ~0;
| label_0:
0x000125bc add sp, sp, 0xc |
0x000125c0 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/nanddump @ 0x125d0 */
| #include <stdint.h>
|
; (fcn) fcn.000125d0 () | void fcn_000125d0 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
| r1 = arg2;
0x000125d0 push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x000125d4 ldr r5, [pc, 0x5c] |
0x000125d8 mov r7, r1 | r7 = r1;
0x000125dc mov r6, r2 | r6 = r2;
0x000125e0 mov r8, r0 | r8 = r0;
0x000125e4 bl 0x10b9c | errno_location ();
0x000125e8 mov r3, r6 | r3 = r6;
0x000125ec ldr r2, [pc, 0x48] | r2 = stderr;
0x000125f0 ldr r1, [pc, 0x48] | r1 = "libmtd";
0x000125f4 ldr r4, [r0] | r4 = *(r0);
0x000125f8 stm sp, {r7, r8} | *(sp) = r7;
| *((sp + 4)) = r8;
0x000125fc ldr r0, [r5] | r0 = *(0x12634);
0x00012600 bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4)
0x00012604 mov r0, r4 | r0 = r4;
0x00012608 ldr r5, [r5] | r5 = *(0x12634);
0x0001260c bl 0x10a4c | strerror (r0);
0x00012610 str r4, [sp] | *(sp) = r4;
0x00012614 ldr r3, [pc, 0x28] | r3 = "_s:_error_:__s_ioctl_failed_for_eraseblock__d__mtd_d_";
0x00012618 mov r2, 8 | r2 = 8;
0x0001261c ldr r1, [pc, 0x24] | r1 = *(0x12644);
0x00012620 str r0, [sp, 4] | var_4h = r0;
0x00012624 mov r0, r5 | r0 = r5;
0x00012628 bl 0x10ae8 | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_eraseblock__d__mtd_d_", r4)
0x0001262c mvn r0, 0 | r0 = ~0;
0x00012630 add sp, sp, 8 |
0x00012634 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/nanddump @ 0x1264c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.0001264c () | void fcn_0001264c (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;
0x0001264c push {r4, r5, r6, r7, r8, fp, lr} |
0x00012650 add fp, sp, 0x18 |
0x00012654 sub sp, sp, 0x44 |
0x00012658 ldr r7, [r0] | r7 = *(r0);
0x0001265c mov r8, r1 | r8 = r1;
0x00012660 mov r0, r7 | r0 = r7;
0x00012664 mov r6, r3 | r6 = r3;
0x00012668 mov r5, r2 | r5 = r2;
0x0001266c bl 0x10bb4 | strlen (r0);
0x00012670 mov r2, r8 | r2 = r8;
0x00012674 mov r1, r7 | r1 = r7;
0x00012678 add r0, r0, 0x39 | r0 += 0x39;
0x0001267c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012680 sub sp, sp, r0 |
0x00012684 add r4, sp, 8 | r4 += var_8h;
0x00012688 mov r0, r4 | r0 = r4;
0x0001268c bl 0x10b84 | sprintf (r0, r1, r2);
0x00012690 mov r2, 0x32 | r2 = 0x32;
0x00012694 sub r1, fp, 0x50 | r1 -= var_50h;
0x00012698 mov r0, r4 | r0 = r4;
0x0001269c bl 0x11e74 | r0 = fcn_00011e74 (r0, r1);
0x000126a0 cmp r0, 0 |
| if (r0 < 0) {
0x000126a4 blt 0x126ec | goto label_1;
| }
0x000126a8 mov r3, r6 | r3 = r6;
0x000126ac mov r2, r5 | r2 = r5;
0x000126b0 ldr r1, [pc, 0x8c] | r1 = *(0x12740);
0x000126b4 sub r0, fp, 0x50 | r0 -= var_50h;
0x000126b8 bl 0x10b30 | r0 = sscanf (r0, r1, r2);
0x000126bc cmp r0, 2 |
| if (r0 == 2) {
0x000126c0 beq 0x126f4 | goto label_2;
| }
0x000126c4 bl 0x10b9c | errno_location ();
0x000126c8 mov r3, 0x16 | r3 = 0x16;
0x000126cc ldr r2, [pc, 0x74] | r2 = "%d:%d\n";
0x000126d0 ldr r1, [pc, 0x74] | r1 = "libmtd";
0x000126d4 str r3, [r0] | *(r0) = r3;
0x000126d8 ldr r0, [pc, 0x70] |
0x000126dc mov r3, r4 | r3 = r4;
0x000126e0 ldr r0, [r0] | r0 = "_s:_error_:___s__does_not_have_major:minor_format";
0x000126e4 bl 0x10ae8 | fprintf ("_s:_error_:___s__does_not_have_major:minor_format", "libmtd", "%d:%d\n", r3)
| label_0:
0x000126e8 mvn r0, 0 | r0 = ~0;
| do {
| label_1:
0x000126ec sub sp, fp, 0x18 |
0x000126f0 pop {r4, r5, r6, r7, r8, fp, pc} |
| label_2:
0x000126f4 ldr r3, [r5] | r3 = *(r5);
0x000126f8 cmp r3, 0 |
| if (r3 < 0) {
0x000126fc blt 0x12710 | goto label_3;
| }
0x00012700 ldr r3, [r6] | r3 = *(r6);
0x00012704 cmp r3, 0 |
| if (r3 < 0) {
0x00012708 movge r0, 0 | r0 = 0;
| }
0x0001270c bge 0x126ec |
| } while (r3 >= 0);
| label_3:
0x00012710 bl 0x10b9c | errno_location ();
0x00012714 mov r3, 0x16 | r3 = 0x16;
0x00012718 ldr r2, [pc, 0x28] | r2 = "%d:%d\n";
0x0001271c ldr r1, [pc, 0x30] | r1 = stderr;
0x00012720 str r3, [r0] | *(r0) = r3;
0x00012724 ldr r0, [pc, 0x24] |
0x00012728 ldr r3, [r6] | r3 = *(r6);
0x0001272c str r4, [sp, 4] | var_4h = r4;
0x00012730 str r3, [sp] | *(sp) = r3;
0x00012734 ldr r3, [r5] | r3 = *(r5);
0x00012738 ldr r0, [r0] | r0 = "_s:_error_:___s__does_not_have_major:minor_format";
0x0001273c bl 0x10ae8 | fprintf ("_s:_error_:___s__does_not_have_major:minor_format", r1, "%d:%d\n", r3, r4)
0x00012740 b 0x126e8 | 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/nanddump @ 0x12a98 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012a98 () | void fcn_00012a98 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
0x00012a98 push {r0, r1, r2, r4, r5, lr} |
0x00012a9c mov r1, 0x38 | r1 = 0x38;
0x00012aa0 mov r0, 1 | r0 = 1;
0x00012aa4 bl 0x10ad0 | r0 = calloc (r0, r1);
0x00012aa8 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00012aac bne 0x12afc |
0x00012ab0 bl 0x10b9c | errno_location ();
0x00012ab4 ldr r5, [pc, 0x1ec] |
0x00012ab8 ldr r2, [pc, 0x1ec] | r2 = stderr;
0x00012abc ldr r1, [pc, 0x1ec] | r1 = "libmtd";
0x00012ac0 ldr r4, [r0] | r4 = *(r0);
0x00012ac4 ldr r0, [r5] | r0 = *(0x12ca4);
0x00012ac8 bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x00012acc mov r0, r4 | r0 = r4;
0x00012ad0 ldr r5, [r5] | r5 = *(0x12ca4);
0x00012ad4 bl 0x10a4c | strerror (r0);
0x00012ad8 str r4, [sp] | *(sp) = r4;
0x00012adc ldr r3, [pc, 0x1d0] | r3 = "%s: error!: out of memory\n";
0x00012ae0 mov r2, 8 | r2 = 8;
0x00012ae4 ldr r1, [pc, 0x1cc] | r1 = *(0x12cb4);
0x00012ae8 str r0, [sp, 4] | var_4h = r0;
0x00012aec mov r0, r5 | r0 = r5;
0x00012af0 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x00012af4 mvn r0, 0 | r0 = ~0;
0x00012af8 bl 0x10ba8 | exit (r0);
| }
0x00012afc ldrb r3, [r4, 0x34] | r3 = *((r4 + 0x34));
0x00012b00 ldr r1, [pc, 0x1b4] | r1 = "_serror__d___s_";
0x00012b04 bic r3, r3, 6 | r3 = BIT_MASK (r3, 6);
0x00012b08 strb r3, [r4, 0x34] | *((r4 + 0x34)) = r3;
0x00012b0c ldr r0, [pc, 0x1ac] | r0 = "class_mtd";
0x00012b10 bl 0x129a8 | r0 = fcn_000129a8 ("class_mtd", r1);
0x00012b14 cmp r0, 0 |
0x00012b18 str r0, [r4] | *(r4) = r0;
| if (r0 == 0) {
0x00012b1c beq 0x12c9c | goto label_1;
| }
0x00012b20 ldr r1, [pc, 0x19c] | r1 = "_sys";
0x00012b24 bl 0x129a8 | r0 = fcn_000129a8 (r0, "_sys");
0x00012b28 cmp r0, 0 |
0x00012b2c str r0, [r4, 4] | *((r4 + 4)) = r0;
| if (r0 == 0) {
0x00012b30 beq 0x12c9c | goto label_1;
| }
0x00012b34 ldr r1, [pc, 0x18c] | r1 = "mtd_d";
0x00012b38 bl 0x129a8 | r0 = fcn_000129a8 (r0, "mtd_d");
0x00012b3c cmp r0, 0 |
0x00012b40 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| if (r0 == 0) {
0x00012b44 beq 0x12c9c | goto label_1;
| }
0x00012b48 mov r0, r4 | r0 = r4;
0x00012b4c bl 0x11c74 | r0 = fcn_00011c74 (r0);
0x00012b50 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00012b54 bne 0x12ba0 | goto label_2;
| }
0x00012b58 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012b5c bl 0x10c08 | free (r0);
0x00012b60 ldr r0, [r4] | r0 = *(r4);
0x00012b64 bl 0x10c08 | free (r0);
0x00012b68 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00012b6c bl 0x10c08 | free (r0);
0x00012b70 str r5, [r4] | *(r4) = r5;
0x00012b74 str r5, [r4, 4] | *((r4 + 4)) = r5;
0x00012b78 str r5, [r4, 0xc] | *((r4 + 0xc)) = r5;
0x00012b7c bl 0x14530 | r0 = fcn_00014530 ();
0x00012b80 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00012b84 bne 0x12b94 | goto label_3;
| }
0x00012b88 mov r0, r4 | r0 = r4;
0x00012b8c bl 0x10c08 | free (r0);
| label_0:
0x00012b90 mov r4, 0 | r4 = 0;
| do {
| label_3:
0x00012b94 mov r0, r4 | r0 = r4;
0x00012b98 add sp, sp, 0xc |
0x00012b9c pop {r4, r5, pc} |
| label_2:
0x00012ba0 ldr r1, [pc, 0x124] | r1 = "name";
0x00012ba4 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012ba8 bl 0x129a8 | r0 = fcn_000129a8 (r0, "name");
0x00012bac cmp r0, 0 |
0x00012bb0 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r0 == 0) {
0x00012bb4 beq 0x12c9c | goto label_1;
| }
0x00012bb8 ldr r1, [pc, 0x110] | r1 = "dev";
0x00012bbc ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012bc0 bl 0x129a8 | r0 = fcn_000129a8 (r0, "dev");
0x00012bc4 cmp r0, 0 |
0x00012bc8 str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
| if (r0 == 0) {
0x00012bcc beq 0x12c9c | goto label_1;
| }
0x00012bd0 ldr r1, [pc, 0xfc] | r1 = "type";
0x00012bd4 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012bd8 bl 0x129a8 | r0 = fcn_000129a8 (r0, "type");
0x00012bdc cmp r0, 0 |
0x00012be0 str r0, [r4, 0x14] | *((r4 + 0x14)) = r0;
| if (r0 == 0) {
0x00012be4 beq 0x12c9c | goto label_1;
| }
0x00012be8 ldr r1, [pc, 0xe8] | r1 = "erasesize";
0x00012bec ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012bf0 bl 0x129a8 | r0 = fcn_000129a8 (r0, "erasesize");
0x00012bf4 cmp r0, 0 |
0x00012bf8 str r0, [r4, 0x18] | *((r4 + 0x18)) = r0;
| if (r0 == 0) {
0x00012bfc beq 0x12c9c | goto label_1;
| }
0x00012c00 ldr r1, [pc, 0xd4] | r1 = "size";
0x00012c04 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012c08 bl 0x129a8 | r0 = fcn_000129a8 (r0, "size");
0x00012c0c cmp r0, 0 |
0x00012c10 str r0, [r4, 0x1c] | *((r4 + 0x1c)) = r0;
| if (r0 == 0) {
0x00012c14 beq 0x12c9c | goto label_1;
| }
0x00012c18 ldr r1, [pc, 0xc0] | r1 = "writesize";
0x00012c1c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012c20 bl 0x129a8 | r0 = fcn_000129a8 (r0, "writesize");
0x00012c24 cmp r0, 0 |
0x00012c28 str r0, [r4, 0x20] | *((r4 + 0x20)) = r0;
| if (r0 == 0) {
0x00012c2c beq 0x12c9c | goto label_1;
| }
0x00012c30 ldr r1, [pc, 0xac] | r1 = "subpagesize";
0x00012c34 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012c38 bl 0x129a8 | r0 = fcn_000129a8 (r0, "subpagesize");
0x00012c3c cmp r0, 0 |
0x00012c40 str r0, [r4, 0x24] | *((r4 + 0x24)) = r0;
| if (r0 == 0) {
0x00012c44 beq 0x12c9c | goto label_1;
| }
0x00012c48 ldr r1, [pc, 0x98] | r1 = "oobsize";
0x00012c4c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012c50 bl 0x129a8 | r0 = fcn_000129a8 (r0, "oobsize");
0x00012c54 cmp r0, 0 |
0x00012c58 str r0, [r4, 0x28] | *((r4 + 0x28)) = r0;
| if (r0 == 0) {
0x00012c5c beq 0x12c9c | goto label_1;
| }
0x00012c60 ldr r1, [pc, 0x84] | r1 = "oobavail";
0x00012c64 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012c68 bl 0x129a8 | r0 = fcn_000129a8 (r0, "oobavail");
0x00012c6c cmp r0, 0 |
0x00012c70 str r0, [r4, 0x2c] | *((r4 + 0x2c)) = r0;
| if (r0 == 0) {
0x00012c74 beq 0x12c9c | goto label_1;
| }
0x00012c78 ldr r1, [pc, 0x70] | r1 = "numeraseregions";
0x00012c7c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00012c80 bl 0x129a8 | r0 = fcn_000129a8 (r0, "numeraseregions");
0x00012c84 cmp r0, 0 |
| if (r0 == 0) {
0x00012c88 ldrbne r3, [r4, 0x34] | r3 = *((r4 + 0x34));
| }
0x00012c8c str r0, [r4, 0x30] | *((r4 + 0x30)) = r0;
| if (r0 == 0) {
0x00012c90 orrne r3, r3, 1 | r3 |= 1;
| }
| if (r0 == 0) {
0x00012c94 strbne r3, [r4, 0x34] | *((r4 + 0x34)) = r3;
| }
0x00012c98 bne 0x12b94 |
| } while (r0 != 0);
| label_1:
0x00012c9c mov r0, r4 | r0 = r4;
0x00012ca0 bl 0x12a1c | fcn_00012a1c (r0);
0x00012ca4 b 0x12b90 | 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/nanddump @ 0x12d74 */
| #include <stdint.h>
|
; (fcn) fcn.00012d74 () | void fcn_00012d74 (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:
0x000127c4 ldrb r3, [r1, 0xc] | r3 = *((r1 + 0xc));
0x000127c8 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x000127cc orr r3, r3, 1 | r3 |= 1;
0x000127d0 sub sp, sp, 0x110 |
0x000127d4 strb r3, [r1, 0xc] | *((r1 + 0xc)) = r3;
0x000127d8 mov r5, r0 | r5 = r0;
0x000127dc ldr r0, [r0] | r0 = *(r0);
0x000127e0 mov r4, r1 | r4 = r1;
0x000127e4 bl 0x10b6c | r0 = opendir ();
0x000127e8 mov r8, r0 | r8 = r0;
0x000127ec bl 0x10b9c | errno_location ();
0x000127f0 cmp r8, 0 |
0x000127f4 mov r6, r0 | r6 = r0;
| if (r8 != 0) {
0x000127f8 bne 0x12848 | goto label_4;
| }
0x000127fc ldr r4, [r0] | r4 = *(r0);
0x00012800 ldr r6, [pc, 0x17c] | r6 = *(0x12980);
0x00012804 ldr r3, [r5] | r3 = *(r5);
0x00012808 ldr r2, [pc, 0x178] | r2 = stderr;
0x0001280c ldr r1, [pc, 0x178] | r1 = "libmtd";
| label_2:
0x00012810 ldr r0, [r6] | r0 = *(r6);
0x00012814 bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00012818 mov r0, r4 | r0 = r4;
0x0001281c ldr r5, [r6] | r5 = *(r6);
0x00012820 bl 0x10a4c | strerror (r0);
0x00012824 str r4, [sp] | *(sp) = r4;
0x00012828 ldr r3, [pc, 0x160] | r3 = "%s: error!: cannot open \"%s\"\n";
0x0001282c mov r2, 8 | r2 = 8;
0x00012830 ldr r1, [pc, 0x15c] | r1 = *(0x12990);
0x00012834 str r0, [sp, 4] | var_4h = r0;
0x00012838 mov r0, r5 | r0 = r5;
0x0001283c bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| do {
0x00012840 mvn r0, 0 | r0 = ~0;
0x00012844 b 0x1297c | goto label_5;
| label_4:
0x00012848 ldr sl, [pc, 0x148] | sl = "mtd_d_s";
0x0001284c mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00012850 mov sb, 0 | sb = 0;
0x00012854 str r3, [r4, 4] | *((r4 + 4)) = r3;
| label_0:
0x00012858 str sb, [r6] | *(r6) = sb;
0x0001285c mov r0, r8 | r0 = r8;
0x00012860 bl 0x10b18 | r0 = readdir64 ();
0x00012864 cmp r0, 0 |
| if (r0 == 0) {
0x00012868 beq 0x128f8 | goto label_6;
| }
0x0001286c add r7, r0, 0x13 | r7 = r0 + 0x13;
0x00012870 mov r0, r7 | r0 = r7;
0x00012874 bl 0x10bb4 | r0 = strlen (r0);
0x00012878 cmp r0, 0xfe |
| if (r0 < 0xfe) {
0x0001287c bls 0x128b0 | goto label_7;
| }
0x00012880 ldr r0, [pc, 0xfc] |
0x00012884 str r7, [sp] | *(sp) = r7;
0x00012888 ldr r2, [pc, 0xf8] | r2 = stderr;
0x0001288c ldr r3, [r5] | r3 = *(r5);
0x00012890 ldr r1, [pc, 0x104] | r1 = "mtd_d_s";
0x00012894 ldr r0, [r0] | r0 = *(0x12980);
0x00012898 bl 0x10ae8 | fprintf (r0, "mtd_d_s", r2, r3)
0x0001289c mov r3, 0x16 | r3 = 0x16;
0x000128a0 str r3, [r6] | *(r6) = r3;
| label_1:
0x000128a4 mov r0, r8 | r0 = r8;
0x000128a8 bl 0x10bd8 | closedir ();
0x000128ac b 0x12840 |
| } while (1);
| label_7:
0x000128b0 add r3, sp, 0x10 | r3 += var_10h;
0x000128b4 add r2, sp, 0xc | r2 += var_ch;
0x000128b8 mov r1, sl | r1 = sl;
0x000128bc mov r0, r7 | r0 = r7;
0x000128c0 bl 0x10b30 | r0 = sscanf (r0, r1, r2);
0x000128c4 cmp r0, 1 |
| if (r0 != 1) {
0x000128c8 bne 0x12858 | goto label_0;
| }
0x000128cc ldr r3, [r4] | r3 = *(r4);
0x000128d0 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x000128d4 add r3, r3, 1 | r3++;
0x000128d8 str r3, [r4] | *(r4) = r3;
0x000128dc ldr r3, [sp, 0xc] | r3 = var_ch;
0x000128e0 cmp r2, r3 |
0x000128e4 ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r2 >= r3) {
0x000128e8 strlt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x000128ec cmp r3, r2 |
| if (r3 >= r2) {
0x000128f0 strlt r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x000128f4 b 0x12858 | goto label_0;
| label_6:
0x000128f8 ldr r7, [r6] | r7 = *(r6);
0x000128fc cmp r7, 0 |
| if (r7 != 0) {
0x00012900 beq 0x12948 |
0x00012904 ldr r4, [pc, 0x78] |
0x00012908 ldr r3, [r5] | r3 = *(r5);
0x0001290c ldr r2, [pc, 0x74] | r2 = stderr;
0x00012910 ldr r1, [pc, 0x88] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x00012914 ldr r0, [r4] | r0 = *(0x12980);
0x00012918 bl 0x10ae8 | fprintf (r0, "%s: error!: invalid entry in %s: \"%s\"\n", r2, r3, r4)
0x0001291c mov r0, r7 | r0 = r7;
0x00012920 ldr r4, [r4] | r4 = *(0x12980);
0x00012924 bl 0x10a4c | strerror (r0);
0x00012928 str r7, [sp] | *(sp) = r7;
0x0001292c ldr r3, [pc, 0x5c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00012930 mov r2, 8 | r2 = 8;
0x00012934 ldr r1, [pc, 0x58] | r1 = *(0x12990);
0x00012938 str r0, [sp, 4] | var_4h = r0;
0x0001293c mov r0, r4 | r0 = r4;
0x00012940 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n")
0x00012944 b 0x128a4 | goto label_1;
| }
0x00012948 mov r0, r8 | r0 = r8;
0x0001294c bl 0x10bd8 | r0 = closedir ();
0x00012950 cmp r0, 0 |
| if (r0 != 0) {
0x00012954 beq 0x12970 |
0x00012958 ldr r4, [r6] | r4 = *(r6);
0x0001295c ldr r3, [r5] | r3 = *(r5);
0x00012960 ldr r6, [pc, 0x1c] | r6 = *(0x12980);
0x00012964 ldr r2, [pc, 0x1c] | r2 = stderr;
0x00012968 ldr r1, [pc, 0x34] | r1 = "%s: error!: readdir failed on \"%s\"\n";
0x0001296c b 0x12810 | goto label_2;
| }
0x00012970 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00012974 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00012978 streq r0, [r4, 4] | *((r4 + 4)) = r0;
| }
| label_5:
0x0001297c add sp, sp, 0x110 |
0x00012980 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
0x00012d74 mov r3, r1 | r3 = r1;
0x00012d78 push {r4, lr} |
0x00012d7c mov r2, 0x10 | r2 = 0x10;
0x00012d80 mov r4, r0 | r4 = r0;
0x00012d84 mov r1, 0 | r1 = 0;
0x00012d88 mov r0, r3 | r0 = r3;
0x00012d8c bl 0x10b54 | memset (r0, r1, r2);
0x00012d90 ldrb r2, [r4, 0x34] | r2 = *((r4 + 0x34));
0x00012d94 tst r2, 1 |
| if ((r2 & 1) == 0) {
0x00012d98 bne 0x12da4 |
0x00012d9c pop {r4, lr} |
0x00012da0 b 0x14618 |
| } else {
0x00012da4 mov r1, r0 | r1 = r0;
0x00012da8 mov r0, r4 | r0 = r4;
0x00012dac pop {r4, lr} |
0x00012db0 b 0x127c4 | goto label_3;
| }
0x00014618 push {r4, lr} |
0x0001461c sub sp, sp, 0xa0 |
0x00014620 mov r4, r0 | r4 = r0;
0x00014624 mov r0, sp | r0 = sp;
0x00014628 bl 0x143a8 | r0 = fcn_000143a8 (r0);
0x0001462c cmp r0, 0 |
| if (r0 != 0) {
0x00014630 mvneq r3, 0x80000000 | r3 = ~0x80000000;
| }
| if (r0 == 0) {
0x00014634 beq 0x14668 | goto label_8;
| }
0x00014638 mvn r0, 0 | r0 = ~0;
0x0001463c b 0x1467c | goto label_9;
| do {
0x00014640 ldr r3, [r4] | r3 = *(r4);
0x00014644 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00014648 add r3, r3, 1 | r3++;
0x0001464c str r3, [r4] | *(r4) = r3;
0x00014650 ldr r3, [sp] | r3 = *(sp);
0x00014654 cmp r3, r2 |
0x00014658 ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r3 <= r2) {
0x0001465c strgt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x00014660 cmp r3, r2 |
| if (r3 < r2) {
0x00014664 bge 0x1466c |
| label_8:
0x00014668 str r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x0001466c mov r0, sp | r0 = sp;
0x00014670 bl 0x14244 | r0 = fcn_00014244 (r0);
0x00014674 cmp r0, 0 |
0x00014678 bne 0x14640 |
| } while (r0 != 0);
| label_9:
0x0001467c add sp, sp, 0xa0 |
0x00014680 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/nanddump @ 0x12db4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012db4 () | void fcn_00012db4 (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;
0x00012db4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012db8 add r6, r2, 4 | r6 = r2 + 4;
0x00012dbc add fp, sp, 0x20 |
0x00012dc0 sub sp, sp, 0x5c |
0x00012dc4 mov r5, r1 | r5 = r1;
0x00012dc8 mov r7, r0 | r7 = r0;
0x00012dcc mov r4, r2 | r4 = r2;
0x00012dd0 mov r1, 0 | r1 = 0;
0x00012dd4 mov r2, 0xfc | r2 = 0xfc;
0x00012dd8 mov r0, r6 | r0 = r6;
0x00012ddc bl 0x10b54 | memset (r0, r1, r2);
0x00012de0 str r5, [r4] | *(r4) = r5;
0x00012de4 mov r1, r5 | r1 = r5;
0x00012de8 mov r0, r7 | r0 = r7;
0x00012dec bl 0x12cf4 | r0 = fcn_00012cf4 (r0, r1);
0x00012df0 cmp r0, 0 |
| if (r0 != 0) {
0x00012df4 bne 0x12e0c | goto label_4;
| }
0x00012df8 bl 0x10b9c | errno_location ();
0x00012dfc mov r3, 0x13 | r3 = 0x13;
0x00012e00 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x00012e04 mvn r5, 0 | r5 = ~0;
0x00012e08 b 0x12e28 | goto label_1;
| label_4:
0x00012e0c ldrb r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x00012e10 tst r3, 1 |
| if ((r3 & 1) == 0) {
0x00012e14 bne 0x12e34 |
0x00012e18 mov r0, r5 | r0 = r5;
0x00012e1c mov r1, r4 | r1 = r4;
0x00012e20 bl 0x14d3c | r0 = fcn_00014d3c (r0, r1);
0x00012e24 mov r5, r0 | r5 = r0;
| label_1:
0x00012e28 mov r0, r5 | r0 = r5;
0x00012e2c sub sp, fp, 0x20 |
0x00012e30 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x00012e34 add r3, r4, 8 | r3 = r4 + 8;
0x00012e38 mov r2, r6 | r2 = r6;
0x00012e3c mov r1, r5 | r1 = r5;
0x00012e40 add r0, r7, 8 | r0 = r7 + 8;
0x00012e44 bl 0x1264c | r0 = fcn_0001264c (r0, r1);
0x00012e48 subs sl, r0, 0 | sl = r0 - 0;
0x00012e4c bne 0x12e04 |
| } while (sl != r0);
0x00012e50 ldr r8, [r7, 0xc] | r8 = *((r7 + 0xc));
0x00012e54 mov sb, sp | sb = sp;
0x00012e58 mov r0, r8 | r0 = r8;
0x00012e5c bl 0x10bb4 | strlen (r0);
0x00012e60 mov r2, r5 | r2 = r5;
0x00012e64 mov r1, r8 | r1 = r8;
0x00012e68 add r6, r4, 0x51 | r6 = r4 + 0x51;
0x00012e6c add r0, r0, 0x6b | r0 += 0x6b;
0x00012e70 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012e74 sub sp, sp, r0 |
0x00012e78 add r3, sp, 0x10 | r3 += s;
0x00012e7c mov r0, r3 | r0 = r3;
0x00012e80 str r3, [fp, -0x68] | var_68h = r3;
0x00012e84 bl 0x10b84 | sprintf (r0, r1, r2);
0x00012e88 ldr r3, [fp, -0x68] | r3 = var_68h;
0x00012e8c mov r2, 0x80 | r2 = 0x80;
0x00012e90 mov r1, r6 | r1 = r6;
0x00012e94 mov r0, r3 | r0 = r3;
0x00012e98 bl 0x11e74 | fcn_00011e74 (r0, r1);
0x00012e9c mov sp, sb |
0x00012ea0 cmp r0, 0 |
| if (r0 < 0) {
0x00012ea4 blt 0x12e04 | goto label_0;
| }
0x00012ea8 add r6, r6, r0 | r6 += r0;
0x00012eac strb sl, [r6, -1] | *((r6 - 1)) = sl;
0x00012eb0 ldr r6, [r7, 0x10] | r6 = *((r7 + 0x10));
0x00012eb4 add r8, r4, 0x10 | r8 = r4 + 0x10;
0x00012eb8 mov r0, r6 | r0 = r6;
0x00012ebc bl 0x10bb4 | strlen (r0);
0x00012ec0 mov r2, r5 | r2 = r5;
0x00012ec4 mov r1, r6 | r1 = r6;
0x00012ec8 add r0, r0, 0x6b | r0 += 0x6b;
0x00012ecc bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012ed0 sub sp, sp, r0 |
0x00012ed4 add r3, sp, 0x10 | r3 += s;
0x00012ed8 mov r0, r3 | r0 = r3;
0x00012edc str r3, [fp, -0x68] | var_68h = r3;
0x00012ee0 bl 0x10b84 | sprintf (r0, r1, r2);
0x00012ee4 ldr r3, [fp, -0x68] | r3 = var_68h;
0x00012ee8 mov r2, 0x41 | r2 = 0x41;
0x00012eec mov r1, r8 | r1 = r8;
0x00012ef0 mov r0, r3 | r0 = r3;
0x00012ef4 bl 0x11e74 | fcn_00011e74 (r0, r1);
0x00012ef8 mov sp, sb |
0x00012efc cmp r0, 0 |
| if (r0 < 0) {
0x00012f00 blt 0x12e04 | goto label_0;
| }
0x00012f04 add r0, r8, r0 | r0 = r8 + r0;
0x00012f08 strb sl, [r0, -1] | *((r0 - 1)) = sl;
0x00012f0c add r2, r4, 0xe4 | r2 = r4 + 0xe4;
0x00012f10 mov r1, r5 | r1 = r5;
0x00012f14 ldr r0, [r7, 0x14] | r0 = *((r7 + 0x14));
0x00012f18 bl 0x121bc | r0 = fcn_000121bc (r0, r1);
0x00012f1c cmp r0, 0 |
| if (r0 != 0) {
0x00012f20 bne 0x12e04 | goto label_0;
| }
0x00012f24 ldr sl, [r7, 0x18] | sl = *((r7 + 0x18));
0x00012f28 mov r0, sl | r0 = sl;
0x00012f2c bl 0x10bb4 | strlen (r0);
0x00012f30 mov r2, r5 | r2 = r5;
0x00012f34 mov r1, sl | r1 = sl;
0x00012f38 add r0, r0, 0x39 | r0 += 0x39;
0x00012f3c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012f40 sub sp, sp, r0 |
0x00012f44 add r6, sp, 0x10 | r6 += s;
0x00012f48 mov r0, r6 | r0 = r6;
0x00012f4c bl 0x10b84 | sprintf (r0, r1, r2);
0x00012f50 add r1, r4, 0xd8 | r1 = r4 + 0xd8;
0x00012f54 mov r0, r6 | r0 = r6;
0x00012f58 bl 0x12008 | fcn_00012008 (r0, r1);
0x00012f5c mov sp, sb |
0x00012f60 cmp r0, 0 |
| if (r0 != 0) {
0x00012f64 bne 0x12e04 | goto label_0;
| }
0x00012f68 add r2, r4, 0xe8 | r2 = r4 + 0xe8;
0x00012f6c mov r1, r5 | r1 = r5;
0x00012f70 ldr r0, [r7, 0x1c] | r0 = *((r7 + 0x1c));
0x00012f74 bl 0x121bc | r0 = fcn_000121bc (r0, r1);
0x00012f78 cmp r0, 0 |
| if (r0 != 0) {
0x00012f7c bne 0x12e04 | goto label_0;
| }
0x00012f80 add r2, r4, 0xec | r2 = r4 + 0xec;
0x00012f84 mov r1, r5 | r1 = r5;
0x00012f88 ldr r0, [r7, 0x20] | r0 = *((r7 + 0x20));
0x00012f8c bl 0x121bc | r0 = fcn_000121bc (r0, r1);
0x00012f90 cmp r0, 0 |
| if (r0 != 0) {
0x00012f94 bne 0x12e04 | goto label_0;
| }
0x00012f98 add r2, r4, 0xf0 | r2 = r4 + 0xf0;
0x00012f9c mov r1, r5 | r1 = r5;
0x00012fa0 ldr r0, [r7, 0x24] | r0 = *((r7 + 0x24));
0x00012fa4 bl 0x121bc | r0 = fcn_000121bc (r0, r1);
0x00012fa8 cmp r0, 0 |
| if (r0 != 0) {
0x00012fac bne 0x12e04 | goto label_0;
| }
0x00012fb0 add r2, r4, 0xf4 | r2 = r4 + 0xf4;
0x00012fb4 mov r1, r5 | r1 = r5;
0x00012fb8 ldr r0, [r7, 0x28] | r0 = *((r7 + 0x28));
0x00012fbc bl 0x121bc | r0 = fcn_000121bc (r0, r1);
0x00012fc0 cmp r0, 0 |
| if (r0 != 0) {
0x00012fc4 beq 0x12fe0 |
0x00012fc8 mov r0, r5 | r0 = r5;
0x00012fcc bl 0x14824 | r0 = fcn_00014824 (r0);
0x00012fd0 cmp r0, 0 |
| if (r0 >= 0) {
0x00012fd4 movlt r3, 0 | r3 = 0;
| }
| if (r0 < 0) {
0x00012fd8 strge r0, [r4, 0xf4] | *((r4 + 0xf4)) = r0;
| }
| if (r0 < 0) {
0x00012fdc strlt r3, [r4, 0xf4] | *((r4 + 0xf4)) = r3;
| goto label_5;
| }
| }
| label_5:
0x00012fe0 add r2, r4, 0xf8 | r2 = r4 + 0xf8;
0x00012fe4 mov r1, r5 | r1 = r5;
0x00012fe8 ldr r0, [r7, 0x2c] | r0 = *((r7 + 0x2c));
0x00012fec bl 0x121bc | r0 = fcn_000121bc (r0, r1);
0x00012ff0 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 != r0) {
0x00012ff4 bne 0x12e04 | goto label_0;
| }
0x00012ff8 ldr r7, [r7, 0x30] | r7 = *((r7 + 0x30));
0x00012ffc mov sl, sp | sl = sp;
0x00013000 mov r0, r7 | r0 = r7;
0x00013004 bl 0x10bb4 | strlen (r0);
0x00013008 mov r2, r5 | r2 = r5;
0x0001300c mov r1, r7 | r1 = r7;
0x00013010 add r0, r0, 0x39 | r0 += 0x39;
0x00013014 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013018 sub sp, sp, r0 |
0x0001301c add sb, sp, 0x10 | sb += s;
0x00013020 mov r0, sb | r0 = sb;
0x00013024 bl 0x10b84 | sprintf (r0, r1, r2);
0x00013028 mov r1, 0x80000 | r1 = 0x80000;
0x0001302c mov r0, sb | r0 = sb;
0x00013030 bl 0x10b60 | r0 = open64 ();
0x00013034 cmn r0, 1 |
0x00013038 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x0001303c bne 0x13048 |
0x00013040 mov sp, sl |
0x00013044 b 0x12e28 | goto label_1;
| }
0x00013048 mov r2, 0x32 | r2 = 0x32;
0x0001304c sub r1, fp, 0x58 | r1 -= buf;
0x00013050 bl 0x10b0c | r0 = read (r0, r1, r2);
0x00013054 cmn r0, 1 |
| if (r0 != 1) {
0x00013058 bne 0x130b0 | goto label_6;
| }
0x0001305c bl 0x10b9c | errno_location ();
0x00013060 ldr r6, [pc, 0x294] |
0x00013064 mov r3, sb | r3 = sb;
0x00013068 ldr r2, [pc, 0x290] | r2 = stderr;
0x0001306c ldr r1, [pc, 0x290] | r1 = "libmtd";
0x00013070 ldr r4, [r0] | r4 = *(r0);
0x00013074 ldr r0, [r6] | r0 = *(0x132f8);
0x00013078 bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x0001307c mov r0, r4 | r0 = r4;
0x00013080 ldr r6, [r6] | r6 = *(0x132f8);
0x00013084 bl 0x10a4c | strerror (r0);
0x00013088 str r4, [sp] | *(sp) = r4;
0x0001308c ldr r3, [pc, 0x274] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00013090 mov r2, 8 | r2 = 8;
0x00013094 ldr r1, [pc, 0x270] | r1 = *(0x13308);
0x00013098 str r0, [sp, 4] | var_4h = r0;
0x0001309c mov r0, r6 | r0 = r6;
0x000130a0 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| do {
0x000130a4 mov r0, r5 | r0 = r5;
0x000130a8 bl 0x10bf0 | close (r0);
0x000130ac b 0x13198 | goto label_7;
| label_6:
0x000130b0 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x000130b4 bne 0x130e0 | goto label_8;
| }
0x000130b8 ldr r2, [pc, 0x240] | r2 = stderr;
0x000130bc ldr r1, [pc, 0x24c] | r1 = "_serror__d___s_";
0x000130c0 mov r3, sb | r3 = sb;
| label_2:
0x000130c4 ldr r0, [pc, 0x230] |
0x000130c8 ldr r0, [r0] | r0 = *(0x132f8);
0x000130cc bl 0x10ae8 | r0 = fprintf (r0, "_serror__d___s_", r2, r3)
| label_3:
0x000130d0 bl 0x10b9c | errno_location ();
0x000130d4 mov r3, 0x16 | r3 = 0x16;
0x000130d8 str r3, [r0] | *(r0) = r3;
0x000130dc b 0x130a4 |
| } while (1);
| label_8:
0x000130e0 sub r3, fp, 0x24 | r3 -= var_24h;
0x000130e4 add r0, r3, r0 | r0 = r3 + r0;
0x000130e8 strb r6, [r0, -0x34] | *((r0 - 0x34)) = r6;
0x000130ec sub r2, fp, 0x64 | r2 -= var_64h;
0x000130f0 ldr r1, [pc, 0x21c] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x000130f4 sub r0, fp, 0x58 | r0 -= buf;
0x000130f8 bl 0x10b30 | r0 = sscanf (r0, "%s: error!: contents of \"%s\" is too long\n", r2);
0x000130fc cmp r0, 1 |
| if (r0 == 1) {
0x00013100 movne r3, sb | r3 = sb;
| }
| if (r0 == 1) {
0x00013104 ldrne r2, [pc, 0x1f4] | r2 = "libmtd";
| }
| if (r0 != 1) {
0x00013108 ldrne r1, [pc, 0x208] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
| goto label_9;
| }
| if (r0 != 1) {
| label_9:
0x0001310c bne 0x130c4 | goto label_2;
| }
0x00013110 ldrd r2, r3, [fp, -0x64] | __asm ("ldrd r2, r3, [var_64h]");
0x00013114 cmp r2, 0 |
0x00013118 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x0001311c bge 0x13140 |
0x00013120 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00013124 ldr r3, [pc, 0x1d0] | r3 = *(0x132f8);
0x00013128 str sb, [sp, 8] | var_8h = sb;
0x0001312c ldr r2, [pc, 0x1cc] | r2 = stderr;
0x00013130 ldr r1, [pc, 0x1e4] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
0x00013134 ldr r0, [r3] | r0 = *(0x132f8);
0x00013138 bl 0x10ae8 | fprintf (r0, "_s:_error_:_cannot_read_integer_from___s_", r2, r3)
0x0001313c b 0x130d0 | goto label_3;
| }
0x00013140 mov r0, r5 | r0 = r5;
0x00013144 bl 0x10bf0 | r0 = close (r0);
0x00013148 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 == r0) {
0x0001314c beq 0x131a0 | goto label_10;
| }
0x00013150 bl 0x10b9c | errno_location ();
0x00013154 ldr r5, [pc, 0x1a0] |
0x00013158 mov r3, sb | r3 = sb;
0x0001315c ldr r2, [pc, 0x19c] | r2 = stderr;
0x00013160 ldr r1, [pc, 0x1b8] | r1 = "_s:_error_:_negative_value__lld_in___s_";
0x00013164 ldr r4, [r0] | r4 = *(r0);
0x00013168 ldr r0, [r5] | r0 = *(0x132f8);
0x0001316c bl 0x10ae8 | fprintf (r0, "_s:_error_:_negative_value__lld_in___s_", r2, r3, r4, r5)
0x00013170 mov r0, r4 | r0 = r4;
0x00013174 ldr r5, [r5] | r5 = *(0x132f8);
0x00013178 bl 0x10a4c | strerror (r0);
0x0001317c str r4, [sp] | *(sp) = r4;
0x00013180 ldr r3, [pc, 0x180] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00013184 mov r2, 8 | r2 = 8;
0x00013188 ldr r1, [pc, 0x17c] | r1 = *(0x13308);
0x0001318c str r0, [sp, 4] | var_4h = r0;
0x00013190 mov r0, r5 | r0 = r5;
0x00013194 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| do {
| label_7:
0x00013198 mov sp, sl |
0x0001319c b 0x12e04 | goto label_0;
| label_10:
0x000131a0 ldrd r2, r3, [fp, -0x64] | __asm ("ldrd r2, r3, [var_64h]");
0x000131a4 mov r1, 0 | r1 = 0;
0x000131a8 adds r6, r2, 0x80000000 | r6 = r2 + 0x80000000;
0x000131ac adc r7, r3, 0 | __asm ("adc r7, r3, 0");
0x000131b0 mvn r0, 0 | r0 = ~0;
0x000131b4 cmp r7, r1 |
0x000131b8 cmpeq r6, r0 | __asm ("cmpeq r6, r0");
| if (r7 < r1) {
0x000131bc bls 0x131ec | goto label_11;
| }
0x000131c0 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x000131c4 ldr r3, [pc, 0x130] | r3 = *(0x132f8);
0x000131c8 str sb, [sp, 8] | var_8h = sb;
0x000131cc ldr r2, [pc, 0x12c] | r2 = stderr;
0x000131d0 ldr r0, [r3] | r0 = *(0x132f8);
0x000131d4 ldr r1, [pc, 0x148] | r1 = "%s: error!: close failed on \"%s\"\n";
0x000131d8 bl 0x10ae8 | r0 = fprintf (r0, "%s: error!: close failed on \"%s\"\n", r2, r3)
0x000131dc bl 0x10b9c | errno_location ();
0x000131e0 mov r3, 0x16 | r3 = 0x16;
0x000131e4 str r3, [r0] | *(r0) = r3;
0x000131e8 b 0x13198 |
| } while (1);
| label_11:
0x000131ec lsl r3, r2, 0x15 | r3 = r2 << 0x15;
0x000131f0 ldrb r2, [r4, 0xfc] | r2 = *((r4 + 0xfc));
0x000131f4 mov sp, sl |
0x000131f8 bic r2, r2, 1 | r2 = BIT_MASK (r2, 1);
0x000131fc orr r2, r2, r3, lsr 31 | r2 |= (r3 >> 31);
0x00013200 strb r2, [r4, 0xfc] | *((r4 + 0xfc)) = r2;
0x00013204 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x00013208 ldrd r0, r1, [r4, 0xd8] | __asm ("ldrd r0, r1, [r4, 0xd8]");
0x0001320c asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00013210 bl 0x14f34 | fcn_00014f34 (r0);
0x00013214 ldr r1, [pc, 0x10c] | r1 = "%s: error!: value %lld read from file \"%s\" is out of range\n";
0x00013218 str r0, [r4, 0xe0] | *((r4 + 0xe0)) = r0;
0x0001321c mov r0, r8 | r0 = r8;
0x00013220 bl 0x10b78 | r0 = strcmp (r0, r1);
0x00013224 cmp r0, 0 |
| if (r0 != 0) {
0x00013228 moveq r0, 4 | r0 = 4;
| }
| if (r0 != 0) {
0x0001322c beq 0x132d4 |
0x00013230 ldr r1, [pc, 0xf4] | r1 = "nand";
0x00013234 mov r0, r8 | r0 = r8;
0x00013238 bl 0x10b78 | r0 = strcmp (r0, "nand");
0x0001323c cmp r0, 0 |
| if (r0 != 0) {
0x00013240 moveq r0, 8 | r0 = 8;
| }
| if (r0 == 0) {
0x00013244 beq 0x132d4 | goto label_12;
| }
0x00013248 ldr r1, [pc, 0xe0] | r1 = "mlc_nand";
0x0001324c mov r0, r8 | r0 = r8;
0x00013250 bl 0x10b78 | r0 = strcmp (r0, "mlc_nand");
0x00013254 cmp r0, 0 |
| if (r0 != 0) {
0x00013258 moveq r0, 3 | r0 = 3;
| }
| if (r0 == 0) {
0x0001325c beq 0x132d4 | goto label_12;
| }
0x00013260 ldr r1, [pc, 0xcc] | r1 = *(0x13330);
0x00013264 mov r0, r8 | r0 = r8;
0x00013268 bl 0x10b78 | r0 = strcmp (r0, r1);
0x0001326c cmp r0, 0 |
| if (r0 != 0) {
0x00013270 moveq r0, 2 | r0 = 2;
| }
| if (r0 == 0) {
0x00013274 beq 0x132d4 | goto label_12;
| }
0x00013278 ldr r1, [pc, 0xb8] | r1 = *(0x13334);
0x0001327c mov r0, r8 | r0 = r8;
0x00013280 bl 0x10b78 | r0 = strcmp (r0, r1);
0x00013284 cmp r0, 0 |
| if (r0 == 0) {
0x00013288 beq 0x132d4 | goto label_12;
| }
0x0001328c ldr r1, [pc, 0xa8] | r1 = "absent";
0x00013290 mov r0, r8 | r0 = r8;
0x00013294 bl 0x10b78 | r0 = strcmp (r0, "absent");
0x00013298 cmp r0, 0 |
| if (r0 != 0) {
0x0001329c moveq r0, 6 | r0 = 6;
| }
| if (r0 == 0) {
0x000132a0 beq 0x132d4 | goto label_12;
| }
0x000132a4 ldr r1, [pc, 0x94] | r1 = "dataflash";
0x000132a8 mov r0, r8 | r0 = r8;
0x000132ac bl 0x10b78 | r0 = strcmp (r0, "dataflash");
0x000132b0 cmp r0, 0 |
| if (r0 != 0) {
0x000132b4 moveq r0, 1 | r0 = 1;
| }
| if (r0 == 0) {
0x000132b8 beq 0x132d4 | goto label_12;
| }
0x000132bc ldr r1, [pc, 0x80] | r1 = "ram";
0x000132c0 mov r0, r8 | r0 = r8;
0x000132c4 bl 0x10b78 | r0 = strcmp (r0, "ram");
0x000132c8 cmp r0, 0 |
| if (r0 != 0) {
0x000132cc moveq r0, 7 | r0 = 7;
| }
| if (r0 != 0) {
0x000132d0 mvnne r0, 0 | r0 = ~0;
| goto label_12;
| }
| }
| label_12:
0x000132d4 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
0x000132d8 sub r0, r0, 4 | r0 -= 4;
0x000132dc bics r3, r0, 4 | __asm ("bics r3, r0, 4");
0x000132e0 ldrb r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
0x000132e4 bic r2, r3, 2 | r2 = BIT_MASK (r3, 2);
| if (r0 != 0) {
0x000132e8 moveq r3, 2 | r3 = 2;
| }
| if (r0 == 0) {
0x000132ec movne r3, 0 | r3 = 0;
| }
0x000132f0 orr r3, r3, r2 | r3 |= r2;
0x000132f4 strb r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
0x000132f8 b 0x12e28 | 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/nanddump @ 0x13348 */
| #include <stdint.h>
|
; (fcn) fcn.00013348 () | void fcn_00013348 (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;
0x00013348 ldrb r3, [r0, 0x34] | r3 = *((r0 + 0x34));
0x0001334c push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00013350 tst r3, 1 |
0x00013354 sub sp, sp, 0x88 |
0x00013358 mov r4, r1 | r4 = r1;
0x0001335c mov r7, r2 | r7 = r2;
| if ((r3 & 1) != 0) {
0x00013360 bne 0x13378 | goto label_3;
| }
0x00013364 mov r1, r2 | r1 = r2;
0x00013368 mov r0, r4 | r0 = r4;
0x0001336c bl 0x14850 | fcn_00014850 (r0, r1);
| do {
| label_2:
0x00013370 add sp, sp, 0x88 |
0x00013374 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_3:
0x00013378 mov r5, r0 | r5 = r0;
0x0001337c add r1, sp, 0x20 | r1 += var_20h;
0x00013380 mov r0, r4 | r0 = r4;
0x00013384 bl 0x10a58 | r0 = stat64 ();
0x00013388 cmp r0, 0 |
| if (r0 == 0) {
0x0001338c beq 0x133e0 | goto label_4;
| }
0x00013390 bl 0x10b9c | errno_location ();
0x00013394 ldr r6, [pc, 0x144] | r6 = *(0x134dc);
0x00013398 mov r3, r4 | r3 = r4;
0x0001339c ldr r2, [pc, 0x140] | r2 = stderr;
0x000133a0 ldr r1, [pc, 0x140] | r1 = "libmtd";
0x000133a4 ldr r5, [r0] | r5 = *(r0);
0x000133a8 ldr r0, [r6] | r0 = *(0x134dc);
0x000133ac bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x000133b0 mov r0, r5 | r0 = r5;
0x000133b4 ldr r4, [r6] | r4 = *(0x134dc);
0x000133b8 bl 0x10a4c | strerror (r0);
0x000133bc str r5, [sp] | *(sp) = r5;
0x000133c0 ldr r3, [pc, 0x124] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x000133c4 mov r2, 8 | r2 = 8;
0x000133c8 ldr r1, [pc, 0x120] | r1 = *(0x134ec);
0x000133cc str r0, [sp, 4] | var_4h = r0;
0x000133d0 mov r0, r4 | r0 = r4;
0x000133d4 bl 0x10ae8 | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4, r5)
| label_0:
0x000133d8 mvn r0, 0 | r0 = ~0;
0x000133dc b 0x13370 |
| } while (1);
| label_4:
0x000133e0 ldr r3, [sp, 0x30] | r3 = var_30h;
0x000133e4 and r3, r3, 0xf000 | r3 &= 0xf000;
0x000133e8 cmp r3, 0x2000 |
| if (r3 != 0x2000) {
0x000133ec beq 0x13418 |
0x000133f0 ldr r0, [pc, 0xe8] |
0x000133f4 mov r3, r4 | r3 = r4;
0x000133f8 ldr r2, [pc, 0xe4] | r2 = stderr;
0x000133fc ldr r1, [pc, 0xf0] | r1 = "_serror__d___s_";
0x00013400 ldr r0, [r0] | r0 = *(0x134dc);
0x00013404 bl 0x10ae8 | r0 = fprintf (r0, "_serror__d___s_", r2, r3)
0x00013408 bl 0x10b9c | errno_location ();
0x0001340c mov r3, 0x16 | r3 = 0x16;
0x00013410 str r3, [r0] | *(r0) = r3;
0x00013414 b 0x133d8 | goto label_0;
| }
0x00013418 ldrd r8, sb, [sp, 0x40] | __asm ("ldrd r8, sb, [var_40h]");
0x0001341c mov r0, r8 | r0 = r8;
0x00013420 mov r1, sb | r1 = sb;
0x00013424 bl 0x10a70 | gnu_dev_major ();
0x00013428 mov r1, sb | r1 = sb;
0x0001342c mov sl, r0 | sl = r0;
0x00013430 mov r0, r8 | r0 = r8;
0x00013434 bl 0x10ab8 | gnu_dev_minor ();
0x00013438 add r1, sp, 0x10 | r1 += var_10h;
0x0001343c mov r8, r0 | r8 = r0;
0x00013440 mov r0, r5 | r0 = r5;
0x00013444 bl 0x12d74 | r0 = fcn_00012d74 (r0, r1);
0x00013448 cmp r0, 0 |
| if (r0 != 0) {
0x0001344c bne 0x133d8 | goto label_0;
| }
0x00013450 bl 0x10b9c | errno_location ();
0x00013454 ldr r4, [sp, 0x14] | r4 = var_14h;
0x00013458 add sb, r5, 8 | sb = r5 + 8;
0x0001345c mov r6, r0 | r6 = r0;
| do {
0x00013460 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00013464 cmp r4, r3 |
| if (r4 > r3) {
0x00013468 bgt 0x134a4 | goto label_5;
| }
0x0001346c add r3, sp, 0xc | r3 += var_ch;
0x00013470 add r2, sp, 8 | r2 += var_8h;
0x00013474 mov r1, r4 | r1 = r4;
0x00013478 mov r0, sb | r0 = sb;
0x0001347c bl 0x1264c | r0 = fcn_0001264c (r0, r1);
0x00013480 cmp r0, 0 |
| if (r0 == 0) {
0x00013484 beq 0x134b0 | goto label_6;
| }
0x00013488 ldr r3, [r6] | r3 = *(r6);
0x0001348c cmp r3, 2 |
| if (r3 != 2) {
0x00013490 bne 0x1349c | goto label_7;
| }
| label_1:
0x00013494 add r4, r4, 1 | r4++;
0x00013498 b 0x13460 |
| } while (1);
| label_7:
0x0001349c cmp r3, 0 |
| if (r3 != 0) {
0x000134a0 bne 0x133d8 | goto label_0;
| }
| label_5:
0x000134a4 mov r3, 0x13 | r3 = 0x13;
0x000134a8 str r3, [r6] | *(r6) = r3;
0x000134ac b 0x133d8 | goto label_0;
| label_6:
0x000134b0 ldr r3, [sp, 8] | r3 = var_8h;
0x000134b4 cmp sl, r3 |
| if (sl != r3) {
0x000134b8 bne 0x13494 | goto label_1;
| }
0x000134bc ldr r3, [sp, 0xc] | r3 = var_ch;
0x000134c0 cmp r8, r3 |
| if (r8 != r3) {
0x000134c4 bne 0x13494 | goto label_1;
| }
0x000134c8 str r0, [r6] | *(r6) = r0;
0x000134cc mov r2, r7 | r2 = r7;
0x000134d0 mov r1, r4 | r1 = r4;
0x000134d4 mov r0, r5 | r0 = r5;
0x000134d8 bl 0x12db4 | fcn_00012db4 (r0, r1);
0x000134dc b 0x13370 | 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/nanddump @ 0x13540 */
| #include <stdint.h>
|
; (fcn) fcn.00013540 () | void fcn_00013540 (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;
0x00013540 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013544 mov r4, r1 | r4 = r1;
0x00013548 sub sp, sp, 0x1c |
0x0001354c mov r6, r0 | r6 = r0;
0x00013550 mov r1, r3 | r1 = r3;
0x00013554 mov r0, r4 | r0 = r4;
0x00013558 mov fp, r2 |
0x0001355c mov sl, r3 | sl = r3;
0x00013560 ldr r7, [sp, 0x40] | r7 = *(arg_40h);
0x00013564 bl 0x12570 | r0 = fcn_00012570 (r0, r1);
0x00013568 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x0001356c bne 0x13658 | goto label_1;
| }
0x00013570 add r1, sl, r7 | r1 = sl + r7;
0x00013574 sub r1, r1, 1 | r1--;
0x00013578 mov r0, r4 | r0 = r4;
0x0001357c bl 0x12570 | r0 = fcn_00012570 (r0, r1);
0x00013580 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00013584 bne 0x13658 | goto label_1;
| }
0x00013588 ldr r3, [r4, 0xe4] | r3 = *((r4 + 0xe4));
0x0001358c smull r0, r1, sl, r3 | r0:r1 = sl * r3;
0x00013590 strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [var_8h]");
0x00013594 smull r0, r1, r3, r7 | r0:r1 = r3 * r7;
0x00013598 ldrb r3, [r6, 0x34] | r3 = *((r6 + 0x34));
0x0001359c strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x000135a0 tst r3, 2 |
| if ((r3 & 2) == 0) {
0x000135a4 bne 0x13600 |
0x000135a8 add r2, sp, 8 | r2 += var_8h;
0x000135ac ldr r1, [pc, 0xd4] | r1 = *(0x13684);
0x000135b0 mov r0, fp | r0 = fp;
0x000135b4 bl 0x10a34 | r0 = ioctl (r0, r1);
0x000135b8 cmp r0, 0 |
| if (r0 == 0) {
0x000135bc beq 0x13658 | goto label_1;
| }
0x000135c0 bl 0x10b9c | r0 = errno_location ();
0x000135c4 ldr r3, [r0] | r3 = *(r0);
0x000135c8 cmp r3, 0x19 |
| if (r3 == 0x19) {
0x000135cc bne 0x135e8 |
0x000135d0 ldrb r3, [r6, 0x34] | r3 = *((r6 + 0x34));
0x000135d4 tst r3, 6 |
0x000135d8 biceq r3, r3, 4 | __asm ("biceq r3, r3, 4");
| if ((r3 & 6) != 0) {
0x000135dc orreq r3, r3, 2 | r3 |= 2;
| }
| if ((r3 & 6) != 0) {
0x000135e0 strbeq r3, [r6, 0x34] | *((r6 + 0x34)) = r3;
| }
| if ((r3 & 6) == 0) {
0x000135e4 beq 0x13600 | goto label_2;
| }
| }
0x000135e8 ldr r2, [pc, 0x9c] | r2 = *(0x13688);
| label_0:
0x000135ec mov r1, sl | r1 = sl;
0x000135f0 ldr r0, [r4] | r0 = *(r4);
0x000135f4 bl 0x125d0 | r0 = fcn_000125d0 (r0, r1);
0x000135f8 mov r5, r0 | r5 = r0;
0x000135fc b 0x13658 |
| } else {
| label_2:
0x00013600 ldrd r0, r1, [sp, 8] | __asm ("ldrd r0, r1, [var_8h]");
0x00013604 ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [var_10h]");
0x00013608 mov r7, 0 | r7 = 0;
0x0001360c adds r8, r0, r2 | r8 = r0 + r2;
0x00013610 adc sb, r1, r3 | __asm ("adc sb, r1, r3");
0x00013614 mvn r6, 0 | r6 = ~0;
0x00013618 cmp sb, r7 |
0x0001361c cmpeq r8, r6 | __asm ("cmpeq r8, r6");
| if (sb < r7) {
0x00013620 bls 0x13664 | goto label_3;
| }
0x00013624 ldr r1, [r4, 0xe4] | r1 = *((r4 + 0xe4));
0x00013628 mvn r0, 0 | r0 = ~0;
0x0001362c bl 0x14d70 | fcn_00014d70 (r0, r1);
0x00013630 ldr r2, [pc, 0x58] | r2 = "MEMERASE64";
0x00013634 ldr r1, [pc, 0x58] | r1 = "libmtd";
0x00013638 mvn r5, 0 | r5 = ~0;
0x0001363c mov r3, r0 | r3 = r0;
0x00013640 ldr r0, [pc, 0x50] |
0x00013644 ldr r0, [r0] | r0 = "_s:_error_:_this_system_can_address_only__u_eraseblocks";
0x00013648 bl 0x10ae8 | r0 = fprintf ("_s:_error_:_this_system_can_address_only__u_eraseblocks", "libmtd", "MEMERASE64", r3, r4, r5)
0x0001364c bl 0x10b9c | errno_location ();
0x00013650 mov r3, 0x16 | r3 = 0x16;
0x00013654 str r3, [r0] | *(r0) = r3;
| }
| do {
| label_1:
0x00013658 mov r0, r5 | r0 = r5;
0x0001365c add sp, sp, 0x1c |
0x00013660 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_3:
0x00013664 stm sp, {r0, r2} | *(sp) = r0;
| *((sp + 4)) = r2;
0x00013668 ldr r1, [pc, 0x2c] | r1 = stderr;
0x0001366c mov r2, sp | r2 = sp;
0x00013670 mov r0, fp | r0 = fp;
0x00013674 bl 0x10a34 | r0 = ioctl (r0, r1);
0x00013678 cmp r0, 0 |
0x0001367c bge 0x13658 |
| } while (r0 >= 0);
0x00013680 ldr r2, [pc, 0x18] | r2 = *(0x1369c);
0x00013684 b 0x135ec | 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/nanddump @ 0x138d4 */
| #include <stdint.h>
|
; (fcn) fcn.000138d4 () | void fcn_000138d4 (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;
0x000138d4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000138d8 mov fp, r1 |
0x000138dc sub sp, sp, 0x14 |
0x000138e0 mov r1, r2 | r1 = r2;
0x000138e4 mov sb, r0 | sb = r0;
0x000138e8 mov sl, r2 | sl = r2;
0x000138ec mov r5, r3 | r5 = r3;
0x000138f0 ldr r8, [sp, 0x3c] | r8 = *(arg_3ch);
0x000138f4 bl 0x12570 | r0 = fcn_00012570 (r0, r1);
0x000138f8 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x000138fc bne 0x13950 | goto label_0;
| }
0x00013900 cmp r5, 0 |
0x00013904 ldr r3, [sb, 0xe4] | r3 = *((sb + 0xe4));
| if (r5 >= 0) {
0x00013908 blt 0x13918 |
0x0001390c add r2, r5, r8 | r2 = r5 + r8;
0x00013910 cmp r2, r3 |
| if (r2 <= r3) {
0x00013914 ble 0x1395c | goto label_3;
| }
| }
0x00013918 str r3, [sp, 8] | var_8h = r3;
0x0001391c ldr r0, [pc, 0x128] |
0x00013920 ldr r3, [sb] | r3 = *(sb);
0x00013924 str r8, [sp] | *(sp) = r8;
0x00013928 str r3, [sp, 4] | var_4h = r3;
0x0001392c ldr r2, [pc, 0x11c] | r2 = stderr;
0x00013930 mov r3, r5 | r3 = r5;
0x00013934 ldr r1, [pc, 0x118] | r1 = "libmtd";
0x00013938 ldr r0, [r0] | r0 = *(0x13a48);
0x0001393c bl 0x10ae8 | r0 = fprintf (r0, "libmtd", r2, r3)
0x00013940 bl 0x10b9c | errno_location ();
0x00013944 mov r3, 0x16 | r3 = 0x16;
0x00013948 str r3, [r0] | *(r0) = r3;
| do {
0x0001394c mvn r4, 0 | r4 = ~0;
| label_0:
0x00013950 mov r0, r4 | r0 = r4;
0x00013954 add sp, sp, 0x14 |
0x00013958 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_3:
0x0001395c mov r6, r5 | r6 = r5;
0x00013960 asr r7, r5, 0x1f | r7 = r5 >> 0x1f;
0x00013964 smlal r6, r7, r3, sl | __asm ("smlal r6, r7, r3, sl");
0x00013968 str r4, [sp] | *(sp) = r4;
0x0001396c mov r3, r7 | r3 = r7;
0x00013970 mov r2, r6 | r2 = r6;
0x00013974 mov r0, fp | r0 = fp;
0x00013978 bl 0x10bc0 | lseek64 ();
0x0001397c cmp r7, r1 |
0x00013980 cmpeq r6, r0 | __asm ("cmpeq r6, r0");
| if (r7 != r1) {
0x00013984 moveq r7, r4 | r7 = r4;
| }
| if (r7 == r1) {
0x00013988 beq 0x139e8 | goto label_4;
| }
0x0001398c bl 0x10b9c | errno_location ();
0x00013990 ldr r5, [pc, 0xb4] |
0x00013994 mov r2, r6 | r2 = r6;
0x00013998 mov r3, r7 | r3 = r7;
0x0001399c ldr r1, [pc, 0xb4] | r1 = "_s:_error_:_bad_offset__d_or_length__d__mtd_d_eraseblock_size_is__d";
0x000139a0 ldr r4, [r0] | r4 = *(r0);
0x000139a4 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x000139a8 ldr r3, [sb] | r3 = *(sb);
0x000139ac ldr r0, [r5] | r0 = *(0x13a48);
0x000139b0 ldr r2, [pc, 0x98] | r2 = stderr;
0x000139b4 bl 0x10ae8 | fprintf (r0, "_s:_error_:_bad_offset__d_or_length__d__mtd_d_eraseblock_size_is__d", r2, r3, r4, r5)
0x000139b8 ldr r5, [r5] | r5 = *(0x13a48);
| label_2:
0x000139bc mov r0, r4 | r0 = r4;
0x000139c0 bl 0x10a4c | strerror (r0);
0x000139c4 str r4, [sp] | *(sp) = r4;
0x000139c8 ldr r3, [pc, 0x8c] | r3 = "%s: error!: cannot seek mtd%d to offset %lld\n";
0x000139cc mov r2, 8 | r2 = 8;
0x000139d0 ldr r1, [pc, 0x88] | r1 = *(0x13a5c);
0x000139d4 str r0, [sp, 4] | var_4h = r0;
0x000139d8 mov r0, r5 | r0 = r5;
0x000139dc bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot seek mtd%d to offset %lld\n", r4)
0x000139e0 b 0x1394c |
| } while (1);
| label_1:
0x000139e4 add r7, r7, r0 | r7 += r0;
| label_4:
0x000139e8 cmp r8, r7 |
| if (r8 <= r7) {
0x000139ec ble 0x13950 | goto label_0;
| }
0x000139f0 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x000139f4 sub r6, r8, r7 | r6 = r8 - r7;
0x000139f8 mov r2, r6 | r2 = r6;
0x000139fc add r1, r3, r7 | r1 = r3 + r7;
0x00013a00 mov r0, fp | r0 = fp;
0x00013a04 bl 0x10b0c | r0 = read (r0, r1, r2);
0x00013a08 cmp r0, 0 |
| if (r0 >= 0) {
0x00013a0c bge 0x139e4 | goto label_1;
| }
0x00013a10 bl 0x10b9c | errno_location ();
0x00013a14 ldr r8, [pc, 0x30] | r8 = *(0x13a48);
0x00013a18 ldr r3, [sb] | r3 = *(sb);
0x00013a1c add r5, r5, r7 | r5 += r7;
0x00013a20 ldr r2, [pc, 0x28] | r2 = stderr;
0x00013a24 ldr r1, [pc, 0x38] | r1 = "_serror__d___s_";
0x00013a28 ldr r4, [r0] | r4 = *(r0);
0x00013a2c str r5, [sp, 8] | var_8h = r5;
0x00013a30 str r3, [sp] | *(sp) = r3;
0x00013a34 str sl, [sp, 4] | var_4h = sl;
0x00013a38 mov r3, r6 | r3 = r6;
0x00013a3c ldr r0, [r8] | r0 = *(0x13a48);
0x00013a40 bl 0x10ae8 | fprintf (r0, "_serror__d___s_", r2, r3, r4, r5)
0x00013a44 ldr r5, [r8] | r5 = *(0x13a48);
0x00013a48 b 0x139bc | 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/nanddump @ 0x13af0 */
| #include <stdint.h>
|
; (fcn) fcn.00013af0 () | void fcn_00013af0 (int32_t arg_158h, char * ptr, int32_t arg_160h, void * s2, int32_t arg_168h, int32_t arg_16ch, int32_t 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_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;
0x00013af0 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013af4 sub sp, sp, 0x134 |
0x00013af8 str r0, [sp, 0x34] | var_34h = r0;
0x00013afc mov r5, r1 | r5 = r1;
0x00013b00 mov r7, r2 | r7 = r2;
0x00013b04 mov r1, 0 | r1 = 0;
0x00013b08 mov r2, 0x30 | r2 = 0x30;
0x00013b0c add r0, sp, 0x38 | r0 += s;
0x00013b10 str r3, [sp, 0x24] | var_24h = r3;
0x00013b14 ldr r6, [sp, 0x160] | r6 = *(arg_160h);
0x00013b18 ldr sl, [sp, 0x168] | sl = *(arg_168h);
0x00013b1c ldrb r8, [sp, 0x16c] | r8 = *(arg_16ch);
0x00013b20 bl 0x10b54 | memset (r0, r1, r2);
0x00013b24 ldr r1, [sp, 0x24] | r1 = var_24h;
0x00013b28 mov r0, r5 | r0 = r5;
0x00013b2c bl 0x12570 | r0 = fcn_00012570 (r0, r1);
0x00013b30 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00013b34 bne 0x13ca4 | goto label_3;
| }
0x00013b38 ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x00013b3c ldr fp, [r5, 0xe4] | fp = *((r5 + 0xe4));
0x00013b40 cmp r3, 0 |
| if (r3 >= 0) {
0x00013b44 blt 0x13b54 |
0x00013b48 add r3, r3, r6 | r3 += r6;
0x00013b4c cmp r3, fp |
| if (r3 <= fp) {
0x00013b50 ble 0x13b90 | goto label_5;
| }
| }
0x00013b54 str fp, [sp, 8] | var_8h = fp;
0x00013b58 ldr r0, [pc, 0x328] |
0x00013b5c ldr r3, [r5] | r3 = *(r5);
0x00013b60 ldr r2, [pc, 0x324] | r2 = stderr;
0x00013b64 str r3, [sp, 4] | var_4h = r3;
0x00013b68 str r6, [sp] | *(sp) = r6;
0x00013b6c ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x00013b70 ldr r1, [pc, 0x318] | r1 = "libmtd";
0x00013b74 ldr r0, [r0] | r0 = *(0x13e84);
0x00013b78 bl 0x10ae8 | r0 = fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
| do {
0x00013b7c bl 0x10b9c | errno_location ();
0x00013b80 mov r3, 0x16 | r3 = 0x16;
0x00013b84 str r3, [r0] | *(r0) = r3;
| label_1:
0x00013b88 mvn r4, 0 | r4 = ~0;
0x00013b8c b 0x13ca4 | goto label_3;
| label_5:
0x00013b90 ldr sb, [r5, 0xec] | sb = *((r5 + 0xec));
0x00013b94 ldr r0, [sp, 0x158] | r0 = *(arg_158h);
0x00013b98 mov r1, sb | r1 = sb;
0x00013b9c bl 0x14f14 | fcn_00014f14 (r0, r1);
0x00013ba0 cmp r1, 0 |
| if (r1 == 0) {
0x00013ba4 beq 0x13bd0 | goto label_6;
| }
0x00013ba8 str sb, [sp, 4] | var_4h = sb;
0x00013bac ldr r3, [r5] | r3 = *(r5);
0x00013bb0 ldr r2, [pc, 0x2d4] | r2 = stderr;
0x00013bb4 str r3, [sp] | *(sp) = r3;
0x00013bb8 ldr r1, [pc, 0x2d4] | r1 = "_s:_error_:_bad_offset__d_or_length__d__mtd_d_eraseblock_size_is__d";
0x00013bbc ldr r3, [sp, 0x158] | r3 = *(arg_158h);
| label_0:
0x00013bc0 ldr r0, [pc, 0x2c0] |
0x00013bc4 ldr r0, [r0] | r0 = *(0x13e84);
0x00013bc8 bl 0x10ae8 | fprintf (r0, "_s:_error_:_bad_offset__d_or_length__d__mtd_d_eraseblock_size_is__d", r2, r3)
0x00013bcc b 0x13b7c |
| } while (1);
| label_6:
0x00013bd0 mov r1, sb | r1 = sb;
0x00013bd4 mov r0, r6 | r0 = r6;
0x00013bd8 bl 0x14f14 | fcn_00014f14 (r0, r1);
0x00013bdc subs r4, r1, 0 | r4 = r1 - 0;
| if (r4 != r1) {
0x00013be0 beq 0x13c00 |
0x00013be4 str sb, [sp, 4] | var_4h = sb;
0x00013be8 ldr r3, [r5] | r3 = *(r5);
0x00013bec ldr r2, [pc, 0x298] | r2 = stderr;
0x00013bf0 str r3, [sp] | *(sp) = r3;
0x00013bf4 ldr r1, [pc, 0x29c] | r1 = "%s: error!: write offset %d is not aligned to mtd%d min. I/O size %d\n";
0x00013bf8 mov r3, r6 | r3 = r6;
0x00013bfc b 0x13bc0 | goto label_0;
| }
0x00013c00 ldr r2, [sp, 0x158] | r2 = *(arg_158h);
0x00013c04 ldr r1, [sp, 0x24] | r1 = var_24h;
0x00013c08 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00013c0c smlal r2, r3, fp, r1 | __asm ("smlal r2, r3, fp, r1");
0x00013c10 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x00013c14 ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013c18 cmp r3, 0 |
| if (r3 == 0) {
0x00013c1c beq 0x13dd0 | goto label_7;
| }
0x00013c20 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00013c24 ldr r1, [pc, 0x270] | r1 = "%s: error!: write length %d is not aligned to mtd%d min. I/O size %d\n";
0x00013c28 strd r2, r3, [sp, 0x38] | __asm ("strd r2, r3, [s]");
0x00013c2c mov r2, r6 | r2 = r6;
0x00013c30 asr r3, r6, 0x1f | r3 = r6 >> 0x1f;
0x00013c34 strd r2, r3, [sp, 0x40] | __asm ("strd r2, r3, [var_40h]");
0x00013c38 mov r2, sl | r2 = sl;
0x00013c3c asr r3, sl, 0x1f | r3 = sl >> 0x1f;
0x00013c40 strd r2, r3, [sp, 0x28] | __asm ("strd r2, r3, [var_28h]");
0x00013c44 strd r2, r3, [sp, 0x48] | __asm ("strd r2, r3, [var_48h]");
0x00013c48 ldr r3, [sp, 0x15c] | r3 = *(ptr);
0x00013c4c add r2, sp, 0x38 | r2 += s;
0x00013c50 str r3, [sp, 0x50] | var_50h = r3;
0x00013c54 ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013c58 mov r0, r7 | r0 = r7;
0x00013c5c str r4, [sp, 0x54] | var_54h = r4;
0x00013c60 str r3, [sp, 0x58] | var_58h = r3;
0x00013c64 str r4, [sp, 0x5c] | var_5ch = r4;
0x00013c68 strb r8, [sp, 0x60] | var_60h = r8;
0x00013c6c bl 0x10a34 | r0 = ioctl (r0, r1);
0x00013c70 cmp r0, 0 |
| if (r0 != 0) {
0x00013c74 beq 0x13ca4 |
0x00013c78 bl 0x10b9c | r0 = errno_location ();
0x00013c7c ldr r3, [r0] | r3 = *(r0);
0x00013c80 mov sb, r0 | sb = r0;
0x00013c84 cmp r3, 0x19 |
0x00013c88 cmpne r3, 0x5f | __asm ("cmpne r3, 0x5f");
| if (r3 == 0x19) {
0x00013c8c beq 0x13cb0 | goto label_8;
| }
0x00013c90 ldr r2, [pc, 0x208] | r2 = *(0x13e9c);
0x00013c94 ldr r1, [sp, 0x24] | r1 = var_24h;
0x00013c98 ldr r0, [r5] | r0 = *(r5);
0x00013c9c bl 0x125d0 | r0 = fcn_000125d0 (r0, r1);
0x00013ca0 mov r4, r0 | r4 = r0;
| }
| label_3:
0x00013ca4 mov r0, r4 | r0 = r4;
0x00013ca8 add sp, sp, 0x134 |
0x00013cac pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_8:
0x00013cb0 cmp r8, 1 |
| if (r8 != 1) {
0x00013cb4 bne 0x13d90 | goto label_9;
| }
0x00013cb8 add r2, sp, 0x68 | r2 += var_68h;
0x00013cbc ldr r1, [pc, 0x1e0] | r1 = "MEMWRITE";
0x00013cc0 mov r0, r7 | r0 = r7;
0x00013cc4 bl 0x10a34 | r0 = ioctl (r0, "MEMWRITE");
0x00013cc8 subs fp, r0, 0 |
| if (fp != r0) {
0x00013ccc beq 0x13d14 |
0x00013cd0 ldr r4, [sb] | r4 = *(sb);
0x00013cd4 ldr r5, [pc, 0x1ac] | r5 = *(0x13e84);
0x00013cd8 ldr r2, [pc, 0x1ac] | r2 = stderr;
0x00013cdc ldr r1, [pc, 0x1c4] | r1 = *(0x13ea4);
| label_2:
0x00013ce0 ldr r0, [r5] | r0 = *(r5);
0x00013ce4 bl 0x10ae8 | fprintf (r0, r1, r2, r3, r4, r5)
0x00013ce8 ldr r5, [r5] | r5 = *(r5);
| label_4:
0x00013cec mov r0, r4 | r0 = r4;
0x00013cf0 bl 0x10a4c | strerror (r0);
0x00013cf4 str r4, [sp] | *(sp) = r4;
0x00013cf8 ldr r3, [pc, 0x1ac] | r3 = "_s:_error_:_MEMGETOOBSEL_failed";
0x00013cfc mov r2, 8 | r2 = 8;
0x00013d00 ldr r1, [pc, 0x1a8] | r1 = *(0x13eac);
0x00013d04 str r0, [sp, 4] | var_4h = r0;
0x00013d08 mov r0, r5 | r0 = r5;
0x00013d0c bl 0x10ae8 | fprintf (r0, r1, r2, "_s:_error_:_MEMGETOOBSEL_failed", r4)
0x00013d10 b 0x13b88 | goto label_1;
| }
0x00013d14 mov r0, sl | r0 = sl;
0x00013d18 bl 0x10a94 | malloc (r0);
0x00013d1c mov r2, sl | r2 = sl;
0x00013d20 ldr r1, [sp, 0x164] | r1 = *(s2);
0x00013d24 str r0, [sp, 0x30] | var_30h = r0;
0x00013d28 bl 0x10a7c | memcpy (r0, r1, r2);
0x00013d2c ldr r2, [sp, 0x68] | r2 = var_68h;
0x00013d30 cmp r2, 2 |
| if (r2 != 2) {
0x00013d34 addeq r8, sp, 0x70 | r8 += var_70h;
| }
| if (r2 == 2) {
0x00013d38 beq 0x13d80 | goto label_10;
| }
0x00013d3c ldr r0, [sp, 0x6c] | r0 = s1;
0x00013d40 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00013d44 ldr r2, [r5, 0xf0] | r2 = *((r5 + 0xf0));
0x00013d48 add r1, r3, r0 | r1 = r3 + r0;
0x00013d4c ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013d50 sub r2, r2, r0 | r2 -= r0;
0x00013d54 add r0, r3, r0 | r0 = r3 + r0;
0x00013d58 bl 0x10a7c | memcpy (r0, r1, r2);
0x00013d5c b 0x13d90 | goto label_9;
| do {
0x00013d60 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00013d64 ldr r0, [r8, -8] | r0 = *((r8 - 8));
0x00013d68 add r1, r3, fp | r1 = r3 + fp;
0x00013d6c ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013d70 mov r2, sl | r2 = sl;
0x00013d74 add r0, r3, r0 | r0 = r3 + r0;
0x00013d78 bl 0x10a7c | memcpy (r0, r1, r2);
0x00013d7c add fp, fp, sl |
| label_10:
0x00013d80 add r8, r8, 8 | r8 += 8;
0x00013d84 ldr sl, [r8, -4] | sl = *((r8 - 4));
0x00013d88 cmp sl, 0 |
0x00013d8c bne 0x13d60 |
| } while (sl != 0);
| label_9:
0x00013d90 ldr r3, [sp, 0x164] | r3 = *(s2);
0x00013d94 mov r1, r5 | r1 = r5;
0x00013d98 str r3, [sp, 0x10] | var_10h = r3;
0x00013d9c ldrd r2, r3, [sp, 0x28] | __asm ("ldrd r2, r3, [var_28h]");
0x00013da0 ldr r0, [sp, 0x34] | r0 = var_34h;
0x00013da4 strd r2, r3, [sp, 8] | __asm ("strd r2, r3, [var_8h]");
0x00013da8 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00013dac strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00013db0 mov r2, r7 | r2 = r7;
0x00013db4 bl 0x13aac | r0 = fcn_00013aac (r0, r1, r2, r3, r4);
0x00013db8 cmp r0, 0 |
| if (r0 >= 0) {
0x00013dbc ldrlt r4, [sb] | r4 = *(sb);
| }
| if (r0 >= 0) {
0x00013dc0 ldrlt r5, [pc, 0xc0] | r5 = obj.stderr;
| }
| if (r0 >= 0) {
0x00013dc4 ldrlt r2, [pc, 0xc0] | r2 = "libmtd";
| }
| if (r0 < 0) {
0x00013dc8 ldrlt r1, [pc, 0xe4] | r1 = "%s: error!: cannot write to OOB\n";
| goto label_11;
| }
| if (r0 < 0) {
| label_11:
0x00013dcc blt 0x13ce0 | goto label_2;
| }
| label_7:
0x00013dd0 ldr r3, [sp, 0x15c] | r3 = *(ptr);
0x00013dd4 cmp r3, 0 |
| if (r3 == 0) {
0x00013dd8 beq 0x13ca4 | goto label_3;
| }
0x00013ddc mov r3, 0 | r3 = 0;
0x00013de0 str r3, [sp] | *(sp) = r3;
0x00013de4 mov r0, r7 | r0 = r7;
0x00013de8 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00013dec bl 0x10bc0 | lseek64 ();
0x00013df0 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00013df4 cmp r1, r3 |
0x00013df8 cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| if (r1 != r3) {
0x00013dfc beq 0x13e30 |
0x00013e00 bl 0x10b9c | errno_location ();
0x00013e04 ldr r6, [pc, 0x7c] | r6 = *(0x13e84);
0x00013e08 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00013e0c ldr r1, [pc, 0xa4] | r1 = "%s: error!: cannot write to OOB\n";
0x00013e10 ldr r4, [r0] | r4 = *(r0);
0x00013e14 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00013e18 ldr r2, [pc, 0x6c] | r2 = stderr;
0x00013e1c ldr r3, [r5] | r3 = *(r5);
0x00013e20 ldr r0, [r6] | r0 = *(0x13e84);
0x00013e24 bl 0x10ae8 | fprintf (r0, "%s: error!: cannot write to OOB\n", r2, r3, r4, r5, r6)
0x00013e28 ldr r5, [r6] | r5 = *(0x13e84);
0x00013e2c b 0x13cec | goto label_4;
| }
0x00013e30 mov r2, r6 | r2 = r6;
0x00013e34 ldr r1, [sp, 0x15c] | r1 = *(ptr);
0x00013e38 mov r0, r7 | r0 = r7;
0x00013e3c bl 0x10adc | r0 = write (r0, r1, r2);
0x00013e40 cmp r6, r0 |
| if (r6 == r0) {
0x00013e44 beq 0x13ca4 | goto label_3;
| }
0x00013e48 bl 0x10b9c | errno_location ();
0x00013e4c ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x00013e50 ldr r7, [pc, 0x30] | r7 = *(0x13e84);
0x00013e54 ldr r2, [pc, 0x30] | r2 = stderr;
0x00013e58 ldr r1, [pc, 0x5c] | r1 = "%s: error!: cannot seek mtd%d to offset %lld\n";
0x00013e5c ldr r4, [r0] | r4 = *(r0);
0x00013e60 str r3, [sp, 8] | var_8h = r3;
0x00013e64 ldr r3, [sp, 0x24] | r3 = var_24h;
0x00013e68 str r3, [sp, 4] | var_4h = r3;
0x00013e6c ldr r3, [r5] | r3 = *(r5);
0x00013e70 str r3, [sp] | *(sp) = r3;
0x00013e74 mov r3, r6 | r3 = r6;
0x00013e78 ldr r0, [r7] | r0 = *(0x13e84);
0x00013e7c bl 0x10ae8 | fprintf (r0, "%s: error!: cannot seek mtd%d to offset %lld\n", r2, r3, r4)
0x00013e80 ldr r5, [r7] | r5 = *(0x13e84);
0x00013e84 b 0x13cec | 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/nanddump @ 0x14244 */
| #include <stdint.h>
|
; (fcn) fcn.00014244 () | void fcn_00014244 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_8h;
| r0 = arg1;
0x00014244 push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x00014248 mov r4, r0 | r4 = r0;
0x0001424c ldr r3, [r4, 0x94] | r3 = *((r4 + 0x94));
0x00014250 ldr r0, [r0, 0x9c] | r0 = *((r0 + 0x9c));
0x00014254 ldr r2, [r4, 0x98] | r2 = *((r4 + 0x98));
0x00014258 sub r5, r0, r3 | r5 = r0 - r3;
0x0001425c cmp r2, r5 |
| if (r2 > r5) {
0x00014260 bgt 0x14278 | goto label_4;
| }
0x00014264 mov r0, r3 | r0 = r3;
0x00014268 bl 0x10c08 | free (r0);
0x0001426c mov r0, 0 | r0 = 0;
| do {
| label_3:
0x00014270 add sp, sp, 8 |
0x00014274 pop {r4, r5, r6, r7, r8, pc} |
| label_4:
0x00014278 add r3, r4, 0x90 | r3 = r4 + 0x90;
0x0001427c str r3, [sp] | *(sp) = r3;
0x00014280 mov r2, r4 | r2 = r4;
0x00014284 add r3, r4, 8 | r3 = r4 + 8;
0x00014288 ldr r1, [pc, 0xf8] | r1 = *(0x14384);
0x0001428c bl 0x10b30 | r0 = sscanf (r0, r1, r2);
0x00014290 cmp r0, 3 |
| if (r0 == 3) {
0x00014294 beq 0x142b8 | goto label_5;
| }
0x00014298 ldr r3, [pc, 0xe8] | r3 = *(0x14384);
0x0001429c ldr r2, [pc, 0xe8] | r2 = "mtd%d: %llx %x";
0x000142a0 ldr r1, [pc, 0xe8] | r1 = "libmtd";
| label_2:
0x000142a4 ldr r0, [pc, 0xe8] |
0x000142a8 ldr r0, [r0] | r0 = "_s:_error_:___s__pattern_not_found";
0x000142ac bl 0x10ae8 | fprintf ("_s:_error_:___s__pattern_not_found", "libmtd", "mtd%d: %llx %x", r3)
| label_0:
0x000142b0 mvn r0, 0 | r0 = ~0;
0x000142b4 b 0x14270 |
| } while (1);
| label_5:
0x000142b8 ldr r8, [r4, 0x98] | r8 = *((r4 + 0x98));
0x000142bc mov r1, 0x22 | r1 = 0x22;
0x000142c0 sub r2, r8, r5 | r2 = r8 - r5;
0x000142c4 ldr r0, [r4, 0x9c] | r0 = *((r4 + 0x9c));
0x000142c8 bl 0x10b00 | r0 = memchr (r0, r1, r2);
0x000142cc cmp r0, 0 |
0x000142d0 bne 0x142ec |
| while (r8 <= r2) {
0x000142d4 ldr r2, [pc, 0xb0] | r2 = "mtd%d: %llx %x";
0x000142d8 ldr r1, [pc, 0xb8] | r1 = stderr;
| label_1:
0x000142dc ldr r3, [pc, 0xb0] | r3 = "_s:_error_:___s__pattern_not_found";
0x000142e0 ldr r0, [r3] | r0 = "_s:_error_:___s__pattern_not_found";
0x000142e4 bl 0x10ae8 | fprintf ("_s:_error_:___s__pattern_not_found", r1, "mtd%d: %llx %x", "_s:_error_:___s__pattern_not_found")
0x000142e8 b 0x142b0 | goto label_0;
0x000142ec ldr r7, [r4, 0x94] | r7 = *((r4 + 0x94));
0x000142f0 add r6, r0, 1 | r6 = r0 + 1;
0x000142f4 sub r2, r6, r7 | r2 = r6 - r7;
0x000142f8 cmp r8, r2 |
0x000142fc ble 0x142d4 |
| }
0x00014300 sub r2, r8, r2 | r2 = r8 - r2;
0x00014304 mov r1, 0x22 | r1 = 0x22;
0x00014308 mov r0, r6 | r0 = r6;
0x0001430c bl 0x10b00 | r0 = memchr (r0, r1, r2);
0x00014310 subs r5, r0, 0 | r5 = r0 - 0;
0x00014314 bne 0x14324 |
| while (r8 <= r7) {
0x00014318 ldr r2, [pc, 0x6c] | r2 = "mtd%d: %llx %x";
0x0001431c ldr r1, [pc, 0x78] | r1 = "_s:_error_:_opening___not_found";
0x00014320 b 0x142dc | goto label_1;
0x00014324 sub r7, r5, r7 | r7 = r5 - r7;
0x00014328 cmp r8, r7 |
0x0001432c ble 0x14318 |
| }
0x00014330 sub r7, r5, r6 | r7 = r5 - r6;
0x00014334 cmp r7, 0x7f |
| if (r7 <= 0x7f) {
0x00014338 ldrgt r3, [r4] | r3 = *(r4);
| }
| if (r7 <= 0x7f) {
0x0001433c ldrgt r2, [pc, 0x48] | r2 = "libmtd";
| }
| if (r7 > 0x7f) {
0x00014340 ldrgt r1, [pc, 0x58] | r1 = "%s: error!: too long mtd%d device name\n";
| goto label_6;
| }
| if (r7 > 0x7f) {
| label_6:
0x00014344 bgt 0x142a4 | goto label_2;
| }
0x00014348 mov r2, r7 | r2 = r7;
0x0001434c mov r1, r6 | r1 = r6;
0x00014350 add r0, r4, 0x10 | r0 = r4 + 0x10;
0x00014354 bl 0x10a7c | memcpy (r0, r1, r2);
0x00014358 add r7, r4, r7 | r7 = r4 + r7;
0x0001435c mov r3, 0 | r3 = 0;
0x00014360 strb r3, [r7, 0x10] | *((r7 + 0x10)) = r3;
0x00014364 ldrb r3, [r5, 1] | r3 = *((r5 + 1));
0x00014368 cmp r3, 0xa |
| if (r3 != 0xa) {
0x0001436c addeq r5, r5, 2 | r5 += 2;
| }
| if (r3 != 0xa) {
0x00014370 streq r5, [r4, 0x9c] | *((r4 + 0x9c)) = r5;
| }
| if (r3 == 0xa) {
0x00014374 moveq r0, 1 | r0 = 1;
| goto label_7;
| }
| if (r3 == 0xa) {
| label_7:
0x00014378 beq 0x14270 | goto label_3;
| }
0x0001437c ldr r2, [pc, 8] | r2 = "libmtd";
0x00014380 ldr r1, [pc, 0x1c] | r1 = "%s: error!: too long mtd%d device name\n";
0x00014384 b 0x142dc | 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/nanddump @ 0x143a8 */
| #include <stdint.h>
|
; (fcn) fcn.000143a8 () | void fcn_000143a8 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
0x000143a8 push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x000143ac mov r5, r0 | r5 = r0;
0x000143b0 mov r1, 0 | r1 = 0;
0x000143b4 ldr r0, [pc, 0x150] | r0 = *(0x14508);
0x000143b8 bl 0x10b60 | r0 = open64 ();
0x000143bc cmn r0, 1 |
0x000143c0 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x000143c4 beq 0x14500 | goto label_0;
| }
0x000143c8 mov r0, 0x1000 | r0 = 0x1000;
0x000143cc bl 0x10a94 | r0 = malloc (r0);
0x000143d0 subs r1, r0, 0 | r1 = r0 - 0;
| if (r1 == r0) {
0x000143d4 bne 0x14424 |
0x000143d8 bl 0x10b9c | errno_location ();
0x000143dc ldr r5, [pc, 0x12c] |
0x000143e0 ldr r2, [pc, 0x12c] | r2 = stderr;
0x000143e4 ldr r1, [pc, 0x12c] | r1 = "libmtd";
0x000143e8 ldr r4, [r0] | r4 = *(r0);
0x000143ec ldr r0, [r5] | r0 = "/proc/mtd";
0x000143f0 bl 0x10ae8 | fprintf ("/proc/mtd", "libmtd", r2, r3, r4, "/proc/mtd")
0x000143f4 mov r0, r4 | r0 = r4;
0x000143f8 ldr r5, [r5] | r5 = "/proc/mtd";
0x000143fc bl 0x10a4c | strerror (r0);
0x00014400 str r4, [sp] | *(sp) = r4;
0x00014404 ldr r3, [pc, 0x110] | r3 = "%s: error!: out of memory\n";
0x00014408 mov r2, 8 | r2 = 8;
0x0001440c ldr r1, [pc, 0x10c] | r1 = *(0x1451c);
0x00014410 str r0, [sp, 4] | var_4h = r0;
0x00014414 mov r0, r5 | r0 = r5;
0x00014418 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x0001441c mvn r0, 0 | r0 = ~0;
0x00014420 bl 0x10ba8 | exit (r0);
| }
0x00014424 str r1, [r5, 0x94] | *((r5 + 0x94)) = r1;
0x00014428 mov r2, 0x1000 | r2 = 0x1000;
0x0001442c mov r0, r4 | r0 = r4;
0x00014430 bl 0x10b0c | r0 = read (r0, r1, r2);
0x00014434 cmn r0, 1 |
0x00014438 mov r7, r0 | r7 = r0;
| if (r0 != 1) {
0x0001443c bne 0x144a0 | goto label_1;
| }
0x00014440 bl 0x10b9c | errno_location ();
0x00014444 ldr r7, [pc, 0xc4] |
0x00014448 ldr r3, [pc, 0xbc] | r3 = *(0x14508);
0x0001444c ldr r2, [pc, 0xc0] | r2 = stderr;
0x00014450 ldr r1, [pc, 0xcc] | r1 = "_serror__d___s_";
0x00014454 ldr r6, [r0] | r6 = *(r0);
0x00014458 ldr r0, [r7] | r0 = "/proc/mtd";
0x0001445c bl 0x10ae8 | fprintf ("/proc/mtd", "_serror__d___s_", r2, r3, r4, r5, r6)
0x00014460 mov r0, r6 | r0 = r6;
0x00014464 ldr r7, [r7] | r7 = "/proc/mtd";
0x00014468 bl 0x10a4c | strerror (r0);
0x0001446c str r6, [sp] | *(sp) = r6;
0x00014470 ldr r3, [pc, 0xa4] | r3 = "%s: error!: out of memory\n";
0x00014474 mov r2, 8 | r2 = 8;
0x00014478 ldr r1, [pc, 0xa0] | r1 = *(0x1451c);
0x0001447c str r0, [sp, 4] | var_4h = r0;
0x00014480 mov r0, r7 | r0 = r7;
0x00014484 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4, r5, r6)
| do {
0x00014488 ldr r0, [r5, 0x94] | r0 = *((r5 + 0x94));
0x0001448c bl 0x10c08 | free (r0);
0x00014490 mov r0, r4 | r0 = r4;
0x00014494 bl 0x10bf0 | close (r0);
0x00014498 mvn r4, 0 | r4 = ~0;
0x0001449c b 0x14500 | goto label_0;
| label_1:
0x000144a0 cmp r0, 0x1e |
| if (r0 >= 0x1e) {
0x000144a4 bls 0x144c4 |
0x000144a8 ldr r6, [r5, 0x94] | r6 = *((r5 + 0x94));
0x000144ac mov r2, 0x1f | r2 = 0x1f;
0x000144b0 ldr r1, [pc, 0x70] | r1 = "%s: error!: cannot read \"%s\"\n";
0x000144b4 mov r0, r6 | r0 = r6;
0x000144b8 bl 0x10b24 | r0 = memcmp (r0, "%s: error!: cannot read \"%s\"\n", r2);
0x000144bc subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x000144c0 beq 0x144e8 | goto label_2;
| }
| }
0x000144c4 ldr r3, [pc, 0x5c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000144c8 ldr r0, [pc, 0x40] |
0x000144cc str r3, [sp] | *(sp) = r3;
0x000144d0 ldr r2, [pc, 0x3c] | r2 = stderr;
0x000144d4 ldr r3, [pc, 0x30] | r3 = *(0x14508);
0x000144d8 ldr r1, [pc, 0x4c] | r1 = "dev: size erasesize name\n";
0x000144dc ldr r0, [r0] | r0 = "/proc/mtd";
0x000144e0 bl 0x10ae8 | fprintf ("/proc/mtd", "dev: size erasesize name\n", r2, "%s: error!: cannot read \"%s\"\n")
0x000144e4 b 0x14488 |
| } while (1);
| label_2:
0x000144e8 add r6, r6, 0x1f | r6 += 0x1f;
0x000144ec mov r0, r4 | r0 = r4;
0x000144f0 str r7, [r5, 0x98] | *((r5 + 0x98)) = r7;
0x000144f4 str r6, [r5, 0x9c] | *((r5 + 0x9c)) = r6;
0x000144f8 bl 0x10bf0 | close (r0);
0x000144fc mov r4, r8 | r4 = r8;
| label_0:
0x00014500 mov r0, r4 | r0 = r4;
0x00014504 add sp, sp, 8 |
0x00014508 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/nanddump @ 0x14530 */
| #include <stdint.h>
|
; (fcn) fcn.00014530 () | void fcn_00014530 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
0x00014530 push {r0, r1, r2, r4, r5, lr} |
0x00014534 ldr r0, [pc, 0x74] | r0 = *(0x145ac);
0x00014538 mov r1, 4 | r1 = 4;
0x0001453c bl 0x10b90 | r0 = access (r0, r1);
0x00014540 cmp r0, 0 |
| if (r0 != 0) {
0x00014544 moveq r0, 1 | r0 = 1;
| }
| if (r0 != 0) {
0x00014548 beq 0x145a8 |
0x0001454c bl 0x10b9c | r0 = errno_location ();
0x00014550 ldr r4, [r0] | r4 = *(r0);
0x00014554 cmp r4, 2 |
| if (r4 != 2) {
0x00014558 moveq r3, 0 | r3 = 0;
| }
| if (r4 != 2) {
0x0001455c streq r3, [r0] | *(r0) = r3;
| }
| if (r4 != 2) {
0x00014560 beq 0x145a4 |
0x00014564 ldr r5, [pc, 0x48] |
0x00014568 ldr r3, [pc, 0x40] | r3 = *(0x145ac);
0x0001456c ldr r2, [pc, 0x44] | r2 = stderr;
0x00014570 ldr r1, [pc, 0x44] | r1 = "libmtd";
0x00014574 ldr r0, [r5] | r0 = "/proc/mtd";
0x00014578 bl 0x10ae8 | fprintf ("/proc/mtd", "libmtd", r2, r3, r4, "/proc/mtd")
0x0001457c mov r0, r4 | r0 = r4;
0x00014580 ldr r5, [r5] | r5 = "/proc/mtd";
0x00014584 bl 0x10a4c | strerror (r0);
0x00014588 str r4, [sp] | *(sp) = r4;
0x0001458c ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00014590 mov r2, 8 | r2 = 8;
0x00014594 ldr r1, [pc, 0x28] | r1 = *(0x145c0);
0x00014598 str r0, [sp, 4] | var_4h = r0;
0x0001459c mov r0, r5 | r0 = r5;
0x000145a0 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| }
0x000145a4 mov r0, 0 | r0 = 0;
| }
0x000145a8 add sp, sp, 0xc |
0x000145ac 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/nanddump @ 0x14684 */
| #include <stdint.h>
|
; (fcn) fcn.00014684 () | void fcn_00014684 (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;
0x00014684 push {r4, r5, r6, r7, lr} |
0x00014688 sub sp, sp, 0x1bc |
0x0001468c add r1, sp, 8 | r1 += var_8h;
0x00014690 mov r5, r0 | r5 = r0;
0x00014694 bl 0x10a58 | r0 = stat64 ();
0x00014698 subs r1, r0, 0 | r1 = r0 - 0;
| if (r1 == r0) {
0x0001469c beq 0x146f8 | goto label_1;
| }
0x000146a0 bl 0x10b9c | errno_location ();
0x000146a4 ldr r6, [pc, 0x158] | r6 = *(0x14800);
0x000146a8 mov r3, r5 | r3 = r5;
0x000146ac ldr r2, [pc, 0x154] | r2 = stderr;
0x000146b0 ldr r1, [pc, 0x154] | r1 = "libmtd";
0x000146b4 ldr r4, [r0] | r4 = *(r0);
0x000146b8 ldr r0, [r6] | r0 = *(0x14800);
0x000146bc bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x000146c0 mov r0, r4 | r0 = r4;
0x000146c4 ldr r5, [r6] | r5 = *(0x14800);
0x000146c8 bl 0x10a4c | strerror (r0);
0x000146cc str r4, [sp] | *(sp) = r4;
0x000146d0 ldr r3, [pc, 0x138] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000146d4 mov r2, 8 | r2 = 8;
0x000146d8 ldr r1, [pc, 0x134] | r1 = *(0x14810);
0x000146dc str r0, [sp, 4] | var_4h = r0;
0x000146e0 mov r0, r5 | r0 = r5;
0x000146e4 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| do {
0x000146e8 mvn r4, 0 | r4 = ~0;
| label_0:
0x000146ec mov r0, r4 | r0 = r4;
0x000146f0 add sp, sp, 0x1bc |
0x000146f4 pop {r4, r5, r6, r7, pc} |
| label_1:
0x000146f8 ldr r3, [sp, 0x18] | r3 = var_18h;
0x000146fc and r3, r3, 0xf000 | r3 &= 0xf000;
0x00014700 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00014704 beq 0x14730 | goto label_2;
| }
0x00014708 bl 0x10b9c | errno_location ();
0x0001470c mov r3, 0x16 | r3 = 0x16;
0x00014710 ldr r2, [pc, 0xf0] | r2 = stderr;
0x00014714 ldr r1, [pc, 0xfc] | r1 = "_serror__d___s_";
0x00014718 str r3, [r0] | *(r0) = r3;
0x0001471c ldr r0, [pc, 0xe0] |
0x00014720 mov r3, r5 | r3 = r5;
0x00014724 ldr r0, [r0] | r0 = *(0x14800);
0x00014728 bl 0x10ae8 | fprintf (r0, "_serror__d___s_", r2, r3)
0x0001472c b 0x146e8 |
| } while (1);
| label_2:
0x00014730 mov r0, r5 | r0 = r5;
0x00014734 bl 0x10b60 | r0 = open64 ();
0x00014738 cmn r0, 1 |
0x0001473c mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00014740 bne 0x14790 |
0x00014744 bl 0x10b9c | errno_location ();
0x00014748 ldr r7, [pc, 0xb4] | r7 = *(0x14800);
0x0001474c mov r3, r5 | r3 = r5;
0x00014750 ldr r2, [pc, 0xb0] | r2 = stderr;
0x00014754 ldr r1, [pc, 0xb0] | r1 = "libmtd";
0x00014758 ldr r6, [r0] | r6 = *(r0);
0x0001475c ldr r0, [r7] | r0 = *(0x14800);
0x00014760 bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00014764 mov r0, r6 | r0 = r6;
0x00014768 ldr r5, [r7] | r5 = *(0x14800);
0x0001476c bl 0x10a4c | strerror (r0);
0x00014770 str r6, [sp] | *(sp) = r6;
0x00014774 ldr r3, [pc, 0x94] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00014778 mov r2, 8 | r2 = 8;
0x0001477c ldr r1, [pc, 0x90] | r1 = *(0x14810);
0x00014780 str r0, [sp, 4] | var_4h = r0;
0x00014784 mov r0, r5 | r0 = r5;
0x00014788 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5, r6)
0x0001478c b 0x146ec | goto label_0;
| }
0x00014790 add r2, sp, 0x70 | r2 += var_70h;
0x00014794 ldr r1, [pc, 0x80] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x00014798 bl 0x10a34 | r0 = ioctl (r0, "%s: error!: \"%s\" is not a character device\n");
0x0001479c subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 < r0) {
0x000147a0 ldrge r6, [sp, 0x174] | r6 = var_174h;
| }
| if (r6 < r0) {
0x000147a4 bge 0x147f4 |
0x000147a8 bl 0x10b9c | r0 = errno_location ();
0x000147ac ldr r5, [r0] | r5 = *(r0);
0x000147b0 cmp r5, 0x5f |
| if (r5 == 0x5f) {
0x000147b4 beq 0x147f4 | goto label_3;
| }
0x000147b8 ldr r7, [pc, 0x44] |
0x000147bc ldr r2, [pc, 0x44] | r2 = stderr;
0x000147c0 ldr r1, [pc, 0x58] | r1 = *(0x1481c);
0x000147c4 ldr r0, [r7] | r0 = *(0x14800);
0x000147c8 bl 0x10ae8 | fprintf (r0, r1, r2)
0x000147cc mov r0, r5 | r0 = r5;
0x000147d0 ldr r7, [r7] | r7 = *(0x14800);
0x000147d4 bl 0x10a4c | strerror (r0);
0x000147d8 str r5, [sp] | *(sp) = r5;
0x000147dc ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000147e0 mov r2, 8 | r2 = 8;
0x000147e4 ldr r1, [pc, 0x28] | r1 = *(0x14810);
0x000147e8 str r0, [sp, 4] | var_4h = r0;
0x000147ec mov r0, r7 | r0 = r7;
0x000147f0 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5)
| }
| label_3:
0x000147f4 mov r0, r4 | r0 = r4;
0x000147f8 bl 0x10bf0 | close (r0);
0x000147fc mov r4, r6 | r4 = r6;
0x00014800 b 0x146ec | 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/nanddump @ 0x14850 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00014850 () | void fcn_00014850 (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;
0x00014850 push {r4, r5, r6, r7, r8, sb, lr} |
0x00014854 sub sp, sp, 0x144 |
0x00014858 mov r2, 0 | r2 = 0;
0x0001485c mov r3, 0 | r3 = 0;
0x00014860 mov r4, r1 | r4 = r1;
0x00014864 add r1, sp, 0x38 | r1 += var_38h;
0x00014868 mov r6, r0 | r6 = r0;
0x0001486c strd r2, r3, [sp, 0x10] | __asm ("strd r2, r3, [var_10h]");
0x00014870 bl 0x10a58 | r0 = stat64 ();
0x00014874 cmp r0, 0 |
| if (r0 != 0) {
0x00014878 beq 0x148e0 |
0x0001487c bl 0x10b9c | errno_location ();
0x00014880 ldr r8, [pc, 0x450] |
0x00014884 mov r3, r6 | r3 = r6;
0x00014888 ldr r2, [pc, 0x44c] | r2 = stderr;
0x0001488c ldr r1, [pc, 0x44c] | r1 = "libmtd";
0x00014890 ldr r7, [r0] | r7 = *(r0);
0x00014894 mov r5, r0 | r5 = r0;
0x00014898 ldr r0, [r8] | r0 = *(0x14cd4);
0x0001489c bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x000148a0 mov r0, r7 | r0 = r7;
0x000148a4 ldr r8, [r8] | r8 = *(0x14cd4);
0x000148a8 bl 0x10a4c | strerror (r0);
0x000148ac ldr r3, [pc, 0x430] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000148b0 str r7, [sp] | *(sp) = r7;
0x000148b4 mov r2, 8 | r2 = 8;
0x000148b8 ldr r1, [pc, 0x428] | r1 = *(0x14ce4);
0x000148bc str r0, [sp, 4] | var_4h = r0;
0x000148c0 mov r0, r8 | r0 = r8;
0x000148c4 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n")
0x000148c8 ldr r3, [r5] | r3 = *(r5);
0x000148cc cmp r3, 2 |
| if (r3 != 2) {
0x000148d0 bne 0x148e0 | goto label_5;
| }
0x000148d4 ldr r1, [pc, 0x400] | r1 = stderr;
0x000148d8 ldr r0, [pc, 0x40c] | r0 = "_serror__d___s_";
0x000148dc bl 0x10a40 | printf ("_serror__d___s_", r1);
| }
| label_5:
0x000148e0 ldr r3, [sp, 0x48] | r3 = var_48h;
0x000148e4 and r3, r3, 0xf000 | r3 &= 0xf000;
0x000148e8 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x000148ec beq 0x1491c | goto label_6;
| }
0x000148f0 bl 0x10b9c | errno_location ();
0x000148f4 mov r3, 0x16 | r3 = 0x16;
0x000148f8 ldr r2, [pc, 0x3dc] | r2 = stderr;
0x000148fc ldr r1, [pc, 0x3ec] | r1 = "_s:_MTD_subsystem_is_old_and_does_not_support_sysfs__so_MTD_character_device_nodes_have_to_exist";
0x00014900 str r3, [r0] | *(r0) = r3;
0x00014904 ldr r0, [pc, 0x3cc] |
0x00014908 mov r3, r6 | r3 = r6;
0x0001490c ldr r0, [r0] | r0 = *(0x14cd4);
0x00014910 bl 0x10ae8 | fprintf (r0, "_s:_MTD_subsystem_is_old_and_does_not_support_sysfs__so_MTD_character_device_nodes_have_to_exist", r2, r3)
| do {
| label_0:
0x00014914 mvn r5, 0 | r5 = ~0;
0x00014918 b 0x14a00 | goto label_4;
| label_6:
0x0001491c mov r2, 0x100 | r2 = 0x100;
0x00014920 mov r1, 0 | r1 = 0;
0x00014924 mov r0, r4 | r0 = r4;
0x00014928 bl 0x10b54 | memset (r0, r1, r2);
0x0001492c ldrd r8, sb, [sp, 0x58] | __asm ("ldrd r8, sb, [var_58h]");
0x00014930 mov r1, sb | r1 = sb;
0x00014934 mov r0, r8 | r0 = r8;
0x00014938 bl 0x10a70 | gnu_dev_major ();
0x0001493c mov r1, sb | r1 = sb;
0x00014940 mov r5, r0 | r5 = r0;
0x00014944 str r0, [r4, 4] | *((r4 + 4)) = r0;
0x00014948 mov r0, r8 | r0 = r8;
0x0001494c bl 0x10ab8 | gnu_dev_minor ();
0x00014950 cmp r5, 0x5a |
0x00014954 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r5 == 0x5a) {
0x00014958 beq 0x14994 | goto label_7;
| }
0x0001495c bl 0x10b9c | errno_location ();
0x00014960 mov r3, 0x16 | r3 = 0x16;
0x00014964 ldr r2, [pc, 0x370] | r2 = stderr;
0x00014968 ldr r1, [pc, 0x384] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x0001496c str r3, [r0] | *(r0) = r3;
0x00014970 mov r3, 0x5a | r3 = 0x5a;
0x00014974 str r3, [sp, 4] | var_4h = r3;
0x00014978 ldr r0, [pc, 0x358] |
0x0001497c ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00014980 str r3, [sp] | *(sp) = r3;
0x00014984 mov r3, r6 | r3 = r6;
0x00014988 ldr r0, [r0] | r0 = *(0x14cd4);
0x0001498c bl 0x10ae8 | fprintf (r0, "%s: error!: \"%s\" is not a character device\n", r2, r3)
0x00014990 b 0x14914 |
| } while (1);
| label_7:
0x00014994 add r0, r0, r0, lsr 31 | r0 += (r0 >> 31);
0x00014998 asr r0, r0, 1 | r0 >>= 1;
0x0001499c str r0, [r4] | *(r4) = r0;
0x000149a0 mov r1, 0 | r1 = 0;
0x000149a4 mov r0, r6 | r0 = r6;
0x000149a8 bl 0x10b60 | r0 = open64 ();
0x000149ac cmn r0, 1 |
0x000149b0 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x000149b4 bne 0x14a0c |
0x000149b8 bl 0x10b9c | errno_location ();
0x000149bc ldr r7, [pc, 0x314] | r7 = *(0x14cd4);
0x000149c0 mov r3, r6 | r3 = r6;
0x000149c4 ldr r2, [pc, 0x310] | r2 = stderr;
0x000149c8 ldr r1, [pc, 0x310] | r1 = "libmtd";
0x000149cc ldr r4, [r0] | r4 = *(r0);
0x000149d0 ldr r0, [r7] | r0 = *(0x14cd4);
0x000149d4 bl 0x10ae8 | fprintf (r0, "libmtd", r2, r3, r4)
0x000149d8 mov r0, r4 | r0 = r4;
0x000149dc ldr r6, [r7] | r6 = *(0x14cd4);
0x000149e0 bl 0x10a4c | strerror (r0);
0x000149e4 str r4, [sp] | *(sp) = r4;
0x000149e8 ldr r3, [pc, 0x2f4] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000149ec mov r2, 8 | r2 = 8;
0x000149f0 ldr r1, [pc, 0x2f0] | r1 = *(0x14ce4);
0x000149f4 str r0, [sp, 4] | var_4h = r0;
0x000149f8 mov r0, r6 | r0 = r6;
0x000149fc bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| label_4:
0x00014a00 mov r0, r5 | r0 = r5;
0x00014a04 add sp, sp, 0x144 |
0x00014a08 pop {r4, r5, r6, r7, r8, sb, pc} |
| }
0x00014a0c add r2, sp, 0x18 | r2 += var_18h;
0x00014a10 ldr r1, [pc, 0x2e0] | r1 = "_s:_error_:___s__has_major_number__d__MTD_devices_have_major__d";
0x00014a14 bl 0x10a34 | r0 = ioctl (r0, "_s:_error_:___s__has_major_number__d__MTD_devices_have_major__d");
0x00014a18 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00014a1c beq 0x14a70 | goto label_8;
| }
0x00014a20 bl 0x10b9c | errno_location ();
0x00014a24 ldr r6, [pc, 0x2ac] |
0x00014a28 ldr r2, [pc, 0x2ac] | r2 = stderr;
0x00014a2c ldr r1, [pc, 0x2c8] | r1 = *(0x14cf8);
0x00014a30 ldr r4, [r0] | r4 = *(r0);
0x00014a34 ldr r0, [r6] | r0 = *(0x14cd4);
0x00014a38 bl 0x10ae8 | fprintf (r0, r1, r2, r3, r4, r5, r6)
0x00014a3c mov r0, r4 | r0 = r4;
0x00014a40 ldr r6, [r6] | r6 = *(0x14cd4);
0x00014a44 bl 0x10a4c | strerror (r0);
0x00014a48 ldr r3, [pc, 0x294] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00014a4c ldr r1, [pc, 0x294] | r1 = *(0x14ce4);
0x00014a50 mov r2, 8 | r2 = 8;
0x00014a54 str r4, [sp] | *(sp) = r4;
0x00014a58 str r0, [sp, 4] | var_4h = r0;
0x00014a5c mov r0, r6 | r0 = r6;
| do {
| label_1:
0x00014a60 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| label_2:
0x00014a64 mov r0, r5 | r0 = r5;
0x00014a68 bl 0x10bf0 | close (r0);
0x00014a6c b 0x14914 | goto label_0;
| label_8:
0x00014a70 add r2, sp, 0x10 | r2 += var_10h;
0x00014a74 ldr r1, [pc, 0x284] | r1 = "%s: error!: MEMGETINFO ioctl request failed\n";
0x00014a78 mov r0, r5 | r0 = r5;
0x00014a7c bl 0x10a34 | r0 = ioctl (r0, "%s: error!: MEMGETINFO ioctl request failed\n");
0x00014a80 cmn r0, 1 |
| if (r0 == 1) {
0x00014a84 ldrbne r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
| if (r0 == 1) {
0x00014a88 orrne r3, r3, 2 | r3 |= 2;
| }
| if (r0 != 1) {
0x00014a8c bne 0x14ae8 | goto label_9;
| }
0x00014a90 bl 0x10b9c | r0 = errno_location ();
0x00014a94 ldr r7, [r0] | r7 = *(r0);
0x00014a98 cmp r7, 0x5f |
| if (r7 != 0x5f) {
0x00014a9c streq r8, [r0] | *(r0) = r8;
| }
| if (r7 != 0x5f) {
0x00014aa0 ldrbeq r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
0x00014aa4 biceq r3, r3, 2 | __asm ("biceq r3, r3, 2");
| if (r7 == 0x5f) {
0x00014aa8 beq 0x14ae8 | goto label_9;
| }
0x00014aac ldr r4, [pc, 0x224] |
0x00014ab0 ldr r2, [pc, 0x224] | r2 = stderr;
0x00014ab4 ldr r1, [pc, 0x248] | r1 = *(0x14d00);
0x00014ab8 ldr r0, [r4] | r0 = *(0x14cd4);
0x00014abc bl 0x10ae8 | fprintf (r0, r1, r2, r3, r4)
0x00014ac0 mov r0, r7 | r0 = r7;
0x00014ac4 ldr r4, [r4] | r4 = *(0x14cd4);
0x00014ac8 bl 0x10a4c | strerror (r0);
0x00014acc str r7, [sp] | *(sp) = r7;
0x00014ad0 ldr r3, [pc, 0x20c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00014ad4 mov r2, 8 | r2 = 8;
0x00014ad8 ldr r1, [pc, 0x208] | r1 = *(0x14ce4);
0x00014adc str r0, [sp, 4] | var_4h = r0;
0x00014ae0 mov r0, r4 | r0 = r4;
0x00014ae4 b 0x14a60 |
| } while (1);
| label_9:
0x00014ae8 strb r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
0x00014aec ldr r3, [sp, 0x28] | r3 = var_28h;
0x00014af0 ldrb r7, [sp, 0x18] | r7 = var_18h;
0x00014af4 ldr r0, [sp, 0x20] | r0 = var_20h;
0x00014af8 ldr r2, [sp, 0x24] | r2 = var_24h;
0x00014afc ldr ip, [sp, 0x2c] | ip = var_2ch;
0x00014b00 mov r1, 0 | r1 = 0;
0x00014b04 cmp r3, 0 |
0x00014b08 str r7, [r4, 0xc] | *((r4 + 0xc)) = r7;
0x00014b0c strd r0, r1, [r4, 0xd8] | __asm ("strd r0, r1, [r4, 0xd8]");
0x00014b10 str r2, [r4, 0xe4] | *((r4 + 0xe4)) = r2;
0x00014b14 str r3, [r4, 0xe8] | *((r4 + 0xe8)) = r3;
0x00014b18 str ip, [r4, 0xf0] | *((r4 + 0xf0)) = ip;
| if (r3 > 0) {
0x00014b1c bgt 0x14b40 | goto label_10;
| }
0x00014b20 str r3, [sp, 4] | var_4h = r3;
0x00014b24 str r6, [sp] | *(sp) = r6;
0x00014b28 ldr r2, [pc, 0x1ac] | r2 = stderr;
0x00014b2c ldr r3, [r4] | r3 = *(r4);
0x00014b30 ldr r1, [pc, 0x1d0] | r1 = "_s:_error_:_MEMGETBADBLOCK_ioctl_failed";
| do {
0x00014b34 ldr r0, [pc, 0x19c] |
0x00014b38 ldr r0, [r0] | r0 = *(0x14cd4);
0x00014b3c b 0x14a60 | goto label_1;
| label_10:
0x00014b40 cmp r2, r3 |
0x00014b44 cmpge r2, 0 | __asm ("cmpge r2, 0");
| if (r2 > r3) {
0x00014b48 bgt 0x14b64 | goto label_11;
| }
0x00014b4c str r2, [sp, 4] | var_4h = r2;
0x00014b50 str r6, [sp] | *(sp) = r6;
0x00014b54 ldr r2, [pc, 0x180] | r2 = stderr;
0x00014b58 ldr r3, [r4] | r3 = *(r4);
0x00014b5c ldr r1, [pc, 0x1a8] | r1 = "%s: error!: mtd%d (%s) has insane min. I/O unit size %d\n";
0x00014b60 b 0x14b34 |
| } while (1);
| label_11:
0x00014b64 orrs r3, r0, r1 | r3 = r0 | r1;
| if (r3 != r0) {
0x00014b68 beq 0x14b7c |
0x00014b6c asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00014b70 cmp r0, r2 |
0x00014b74 sbcs ip, r1, r3 | __asm ("sbcs ip, r1, r3");
| if (r0 >= r2) {
0x00014b78 bge 0x14ba0 | goto label_12;
| }
| }
0x00014b7c strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [var_8h]");
0x00014b80 ldr r0, [pc, 0x150] |
0x00014b84 str r6, [sp] | *(sp) = r6;
0x00014b88 ldr r2, [pc, 0x14c] | r2 = stderr;
0x00014b8c ldr r3, [r4] | r3 = *(r4);
0x00014b90 ldr r1, [pc, 0x178] | r1 = "_s:_error_:_mtd_d___s__has_insane_eraseblock_size__d";
0x00014b94 ldr r0, [r0] | r0 = *(0x14cd4);
0x00014b98 bl 0x10ae8 | fprintf (r0, "_s:_error_:_mtd_d___s__has_insane_eraseblock_size__d", r2, r3, r4, r5, r6)
0x00014b9c b 0x14a64 | goto label_2;
| label_12:
0x00014ba0 bl 0x14f34 | fcn_00014f34 (r0);
0x00014ba4 str r0, [r4, 0xe0] | *((r4 + 0xe0)) = r0;
0x00014ba8 cmp r7, 8 |
| if (r7 > 8) {
| /* switch table (9 cases) at 0x14bb4 */
0x00014bac ldrls pc, [pc, r7, lsl 2] | offset_0 = r7 << 2;
| pc = *((pc + offset_0));
| }
0x00014bb0 b 0x14a64 | goto label_2;
0x00014bd8 ldr r0, [pc, 0xf8] |
0x00014bdc str r6, [sp] | *(sp) = r6;
0x00014be0 ldr r2, [pc, 0xf4] | r2 = stderr;
0x00014be4 ldr r3, [r4] | r3 = *(r4);
0x00014be8 ldr r1, [pc, 0x124] | r1 = "_s:_error_:_mtd_d___s__has_insane_size__lld";
0x00014bec ldr r0, [r0] | r0 = *(0x14cd4);
0x00014bf0 bl 0x10ae8 | fprintf (r0, "_s:_error_:_mtd_d___s__has_insane_size__lld", r2, r3, r4, r5, r6)
0x00014bf4 b 0x14a64 | goto label_2;
0x00014bf8 ldr r1, [pc, 0x118] | r1 = "%s: error!: mtd%d (%s) is removable and is not present\n";
| label_3:
0x00014bfc add r0, r4, 0x10 | r0 = r4 + 0x10;
0x00014c00 bl 0x10a28 | strcpy (r0, "%s: error!: mtd%d (%s) is removable and is not present\n");
0x00014c04 ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x00014c08 mov r0, r5 | r0 = r5;
0x00014c0c tst r3, 0x400 |
| if ((r3 & 0x400) == 0) {
0x00014c10 ldrbne r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
| if ((r3 & 0x400) == 0) {
0x00014c14 orrne r3, r3, 1 | r3 |= 1;
| }
| if ((r3 & 0x400) == 0) {
0x00014c18 strbne r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
| }
0x00014c1c ldr r3, [r4, 0xe8] | r3 = *((r4 + 0xe8));
0x00014c20 str r3, [r4, 0xec] | *((r4 + 0xec)) = r3;
0x00014c24 bl 0x10bf0 | close (r0);
0x00014c28 mov r0, r6 | r0 = r6;
0x00014c2c bl 0x14684 | r0 = fcn_00014684 (r0);
0x00014c30 bic r0, r0, r0, asr 31 | r0 = BIT_MASK (r0, r0);
0x00014c34 str r0, [r4, 0xf4] | *((r4 + 0xf4)) = r0;
0x00014c38 add r0, sp, 0xa0 | r0 += var_a0h;
0x00014c3c bl 0x143a8 | fcn_000143a8 (r0);
0x00014c40 subs r5, r0, 0 | r5 -= var_a0h;
| if (r5 != var_a0h) {
0x00014c44 bne 0x14914 | goto label_0;
| }
| do {
0x00014c48 add r0, sp, 0xa0 | r0 += var_a0h;
0x00014c4c bl 0x14244 | r0 = fcn_00014244 (r0);
0x00014c50 cmp r0, 0 |
| if (r0 == 0) {
0x00014c54 bne 0x14cb8 |
0x00014c58 ldr r3, [pc, 0xbc] | r3 = "ram";
0x00014c5c ldr r0, [pc, 0x74] |
0x00014c60 str r3, [sp] | *(sp) = r3;
0x00014c64 ldr r2, [pc, 0x70] | r2 = stderr;
0x00014c68 ldr r3, [r4] | r3 = *(r4);
0x00014c6c ldr r1, [pc, 0xac] | r1 = "/proc/mtd";
0x00014c70 ldr r0, [r0] | r0 = *(0x14cd4);
0x00014c74 bl 0x10ae8 | r0 = fprintf (r0, "/proc/mtd", r2, "ram")
0x00014c78 bl 0x10b9c | errno_location ();
0x00014c7c mov r3, 2 | r3 = 2;
0x00014c80 str r3, [r0] | *(r0) = r3;
0x00014c84 b 0x14914 | goto label_0;
0x00014c88 ldr r1, [pc, 0x94] | r1 = "%s: error!: mtd%d not found in \"%s\"\n";
0x00014c8c b 0x14bfc | goto label_3;
0x00014c90 ldr r1, [pc, 0x90] | r1 = *(0x14d24);
0x00014c94 b 0x14bfc | goto label_3;
0x00014c98 ldr r1, [pc, 0x8c] | r1 = *(0x14d28);
0x00014c9c b 0x14bfc | goto label_3;
0x00014ca0 ldr r1, [pc, 0x88] | r1 = "nand";
0x00014ca4 b 0x14bfc | goto label_3;
0x00014ca8 ldr r1, [pc, 0x84] | r1 = "mlc_nand";
0x00014cac b 0x14bfc | goto label_3;
0x00014cb0 ldr r1, [pc, 0x80] | r1 = "dataflash";
0x00014cb4 b 0x14bfc | goto label_3;
| }
0x00014cb8 ldr r3, [r4] | r3 = *(r4);
0x00014cbc ldr r2, [sp, 0xa0] | r2 = var_a0h;
0x00014cc0 cmp r2, r3 |
0x00014cc4 bne 0x14c48 |
| } while (r2 != r3);
0x00014cc8 add r1, sp, 0xb0 | r1 += src;
0x00014ccc add r0, r4, 0x51 | r0 = r4 + 0x51;
0x00014cd0 bl 0x10a28 | strcpy (r0, r1);
0x00014cd4 b 0x14a00 | 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/nanddump @ 0x10cdc */
| #include <stdint.h>
|
; (fcn) main () | int32_t main (int32_t argc, char ** argv) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_8h_2;
| int32_t var_10h;
| FILE * format;
| int32_t var_18h_2;
| void * s;
| void * ptr;
| int32_t var_28h;
| int32_t var_28h_2;
| int32_t var_30h;
| int32_t var_30h_2;
| int32_t var_38h;
| int32_t var_3ch;
| int32_t var_40h;
| int32_t var_44h;
| int32_t var_48h;
| int32_t var_4ch;
| int32_t var_50h;
| int32_t var_54h;
| int32_t var_58h;
| int32_t var_5ch;
| char * var_68h;
| int32_t var_b8h;
| int32_t var_190h;
| int32_t var_0h_2;
| int32_t var_19ch;
| size_t var_1a0h;
| size_t size;
| int32_t var_1b8h;
| int32_t var_1bch;
| r0 = argc;
| r1 = argv;
0x00010cdc push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00010ce0 ldr r4, [pc, 0xb24] | r4 = *(0x11808);
0x00010ce4 ldr r5, [pc, 0xb24] | r5 = *(0x1180c);
0x00010ce8 sub sp, sp, 0x1bc |
0x00010cec mov r3, 0 | r3 = 0;
0x00010cf0 mov r6, r0 | r6 = r0;
0x00010cf4 mov sl, r1 | sl = r1;
0x00010cf8 mov sb, 1 | sb = 1;
0x00010cfc str r3, [sp, 0x68] | var_68h = r3;
| do {
| label_0:
0x00010d00 ldr r3, [pc, 0xb0c] | r3 = *(0x11810);
0x00010d04 add r8, sp, 0x1b8 | r8 += var_1b8h;
0x00010d08 mov r7, 0 | r7 = 0;
0x00010d0c str r7, [r8, -0x100]! | *((r8 -= 0x100)) = r7;
0x00010d10 add r2, r3, 0xf0 | r2 = r3 + 0xf0;
0x00010d14 str r8, [sp] | *(sp) = r8;
0x00010d18 mov r1, sl | r1 = sl;
0x00010d1c mov r0, r6 | r0 = r6;
0x00010d20 bl 0x10a64 | r0 = getopt_long ();
0x00010d24 cmn r0, 1 |
0x00010d28 mov fp, r0 |
| if (r0 == 1) {
0x00010d2c beq 0x10f78 | goto label_20;
| }
0x00010d30 cmp r0, 0x68 |
| if (r0 == 0x68) {
0x00010d34 beq 0x10f60 | goto label_21;
| }
| if (r0 > 0x68) {
0x00010d38 bgt 0x10d88 | goto label_22;
| }
0x00010d3c cmp r0, 0x56 |
| if (r0 == 0x56) {
0x00010d40 beq 0x10e90 | goto label_23;
| }
| if (r0 > 0x56) {
0x00010d44 bgt 0x10d68 | goto label_24;
| }
0x00010d48 cmp r0, r7 |
| if (r0 == r7) {
0x00010d4c beq 0x10de0 | goto label_25;
| }
0x00010d50 cmp r0, 0x3f |
0x00010d54 bne 0x10d00 |
| } while (r0 != 0x3f);
| label_1:
0x00010d58 ldr r3, [sp, 0x68] | r3 = var_68h;
0x00010d5c add r3, r3, 1 | r3++;
0x00010d60 str r3, [sp, 0x68] | var_68h = r3;
0x00010d64 b 0x10d00 | goto label_0;
| label_24:
0x00010d68 cmp r0, 0x63 |
| if (r0 == 0x63) {
0x00010d6c beq 0x10f4c | goto label_26;
| }
0x00010d70 cmp r0, 0x66 |
| if (r0 == 0x66) {
0x00010d74 beq 0x10eb4 | goto label_27;
| }
0x00010d78 cmp r0, 0x61 |
| if (r0 != 0x61) {
0x00010d7c moveq r3, 1 | r3 = 1;
| }
| if (r0 != 0x61) {
0x00010d80 strbeq r3, [r4, 0x20] | *((r4 + 0x20)) = r3;
| }
0x00010d84 b 0x10d00 | goto label_0;
| label_22:
0x00010d88 cmp r0, 0x6f |
| if (r0 == 0x6f) {
0x00010d8c beq 0x10f38 | goto label_28;
| }
| if (r0 <= 0x6f) {
0x00010d90 bgt 0x10dac |
0x00010d94 cmp r0, 0x6c |
| if (r0 == 0x6c) {
0x00010d98 beq 0x10f20 | goto label_29;
| }
0x00010d9c cmp r0, 0x6e |
| if (r0 != 0x6e) {
0x00010da0 moveq r3, 1 | r3 = 1;
| }
| if (r0 != 0x6e) {
0x00010da4 strbeq r3, [r4, 0x24] | *((r4 + 0x24)) = r3;
| }
0x00010da8 b 0x10d00 | goto label_0;
| }
0x00010dac cmp r0, 0x71 |
| if (r0 != 0x71) {
0x00010db0 moveq r3, 1 | r3 = 1;
| }
| if (r0 == 0x71) {
0x00010db4 strbeq r3, [r4, 0x23] | *((r4 + 0x23)) = r3;
| goto label_30;
| }
| if (r0 == 0x71) {
| label_30:
0x00010db8 beq 0x10d00 | goto label_0;
| }
| if (r0 < 0x71) {
0x00010dbc blt 0x10f54 | goto label_31;
| }
0x00010dc0 cmp r0, 0x73 |
| if (r0 != 0x73) {
0x00010dc4 bne 0x10d00 | goto label_0;
| }
0x00010dc8 ldr r3, [pc, 0xa48] | r3 = "version";
0x00010dcc add r1, sp, 0x68 | r1 += var_68h;
0x00010dd0 ldr r0, [r3] | r0 = "version";
0x00010dd4 bl 0x119dc | fcn_000119dc ("version", r1);
0x00010dd8 strd r0, r1, [r4, 8] | __asm ("strd r0, r1, [r4, 8]");
0x00010ddc b 0x10d00 | goto label_0;
| label_25:
0x00010de0 ldr r2, [sp, 0xb8] | r2 = var_b8h;
0x00010de4 cmp r2, 2 |
| if (r2 == 2) {
0x00010de8 beq 0x10e60 | goto label_32;
| }
0x00010dec cmp r2, 3 |
| if (r2 != 3) {
0x00010df0 moveq r3, 1 | r3 = 1;
| }
| if (r2 == 3) {
0x00010df4 strbeq r3, [r4] | *(r4) = r3;
| goto label_33;
| }
| if (r2 == 3) {
| label_33:
0x00010df8 beq 0x10d00 | goto label_0;
| }
0x00010dfc cmp r2, 1 |
| if (r2 != 1) {
0x00010e00 bne 0x10d00 | goto label_0;
| }
0x00010e04 ldr r3, [pc, 0xa0c] | r3 = "version";
0x00010e08 ldr r1, [pc, 0xa0c] | r1 = optarg;
0x00010e0c ldr r7, [r3] | r7 = "version";
0x00010e10 mov r0, r7 | r0 = r7;
0x00010e14 bl 0x10b78 | r0 = strcmp (r0, r1);
0x00010e18 cmp r0, 0 |
| if (r0 != 0) {
0x00010e1c moveq r3, 0 | r3 = 0;
| }
| if (r0 == 0) {
0x00010e20 beq 0x10e3c | goto label_34;
| }
0x00010e24 ldr r1, [pc, 0x9f4] | r1 = "padbad";
0x00010e28 mov r0, r7 | r0 = r7;
0x00010e2c bl 0x10b78 | r0 = strcmp (r0, "padbad");
0x00010e30 cmp r0, 0 |
| if (r0 != 0) {
0x00010e34 bne 0x10e44 | goto label_35;
| }
0x00010e38 mov r3, 1 | r3 = 1;
| do {
| label_34:
0x00010e3c str r3, [r5] | *(r5) = r3;
0x00010e40 b 0x10d00 | goto label_0;
| label_35:
0x00010e44 ldr r1, [pc, 0x9d8] | r1 = "dumpbad";
0x00010e48 mov r0, r7 | r0 = r7;
0x00010e4c bl 0x10b78 | r0 = strcmp (r0, "dumpbad");
0x00010e50 cmp r0, 0 |
| if (r0 != 0) {
0x00010e54 moveq r3, 2 | r3 = 2;
| }
0x00010e58 beq 0x10e3c |
| } while (r0 == 0);
0x00010e5c b 0x10d58 | goto label_1;
| label_32:
0x00010e60 cmp sb, 0 |
| if (sb == 0) {
0x00010e64 movne r2, 1 | r2 = 1;
| }
| if (sb == 0) {
0x00010e68 strbne r2, [r5, 4] | *((r5 + 4)) = r2;
| }
| if (sb != 0) {
0x00010e6c movne sb, r0 | sb = r0;
| goto label_36;
| }
| if (sb != 0) {
| label_36:
0x00010e70 bne 0x10d00 | goto label_0;
| }
| label_2:
0x00010e74 ldr r3, [pc, 0x9ac] | r3 = "skipbad";
0x00010e78 ldr r2, [pc, 0x9ac] | r2 = stderr;
0x00010e7c ldr r1, [pc, 0x9ac] | r1 = "nanddump";
0x00010e80 ldr r0, [r3] | r0 = "skipbad";
0x00010e84 bl 0x10ae8 | fprintf ("skipbad", "nanddump", r2, "skipbad")
| do {
| label_4:
0x00010e88 mvn r0, 0 | r0 = ~0;
0x00010e8c b 0x10eb0 | goto label_5;
| label_23:
0x00010e90 ldr r1, [pc, 0x994] | r1 = stderr;
0x00010e94 ldr r2, [pc, 0x998] | r2 = "_s:_error_:___oob_and___oomitoob_are_mutually_exclusive";
0x00010e98 ldr r0, [pc, 0x998] | r0 = "2.1.0";
0x00010e9c bl 0x10a40 | printf ("2.1.0", r1, "_s:_error_:___oob_and___oomitoob_are_mutually_exclusive");
0x00010ea0 ldr r1, [pc, 0x984] | r1 = stderr;
0x00010ea4 ldr r0, [pc, 0x990] | r0 = "%s (mtd-utils) %s\n";
0x00010ea8 bl 0x10a40 | printf ("%s (mtd-utils) %s\n", r1);
| label_3:
0x00010eac mov r0, r7 | r0 = r7;
| label_5:
0x00010eb0 bl 0x10ba8 | exit (r0);
| label_27:
0x00010eb4 ldr r3, [pc, 0x95c] | r3 = "version";
0x00010eb8 ldr r0, [r3] | r0 = "version";
0x00010ebc cmp r0, 0 |
| if (r0 == 0) {
0x00010ec0 beq 0x10f18 | goto label_37;
| }
0x00010ec4 bl 0x10b48 | r0 = strdup (r0);
0x00010ec8 cmp r0, 0 |
| if (r0 != 0) {
0x00010ecc bne 0x10f18 | goto label_37;
| }
0x00010ed0 bl 0x10b9c | errno_location ();
0x00010ed4 ldr r5, [pc, 0x94c] |
0x00010ed8 ldr r2, [pc, 0x94c] | r2 = stderr;
0x00010edc ldr r1, [pc, 0x95c] | r1 = "_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.";
0x00010ee0 ldr r4, [r0] | r4 = *(r0);
0x00010ee4 ldr r0, [r5] | r0 = "skipbad";
0x00010ee8 bl 0x10ae8 | fprintf ("skipbad", "_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.", r2, r3, r4, "skipbad")
0x00010eec mov r0, r4 | r0 = r4;
0x00010ef0 ldr r5, [r5] | r5 = "skipbad";
0x00010ef4 bl 0x10a4c | strerror (r0);
0x00010ef8 str r4, [sp] | *(sp) = r4;
0x00010efc ldr r3, [pc, 0x940] | r3 = "%s: error!: out of memory\n";
0x00010f00 mov r2, 0xa | r2 = 0xa;
0x00010f04 ldr r1, [pc, 0x93c] | r1 = *(0x11844);
0x00010f08 str r0, [sp, 4] | var_4h = r0;
0x00010f0c mov r0, r5 | r0 = r5;
0x00010f10 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x00010f14 b 0x10e88 |
| } while (1);
| label_37:
0x00010f18 str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
0x00010f1c b 0x10d00 | goto label_0;
| label_29:
0x00010f20 ldr r3, [pc, 0x8f0] | r3 = "version";
0x00010f24 add r1, sp, 0x68 | r1 += var_68h;
0x00010f28 ldr r0, [r3] | r0 = "version";
0x00010f2c bl 0x119dc | fcn_000119dc ("version", r1);
0x00010f30 strd r0, r1, [r4, 0x18] | __asm ("strd r0, r1, [r4, 0x18]");
0x00010f34 b 0x10d00 | goto label_0;
| label_28:
0x00010f38 cmp sb, 0 |
| if (sb == 0) {
0x00010f3c beq 0x10e74 | goto label_2;
| }
0x00010f40 strb r7, [r5, 4] | *((r5 + 4)) = r7;
0x00010f44 mov sb, r7 | sb = r7;
0x00010f48 b 0x10d00 | goto label_0;
| label_26:
0x00010f4c mov r3, 1 | r3 = 1;
0x00010f50 strb r3, [r4, 0x21] | *((r4 + 0x21)) = r3;
| label_31:
0x00010f54 mov r3, 1 | r3 = 1;
0x00010f58 strb r3, [r4, 0x22] | *((r4 + 0x22)) = r3;
0x00010f5c b 0x10d00 | goto label_0;
| label_21:
0x00010f60 ldr r3, [pc, 0x8e4] | r3 = "_serror__d___s_";
0x00010f64 ldr r2, [pc, 0x8c0] | r2 = stderr;
0x00010f68 ldr r1, [pc, 0x8e0] | r1 = stdout;
0x00010f6c ldr r0, [r3] | r0 = "_serror__d___s_";
0x00010f70 bl 0x10ae8 | fprintf ("_serror__d___s_", r1, r2, "_serror__d___s_")
0x00010f74 b 0x10eac | goto label_3;
| label_20:
0x00010f78 ldr r2, [pc, 0x88c] | r2 = *(0x11808);
0x00010f7c ldrd r0, r1, [r2, 8] | __asm ("ldrd r0, r1, [r2, 8]");
0x00010f80 mov r7, r2 | r7 = r2;
0x00010f84 cmp r0, 0 |
0x00010f88 sbcs r3, r1, 0 | __asm ("sbcs r3, r1, 0");
| if (r0 >= 0) {
0x00010f8c bge 0x10fac | goto label_38;
| }
0x00010f90 strd r0, r1, [sp] | __asm ("strd r0, r1, [sp]");
0x00010f94 ldr r2, [pc, 0x890] | r2 = stderr;
0x00010f98 ldr r1, [pc, 0x8b4] | r1 = "Usage:__s__OPTIONS__MTD_deviceDumps_the_contents_of_a_nand_mtd_partition._h___________help_______________Display_this_help_and_exit_____________version____________Output_version_information_and_exit_____________bbMETHOD__________Choose_bad_block_han";
| do {
0x00010f9c ldr r0, [pc, 0x884] |
0x00010fa0 ldr r0, [r0] | r0 = "skipbad";
0x00010fa4 bl 0x10ae8 | fprintf (r0, "Usage:__s__OPTIONS__MTD_deviceDumps_the_contents_of_a_nand_mtd_partition._h___________help_______________Display_this_help_and_exit_____________version____________Output_version_information_and_exit_____________bbMETHOD__________Choose_bad_block_han", r2)
0x00010fa8 b 0x10e88 | goto label_4;
| label_38:
0x00010fac ldrd r0, r1, [r2, 0x18] | __asm ("ldrd r0, r1, [r2, 0x18]");
0x00010fb0 cmp r0, 0 |
0x00010fb4 sbcs r3, r1, 0 | __asm ("sbcs r3, r1, 0");
0x00010fb8 strdlt r0, r1, [sp] | __asm ("strdlt r0, r1, [sp]");
| if (r0 >= 0) {
0x00010fbc ldrlt r2, [pc, 0x868] | r2 = "nanddump";
| }
| if (r0 >= 0) {
0x00010fc0 ldrlt r1, [pc, 0x890] | r1 = "%s: error!: Can't specify negative length with option -l: %lld\n";
| }
0x00010fc4 blt 0x10f9c |
| } while (r0 < 0);
0x00010fc8 ldrb r1, [r2, 0x23] | r1 = *((r2 + 0x23));
0x00010fcc cmp r1, 0 |
| if (r1 == 0) {
0x00010fd0 beq 0x10ff8 | goto label_39;
| }
0x00010fd4 ldrb r2, [r2, 0x22] | r2 = *((r2 + 0x22));
0x00010fd8 cmp r2, 0 |
| if (r2 == 0) {
0x00010fdc beq 0x10ff8 | goto label_39;
| }
0x00010fe0 ldr r3, [pc, 0x840] | r3 = "skipbad";
0x00010fe4 ldr r0, [pc, 0x870] | r0 = "%s: error!: Can't specify negative length with option -l: %lld\n";
0x00010fe8 ldr r1, [r3] | r1 = "skipbad";
| do {
0x00010fec bl 0x10bcc | fputs ("%s: error!: Can't specify negative length with option -l: %lld\n", "skipbad");
| label_6:
0x00010ff0 mov r0, 1 | r0 = 1;
0x00010ff4 b 0x10eb0 | goto label_5;
| label_39:
0x00010ff8 ldrb r2, [r7, 0x20] | r2 = *((r7 + 0x20));
0x00010ffc cmp r2, 0 |
| if (r2 == 0) {
0x00011000 beq 0x1101c | goto label_40;
| }
0x00011004 ldrb r2, [r7, 0x22] | r2 = *((r7 + 0x22));
0x00011008 cmp r2, 0 |
| if (r2 == 0) {
0x0001100c ldrne r3, [pc, 0x814] | r3 = obj.stderr;
| }
| if (r2 == 0) {
0x00011010 ldrne r0, [pc, 0x848] | r0 = "The forcebinary and pretty print options are\nmutually-exclusive. Choose one or the other.\n";
| }
| if (r2 == 0) {
0x00011014 ldrne r1, [r3] | r1 = *(r3);
| }
0x00011018 bne 0x10fec |
| } while (r2 != 0);
| label_40:
0x0001101c ldr r2, [pc, 0x840] |
0x00011020 ldr r2, [r2] | r2 = "The forcebinary and pretty print options are\nmutually-exclusive. Choose one or the other.\n";
0x00011024 sub r6, r6, r2 | r6 -= r2;
0x00011028 cmp r6, 1 |
| if (r6 == 1) {
0x0001102c bne 0x1103c |
0x00011030 ldr r4, [sp, 0x68] | r4 = var_68h;
0x00011034 cmp r4, 0 |
| if (r4 == 0) {
0x00011038 beq 0x11054 | goto label_41;
| }
| }
0x0001103c ldr r3, [pc, 0x7e4] | r3 = "skipbad";
0x00011040 ldr r2, [pc, 0x7e4] | r2 = stderr;
0x00011044 ldr r1, [pc, 0x804] | r1 = stdout;
0x00011048 ldr r0, [r3] | r0 = "skipbad";
0x0001104c bl 0x10ae8 | fprintf ("skipbad", r1, r2, "skipbad")
0x00011050 b 0x10ff0 | goto label_6;
| label_41:
0x00011054 ldr r2, [sl, r2, lsl 2] | offset_0 = r2 << 2;
| r2 = *((sl + offset_0));
0x00011058 str r2, [r7, 0x28] | *((r7 + 0x28)) = r2;
0x0001105c bl 0x12a98 | r0 = fcn_00012a98 ();
0x00011060 subs r3, r0, 0 | r3 = r0 - 0;
0x00011064 str r3, [sp, 0x3c] | var_3ch = r3;
| if (r3 != r0) {
0x00011068 bne 0x1108c | goto label_42;
| }
0x0001106c ldr r2, [pc, 0x7b8] | r2 = stderr;
0x00011070 ldr r1, [pc, 0x7f0] | r1 = optind;
| do {
0x00011074 ldr r0, [pc, 0x7ac] |
0x00011078 ldr r0, [r0] | r0 = "skipbad";
0x0001107c bl 0x10ae8 | fprintf ("skipbad", r1, r2)
| label_9:
0x00011080 mov r0, fp | r0 = fp;
0x00011084 add sp, sp, 0x1bc |
0x00011088 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_42:
0x0001108c mov r1, r4 | r1 = r4;
0x00011090 ldr r0, [r7, 0x28] | r0 = *((r7 + 0x28));
0x00011094 bl 0x10b60 | r0 = open64 ();
0x00011098 cmn r0, 1 |
0x0001109c mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x000110a0 bne 0x110b0 |
0x000110a4 ldr r0, [r7, 0x28] | r0 = *((r7 + 0x28));
0x000110a8 bl 0x10a88 | perror (r0);
0x000110ac b 0x10ff0 | goto label_6;
| }
0x000110b0 mov r2, r8 | r2 = r8;
0x000110b4 ldr r1, [r7, 0x28] | r1 = *((r7 + 0x28));
0x000110b8 ldr r0, [sp, 0x3c] | r0 = var_3ch;
0x000110bc bl 0x13348 | r0 = fcn_00013348 (r0, r1);
0x000110c0 cmp r0, 0 |
| if (r0 >= 0) {
0x000110c4 ldrlt r2, [pc, 0x760] | r2 = "nanddump";
| }
| if (r0 >= 0) {
0x000110c8 ldrlt r1, [pc, 0x79c] | r1 = "%s: error!: mtd_get_dev_info failed\n";
| }
0x000110cc blt 0x11074 |
| } while (r0 < 0);
0x000110d0 ldr r4, [sp, 0x1a8] | r4 = size;
0x000110d4 lsl r4, r4, 2 | r4 <<= 2;
0x000110d8 mov r0, r4 | r0 = r4;
0x000110dc bl 0x10a94 | malloc (r0);
0x000110e0 adds r4, r4, 0 | r4 += 0;
| if (r4 == r4) {
0x000110e4 movne r4, 1 | r4 = 1;
| }
0x000110e8 cmp r0, 0 |
| if (r0 == 0) {
0x000110ec movne r4, 0 | r4 = 0;
| }
0x000110f0 cmp r4, 0 |
0x000110f4 str r0, [sp, 0x24] | ptr = r0;
0x000110f8 beq 0x11100 |
| while (r4 != 0) {
0x000110fc bl 0x10c14 | fcn_00010c14 ();
0x00011100 ldr r4, [sp, 0x1a0] | r4 = var_1a0h;
0x00011104 lsl r4, r4, 2 | r4 <<= 2;
0x00011108 mov r0, r4 | r0 = r4;
0x0001110c bl 0x10a94 | malloc (r0);
0x00011110 adds r4, r4, 0 | r4 += 0;
| if (r4 == r4) {
0x00011114 movne r4, 1 | r4 = 1;
| }
0x00011118 cmp r0, 0 |
| if (r0 == 0) {
0x0001111c movne r4, 0 | r4 = 0;
| }
0x00011120 cmp r4, 0 |
0x00011124 str r0, [sp, 0x20] | s = r0;
0x00011128 str r4, [sp, 0x38] | var_38h = r4;
0x0001112c bne 0x110fc |
| }
0x00011130 ldrb r3, [r7, 0x24] | r3 = *((r7 + 0x24));
0x00011134 cmp r3, 0 |
| if (r3 == 0) {
0x00011138 beq 0x11184 | goto label_43;
| }
0x0001113c mov r2, 3 | r2 = 3;
0x00011140 ldr r1, [pc, 0x728] | r1 = "%s: error!: mtd_get_dev_info failed\n";
0x00011144 mov r0, r5 | r0 = r5;
0x00011148 bl 0x10a34 | r0 = ioctl (r0, "%s: error!: mtd_get_dev_info failed\n");
0x0001114c cmp r0, 0 |
| if (r0 == 0) {
0x00011150 beq 0x111f8 | goto label_7;
| }
0x00011154 ldr r0, [pc, 0x718] | r0 = *(0x11870);
0x00011158 bl 0x10a88 | perror (r0);
0x0001115c ldr r4, [sp, 0x38] | r4 = var_38h;
| do {
| label_10:
0x00011160 mov r0, r5 | r0 = r5;
0x00011164 bl 0x10bf0 | close (r0);
0x00011168 mov r0, r4 | r0 = r4;
0x0001116c bl 0x10bf0 | close (r0);
0x00011170 ldr r0, [sp, 0x24] | r0 = ptr;
0x00011174 bl 0x10c08 | free (r0);
0x00011178 ldr r0, [sp, 0x20] | r0 = s;
0x0001117c bl 0x10c08 | free (r0);
0x00011180 b 0x10ff0 | goto label_6;
| label_43:
0x00011184 add r2, sp, 0x48 | r2 += var_48h;
0x00011188 ldr r1, [pc, 0x6e8] | r1 = "MTDFILEMODE";
0x0001118c mov r0, r5 | r0 = r5;
0x00011190 bl 0x10a34 | r0 = ioctl (r0, "MTDFILEMODE");
0x00011194 cmp r0, 0 |
| if (r0 != 0) {
0x00011198 bne 0x1125c | goto label_44;
| }
0x0001119c ldrb r3, [r7, 0x23] | r3 = *((r7 + 0x23));
0x000111a0 cmp r3, 0 |
0x000111a4 str r3, [sp, 0x38] | var_38h = r3;
| if (r3 == 0) {
0x000111a8 bne 0x111f8 |
0x000111ac ldr r4, [pc, 0x674] | r4 = "skipbad";
0x000111b0 ldr r2, [sp, 0x4c] | r2 = var_4ch;
0x000111b4 ldr r1, [pc, 0x6c0] | r1 = *(0x11878);
0x000111b8 ldr r0, [r4] | r0 = "skipbad";
0x000111bc bl 0x10ae8 | fprintf ("skipbad", r1, r2, r3, "skipbad")
0x000111c0 ldr r2, [sp, 0x48] | r2 = var_48h;
0x000111c4 ldr r1, [pc, 0x6b4] | r1 = "ECC_failed:__d";
0x000111c8 ldr r0, [r4] | r0 = "skipbad";
0x000111cc bl 0x10ae8 | fprintf ("skipbad", "ECC_failed:__d", r2)
0x000111d0 ldr r2, [sp, 0x50] | r2 = var_50h;
0x000111d4 ldr r1, [pc, 0x6a8] | r1 = "ECC_corrected:__d";
0x000111d8 ldr r0, [r4] | r0 = "skipbad";
0x000111dc bl 0x10ae8 | fprintf ("skipbad", "ECC_corrected:__d", r2)
0x000111e0 ldr r2, [sp, 0x54] | r2 = var_54h;
0x000111e4 ldr r1, [pc, 0x69c] | r1 = "Number of bad blocks: %d\n";
0x000111e8 ldr r0, [r4] | r0 = "skipbad";
0x000111ec bl 0x10ae8 | fprintf ("skipbad", "Number of bad blocks: %d\n", r2)
0x000111f0 mov r3, 1 | r3 = 1;
0x000111f4 str r3, [sp, 0x38] | var_38h = r3;
| }
| label_7:
0x000111f8 ldr r0, [r7, 0x10] | r0 = *((r7 + 0x10));
0x000111fc cmp r0, 0 |
| if (r0 == 0) {
0x00011200 beq 0x11268 | goto label_45;
| }
0x00011204 mov r2, 0x1a4 | r2 = 0x1a4;
0x00011208 ldr r1, [pc, 0x67c] | r1 = "Number of bbt blocks: %d\n";
0x0001120c bl 0x10b60 | r0 = open64 ();
0x00011210 cmn r0, 1 |
0x00011214 mov r4, r0 | r4 = r0;
| if (r0 != 1) {
0x00011218 ldreq r0, [r7, 0x10] | r0 = *((r7 + 0x10));
| }
| if (r0 == 1) {
0x0001121c beq 0x11590 | goto label_46;
| }
| label_8:
0x00011220 ldrb r3, [r7, 0x22] | r3 = *((r7 + 0x22));
0x00011224 cmp r3, 0 |
| if (r3 != 0) {
0x00011228 bne 0x11270 | goto label_47;
| }
0x0001122c ldrb r3, [r7, 0x20] | r3 = *((r7 + 0x20));
0x00011230 cmp r3, 0 |
| if (r3 != 0) {
0x00011234 bne 0x11270 | goto label_47;
| }
0x00011238 mov r0, r4 | r0 = r4;
0x0001123c bl 0x10aa0 | r0 = isatty (r0);
0x00011240 cmp r0, 0 |
| if (r0 == 0) {
0x00011244 beq 0x11270 | goto label_47;
| }
0x00011248 ldr r3, [pc, 0x5d8] | r3 = "skipbad";
0x0001124c ldr r0, [pc, 0x63c] | r0 = *(0x1188c);
0x00011250 ldr r1, [r3] | r1 = "skipbad";
0x00011254 bl 0x10bcc | fputs (r0, "skipbad");
0x00011258 b 0x11160 |
| } while (1);
| label_44:
0x0001125c ldr r0, [pc, 0x630] | r0 = "Not printing binary garbage to tty. Use '-a'\nor '--forcebinary' to override.\n";
0x00011260 bl 0x10a88 | perror ("Not printing binary garbage to tty. Use '-a'\nor '--forcebinary' to override.\n");
0x00011264 b 0x111f8 | goto label_7;
| label_45:
0x00011268 mov r4, 1 | r4 = 1;
0x0001126c b 0x11220 | goto label_8;
| label_47:
0x00011270 ldr r2, [sp, 0x1a0] | r2 = var_1a0h;
0x00011274 ldrd r8, sb, [r7, 8] | __asm ("ldrd r8, sb, [r7, 8]");
0x00011278 sub r3, r2, 1 | r3 = r2 - 1;
0x0001127c and r1, sb, r3, asr 31 | r1 = sb & (r3 >> 31);
0x00011280 and r0, r8, r3 | r0 = r8 & r3;
0x00011284 orrs r3, r0, r1 | r3 = r0 | r1;
0x00011288 strd r0, r1, [sp, 0x18] | __asm ("strd r0, r1, [format]");
| if (r3 == r0) {
0x0001128c ldrne r1, [pc, 0x604] | r1 = "the start address (-s parameter) is not page-aligned!\nThe pagesize of this NAND Flash is 0x%x.\n";
| }
| if (r3 != r0) {
0x00011290 bne 0x114cc | goto label_13;
| }
0x00011294 ldrb r3, [r7] | r3 = *(r7);
0x00011298 cmp r3, 0 |
| if (r3 == 0) {
0x0001129c beq 0x112c0 | goto label_48;
| }
0x000112a0 ldr r7, [pc, 0x564] | r7 = *(0x11808);
0x000112a4 ldr sl, [pc, 0x57c] | sl = obj.stderr;
0x000112a8 ldr fp, [pc, 0x5ec] | fp = "Bad block at %llx\n";
| do {
0x000112ac ldrd r2, r3, [r7, 8] | __asm ("ldrd r2, r3, [r7, 8]");
0x000112b0 ldrd r0, r1, [sp, 0x18] | __asm ("ldrd r0, r1, [format]");
0x000112b4 cmp r0, r2 |
0x000112b8 sbcs r3, r1, r3 | __asm ("sbcs r3, r1, r3");
| if (r0 >= r2) {
0x000112bc blt 0x11374 |
| label_48:
0x000112c0 ldr r7, [pc, 0x544] | r7 = *(0x11808);
0x000112c4 add r3, sp, 0x190 | r3 += var_190h;
0x000112c8 ldrd r2, r3, [r3] | __asm ("ldrd r2, r3, [r3]");
0x000112cc ldrd r0, r1, [r7, 0x18] | __asm ("ldrd r0, r1, [r7, 0x18]");
0x000112d0 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [format]");
0x000112d4 orrs r3, r0, r1 | r3 = r0 | r1;
| if (r3 != r0) {
0x000112d8 bne 0x11438 | goto label_49;
| }
| label_11:
0x000112dc ldrb r3, [r7, 0x23] | r3 = *((r7 + 0x23));
0x000112e0 ldr fp, [sp, 0x1a0] | fp = var_1a0h;
0x000112e4 cmp r3, 0 |
| if (r3 == 0) {
0x000112e8 bne 0x11324 |
0x000112ec ldr r3, [sp, 0x1a8] | r3 = size;
0x000112f0 ldr r8, [pc, 0x530] | r8 = "skipbad";
0x000112f4 str r3, [sp] | *(sp) = r3;
0x000112f8 ldr r2, [sp, 0x19c] | r2 = var_19ch;
0x000112fc mov r3, fp | r3 = fp;
0x00011300 ldr r1, [pc, 0x598] | r1 = "Bad block at %llx\n";
0x00011304 ldr r0, [r8] | r0 = "skipbad";
0x00011308 bl 0x10ae8 | fprintf ("skipbad", "Bad block at %llx\n", r2, r3)
0x0001130c ldrd r0, r1, [sp, 0x18] | __asm ("ldrd r0, r1, [format]");
0x00011310 ldrd r2, r3, [r7, 8] | __asm ("ldrd r2, r3, [r7, 8]");
0x00011314 strd r0, r1, [sp] | __asm ("strd r0, r1, [sp]");
0x00011318 ldr r1, [pc, 0x584] | r1 = "Block_size__d__page_size__d__OOB_size__d";
0x0001131c ldr r0, [r8] | r0 = "skipbad";
0x00011320 bl 0x10ae8 | fprintf (r0, "Block_size__d__page_size__d__OOB_size__d", r2)
| }
0x00011324 ldr r3, [pc, 0x4e0] | r3 = *(0x11808);
0x00011328 mov sl, 0 | sl = 0;
0x0001132c ldrd r8, sb, [r3, 8] | __asm ("ldrd r8, sb, [r3, 8]");
0x00011330 mov r2, 1 | r2 = 1;
0x00011334 mov r3, 0 | r3 = 0;
| label_12:
0x00011338 strd r2, r3, [sp, 0x30] | __asm ("strd r2, r3, [var_30h]");
0x0001133c ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [format]");
0x00011340 cmp r8, r2 |
0x00011344 sbcs r3, sb, r3 | __asm ("sbcs r3, sb, r3");
| if (r8 < r2) {
0x00011348 blt 0x11458 | goto label_50;
| }
0x0001134c mov r0, r5 | r0 = r5;
0x00011350 bl 0x10bf0 | close (r0);
0x00011354 mov r0, r4 | r0 = r4;
0x00011358 bl 0x10bf0 | close (r0);
0x0001135c ldr r0, [sp, 0x24] | r0 = ptr;
0x00011360 bl 0x10c08 | free (r0);
0x00011364 ldr r0, [sp, 0x20] | r0 = s;
0x00011368 bl 0x10c08 | free (r0);
0x0001136c mov fp, 0 |
0x00011370 b 0x11080 | goto label_9;
| }
0x00011374 ldr r2, [sp, 0x19c] | r2 = var_19ch;
0x00011378 ldrd r0, r1, [sp, 0x18] | __asm ("ldrd r0, r1, [format]");
0x0001137c asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011380 bl 0x14f34 | fcn_00014f34 (r0);
0x00011384 mov r1, r5 | r1 = r5;
0x00011388 mov r2, r0 | r2 = r0;
0x0001138c add r0, sp, 0xb8 | r0 += var_b8h;
0x00011390 bl 0x137d8 | r0 = fcn_000137d8 (r0, r1);
0x00011394 cmp r0, 0 |
| if (r0 < 0) {
0x00011398 bge 0x113e8 |
0x0001139c bl 0x10b9c | errno_location ();
0x000113a0 ldr r8, [pc, 0x480] | r8 = "skipbad";
0x000113a4 ldr r3, [r7, 0x28] | r3 = *((r7 + 0x28));
0x000113a8 ldr r2, [pc, 0x47c] | r2 = stderr;
0x000113ac ldr r1, [pc, 0x4f4] | r1 = "Dumping_data_starting_at_0x_08llx_and_ending_at_0x_08llx...";
0x000113b0 ldr r6, [r0] | r6 = *(r0);
0x000113b4 ldr r0, [r8] | r0 = "skipbad";
0x000113b8 bl 0x10ae8 | fprintf ("skipbad", "Dumping_data_starting_at_0x_08llx_and_ending_at_0x_08llx...", r2, r3, r4, r5, r6)
0x000113bc mov r0, r6 | r0 = r6;
0x000113c0 ldr r7, [r8] | r7 = "skipbad";
0x000113c4 bl 0x10a4c | strerror (r0);
0x000113c8 str r6, [sp] | *(sp) = r6;
0x000113cc ldr r3, [pc, 0x470] | r3 = "%s: error!: out of memory\n";
0x000113d0 mov r2, 0xa | r2 = 0xa;
0x000113d4 ldr r1, [pc, 0x46c] | r1 = *(0x11844);
0x000113d8 str r0, [sp, 4] | var_4h = r0;
0x000113dc mov r0, r7 | r0 = r7;
0x000113e0 bl 0x10ae8 | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4, r5, r6)
0x000113e4 b 0x11160 | goto label_10;
| }
0x000113e8 cmp r0, 1 |
| if (r0 == 1) {
0x000113ec bne 0x11420 |
0x000113f0 ldrb r3, [r7, 0x23] | r3 = *((r7 + 0x23));
0x000113f4 cmp r3, 0 |
| if (r3 == 0) {
0x000113f8 bne 0x1140c |
0x000113fc ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [format]");
0x00011400 ldr r0, [sl] | r0 = *(sl);
0x00011404 mov r1, fp | r1 = fp;
0x00011408 bl 0x10ae8 | fprintf (r0, r1, r2)
| }
0x0001140c ldrd r2, r3, [r7, 8] | __asm ("ldrd r2, r3, [r7, 8]");
0x00011410 ldr r1, [sp, 0x19c] | r1 = var_19ch;
0x00011414 adds r8, r2, r1 | r8 = r2 + r1;
0x00011418 adc sb, r3, r1, asr 31 | __asm ("adc sb, r3, r1, asr 31");
0x0001141c strd r8, sb, [r7, 8] | __asm ("strd r8, sb, [r7, 8]");
| }
0x00011420 ldr r3, [sp, 0x19c] | r3 = var_19ch;
0x00011424 ldrd r0, r1, [sp, 0x18] | __asm ("ldrd r0, r1, [format]");
0x00011428 adds r0, r0, r3 | r0 += r3;
0x0001142c adc r1, r1, r3, asr 31 | __asm ("adc r1, r1, r3, asr 31");
0x00011430 strd r0, r1, [sp, 0x18] | __asm ("strd r0, r1, [format]");
0x00011434 b 0x112ac |
| } while (1);
| label_49:
0x00011438 ldrd r2, r3, [r7, 8] | __asm ("ldrd r2, r3, [r7, 8]");
0x0001143c adds r8, r2, r0 | r8 = r2 + r0;
0x00011440 adc sb, r3, r1 | __asm ("adc sb, r3, r1");
0x00011444 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [format]");
0x00011448 cmp r8, r2 |
0x0001144c sbcs r3, sb, r3 | __asm ("sbcs r3, sb, r3");
0x00011450 strdlt r8, sb, [sp, 0x18] | __asm ("strdlt r8, sb, [sp, 0x18]");
0x00011454 b 0x112dc | goto label_11;
| label_50:
0x00011458 ldr r3, [pc, 0x3b0] |
0x0001145c ldr r3, [r3] | r3 = *(0x1180c);
0x00011460 cmp r3, 1 |
| if (r3 == 1) {
0x00011464 beq 0x11598 | goto label_51;
| }
0x00011468 ldr ip, [sp, 0x19c] | ip = var_19ch;
0x0001146c rsb r3, ip, 0 | r3 = ip - ;
0x00011470 and r0, r8, r3 | r0 = r8 & r3;
0x00011474 and r1, sb, r3, asr 31 | r1 = sb & (r3 >> 31);
0x00011478 ldrd r2, r3, [sp, 0x30] | __asm ("ldrd r2, r3, [var_30h]");
0x0001147c strd r0, r1, [sp, 0x28] | __asm ("strd r0, r1, [var_28h]");
0x00011480 cmp r1, r3 |
0x00011484 cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| if (r1 != r3) {
0x00011488 andeq r6, r6, 1 | r6 &= 1;
| }
| if (r1 == r3) {
0x0001148c movne r6, 1 | r6 = 1;
| }
0x00011490 cmp r6, 0 |
| if (r6 != 0) {
0x00011494 beq 0x114dc |
0x00011498 mov r2, ip | r2 = ip;
0x0001149c asr r3, ip, 0x1f | r3 = ip >> 0x1f;
0x000114a0 mov r0, r8 | r0 = r8;
0x000114a4 mov r1, sb | r1 = sb;
0x000114a8 bl 0x14f34 | fcn_00014f34 (r0);
0x000114ac mov r1, r5 | r1 = r5;
0x000114b0 mov r2, r0 | r2 = r0;
0x000114b4 add r0, sp, 0xb8 | r0 += var_b8h;
0x000114b8 bl 0x137d8 | fcn_000137d8 (r0, r1);
0x000114bc subs sl, r0, 0 | sl -= var_b8h;
| if (sl >= var_b8h) {
0x000114c0 bge 0x114e4 | goto label_52;
| }
0x000114c4 ldr r2, [pc, 0x360] | r2 = stderr;
0x000114c8 ldr r1, [pc, 0x3dc] | r1 = "%s: error!: %s: MTD get bad block failed\n";
| label_13:
0x000114cc ldr r3, [pc, 0x354] | r3 = "skipbad";
0x000114d0 ldr r0, [r3] | r0 = "skipbad";
0x000114d4 bl 0x10ae8 | fprintf ("skipbad", "%s: error!: %s: MTD get bad block failed\n", r2, "skipbad")
0x000114d8 b 0x11160 | goto label_10;
| }
0x000114dc ldrd r2, r3, [sp, 0x30] | __asm ("ldrd r2, r3, [var_30h]");
0x000114e0 strd r2, r3, [sp, 0x28] | __asm ("strd r2, r3, [var_28h]");
| label_52:
0x000114e4 cmp sl, 0 |
| if (sl == 0) {
0x000114e8 beq 0x115a4 | goto label_53;
| }
0x000114ec ldr r3, [pc, 0x31c] |
0x000114f0 ldr r3, [r3] | r3 = *(0x1180c);
0x000114f4 cmp r3, 2 |
| if (r3 == 2) {
0x000114f8 bne 0x11550 |
0x000114fc ldr r1, [sp, 0x19c] | r1 = var_19ch;
0x00011500 sub r3, r1, fp | r3 = r1 - fp;
0x00011504 adds r8, r8, r3 | r8 += r3;
0x00011508 adc sb, sb, r3, asr 31 | __asm ("adc sb, sb, r3, asr 31");
0x0001150c ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [format]");
0x00011510 adds r2, r2, r1 | r2 += r1;
0x00011514 adc r3, r3, r1, asr 31 | __asm ("adc r3, r3, r1, asr 31");
0x00011518 add r1, sp, 0x190 | r1 += var_190h;
0x0001151c ldrd r0, r1, [r1] | __asm ("ldrd r0, r1, [r1]");
0x00011520 cmp r2, r0 |
0x00011524 strd r0, r1, [sp, 0x18] | __asm ("strd r0, r1, [format]");
0x00011528 sbcs r1, r3, r1 | __asm ("sbcs r1, r3, r1");
0x0001152c strdlt r2, r3, [sp, 0x18] | __asm ("strdlt r2, r3, [sp, 0x18]");
0x00011530 str sl, [sp, 0x30] | var_30h = sl;
0x00011534 mov sl, 0 | sl = 0;
| label_14:
0x00011538 adds r8, r8, fp | r8 += fp;
0x0001153c mov r6, sl | r6 = sl;
0x00011540 adc sb, sb, fp, asr 31 | __asm ("adc sb, sb, fp, asr 31");
0x00011544 ldr sl, [sp, 0x30] | sl = var_30h;
0x00011548 ldrd r2, r3, [sp, 0x28] | __asm ("ldrd r2, r3, [var_28h]");
0x0001154c b 0x11338 | goto label_12;
| }
0x00011550 mov r2, fp | r2 = fp;
0x00011554 mov r1, 0xff | r1 = 0xff;
0x00011558 ldr r0, [sp, 0x20] | r0 = s;
0x0001155c bl 0x10b54 | memset (r0, r1, r2);
0x00011560 str sl, [sp, 0x30] | var_30h = sl;
0x00011564 mov sl, 0 | sl = 0;
| do {
0x00011568 ldr r3, [sp, 0x38] | r3 = var_38h;
0x0001156c cmp r3, 0 |
| if (r3 == 0) {
0x00011570 beq 0x11650 | goto label_54;
| }
0x00011574 add r2, sp, 0x58 | r2 += var_58h;
0x00011578 ldr r1, [pc, 0x2f8] | r1 = "MTDFILEMODE";
0x0001157c mov r0, r5 | r0 = r5;
0x00011580 bl 0x10a34 | r0 = ioctl (r0, "MTDFILEMODE");
0x00011584 cmp r0, 0 |
| if (r0 == 0) {
0x00011588 beq 0x115f0 | goto label_55;
| }
0x0001158c ldr r0, [pc, 0x31c] | r0 = "%s: error!: libmtd: mtd_is_bad\n";
| label_46:
0x00011590 bl 0x10a88 | perror ("%s: error!: libmtd: mtd_is_bad\n");
0x00011594 b 0x11160 | goto label_10;
| label_51:
0x00011598 ldrd r2, r3, [sp, 0x30] | __asm ("ldrd r2, r3, [var_30h]");
0x0001159c mov sl, r6 | sl = r6;
0x000115a0 strd r2, r3, [sp, 0x28] | __asm ("strd r2, r3, [var_28h]");
| label_53:
0x000115a4 ldr r2, [sp, 0x19c] | r2 = var_19ch;
0x000115a8 mov r0, r8 | r0 = r8;
0x000115ac asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x000115b0 mov r1, sb | r1 = sb;
0x000115b4 bl 0x14f34 | fcn_00014f34 (r0);
0x000115b8 ldr r3, [sp, 0x20] | r3 = s;
0x000115bc str fp, [sp, 4] | var_4h = fp;
0x000115c0 str r3, [sp] | *(sp) = r3;
0x000115c4 mov r1, r5 | r1 = r5;
0x000115c8 mov r3, r2 | r3 = r2;
0x000115cc mov r2, r0 | r2 = r0;
0x000115d0 add r0, sp, 0xb8 | r0 += var_b8h;
0x000115d4 bl 0x138d4 | fcn_000138d4 (r0, r1, r2, r3);
0x000115d8 subs r3, r0, 0 | r3 -= var_b8h;
0x000115dc str r3, [sp, 0x30] | var_30h = r3;
0x000115e0 beq 0x11568 |
| } while (r3 == var_b8h);
0x000115e4 ldr r2, [pc, 0x240] | r2 = stderr;
0x000115e8 ldr r1, [pc, 0x2c4] | r1 = "ioctl(ECCGETSTATS)";
0x000115ec b 0x114cc | goto label_13;
| label_55:
0x000115f0 ldr r3, [sp, 0x4c] | r3 = var_4ch;
0x000115f4 ldr r2, [sp, 0x5c] | r2 = var_5ch;
0x000115f8 cmp r3, r2 |
| if (r3 != r2) {
0x000115fc beq 0x11618 |
0x00011600 sub r2, r2, r3 | r2 -= r3;
0x00011604 ldr r3, [pc, 0x21c] | r3 = "skipbad";
0x00011608 strd r8, sb, [sp] | __asm ("strd r8, sb, [sp]");
0x0001160c ldr r1, [pc, 0x2a4] | r1 = "%s: error!: mtd_read\n";
0x00011610 ldr r0, [r3] | r0 = "skipbad";
0x00011614 bl 0x10ae8 | fprintf ("skipbad", "%s: error!: mtd_read\n", r2, "skipbad")
| }
0x00011618 ldr r3, [sp, 0x48] | r3 = var_48h;
0x0001161c ldr r2, [sp, 0x58] | r2 = var_58h;
0x00011620 cmp r3, r2 |
| if (r3 != r2) {
0x00011624 beq 0x11640 |
0x00011628 sub r2, r2, r3 | r2 -= r3;
0x0001162c ldr r3, [pc, 0x1f4] | r3 = "skipbad";
0x00011630 strd r8, sb, [sp] | __asm ("strd r8, sb, [sp]");
0x00011634 ldr r1, [pc, 0x280] | r1 = "ECC:__d_uncorrectable_bitflip_s__at_offset_0x_08llx";
0x00011638 ldr r0, [r3] | r0 = "skipbad";
0x0001163c bl 0x10ae8 | fprintf ("skipbad", "ECC:__d_uncorrectable_bitflip_s__at_offset_0x_08llx", r2, "skipbad")
| }
0x00011640 add r3, sp, 0x58 | r3 += var_58h;
0x00011644 ldm r3, {r0, r1, r2, r3} | r0 = *(r3);
| r1 = *((r3 + 4));
| r2 = *((r3 + 8));
| r3 = *((r3 + 12));
0x00011648 add ip, sp, 0x48 |
0x0001164c stm ip, {r0, r1, r2, r3} | *(ip) = r0;
| *((ip + 4)) = r1;
| *((ip + 8)) = r2;
| *((ip + 12)) = r3;
| label_54:
0x00011650 ldr r2, [pc, 0x1b4] | r2 = *(0x11808);
0x00011654 ldrb r3, [r2, 0x22] | r3 = *((r2 + 0x22));
0x00011658 cmp r3, 0 |
| if (r3 == 0) {
0x0001165c beq 0x11734 | goto label_56;
| }
0x00011660 ldr r3, [sp, 0x20] | r3 = s;
0x00011664 mov r6, r8 | r6 = r8;
0x00011668 sub r3, r3, r8 | r3 -= r8;
0x0001166c mov r7, sb | r7 = sb;
0x00011670 str r3, [sp, 0x40] | var_40h = r3;
0x00011674 str r2, [sp, 0x44] | var_44h = r2;
| label_15:
0x00011678 sub r3, r6, r8 | r3 = r6 - r8;
0x0001167c cmp fp, r3 |
| if (fp > r3) {
0x00011680 bgt 0x116e0 | goto label_57;
| }
| label_16:
0x00011684 ldr r3, [pc, 0x184] | r3 = *(0x1180c);
0x00011688 ldrb r3, [r3, 4] | r3 = *((r3 + 4));
0x0001168c cmp r3, 0 |
| if (r3 != 0) {
0x00011690 bne 0x11538 | goto label_14;
| }
0x00011694 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00011698 ldr r2, [sp, 0x1a8] | r2 = size;
0x0001169c cmp r3, 0 |
| if (r3 == 0) {
0x000116a0 beq 0x11774 | goto label_58;
| }
0x000116a4 mov r1, 0xff | r1 = 0xff;
0x000116a8 ldr r0, [sp, 0x24] | r0 = ptr;
0x000116ac bl 0x10b54 | memset (r0, r1, r2);
| label_18:
0x000116b0 ldr r7, [pc, 0x154] | r7 = *(0x11808);
0x000116b4 ldrb r3, [r7, 0x22] | r3 = *((r7 + 0x22));
0x000116b8 cmp r3, 0 |
| if (r3 == 0) {
0x000116bc movne r6, 0 | r6 = 0;
| }
| if (r3 != 0) {
0x000116c0 bne 0x117fc | goto label_59;
| }
0x000116c4 ldr r2, [sp, 0x1a8] | r2 = size;
0x000116c8 ldr r1, [sp, 0x24] | r1 = ptr;
0x000116cc mov r0, r4 | r0 = r4;
0x000116d0 bl 0x11a60 | r0 = fcn_00011a60 (r0, r1);
0x000116d4 cmp r0, 0 |
| if (r0 == 0) {
0x000116d8 beq 0x11538 | goto label_14;
| }
0x000116dc b 0x11160 | goto label_10;
| label_57:
0x000116e0 ldr r3, [sp, 0x44] | r3 = var_44h;
0x000116e4 strd r6, r7, [sp, 8] | __asm ("strd r6, r7, [var_8h]");
0x000116e8 ldr r0, [sp, 0x40] | r0 = var_40h;
0x000116ec ldrb r3, [r3, 0x21] | r3 = *((r3 + 0x21));
0x000116f0 add r2, sp, 0x68 | r2 += var_68h;
0x000116f4 mov r1, 0x10 | r1 = 0x10;
0x000116f8 add r0, r0, r6 | r0 += r6;
0x000116fc str r3, [sp] | *(sp) = r3;
0x00011700 mov r3, 1 | r3 = 1;
0x00011704 bl 0x11b04 | fcn_00011b04 (r0, r1, r2, r3);
0x00011708 add r0, sp, 0x68 | r0 += var_68h;
0x0001170c bl 0x10bb4 | strlen (r0);
0x00011710 add r1, sp, 0x68 | r1 += var_68h;
0x00011714 mov r2, r0 | r2 = r0;
0x00011718 mov r0, r4 | r0 = r4;
0x0001171c bl 0x11a60 | fcn_00011a60 (r0, r1);
0x00011720 adds r6, r6, 0x10 | r6 += 0x10;
0x00011724 adc r7, r7, 0 | __asm ("adc r7, r7, 0");
0x00011728 cmp r0, 0 |
| if (r0 == 0) {
0x0001172c beq 0x11678 | goto label_15;
| }
0x00011730 b 0x11160 | goto label_10;
| label_56:
0x00011734 ldr r3, [pc, 0xd4] | r3 = *(0x1180c);
0x00011738 ldrb r3, [r3, 4] | r3 = *((r3 + 4));
0x0001173c cmp r3, 0 |
| if (r3 == 0) {
0x00011740 beq 0x1176c | goto label_60;
| }
0x00011744 ldr r3, [sp, 0x18] | r3 = format;
0x00011748 sub r2, r3, r8 | r2 = r3 - r8;
0x0001174c cmp r2, fp |
| if (r2 >= fp) {
0x00011750 bhs 0x1176c | goto label_60;
| }
| label_17:
0x00011754 ldr r1, [sp, 0x20] | r1 = s;
0x00011758 mov r0, r4 | r0 = r4;
0x0001175c bl 0x11a60 | r0 = fcn_00011a60 (r0, r1);
0x00011760 cmp r0, 0 |
| if (r0 == 0) {
0x00011764 beq 0x11684 | goto label_16;
| }
0x00011768 b 0x11160 | goto label_10;
| label_60:
0x0001176c mov r2, fp | r2 = fp;
0x00011770 b 0x11754 | goto label_17;
| label_58:
0x00011774 ldr r3, [sp, 0x24] | r3 = ptr;
0x00011778 strd r8, sb, [sp] | __asm ("strd r8, sb, [sp]");
0x0001177c ldr r0, [sp, 0x3c] | r0 = var_3ch;
0x00011780 str r3, [sp, 0x10] | var_10h = r3;
0x00011784 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00011788 strd r2, r3, [sp, 8] | __asm ("strd r2, r3, [var_8h]");
0x0001178c add r1, sp, 0xb8 | r1 += var_b8h;
0x00011790 mov r2, r5 | r2 = r5;
0x00011794 bl 0x13a68 | r0 = fcn_00013a68 (r0, r1, r2);
0x00011798 cmp r0, 0 |
| if (r0 == 0) {
0x0001179c beq 0x116b0 | goto label_18;
| }
0x000117a0 ldr r2, [pc, 0x84] | r2 = stderr;
0x000117a4 ldr r1, [pc, 0x114] | r1 = "ECC: %d corrected bitflip(s) at offset 0x%08llx\n";
0x000117a8 b 0x114cc | goto label_13;
| label_19:
0x000117ac mov r2, 0 | r2 = 0;
0x000117b0 mov r3, 0 | r3 = 0;
0x000117b4 strd r2, r3, [sp, 8] | __asm ("strd r2, r3, [var_8h]");
0x000117b8 ldr r0, [sp, 0x24] | r0 = ptr;
0x000117bc ldrb r3, [r7, 0x21] | r3 = *((r7 + 0x21));
0x000117c0 add r2, sp, 0x68 | r2 += var_68h;
0x000117c4 sub r1, r1, r6 | r1 -= r6;
0x000117c8 str r3, [sp] | *(sp) = r3;
0x000117cc add r0, r0, r6 | r0 += r6;
0x000117d0 mov r3, 0 | r3 = 0;
0x000117d4 bl 0x11b04 | fcn_00011b04 (r0, r1, r2, r3);
0x000117d8 add r0, sp, 0x68 | r0 += var_68h;
0x000117dc bl 0x10bb4 | strlen (r0);
0x000117e0 add r1, sp, 0x68 | r1 += var_68h;
0x000117e4 mov r2, r0 | r2 = r0;
0x000117e8 mov r0, r4 | r0 = r4;
0x000117ec bl 0x11a60 | r0 = fcn_00011a60 (r0, r1);
0x000117f0 cmp r0, 0 |
| if (r0 != 0) {
0x000117f4 bne 0x11160 | goto label_10;
| }
0x000117f8 add r6, r6, 0x10 | r6 += 0x10;
| label_59:
0x000117fc ldr r1, [sp, 0x1a8] | r1 = size;
0x00011800 cmp r1, r6 |
| if (r1 > r6) {
0x00011804 bgt 0x117ac | goto label_19;
| }
0x00011808 b 0x11538 | goto label_14;
| }
[*] Function fprintf used 113 times nanddump