[*] Binary protection state of mtdinfo
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of mtdinfo
; 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/mtdinfo @ 0x10c00 */
| #include <stdint.h>
|
; (fcn) fcn.00010c00 () | void fcn_00010c00 () {
| int32_t var_0h_2;
| int32_t var_0h;
| int32_t var_4h;
| /* [10] -r-x section size 21224 named .text */
0x00010c00 push {r0, r1, r2, lr} |
0x00010c04 bl 0x10b88 | errno_location ();
0x00010c08 ldr r5, [pc, 0x40] |
0x00010c0c ldr r2, [pc, 0x40] | r2 = stderr;
0x00010c10 ldr r1, [pc, 0x40] | r1 = "libmtd";
0x00010c14 ldr r4, [r0] | r4 = *(r0);
0x00010c18 ldr r0, [r5] | r0 = *(0x10c4c);
0x00010c1c bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x00010c20 mov r0, r4 | r0 = r4;
0x00010c24 ldr r5, [r5] | r5 = *(0x10c4c);
0x00010c28 bl 0x10a2c | strerror (r0);
0x00010c2c str r4, [sp] | *(sp) = r4;
0x00010c30 ldr r3, [pc, 0x24] | r3 = "%s: error!: out of memory\n";
0x00010c34 mov r2, 8 | r2 = 8;
0x00010c38 ldr r1, [pc, 0x20] | r1 = *(0x10c5c);
0x00010c3c str r0, [sp, 4] | var_4h = r0;
0x00010c40 mov r0, r5 | r0 = r5;
0x00010c44 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x00010c48 mvn r0, 0 | r0 = ~0;
0x00010c4c bl 0x10b94 | exit (r0);
| if (? != ?) {
0x00010c50 andeq r8, r2, r4, asr 1 | r8 = r2 & (r4 >> 1);
| }
| if (? != ?) {
0x00010c54 andeq r6, r1, r8, lsl 23 | r6 = r1 & (r8 << 23);
| }
| if (? != ?) {
0x00010c58 andeq r6, r1, r7, lsl pc | r6 = r1 & (r7 << pc);
| }
0x00010c5c ldrdeq r6, r7, [r1], -r1 | __asm ("ldrdeq r6, r7, [r1], -r1");
0x00010c60 ldrdeq r5, r6, [r1], -fp | __asm ("ldrdeq r5, r6, [r1], -fp");
| }
; 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/mtdinfo @ 0x11054 */
| #include <stdint.h>
|
; (fcn) fcn.00011054 () | void fcn_00011054 (int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_108h;
| r1 = arg2;
0x00011054 push {r4, r5, r6, lr} |
0x00011058 sub sp, sp, 0x108 |
0x0001105c add r2, sp, 8 | r2 += var_8h;
0x00011060 mov r6, r1 | r6 = r1;
0x00011064 bl 0x13d90 | r0 = fcn_00013d90 (r0, r1);
0x00011068 cmp r0, 0 |
| if (r0 != 0) {
0x0001106c ldreq r0, [sp, 8] | r0 = var_8h;
| }
| if (r0 == 0) {
0x00011070 beq 0x110a0 | goto label_0;
| }
0x00011074 bl 0x10b88 | errno_location ();
0x00011078 ldr r5, [pc, 0x5c] | r5 = *(0x110d8);
0x0001107c mov r3, r6 | r3 = r6;
0x00011080 ldr r2, [pc, 0x58] | r2 = stderr;
0x00011084 ldr r4, [r0] | r4 = *(r0);
0x00011088 ldr r0, [r5] | r0 = *(0x110d8);
0x0001108c cmp r4, 0x13 |
| if (r4 != 0x13) {
0x00011090 bne 0x110a8 | goto label_1;
| }
0x00011094 ldr r1, [pc, 0x48] | r1 = "mtdinfo";
0x00011098 bl 0x10abc | fprintf (r0, "mtdinfo")
| do {
0x0001109c mvn r0, 0 | r0 = ~0;
| label_0:
0x000110a0 add sp, sp, 0x108 |
0x000110a4 pop {r4, r5, r6, pc} |
| label_1:
0x000110a8 ldr r1, [pc, 0x38] | r1 = "_s:_error_:___s__does_not_correspond_to_any_existing_MTD_device";
0x000110ac bl 0x10abc | fprintf (r0, "_s:_error_:___s__does_not_correspond_to_any_existing_MTD_device")
0x000110b0 mov r0, r4 | r0 = r4;
0x000110b4 ldr r5, [r5] | r5 = *(r5);
0x000110b8 bl 0x10a2c | strerror (r0);
0x000110bc str r4, [sp] | *(sp) = r4;
0x000110c0 ldr r3, [pc, 0x24] | r3 = "%s: error!: cannot get information about MTD device \"%s\"\n";
0x000110c4 mov r2, 9 | r2 = 9;
0x000110c8 ldr r1, [pc, 0x20] | r1 = *(0x110ec);
0x000110cc str r0, [sp, 4] | var_4h = r0;
0x000110d0 mov r0, r5 | r0 = r5;
0x000110d4 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot get information about MTD device \"%s\"\n", r4)
0x000110d8 b 0x1109c |
| } 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/mtdinfo @ 0x110f4 */
| #include <stdint.h>
|
; (fcn) fcn.000110f4 () | void fcn_000110f4 (int32_t arg_fch, int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x000110f4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000110f8 mov sl, r2 | sl = r2;
0x000110fc sub sp, sp, 0x14 |
0x00011100 mov fp, r0 |
0x00011104 ldr r0, [pc, 0x1dc] | r0 = *(0x112e4);
0x00011108 mov sb, r1 | sb = r1;
0x0001110c bl 0x10a74 | puts (r0);
0x00011110 ldr r2, [sl, 8] | r2 = *((sl + 8));
0x00011114 mov r3, 0 | r3 = 0;
0x00011118 str r3, [sp, 0xc] | var_ch = r3;
0x0001111c mov r1, 0xa | r1 = 0xa;
0x00011120 mov r3, 1 | r3 = 1;
| do {
0x00011124 cmp r2, r3 |
| if (r2 <= r3) {
0x00011128 bhi 0x11234 |
0x0001112c cmn sb, 1 |
| if (sb == 1) {
0x00011130 movne r5, 0 | r5 = 0;
| }
| if (sb == 1) {
0x00011134 movne r6, r5 | r6 = r5;
| }
| if (sb != 1) {
0x00011138 moveq r6, sb | r6 = sb;
| }
| if (sb != 1) {
0x0001113c moveq r5, 0x13 | r5 = 0x13;
| }
0x00011140 mov r7, r5 | r7 = r5;
0x00011144 mov r8, r6 | r8 = r6;
0x00011148 mov r4, 0 | r4 = 0;
| label_0:
0x0001114c ldr r3, [sl, 8] | r3 = *((sl + 8));
0x00011150 cmp r3, r4 |
| if (r3 > r4) {
0x00011154 bhi 0x11248 | goto label_1;
| }
0x00011158 tst r4, 3 |
| if ((r4 & 3) != 0) {
0x0001115c beq 0x11168 |
0x00011160 mov r0, 0xa | r0 = 0xa;
0x00011164 bl 0x109fc | putchar (r0);
| }
0x00011168 subs r3, r5, 0x5f | r3 = r5 - 0x5f;
| if (r3 == r5) {
0x0001116c movne r3, 1 | r3 = 1;
| }
0x00011170 cmn r6, 1 |
| if (r6 == 1) {
0x00011174 movne r3, 0 | r3 = 0;
| }
0x00011178 cmp r3, 0 |
| if (r3 != 0) {
0x0001117c beq 0x111c4 |
0x00011180 bl 0x10b88 | errno_location ();
0x00011184 ldr r4, [pc, 0x160] |
0x00011188 ldr r2, [pc, 0x160] | r2 = stderr;
0x0001118c ldr r1, [pc, 0x160] | r1 = "mtdinfo";
0x00011190 str r5, [r0] | *(r0) = r5;
0x00011194 ldr r0, [r4] | r0 = "Eraseblock map:";
0x00011198 bl 0x10abc | fprintf ("Eraseblock map:", "mtdinfo", r2, r3, "Eraseblock map:", r5)
0x0001119c mov r0, r5 | r0 = r5;
0x000111a0 ldr r4, [r4] | r4 = "Eraseblock map:";
0x000111a4 bl 0x10a2c | strerror (r0);
0x000111a8 str r5, [sp] | *(sp) = r5;
0x000111ac ldr r3, [pc, 0x144] | r3 = "%s: error!: could not read locked block info\n";
0x000111b0 mov r2, 9 | r2 = 9;
0x000111b4 ldr r1, [pc, 0x140] | r1 = *(0x112f8);
0x000111b8 str r0, [sp, 4] | var_4h = r0;
0x000111bc mov r0, r4 | r0 = r4;
0x000111c0 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: could not read locked block info\n", r4, r5)
| }
0x000111c4 ldrb r3, [fp, 0xfc] | r3 = *(arg_fch);
0x000111c8 tst r3, 2 |
| if ((r3 & 2) != 0) {
0x000111cc beq 0x1122c |
0x000111d0 subs r3, r7, 0x5f | r3 = r7 - 0x5f;
| if (r3 == r7) {
0x000111d4 movne r3, 1 | r3 = 1;
| }
0x000111d8 cmn r8, 1 |
| if (r8 == 1) {
0x000111dc movne r3, 0 | r3 = 0;
| }
0x000111e0 cmp r3, 0 |
| if (r3 == 0) {
0x000111e4 beq 0x1122c | goto label_2;
| }
0x000111e8 bl 0x10b88 | errno_location ();
0x000111ec ldr r4, [pc, 0xf8] |
0x000111f0 ldr r2, [pc, 0xf8] | r2 = stderr;
0x000111f4 ldr r1, [pc, 0x104] | r1 = "%*serror %d (%s)\n";
0x000111f8 str r7, [r0] | *(r0) = r7;
0x000111fc ldr r0, [r4] | r0 = "Eraseblock map:";
0x00011200 bl 0x10abc | fprintf ("Eraseblock map:", "%*serror %d (%s)\n", r2, r3, "Eraseblock map:")
0x00011204 mov r0, r7 | r0 = r7;
0x00011208 ldr r4, [r4] | r4 = "Eraseblock map:";
0x0001120c bl 0x10a2c | strerror (r0);
0x00011210 str r7, [sp] | *(sp) = r7;
0x00011214 ldr r3, [pc, 0xdc] | r3 = "%s: error!: could not read locked block info\n";
0x00011218 mov r2, 9 | r2 = 9;
0x0001121c ldr r1, [pc, 0xd8] | r1 = *(0x112f8);
0x00011220 str r0, [sp, 4] | var_4h = r0;
0x00011224 mov r0, r4 | r0 = r4;
0x00011228 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: could not read locked block info\n")
| }
| label_2:
0x0001122c add sp, sp, 0x14 |
0x00011230 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x00011234 ldr r0, [sp, 0xc] | r0 = var_ch;
0x00011238 mul r3, r1, r3 | r3 = r1 * r3;
0x0001123c add r0, r0, 1 | r0++;
0x00011240 str r0, [sp, 0xc] | var_ch = r0;
0x00011244 b 0x11124 |
| } while (1);
| label_1:
0x00011248 ldm sl, {r1, r2} | r1 = *(sl);
| r2 = *((sl + 4));
0x0001124c ldr r0, [pc, 0xb0] | r0 = "%s: error!: could not read bad block info\n";
0x00011250 mla r3, r2, r4, r1 | __asm ("mla r3, r2, r4, r1");
0x00011254 mov r2, r4 | r2 = r4;
0x00011258 ldr r1, [sp, 0xc] | r1 = var_ch;
0x0001125c bl 0x10a20 | printf ("%s: error!: could not read bad block info\n", r1, r2, r3);
0x00011260 cmn r6, 1 |
| if (r6 != 1) {
0x00011264 beq 0x11290 |
0x00011268 mov r2, r4 | r2 = r4;
0x0001126c mov r1, sb | r1 = sb;
0x00011270 mov r0, fp | r0 = fp;
0x00011274 bl 0x141ac | r0 = fcn_000141ac (r0, r1);
0x00011278 cmp r0, 1 |
0x0001127c mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x00011280 ldreq r0, [pc, 0x80] | r0 = *(0x00011308);
| }
| if (r0 == 1) {
0x00011284 beq 0x11294 | goto label_3;
| }
0x00011288 bl 0x10b88 | r0 = errno_location ();
0x0001128c ldr r5, [r0] | r5 = *(r0);
| }
0x00011290 ldr r0, [pc, 0x74] | r0 = *(0x11308);
| label_3:
0x00011294 bl 0x10a20 | printf (r0, r1, r2, r3, r4, r5);
0x00011298 cmn r8, 1 |
| if (r8 != 1) {
0x0001129c beq 0x112c8 |
0x000112a0 mov r2, r4 | r2 = r4;
0x000112a4 mov r1, sb | r1 = sb;
0x000112a8 mov r0, fp | r0 = fp;
0x000112ac bl 0x14220 | r0 = fcn_00014220 (r0, r1);
0x000112b0 cmp r0, 1 |
0x000112b4 mov r8, r0 | r8 = r0;
| if (r0 != 1) {
0x000112b8 ldreq r0, [pc, 0x50] | r0 = "BAD ";
| }
| if (r0 == 1) {
0x000112bc beq 0x112cc | goto label_4;
| }
0x000112c0 bl 0x10b88 | r0 = errno_location ();
0x000112c4 ldr r7, [r0] | r7 = *(r0);
| }
0x000112c8 ldr r0, [pc, 0x44] | r0 = "BAD ";
| label_4:
0x000112cc bl 0x10a20 | printf ("BAD ");
0x000112d0 add r4, r4, 1 | r4++;
0x000112d4 tst r4, 3 |
| if ((r4 & 3) != 0) {
0x000112d8 bne 0x1114c | goto label_0;
| }
0x000112dc mov r0, 0xa | r0 = 0xa;
0x000112e0 bl 0x109fc | putchar (r0);
0x000112e4 b 0x1114c | 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/mtdinfo @ 0x11318 */
| #include <stdint.h>
|
; (fcn) fcn.00011318 () | void fcn_00011318 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| void * s;
| int32_t var_18h;
| int32_t var_1ch;
| int32_t var_20h;
| int32_t var_24h;
| int32_t var_30h;
| int32_t var_38h;
| int32_t var_3ch;
| int32_t var_40h;
| int32_t var_44h;
| int32_t var_48h;
| int32_t var_89h;
| int32_t var_d8h;
| int32_t var_d8h_2;
| int32_t var_118h;
| int32_t var_11ch;
| int32_t var_120h;
| int32_t var_124h;
| int32_t var_128h;
| int32_t var_130h;
| int32_t var_134h;
| int32_t var_13ch;
| r0 = arg1;
| r1 = arg2;
0x00011318 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001131c sub sp, sp, 0x13c |
0x00011320 mov r7, r2 | r7 = r2;
0x00011324 add r8, sp, 0x38 | r8 += var_38h;
0x00011328 mov r5, r1 | r5 = r1;
0x0001132c mov r2, r8 | r2 = r8;
0x00011330 mov r1, r7 | r1 = r7;
0x00011334 bl 0x137fc | r0 = fcn_000137fc (r0, r1);
0x00011338 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 == r0) {
0x0001133c beq 0x113ac | goto label_7;
| }
0x00011340 bl 0x10b88 | errno_location ();
0x00011344 ldr r5, [pc, 0x3b8] | r5 = *(0x11700);
0x00011348 mov r3, r7 | r3 = r7;
0x0001134c ldr r2, [pc, 0x3b4] | r2 = stderr;
0x00011350 ldr r4, [r0] | r4 = *(r0);
0x00011354 ldr r0, [r5] | r0 = *(0x11700);
0x00011358 cmp r4, 0x13 |
| if (r4 != 0x13) {
0x0001135c bne 0x11378 | goto label_8;
| }
0x00011360 ldr r1, [pc, 0x3a4] | r1 = "mtdinfo";
0x00011364 bl 0x10abc | fprintf (r0, "mtdinfo")
| do {
0x00011368 mvn r6, 0 | r6 = ~0;
| label_3:
0x0001136c mov r0, r6 | r0 = r6;
0x00011370 add sp, sp, 0x13c |
0x00011374 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_8:
0x00011378 ldr r1, [pc, 0x390] | r1 = "_s:_error_:_mtd_d_does_not_correspond_to_any_existing_MTD_device";
0x0001137c bl 0x10abc | fprintf (r0, "_s:_error_:_mtd_d_does_not_correspond_to_any_existing_MTD_device")
0x00011380 mov r0, r4 | r0 = r4;
0x00011384 ldr r5, [r5] | r5 = *(r5);
0x00011388 bl 0x10a2c | strerror (r0);
0x0001138c str r4, [sp] | *(sp) = r4;
0x00011390 ldr r3, [pc, 0x37c] | r3 = "_s:_error_:_cannot_get_information_about_MTD_device__d";
0x00011394 mov r2, 9 | r2 = 9;
0x00011398 ldr r1, [pc, 0x378] | r1 = *(0x11714);
0x0001139c str r0, [sp, 4] | var_4h = r0;
0x000113a0 mov r0, r5 | r0 = r5;
0x000113a4 bl 0x10abc | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about_MTD_device__d", r4)
0x000113a8 b 0x11368 |
| } while (1);
| label_7:
0x000113ac ldr r1, [sp, 0x38] | r1 = var_38h;
0x000113b0 ldr r0, [pc, 0x364] | r0 = "%*serror %d (%s)\n";
0x000113b4 bl 0x10a20 | printf ("%*serror %d (%s)\n", r1);
0x000113b8 add r1, sp, 0x89 | r1 += var_89h;
0x000113bc ldr r0, [pc, 0x35c] | r0 = "mtd_d";
0x000113c0 bl 0x10a20 | printf ("mtd_d", r1);
0x000113c4 add r1, sp, 0x48 | r1 += var_48h;
0x000113c8 ldr r0, [pc, 0x354] | r0 = "Name: %s\n";
0x000113cc bl 0x10a20 | printf ("Name: %s\n", r1);
0x000113d0 ldr r0, [pc, 0x350] | r0 = "Type: %s\n";
0x000113d4 bl 0x10a20 | printf ("Type: %s\n");
0x000113d8 ldr r0, [sp, 0x11c] | r0 = var_11ch;
0x000113dc mov r2, r6 | r2 = r6;
0x000113e0 asr r1, r0, 0x1f | r1 = r0 >> 0x1f;
0x000113e4 bl 0x14d9c | fcn_00014d9c (r0, r1);
0x000113e8 mov r0, 0xa | r0 = 0xa;
0x000113ec bl 0x109fc | putchar (r0);
0x000113f0 ldr r1, [sp, 0x118] | r1 = var_118h;
0x000113f4 ldr r0, [pc, 0x330] | r0 = "Eraseblock size: ";
0x000113f8 bl 0x10a20 | printf ("Eraseblock size: ", r1);
0x000113fc mov r2, r6 | r2 = r6;
0x00011400 ldrd r0, r1, [r8, 0xd8] | __asm ("ldrd r0, r1, [var_d8h]");
0x00011404 bl 0x14d9c | fcn_00014d9c (r0, r1);
0x00011408 ldr r0, [pc, 0x320] | r0 = "Amount_of_eraseblocks:___________d__";
0x0001140c bl 0x10a74 | puts ("Amount_of_eraseblocks:___________d__");
0x00011410 ldr r1, [sp, 0x120] | r1 = var_120h;
0x00011414 ldr r7, [pc, 0x318] | r7 = *(0x11730);
0x00011418 ldr r4, [pc, 0x318] | r4 = "byte";
0x0001141c cmp r1, 1 |
| if (r1 > 1) {
0x00011420 movle r2, r7 | r2 = r7;
| }
| if (r1 <= 1) {
0x00011424 movgt r2, r4 | r2 = r4;
| }
0x00011428 ldr r0, [pc, 0x30c] | r0 = "bytes";
0x0001142c bl 0x10a20 | printf ("bytes", r1, r2, r3, "byte");
0x00011430 ldrb r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00011434 tst r3, 1 |
| if ((r3 & 1) == 0) {
0x00011438 beq 0x11588 | goto label_9;
| }
0x0001143c ldr r1, [sp, 0x124] | r1 = var_124h;
0x00011440 ldr r0, [pc, 0x2f8] | r0 = "Minimum input/output unit size: %d %s\n";
0x00011444 cmp r1, 1 |
| if (r1 > 1) {
0x00011448 movle r2, r7 | r2 = r7;
| }
| if (r1 <= 1) {
0x0001144c movgt r2, r4 | r2 = r4;
| }
0x00011450 bl 0x10a20 | printf ("Minimum input/output unit size: %d %s\n", r1, r2);
| do {
| label_0:
0x00011454 ldr r1, [sp, 0x128] | r1 = var_128h;
0x00011458 cmp r1, 0 |
| if (r1 > 0) {
0x0001145c ble 0x11468 |
0x00011460 ldr r0, [pc, 0x2dc] | r0 = "Sub_page_size:___________________d__s";
0x00011464 bl 0x10a20 | printf ("Sub_page_size:___________________d__s");
| }
0x00011468 ldr r3, [sp, 0x130] | r3 = var_130h;
0x0001146c cmp r3, 0 |
| if (r3 > 0) {
0x00011470 ble 0x11480 |
0x00011474 ldr r1, [sp, 0x128] | r1 = var_128h;
0x00011478 ldr r0, [pc, 0x2c8] | r0 = "OOB size: %d bytes\n";
0x0001147c bl 0x10a20 | printf ("OOB size: %d bytes\n", r1);
| }
0x00011480 ldrb r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00011484 tst r3, 1 |
| if ((r3 & 1) != 0) {
0x00011488 beq 0x1149c |
0x0001148c ldr r2, [sp, 0x40] | r2 = var_40h;
0x00011490 ldr r1, [sp, 0x3c] | r1 = var_3ch;
0x00011494 ldr r0, [pc, 0x2b0] | r0 = "Additional erase regions: %d\n";
0x00011498 bl 0x10a20 | printf ("Additional erase regions: %d\n", r1, r2);
| }
0x0001149c ldrb r3, [sp, 0x134] | r3 = var_134h;
0x000114a0 ldr r4, [pc, 0x2a8] | r4 = "Character device major/minor: %d:%d\n";
0x000114a4 ldr r7, [pc, 0x2a8] | r7 = "true";
0x000114a8 tst r3, 2 |
| if ((r3 & 2) == 0) {
0x000114ac movne r1, r4 | r1 = r4;
| }
| if ((r3 & 2) != 0) {
0x000114b0 moveq r1, r7 | r1 = r7;
| }
0x000114b4 ldr r0, [pc, 0x29c] | r0 = "false";
0x000114b8 bl 0x10a20 | printf ("false", r1, r2, r3, "Character device major/minor: %d:%d\n");
0x000114bc ldrb r3, [sp, 0x134] | r3 = var_134h;
0x000114c0 ldr r0, [pc, 0x294] | r0 = "Bad_blocks_are_allowed:__________s";
0x000114c4 tst r3, 1 |
| if ((r3 & 1) == 0) {
0x000114c8 movne r1, r4 | r1 = r4;
| }
0x000114cc ldr r4, [pc, 0x28c] | r4 = "Device_is_writable:______________s";
| if ((r3 & 1) != 0) {
0x000114d0 moveq r1, r7 | r1 = r7;
| }
0x000114d4 bl 0x10a20 | printf ("Bad_blocks_are_allowed:__________s", r1, r2, r3, "Device_is_writable:______________s");
0x000114d8 ldrb r3, [r4] | r3 = *(r4);
0x000114dc tst r3, 2 |
| if ((r3 & 2) != 0) {
0x000114e0 beq 0x11504 |
0x000114e4 ldrb r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000114e8 tst r3, 1 |
| if ((r3 & 1) != 0) {
0x000114ec bne 0x115a4 | goto label_10;
| }
0x000114f0 ldr r3, [pc, 0x20c] | r3 = *(0x11700);
0x000114f4 ldr r2, [pc, 0x20c] | r2 = stderr;
0x000114f8 ldr r1, [pc, 0x264] | r1 = *(0x11760);
0x000114fc ldr r0, [r3] | r0 = *(0x11700);
0x00011500 bl 0x10abc | fprintf (r0, r1, r2, r3)
| }
| label_1:
0x00011504 ldr r5, [r4, 4] | r5 = *((r4 + 4));
0x00011508 cmp r5, 0 |
| if (r5 == 0) {
0x0001150c beq 0x11664 | goto label_4;
| }
0x00011510 ldrb r3, [r4] | r3 = *(r4);
0x00011514 tst r3, 4 |
| if ((r3 & 4) == 0) {
0x00011518 bne 0x11528 |
0x0001151c ldr r3, [sp, 0x130] | r3 = var_130h;
0x00011520 cmp r3, 0 |
| if (r3 == 0) {
0x00011524 beq 0x11664 | goto label_4;
| }
| }
0x00011528 mov r2, 0x10 | r2 = 0x10;
0x0001152c mov r1, 0 | r1 = 0;
0x00011530 add r0, sp, 0x14 | r0 += s;
0x00011534 bl 0x10b34 | memset (r0, r1, r2);
0x00011538 mov r0, r5 | r0 = r5;
0x0001153c mov r1, 0x80000 | r1 = 0x80000;
0x00011540 bl 0x10b4c | r0 = open64 ();
0x00011544 cmn r0, 1 |
0x00011548 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x0001154c beq 0x11610 | goto label_11;
| }
| label_2:
0x00011550 ldr r3, [sp, 0x130] | r3 = var_130h;
0x00011554 cmp r3, 0 |
| if (r3 != 0) {
0x00011558 bne 0x116f0 | goto label_12;
| }
0x0001155c ldr r2, [sp, 0x11c] | r2 = var_11ch;
0x00011560 mov r1, r5 | r1 = r5;
0x00011564 str r2, [sp, 0x18] | var_18h = r2;
0x00011568 ldr r2, [sp, 0x118] | r2 = var_118h;
0x0001156c mov r0, r8 | r0 = r8;
0x00011570 str r2, [sp, 0x1c] | var_1ch = r2;
0x00011574 add r2, sp, 0x14 | r2 += s;
0x00011578 str r3, [sp, 0x14] | s = r3;
0x0001157c str r3, [sp, 0x20] | var_20h = r3;
0x00011580 bl 0x110f4 | fcn_000110f4 (r0, r1, r2);
0x00011584 b 0x116d0 | goto label_13;
| label_9:
0x00011588 ldr r3, [sp, 0x44] | r3 = var_44h;
0x0001158c sub r3, r3, 4 | r3 -= 4;
0x00011590 bics r3, r3, 4 | __asm ("bics r3, r3, 4");
0x00011594 bne 0x11454 |
| } while (r3 != 0);
0x00011598 ldr r0, [pc, 0x1c8] | r0 = "_s:_error_:_cannot_provide_UBI_info__becasue_sub_page_size_is_not_known";
0x0001159c bl 0x10a74 | puts ("_s:_error_:_cannot_provide_UBI_info__becasue_sub_page_size_is_not_known");
0x000115a0 b 0x11454 | goto label_0;
| label_10:
0x000115a4 mov r5, 0 | r5 = 0;
0x000115a8 mov r3, 1 | r3 = 1;
0x000115ac add r1, sp, 0x11c | r1 += var_11ch;
0x000115b0 str r5, [sp, 8] | var_8h = r5;
0x000115b4 str r3, [sp, 4] | var_4h = r3;
0x000115b8 str r5, [sp] | *(sp) = r5;
0x000115bc add r0, sp, 0x14 | r0 += s;
0x000115c0 ldm r1, {r1, r2, r3} | r1 = *(r1);
| r2 = *((r1 + 4));
| r3 = *((r1 + 8));
0x000115c4 bl 0x1192c | fcn_0001192c (r0, r1, r2, r3, r4);
0x000115c8 ldr r1, [sp, 0x20] | r1 = var_20h;
0x000115cc ldr r0, [pc, 0x198] | r0 = "Sub-page size: unknown";
0x000115d0 bl 0x10a20 | printf ("Sub-page size: unknown", r1);
0x000115d4 ldr r1, [sp, 0x24] | r1 = var_24h;
0x000115d8 ldr r0, [pc, 0x190] | r0 = "Default UBI VID header offset: %d\n";
0x000115dc bl 0x10a20 | printf ("Default UBI VID header offset: %d\n", r1);
0x000115e0 ldr r0, [pc, 0x18c] | r0 = "Default UBI data offset: %d\n";
0x000115e4 bl 0x10a20 | printf ("Default UBI data offset: %d\n");
0x000115e8 ldr r0, [sp, 0x14] | r0 = s;
0x000115ec mov r2, r5 | r2 = r5;
0x000115f0 asr r1, r0, 0x1f | r1 = r0 >> 0x1f;
0x000115f4 bl 0x14d9c | fcn_00014d9c (r0, r1);
0x000115f8 mov r0, 0xa | r0 = 0xa;
0x000115fc bl 0x109fc | putchar (r0);
0x00011600 ldr r1, [sp, 0x30] | r1 = var_30h;
0x00011604 ldr r0, [pc, 0x16c] | r0 = "Default UBI LEB size: ";
0x00011608 bl 0x10a20 | printf ("Default UBI LEB size: ", r1);
0x0001160c b 0x11504 | goto label_1;
| label_11:
0x00011610 bl 0x10b88 | errno_location ();
0x00011614 ldr sb, [pc, 0xe8] | sb = obj.stderr;
0x00011618 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x0001161c ldr r2, [pc, 0xe4] | r2 = stderr;
0x00011620 ldr r1, [pc, 0x154] | r1 = "Maximum_UBI_volumes_count:_______d";
0x00011624 ldr r7, [r0] | r7 = *(r0);
0x00011628 ldr r0, [sb] | r0 = *(sb);
0x0001162c bl 0x10abc | fprintf (r0, "Maximum_UBI_volumes_count:_______d", r2, r3)
0x00011630 mov r0, r7 | r0 = r7;
0x00011634 ldr sb, [sb] | sb = *(sb);
0x00011638 bl 0x10a2c | strerror (r0);
0x0001163c ldr r3, [pc, 0xd0] | r3 = "_s:_error_:_cannot_get_information_about_MTD_device__d";
0x00011640 str r7, [sp] | *(sp) = r7;
0x00011644 mov r2, 9 | r2 = 9;
0x00011648 ldr r1, [pc, 0xc8] | r1 = *(0x11714);
0x0001164c str r0, [sp, 4] | var_4h = r0;
0x00011650 mov r0, sb | r0 = sb;
0x00011654 bl 0x10abc | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about_MTD_device__d")
0x00011658 ldr r3, [sp, 0x130] | r3 = var_130h;
0x0001165c cmp r3, 0 |
| if (r3 == 0) {
0x00011660 beq 0x11550 | goto label_2;
| }
| label_4:
0x00011664 mov r0, 0xa | r0 = 0xa;
0x00011668 bl 0x109fc | putchar (r0);
0x0001166c b 0x1136c | goto label_3;
| do {
0x00011670 mov r1, r7 | r1 = r7;
0x00011674 mov r0, sb | r0 = sb;
0x00011678 bl 0x10a20 | printf (r0, r1);
0x0001167c add r2, sp, 0x14 | r2 += s;
0x00011680 mov r1, r7 | r1 = r7;
0x00011684 mov r0, r5 | r0 = r5;
0x00011688 bl 0x14104 | r0 = fcn_00014104 (r0, r1);
0x0001168c cmp r0, 0 |
| if (r0 != 0) {
0x00011690 bne 0x116e4 | goto label_14;
| }
0x00011694 add r1, sp, 0x14 | r1 += s;
0x00011698 ldm r1, {r1, r2, r3} | r1 = *(r1);
| r2 = *((r1 + 4));
| r3 = *((r1 + 8));
0x0001169c mov r0, fp | r0 = fp;
0x000116a0 bl 0x10a20 | printf (r0, r1);
0x000116a4 ldrb r3, [r4] | r3 = *(r4);
0x000116a8 tst r3, 4 |
| if ((r3 & 4) != 0) {
0x000116ac beq 0x116c0 |
0x000116b0 add r2, sp, 0x14 | r2 += s;
0x000116b4 mov r1, r5 | r1 = r5;
0x000116b8 mov r0, r8 | r0 = r8;
0x000116bc bl 0x110f4 | fcn_000110f4 (r0, r1, r2);
| }
| label_5:
0x000116c0 add r7, r7, 1 | r7++;
| label_6:
0x000116c4 ldr r3, [sp, 0x130] | r3 = var_130h;
0x000116c8 cmp r7, r3 |
0x000116cc blt 0x11670 |
| } while (r7 < r3);
| label_13:
0x000116d0 cmn r5, 1 |
| if (r5 == 1) {
0x000116d4 beq 0x11664 | goto label_4;
| }
0x000116d8 mov r0, r5 | r0 = r5;
0x000116dc bl 0x10bdc | close (r0);
0x000116e0 b 0x11664 | goto label_4;
| label_14:
0x000116e4 mov r0, sl | r0 = sl;
0x000116e8 bl 0x10a74 | puts (r0);
0x000116ec b 0x116c0 | goto label_5;
| label_12:
0x000116f0 mov r7, 0 | r7 = 0;
0x000116f4 ldr sb, [pc, 0x84] | sb = "Eraseblock region %i: ";
0x000116f8 ldr sl, [pc, 0x84] | sl = " info is unavailable";
0x000116fc ldr fp, [pc, 0x84] | fp = "offset:__x_size:__x_numblocks:__x";
0x00011700 b 0x116c4 | goto label_6;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/mtdinfo @ 0x1178c */
| #include <stdint.h>
|
; (fcn) fcn.0001178c () | void fcn_0001178c (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_114h;
| r0 = arg1;
| r1 = arg2;
0x0001178c push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00011790 mov r4, r1 | r4 = r1;
0x00011794 sub sp, sp, 0x114 |
0x00011798 mov r6, r0 | r6 = r0;
0x0001179c ldr r1, [r1] | r1 = *(r1);
0x000117a0 ldr r0, [pc, 0x158] | r0 = *(0x118fc);
0x000117a4 str r2, [sp, 0xc] | var_ch = r2;
0x000117a8 bl 0x10a20 | printf (r0, r1, r2, r3, r4, r5, r6);
0x000117ac ldr r3, [r4] | r3 = *(r4);
0x000117b0 cmp r3, 0 |
0x000117b4 bne 0x117c8 |
| while (r3 == 0) {
| label_0:
0x000117b8 mov r5, 0 | r5 = 0;
| label_2:
0x000117bc mov r0, r5 | r0 = r5;
0x000117c0 add sp, sp, 0x114 |
0x000117c4 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x000117c8 ldr sb, [r4, 4] | sb = *((r4 + 4));
0x000117cc ldr sl, [pc, 0x130] | sl = "Present MTD devices: mtd%d";
0x000117d0 ldr fp, [pc, 0x130] | fp = ", mtd%d";
0x000117d4 mov r8, 1 | r8 = 1;
| label_3:
0x000117d8 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x000117dc cmp r2, sb |
| if (r2 >= sb) {
0x000117e0 bge 0x11848 | goto label_5;
| }
0x000117e4 mov r0, 0xa | r0 = 0xa;
0x000117e8 bl 0x109fc | putchar (r0);
0x000117ec ldrb r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x000117f0 ldr r1, [pc, 0x114] | r1 = ", mtd%d";
0x000117f4 tst r3, 1 |
0x000117f8 ldr r3, [pc, 0x110] | r3 = "yes";
0x000117fc ldr r0, [pc, 0x110] | r0 = "no";
| if ((r3 & 1) != 0) {
0x00011800 moveq r1, r3 | r1 = r3;
| }
0x00011804 bl 0x10a20 | printf ("no", ", mtd%d", r2, r3);
0x00011808 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0001180c cmp r3, 0 |
0x00011810 beq 0x117b8 |
| }
0x00011814 mov r0, 0xa | r0 = 0xa;
0x00011818 bl 0x109fc | putchar (r0);
0x0001181c ldr r7, [r4, 4] | r7 = *((r4 + 4));
| label_1:
0x00011820 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00011824 cmp r3, r7 |
| if (r3 < r7) {
0x00011828 blt 0x117b8 | goto label_0;
| }
0x0001182c mov r1, r7 | r1 = r7;
0x00011830 mov r0, r6 | r0 = r6;
0x00011834 bl 0x1373c | r0 = fcn_0001373c (r0, r1);
0x00011838 cmp r0, 0 |
| if (r0 != 0) {
0x0001183c bne 0x118e4 | goto label_6;
| }
| label_4:
0x00011840 add r7, r7, 1 | r7++;
0x00011844 b 0x11820 | goto label_1;
| label_5:
0x00011848 add r2, sp, 0x10 | r2 += var_10h;
0x0001184c mov r1, sb | r1 = sb;
0x00011850 mov r0, r6 | r0 = r6;
0x00011854 bl 0x137fc | r0 = fcn_000137fc (r0, r1);
0x00011858 cmn r0, 1 |
0x0001185c mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x00011860 bne 0x118b8 |
0x00011864 bl 0x10b88 | r0 = errno_location ();
0x00011868 ldr r7, [r0] | r7 = *(r0);
0x0001186c cmp r7, 0x13 |
| if (r7 == 0x13) {
0x00011870 beq 0x118cc | goto label_7;
| }
0x00011874 ldr r4, [pc, 0x9c] |
0x00011878 mov r3, sb | r3 = sb;
0x0001187c ldr r2, [pc, 0x98] | r2 = stderr;
0x00011880 ldr r1, [pc, 0x98] | r1 = "mtdinfo";
0x00011884 ldr r0, [r4] | r0 = "Sysfs interface supported: %s\n";
0x00011888 bl 0x10abc | fprintf ("Sysfs interface supported: %s\n", "mtdinfo", r2, r3, "Sysfs interface supported: %s\n")
0x0001188c mov r0, r7 | r0 = r7;
0x00011890 ldr r4, [r4] | r4 = "Sysfs interface supported: %s\n";
0x00011894 bl 0x10a2c | strerror (r0);
0x00011898 str r7, [sp] | *(sp) = r7;
0x0001189c ldr r3, [pc, 0x80] | r3 = "%s: error!: libmtd failed to get MTD device %d information\n";
0x000118a0 mov r2, 9 | r2 = 9;
0x000118a4 ldr r1, [pc, 0x7c] | r1 = *(0x11924);
0x000118a8 str r0, [sp, 4] | var_4h = r0;
0x000118ac mov r0, r4 | r0 = r4;
0x000118b0 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: libmtd failed to get MTD device %d information\n")
0x000118b4 b 0x117bc | goto label_2;
| }
0x000118b8 cmp r8, 0 |
0x000118bc mov r1, sb | r1 = sb;
| if (r8 != 0) {
0x000118c0 bne 0x118d4 | goto label_8;
| }
0x000118c4 mov r0, fp | r0 = fp;
0x000118c8 bl 0x10a20 | printf (r0);
| do {
| label_7:
0x000118cc add sb, sb, 1 | sb++;
0x000118d0 b 0x117d8 | goto label_3;
| label_8:
0x000118d4 mov r0, sl | r0 = sl;
0x000118d8 bl 0x10a20 | printf (r0);
0x000118dc mov r8, 0 | r8 = 0;
0x000118e0 b 0x118cc |
| } while (1);
| label_6:
0x000118e4 mov r2, r7 | r2 = r7;
0x000118e8 mov r1, r4 | r1 = r4;
0x000118ec mov r0, r6 | r0 = r6;
0x000118f0 bl 0x11318 | r0 = fcn_00011318 (r0, r1);
0x000118f4 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 == r0) {
0x000118f8 beq 0x11840 | goto label_4;
| }
0x000118fc b 0x117bc | 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/mtdinfo @ 0x126bc */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000126bc () | void fcn_000126bc (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;
0x000126bc push {r4, r5, r6, r7, r8, fp, lr} |
0x000126c0 add fp, sp, 0x18 |
0x000126c4 sub sp, sp, 0x114 |
0x000126c8 mov r5, r0 | r5 = r0;
0x000126cc ldr r0, [r0, 0xc] | r0 = *((r0 + 0xc));
0x000126d0 bl 0x10ba0 | r0 = strlen (r0);
0x000126d4 add r0, r0, 0x11 | r0 += 0x11;
0x000126d8 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000126dc sub sp, sp, r0 |
0x000126e0 ldr r0, [r5] | r0 = *(r5);
0x000126e4 bl 0x10b58 | r0 = opendir ();
0x000126e8 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x000126ec addne r7, sp, 8 | r7 += var_8h;
| }
| if (r4 == r0) {
0x000126f0 ldrne r8, [pc, 0x1a0] | r8 = "mtd_d_s";
| }
| if (r4 != r0) {
0x000126f4 bne 0x12750 | goto label_3;
| }
0x000126f8 bl 0x10b88 | r0 = errno_location ();
0x000126fc ldr r6, [r0] | r6 = *(r0);
0x00012700 cmp r6, 2 |
| if (r6 != 2) {
0x00012704 streq r4, [r0] | *(r0) = r4;
| }
| if (r6 == 2) {
0x00012708 beq 0x127a8 | goto label_1;
| }
0x0001270c ldr r4, [pc, 0x188] |
0x00012710 ldr r3, [r5] | r3 = *(r5);
0x00012714 ldr r2, [pc, 0x184] | r2 = stderr;
0x00012718 ldr r1, [pc, 0x184] | r1 = "libmtd";
0x0001271c ldr r0, [r4] | r0 = "mtd_d_s";
0x00012720 bl 0x10abc | fprintf ("mtd_d_s", "libmtd", r2, r3, "mtd_d_s")
0x00012724 mov r0, r6 | r0 = r6;
0x00012728 ldr r4, [r4] | r4 = "mtd_d_s";
0x0001272c bl 0x10a2c | strerror (r0);
0x00012730 ldr r3, [pc, 0x170] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00012734 ldr r1, [pc, 0x170] | r1 = *(0x128a8);
0x00012738 mov r2, 8 | r2 = 8;
0x0001273c str r6, [sp] | *(sp) = r6;
0x00012740 str r0, [sp, 4] | var_4h = r0;
0x00012744 mov r0, r4 | r0 = r4;
| label_0:
0x00012748 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5, r6)
0x0001274c b 0x127a4 |
| while (r0 != 1) {
| label_3:
0x00012750 mov r0, r4 | r0 = r4;
0x00012754 bl 0x10aec | r0 = readdir64 ();
0x00012758 cmp r0, 0 |
| if (r0 == 0) {
0x0001275c beq 0x1282c | goto label_4;
| }
0x00012760 add r6, r0, 0x13 | r6 = r0 + 0x13;
0x00012764 mov r0, r6 | r0 = r6;
0x00012768 bl 0x10ba0 | r0 = strlen (r0);
0x0001276c cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00012770 bls 0x127b4 |
0x00012774 ldr r0, [pc, 0x120] |
0x00012778 str r6, [sp] | *(sp) = r6;
0x0001277c ldr r2, [pc, 0x11c] | r2 = stderr;
0x00012780 ldr r3, [r5] | r3 = *(r5);
0x00012784 ldr r1, [pc, 0x124] | r1 = "%*serror %d (%s)\n";
0x00012788 ldr r0, [r0] | r0 = "mtd_d_s";
0x0001278c bl 0x10abc | r0 = fprintf ("mtd_d_s", "%*serror %d (%s)\n", r2, r3, r4, r5, r6)
0x00012790 bl 0x10b88 | errno_location ();
0x00012794 mov r3, 0x16 | r3 = 0x16;
0x00012798 str r3, [r0] | *(r0) = r3;
0x0001279c mov r0, r4 | r0 = r4;
0x000127a0 bl 0x10bc4 | closedir ();
0x000127a4 mvn r4, 0 | r4 = ~0;
| label_1:
0x000127a8 mov r0, r4 | r0 = r4;
0x000127ac sub sp, fp, 0x18 |
0x000127b0 pop {r4, r5, r6, r7, r8, fp, pc} |
| }
0x000127b4 sub r3, fp, 0x11c | r3 -= var_11ch;
0x000127b8 sub r2, fp, 0x120 | r2 -= var_120h;
0x000127bc mov r1, r8 | r1 = r8;
0x000127c0 mov r0, r6 | r0 = r6;
0x000127c4 bl 0x10b04 | r0 = sscanf (r0, r1, r2);
0x000127c8 cmp r0, 1 |
0x000127cc bne 0x12750 |
| }
0x000127d0 ldr r6, [fp, -0x120] | r6 = var_120h;
| do {
0x000127d4 mov r0, r4 | r0 = r4;
0x000127d8 bl 0x10bc4 | r0 = closedir ();
0x000127dc subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x000127e0 beq 0x12834 | goto label_5;
| }
0x000127e4 bl 0x10b88 | errno_location ();
0x000127e8 ldr r6, [pc, 0xac] | r6 = "mtd_d_s";
0x000127ec ldr r3, [r5] | r3 = *(r5);
0x000127f0 ldr r2, [pc, 0xa8] | r2 = stderr;
0x000127f4 ldr r1, [pc, 0xb8] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x000127f8 ldr r4, [r0] | r4 = *(r0);
0x000127fc ldr r0, [r6] | r0 = "mtd_d_s";
0x00012800 bl 0x10abc | fprintf ("mtd_d_s", "%s: error!: invalid entry in %s: \"%s\"\n", r2, r3, r4, r5, "mtd_d_s")
0x00012804 ldr r5, [r6] | r5 = "mtd_d_s";
| label_2:
0x00012808 mov r0, r4 | r0 = r4;
0x0001280c bl 0x10a2c | strerror (r0);
0x00012810 str r4, [sp] | *(sp) = r4;
0x00012814 ldr r3, [pc, 0x8c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00012818 mov r2, 8 | r2 = 8;
0x0001281c ldr r1, [pc, 0x88] | r1 = *(0x128a8);
0x00012820 str r0, [sp, 4] | var_4h = r0;
0x00012824 mov r0, r5 | r0 = r5;
0x00012828 b 0x12748 | goto label_0;
| label_4:
0x0001282c mvn r6, 0 | r6 = ~0;
0x00012830 b 0x127d4 |
| } while (1);
| label_5:
0x00012834 cmn r6, 1 |
| if (r6 == 1) {
0x00012838 beq 0x127a8 | goto label_1;
| }
0x0001283c mov r2, r6 | r2 = r6;
0x00012840 ldr r1, [r5, 0xc] | r1 = *((r5 + 0xc));
0x00012844 mov r0, r7 | r0 = r7;
0x00012848 bl 0x10b70 | sprintf (r0, r1, r2);
0x0001284c mov r1, 0x80000 | r1 = 0x80000;
0x00012850 mov r0, r7 | r0 = r7;
0x00012854 bl 0x10b4c | r0 = open64 ();
0x00012858 cmn r0, 1 |
| if (r0 == 1) {
0x0001285c beq 0x127a8 | goto label_1;
| }
0x00012860 bl 0x10bdc | r0 = close (r0);
0x00012864 cmp r0, 0 |
| if (r0 == 0) {
0x00012868 moveq r4, 1 | r4 = 1;
| goto label_6;
| }
| if (r0 == 0) {
| label_6:
0x0001286c beq 0x127a8 | goto label_1;
| }
0x00012870 bl 0x10b88 | errno_location ();
0x00012874 ldr r5, [pc, 0x20] |
0x00012878 mov r3, r7 | r3 = r7;
0x0001287c ldr r2, [pc, 0x1c] | r2 = stderr;
0x00012880 ldr r1, [pc, 0x30] | r1 = "_s:_error_:_closedir_failed_on___s_";
0x00012884 ldr r4, [r0] | r4 = *(r0);
0x00012888 ldr r0, [r5] | r0 = "mtd_d_s";
0x0001288c bl 0x10abc | fprintf ("mtd_d_s", "_s:_error_:_closedir_failed_on___s_", r2, r3, r4, "mtd_d_s")
0x00012890 ldr r5, [r5] | r5 = "mtd_d_s";
0x00012894 b 0x12808 | 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/mtdinfo @ 0x128bc */
| #include <stdint.h>
|
; (fcn) fcn.000128bc () | void fcn_000128bc (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| void * buf;
| int32_t var_10h;
| r0 = arg1;
| r1 = arg2;
0x000128bc push {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr} |
0x000128c0 mov r8, r1 | r8 = r1;
0x000128c4 mov r1, 0x80000 | r1 = 0x80000;
0x000128c8 mov r5, r0 | r5 = r0;
0x000128cc mov r7, r2 | r7 = r2;
0x000128d0 bl 0x10b4c | r0 = open64 ();
0x000128d4 cmn r0, 1 |
0x000128d8 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x000128dc beq 0x12a24 | goto label_2;
| }
0x000128e0 mov r2, r7 | r2 = r7;
0x000128e4 mov r1, r8 | r1 = r8;
0x000128e8 bl 0x10ae0 | r0 = read (r0, r1, r2);
0x000128ec cmn r0, 1 |
0x000128f0 mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x000128f4 bne 0x1294c | goto label_3;
| }
| label_0:
0x000128f8 bl 0x10b88 | errno_location ();
0x000128fc ldr r7, [pc, 0x12c] | r7 = *(0x12a2c);
0x00012900 mov r3, r5 | r3 = r5;
0x00012904 ldr r2, [pc, 0x128] | r2 = stderr;
0x00012908 ldr r1, [pc, 0x128] | r1 = "libmtd";
0x0001290c ldr r6, [r0] | r6 = *(r0);
0x00012910 ldr r0, [r7] | r0 = *(0x12a2c);
0x00012914 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00012918 mov r0, r6 | r0 = r6;
0x0001291c ldr r5, [r7] | r5 = *(0x12a2c);
0x00012920 bl 0x10a2c | strerror (r0);
0x00012924 str r6, [sp] | *(sp) = r6;
0x00012928 ldr r3, [pc, 0x10c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x0001292c mov r2, 8 | r2 = 8;
0x00012930 ldr r1, [pc, 0x108] | r1 = *(0x12a3c);
0x00012934 str r0, [sp, 4] | var_4h = r0;
0x00012938 mov r0, r5 | r0 = r5;
0x0001293c bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x00012940 mov r0, r4 | r0 = r4;
0x00012944 bl 0x10bdc | close (r0);
0x00012948 b 0x12a20 | goto label_4;
| label_3:
0x0001294c cmp r7, r0 |
| if (r7 != r0) {
0x00012950 bne 0x1297c | goto label_5;
| }
0x00012954 ldr r0, [pc, 0xd4] |
0x00012958 mov r3, r5 | r3 = r5;
0x0001295c ldr r2, [pc, 0xd0] | r2 = stderr;
0x00012960 ldr r1, [pc, 0xdc] | r1 = "%*serror %d (%s)\n";
0x00012964 ldr r0, [r0] | r0 = *(0x12a2c);
0x00012968 bl 0x10abc | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x0001296c bl 0x10b88 | errno_location ();
0x00012970 mov r3, 0x16 | r3 = 0x16;
0x00012974 str r3, [r0] | *(r0) = r3;
0x00012978 b 0x12940 |
| } while (1);
| label_5:
0x0001297c mov r3, 0 | r3 = 0;
0x00012980 strb r3, [r8, r0] | *((r8 + r0)) = r3;
0x00012984 mov r2, 1 | r2 = 1;
0x00012988 add r1, sp, 0xc | r1 += buf;
0x0001298c mov r0, r4 | r0 = r4;
0x00012990 bl 0x10ae0 | r0 = read (r0, r1, r2);
0x00012994 cmp r0, 1 |
| if (r0 == 1) {
0x00012998 beq 0x128f8 | goto label_0;
| }
0x0001299c cmp r0, 0 |
| if (r0 != 0) {
0x000129a0 beq 0x129c4 |
0x000129a4 ldr r0, [pc, 0x84] |
0x000129a8 str r7, [sp] | *(sp) = r7;
0x000129ac mov r3, r5 | r3 = r5;
0x000129b0 ldr r2, [pc, 0x7c] | r2 = stderr;
0x000129b4 ldr r1, [pc, 0x8c] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x000129b8 ldr r0, [r0] | r0 = *(0x12a2c);
0x000129bc bl 0x10abc | fprintf (r0, "%s: error!: contents of \"%s\" is too long\n", r2, r3)
0x000129c0 b 0x1296c | goto label_1;
| }
0x000129c4 mov r0, r4 | r0 = r4;
0x000129c8 bl 0x10bdc | r0 = close (r0);
0x000129cc cmp r0, 0 |
| if (r0 != 0) {
0x000129d0 moveq r4, r6 | r4 = r6;
| }
| if (r0 != 0) {
0x000129d4 beq 0x12a24 |
0x000129d8 bl 0x10b88 | errno_location ();
0x000129dc ldr r6, [pc, 0x4c] | r6 = *(0x12a2c);
0x000129e0 mov r3, r5 | r3 = r5;
0x000129e4 ldr r2, [pc, 0x48] | r2 = stderr;
0x000129e8 ldr r1, [pc, 0x5c] | r1 = "%s: error!: file \"%s\" contains too much data (> %d bytes)\n";
0x000129ec ldr r4, [r0] | r4 = *(r0);
0x000129f0 ldr r0, [r6] | r0 = *(0x12a2c);
0x000129f4 bl 0x10abc | fprintf (r0, "%s: error!: file \"%s\" contains too much data (> %d bytes)\n", r2, r3, r4, r5, r6)
0x000129f8 mov r0, r4 | r0 = r4;
0x000129fc ldr r5, [r6] | r5 = *(0x12a2c);
0x00012a00 bl 0x10a2c | strerror (r0);
0x00012a04 str r4, [sp] | *(sp) = r4;
0x00012a08 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00012a0c mov r2, 8 | r2 = 8;
0x00012a10 ldr r1, [pc, 0x28] | r1 = *(0x12a3c);
0x00012a14 str r0, [sp, 4] | var_4h = r0;
0x00012a18 mov r0, r5 | r0 = r5;
0x00012a1c bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x00012a20 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00012a24 mov r0, r4 | r0 = r4;
0x00012a28 add sp, sp, 0x10 |
0x00012a2c 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/mtdinfo @ 0x12a50 */
| #include <stdint.h>
|
; (fcn) fcn.00012a50 () | void fcn_00012a50 (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;
0x00012a50 push {r4, r5, r6, r7, lr} |
0x00012a54 sub sp, sp, 0x4c |
0x00012a58 mov r5, r0 | r5 = r0;
0x00012a5c mov r2, 0x32 | r2 = 0x32;
0x00012a60 mov r6, r1 | r6 = r1;
0x00012a64 add r0, sp, 0x14 | r0 += buf;
0x00012a68 mov r1, 0 | r1 = 0;
0x00012a6c bl 0x10b34 | memset (r0, r1, r2);
0x00012a70 mov r1, 0x80000 | r1 = 0x80000;
0x00012a74 mov r0, r5 | r0 = r5;
0x00012a78 bl 0x10b4c | r0 = open64 ();
0x00012a7c cmn r0, 1 |
0x00012a80 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00012a84 beq 0x12bd0 | goto label_2;
| }
0x00012a88 mov r2, 0x32 | r2 = 0x32;
0x00012a8c add r1, sp, 0x14 | r1 += buf;
0x00012a90 bl 0x10ae0 | r0 = read (r0, r1, r2);
0x00012a94 cmn r0, 1 |
| if (r0 != 1) {
0x00012a98 bne 0x12af0 | goto label_3;
| }
0x00012a9c bl 0x10b88 | errno_location ();
0x00012aa0 ldr r7, [pc, 0x134] | r7 = *(0x12bd8);
0x00012aa4 mov r3, r5 | r3 = r5;
0x00012aa8 ldr r2, [pc, 0x130] | r2 = stderr;
0x00012aac ldr r1, [pc, 0x130] | r1 = "libmtd";
0x00012ab0 ldr r6, [r0] | r6 = *(r0);
0x00012ab4 ldr r0, [r7] | r0 = *(0x12bd8);
0x00012ab8 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00012abc mov r0, r6 | r0 = r6;
0x00012ac0 ldr r5, [r7] | r5 = *(0x12bd8);
0x00012ac4 bl 0x10a2c | strerror (r0);
0x00012ac8 str r6, [sp] | *(sp) = r6;
0x00012acc ldr r3, [pc, 0x114] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00012ad0 mov r2, 8 | r2 = 8;
0x00012ad4 ldr r1, [pc, 0x110] | r1 = *(0x12be8);
0x00012ad8 str r0, [sp, 4] | var_4h = r0;
0x00012adc mov r0, r5 | r0 = r5;
0x00012ae0 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4, r5, r6)
| do {
0x00012ae4 mov r0, r4 | r0 = r4;
0x00012ae8 bl 0x10bdc | close (r0);
0x00012aec b 0x12bcc | goto label_4;
| label_3:
0x00012af0 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x00012af4 bne 0x12b20 | goto label_5;
| }
0x00012af8 ldr r2, [pc, 0xe0] | r2 = stderr;
0x00012afc ldr r1, [pc, 0xec] | r1 = "%*serror %d (%s)\n";
0x00012b00 mov r3, r5 | r3 = r5;
| label_0:
0x00012b04 ldr r0, [pc, 0xd0] |
0x00012b08 ldr r0, [r0] | r0 = *(0x12bd8);
0x00012b0c bl 0x10abc | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x00012b10 bl 0x10b88 | errno_location ();
0x00012b14 mov r3, 0x16 | r3 = 0x16;
0x00012b18 str r3, [r0] | *(r0) = r3;
0x00012b1c b 0x12ae4 |
| } while (1);
| label_5:
0x00012b20 mov r2, r6 | r2 = r6;
0x00012b24 ldr r1, [pc, 0xc8] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x00012b28 add r0, sp, 0x14 | r0 += buf;
0x00012b2c bl 0x10b04 | r0 = sscanf (r0, "%s: error!: contents of \"%s\" is too long\n", r2);
0x00012b30 cmp r0, 1 |
| if (r0 == 1) {
0x00012b34 movne r3, r5 | r3 = r5;
| }
| if (r0 == 1) {
0x00012b38 ldrne r2, [pc, 0xa0] | r2 = "libmtd";
| }
| if (r0 != 1) {
0x00012b3c ldrne r1, [pc, 0xb4] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
| goto label_6;
| }
| if (r0 != 1) {
| label_6:
0x00012b40 bne 0x12b04 | goto label_0;
| }
0x00012b44 ldrd r2, r3, [r6] | __asm ("ldrd r2, r3, [r6]");
0x00012b48 cmp r2, 0 |
0x00012b4c sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x00012b50 bge 0x12b74 |
0x00012b54 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00012b58 ldr r3, [pc, 0x7c] | r3 = *(0x12bd8);
0x00012b5c str r5, [sp, 8] | var_8h = r5;
0x00012b60 ldr r2, [pc, 0x78] | r2 = stderr;
0x00012b64 ldr r1, [pc, 0x90] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
0x00012b68 ldr r0, [r3] | r0 = *(0x12bd8);
0x00012b6c bl 0x10abc | fprintf (r0, "_s:_error_:_cannot_read_integer_from___s_", r2, r3, r4, r5)
0x00012b70 b 0x12b10 | goto label_1;
| }
0x00012b74 mov r0, r4 | r0 = r4;
0x00012b78 bl 0x10bdc | r0 = close (r0);
0x00012b7c subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00012b80 beq 0x12bd0 |
0x00012b84 bl 0x10b88 | errno_location ();
0x00012b88 ldr r6, [pc, 0x4c] | r6 = *(0x12bd8);
0x00012b8c mov r3, r5 | r3 = r5;
0x00012b90 ldr r2, [pc, 0x48] | r2 = stderr;
0x00012b94 ldr r1, [pc, 0x64] | r1 = "_s:_error_:_negative_value__lld_in___s_";
0x00012b98 ldr r4, [r0] | r4 = *(r0);
0x00012b9c ldr r0, [r6] | r0 = *(0x12bd8);
0x00012ba0 bl 0x10abc | fprintf (r0, "_s:_error_:_negative_value__lld_in___s_", r2, r3, r4, r5, r6)
0x00012ba4 mov r0, r4 | r0 = r4;
0x00012ba8 ldr r5, [r6] | r5 = *(0x12bd8);
0x00012bac bl 0x10a2c | strerror (r0);
0x00012bb0 str r4, [sp] | *(sp) = r4;
0x00012bb4 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00012bb8 mov r2, 8 | r2 = 8;
0x00012bbc ldr r1, [pc, 0x28] | r1 = *(0x12be8);
0x00012bc0 str r0, [sp, 4] | var_4h = r0;
0x00012bc4 mov r0, r5 | r0 = r5;
0x00012bc8 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| label_4:
0x00012bcc mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00012bd0 mov r0, r4 | r0 = r4;
0x00012bd4 add sp, sp, 0x4c |
0x00012bd8 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/mtdinfo @ 0x12c04 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012c04 () | void fcn_00012c04 (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;
0x00012c04 push {r4, r5, r6, r7, fp, lr} |
0x00012c08 add fp, sp, 0x14 |
0x00012c0c sub sp, sp, 0x18 |
0x00012c10 mov r7, r1 | r7 = r1;
0x00012c14 mov r6, r0 | r6 = r0;
0x00012c18 mov r5, r2 | r5 = r2;
0x00012c1c bl 0x10ba0 | strlen (r0);
0x00012c20 mov r2, r7 | r2 = r7;
0x00012c24 mov r1, r6 | r1 = r6;
0x00012c28 add r0, r0, 0x39 | r0 += 0x39;
0x00012c2c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012c30 sub sp, sp, r0 |
0x00012c34 add r4, sp, 0x10 | r4 += s;
0x00012c38 mov r0, r4 | r0 = r4;
0x00012c3c bl 0x10b70 | sprintf (r0, r1, r2);
0x00012c40 sub r1, fp, 0x1c | r1 -= s;
0x00012c44 mov r0, r4 | r0 = r4;
0x00012c48 bl 0x12a50 | r0 = fcn_00012a50 (r0, r1);
0x00012c4c cmp r0, 0 |
| if (r0 == 0) {
0x00012c50 bne 0x12c90 |
0x00012c54 ldrd r2, r3, [fp, -0x1c] | __asm ("ldrd r2, r3, [s]");
0x00012c58 cmp r2, 0x80000000 |
0x00012c5c sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 >= 0x80000000) {
0x00012c60 strlt r2, [r5] | *(r5) = r2;
| }
| if (r2 < 0x80000000) {
0x00012c64 blt 0x12c94 | goto label_0;
| }
0x00012c68 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00012c6c ldr r3, [pc, 0x28] | r3 = *(0x12c98);
0x00012c70 str r4, [sp, 8] | var_8h = r4;
0x00012c74 ldr r2, [pc, 0x24] | r2 = stderr;
0x00012c78 ldr r0, [r3] | r0 = *(0x12c98);
0x00012c7c ldr r1, [pc, 0x20] | r1 = "libmtd";
0x00012c80 bl 0x10abc | r0 = fprintf (r0, "libmtd", r2, r3, r4)
0x00012c84 bl 0x10b88 | errno_location ();
0x00012c88 mov r3, 0x16 | r3 = 0x16;
0x00012c8c str r3, [r0] | *(r0) = r3;
| }
0x00012c90 mvn r0, 0 | r0 = ~0;
| label_0:
0x00012c94 sub sp, fp, 0x14 |
0x00012c98 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/mtdinfo @ 0x12ca8 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012ca8 () | void fcn_00012ca8 (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;
0x00012ca8 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012cac ldr r8, [pc, 0x2d0] | r8 = *(0x12f80);
0x00012cb0 sub sp, sp, 0x54 |
0x00012cb4 mov r4, r1 | r4 = r1;
0x00012cb8 mov r5, r0 | r5 = r0;
0x00012cbc mov r1, 0 | r1 = 0;
0x00012cc0 mov sb, r2 | sb = r2;
0x00012cc4 add r0, sp, 0x38 | r0 += s;
0x00012cc8 mov r2, 0x18 | r2 = 0x18;
0x00012ccc ldrd sl, fp, [sp, 0x78] | __asm ("ldrd sl, fp, [arg_78h]");
0x00012cd0 bl 0x10b34 | memset (r0, r1, r2);
0x00012cd4 mov r3, 0 | r3 = 0;
0x00012cd8 ldr r2, [sp, 0x8c] | r2 = *(request);
0x00012cdc str r3, [sp, 0x2c] | var_2ch = r3;
0x00012ce0 str r3, [sp, 0x30] | var_30h = r3;
0x00012ce4 str r3, [sp, 0x34] | var_34h = r3;
0x00012ce8 ldr r3, [pc, 0x298] | r3 = "MEMREADOOB64";
0x00012cec cmp r2, r3 |
0x00012cf0 ldr r2, [pc, 0x294] | r2 = *(0x12f88);
0x00012cf4 ldr r3, [pc, 0x294] | r3 = "MEMREADOOB";
| if (r2 != r3) {
0x00012cf8 moveq r3, r2 | r3 = r2;
| }
0x00012cfc str r3, [sp, 0x24] | var_24h = r3;
0x00012d00 ldr r3, [pc, 0x28c] | r3 = "MEMWRITEOOB";
0x00012d04 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
| if (r2 == r3) {
0x00012d08 movne r8, r3 | r8 = r3;
| }
0x00012d0c ldr r3, [r4, 0xe0] | r3 = *((r4 + 0xe0));
0x00012d10 smull r0, r1, r3, r2 | r0:r1 = r3 * r2;
0x00012d14 cmp r1, fp |
0x00012d18 cmpeq r0, sl | __asm ("cmpeq r0, sl");
| if (r1 > fp) {
0x00012d1c bhi 0x12d64 | goto label_2;
| }
0x00012d20 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x00012d24 ldr r2, [pc, 0x26c] | r2 = "MEMWRITEOOB64";
0x00012d28 str r3, [sp, 0xc] | var_ch = r3;
0x00012d2c ldr r3, [r4] | r3 = *(r4);
0x00012d30 ldr r1, [pc, 0x264] | r1 = "libmtd";
0x00012d34 str r3, [sp, 8] | var_8h = r3;
0x00012d38 ldr r3, [pc, 0x260] | r3 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012d3c strd sl, fp, [sp] | __asm ("strd sl, fp, [sp]");
0x00012d40 ldr r0, [r3] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012d44 bl 0x10abc | r0 = fprintf (r0, "libmtd", "MEMWRITEOOB64", r3)
| do {
| label_1:
0x00012d48 bl 0x10b88 | errno_location ();
0x00012d4c mvn r7, 0 | r7 = ~0;
0x00012d50 mov r3, 0x16 | r3 = 0x16;
0x00012d54 str r3, [r0] | *(r0) = r3;
| label_0:
0x00012d58 mov r0, r7 | r0 = r7;
0x00012d5c add sp, sp, 0x54 |
0x00012d60 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_2:
0x00012d64 ldr r3, [r4, 0xe8] | r3 = *((r4 + 0xe8));
0x00012d68 ldrd r0, r1, [sp, 0x80] | __asm ("ldrd r0, r1, [arg_80h]");
0x00012d6c ldr r2, [r4, 0xf0] | r2 = *((r4 + 0xf0));
0x00012d70 sub r3, r3, 1 | r3--;
0x00012d74 and r3, r3, sl | r3 &= sl;
0x00012d78 adds r0, r0, r3 | r0 += r3;
0x00012d7c adc r1, r1, r3, asr 31 | __asm ("adc r1, r1, r3, asr 31");
0x00012d80 mov r6, r0 | r6 = r0;
0x00012d84 mov r7, r1 | r7 = r1;
0x00012d88 ldr r0, [sp, 0x80] | r0 = *(arg_80h);
0x00012d8c asr r1, r2, 0x1f | r1 = r2 >> 0x1f;
0x00012d90 ldr ip, [sp, 0x84] | ip = *(arg_84h);
0x00012d94 cmp r7, r1 |
0x00012d98 cmpeq r6, r2 | __asm ("cmpeq r6, r2");
| if (r7 <= r1) {
0x00012d9c movhi r1, 1 | r1 = 1;
| }
| if (r7 > r1) {
0x00012da0 movls r1, 0 | r1 = 0;
| }
0x00012da4 orrs r0, r0, ip | r0 |= ip;
| if (r0 != r0) {
0x00012da8 moveq r1, 1 | r1 = 1;
| }
0x00012dac cmp r1, 0 |
| if (r1 == 0) {
0x00012db0 beq 0x12de8 | goto label_3;
| }
0x00012db4 str r2, [sp, 0x18] | var_18h = r2;
0x00012db8 ldr r2, [r4] | r2 = *(r4);
0x00012dbc str r3, [sp, 0x10] | var_10h = r3;
0x00012dc0 str r2, [sp, 0x14] | var_14h = r2;
0x00012dc4 ldrd r2, r3, [sp, 0x80] | __asm ("ldrd r2, r3, [arg_80h]");
0x00012dc8 ldr r1, [pc, 0x1d4] | r1 = stderr;
0x00012dcc strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00012dd0 ldr r3, [pc, 0x1c8] | r3 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012dd4 strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x00012dd8 ldr r2, [pc, 0x1b8] | r2 = "MEMWRITEOOB64";
0x00012ddc ldr r0, [r3] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012de0 bl 0x10abc | fprintf ("%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n", r1, r2, r3)
0x00012de4 b 0x12d48 |
| } while (1);
| label_3:
0x00012de8 ldr r3, [sp, 0x80] | r3 = *(arg_80h);
0x00012dec strd sl, fp, [sp, 0x38] | __asm ("strd sl, fp, [s]");
0x00012df0 str r3, [sp, 0x44] | var_44h = r3;
0x00012df4 ldr r3, [sp, 0x88] | r3 = *(arg_88h);
0x00012df8 str r1, [sp, 0x4c] | var_4ch = r1;
0x00012dfc str r3, [sp, 0x48] | var_48h = r3;
0x00012e00 ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x00012e04 tst r3, 2 |
| if ((r3 & 2) != 0) {
0x00012e08 bne 0x12eb4 | goto label_4;
| }
0x00012e0c add r2, sp, 0x38 | r2 += s;
0x00012e10 ldr r1, [sp, 0x8c] | r1 = *(request);
0x00012e14 mov r0, sb | r0 = sb;
0x00012e18 bl 0x10a14 | r0 = ioctl (r0, r1);
0x00012e1c subs r7, r0, 0 | r7 = r0 - 0;
| if (r7 == r0) {
0x00012e20 beq 0x12d58 | goto label_0;
| }
0x00012e24 bl 0x10b88 | r0 = errno_location ();
0x00012e28 ldr r7, [r0] | r7 = *(r0);
0x00012e2c cmp r7, 0x19 |
| if (r7 == 0x19) {
0x00012e30 bne 0x12e40 |
0x00012e34 ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x00012e38 tst r3, 6 |
| if ((r3 & 6) == 0) {
0x00012e3c beq 0x12ea4 | goto label_5;
| }
| }
0x00012e40 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x00012e44 mov r0, sl | r0 = sl;
0x00012e48 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00012e4c mov r1, fp | r1 = fp;
0x00012e50 bl 0x15d40 | fcn_00015d40 (r0, r1);
0x00012e54 ldr r6, [pc, 0x144] | r6 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012e58 strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x00012e5c ldr r2, [pc, 0x134] | r2 = "MEMWRITEOOB64";
0x00012e60 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x00012e64 ldr r3, [r4] | r3 = *(r4);
0x00012e68 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";
0x00012e6c str r3, [sp] | *(sp) = r3;
0x00012e70 mov r3, r8 | r3 = r8;
0x00012e74 ldr r0, [r6] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012e78 bl 0x10abc | 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")
0x00012e7c mov r0, r7 | r0 = r7;
0x00012e80 ldr r8, [r6] | r8 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012e84 bl 0x10a2c | strerror (r0);
0x00012e88 str r7, [sp] | *(sp) = r7;
0x00012e8c ldr r3, [pc, 0x118] | r3 = "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_";
0x00012e90 mov r2, 8 | r2 = 8;
0x00012e94 ldr r1, [pc, 0x114] | r1 = *(0x12fac);
0x00012e98 str r0, [sp, 4] | var_4h = r0;
0x00012e9c mov r0, r8 | r0 = r8;
0x00012ea0 bl 0x10abc | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_")
| label_5:
0x00012ea4 ldrb r3, [r5, 0x34] | r3 = *((r5 + 0x34));
0x00012ea8 bic r3, r3, 4 | r3 = BIT_MASK (r3, 4);
0x00012eac orr r3, r3, 2 | r3 |= 2;
0x00012eb0 strb r3, [r5, 0x34] | *((r5 + 0x34)) = r3;
| label_4:
0x00012eb4 ldrd r2, r3, [sp, 0x38] | __asm ("ldrd r2, r3, [s]");
0x00012eb8 mov r1, 0 | r1 = 0;
0x00012ebc mvn r0, 0 | r0 = ~0;
0x00012ec0 cmp r3, r1 |
0x00012ec4 cmpeq r2, r0 | __asm ("cmpeq r2, r0");
| if (r3 >= r1) {
0x00012ec8 bls 0x12ee8 |
0x00012ecc ldr r0, [pc, 0xcc] |
0x00012ed0 mvn r3, 0 | r3 = ~0;
0x00012ed4 ldr r2, [pc, 0xbc] | r2 = "MEMWRITEOOB64";
0x00012ed8 ldr r1, [pc, 0xd4] | r1 = "%*serror %d (%s)\n";
0x00012edc ldr r0, [r0] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012ee0 bl 0x10abc | fprintf ("%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n", "%*serror %d (%s)\n", "MEMWRITEOOB64", r3)
0x00012ee4 b 0x12d48 | goto label_1;
| }
0x00012ee8 ldr r3, [sp, 0x44] | r3 = var_44h;
0x00012eec str r2, [sp, 0x2c] | var_2ch = r2;
0x00012ef0 str r3, [sp, 0x30] | var_30h = r3;
0x00012ef4 ldr r3, [sp, 0x88] | r3 = *(arg_88h);
0x00012ef8 add r2, sp, 0x2c | r2 += var_2ch;
0x00012efc ldr r1, [sp, 0x90] | r1 = *(arg_90h);
0x00012f00 mov r0, sb | r0 = sb;
0x00012f04 str r3, [sp, 0x34] | var_34h = r3;
0x00012f08 bl 0x10a14 | r0 = ioctl (r0, r1);
0x00012f0c subs r7, r0, 0 | r7 = r0 - 0;
| if (r7 >= r0) {
0x00012f10 bge 0x12d58 | goto label_0;
| }
0x00012f14 bl 0x10b88 | errno_location ();
0x00012f18 ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x00012f1c mov r1, fp | r1 = fp;
0x00012f20 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00012f24 ldr r8, [pc, 0x74] | r8 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012f28 ldr r5, [r0] | r5 = *(r0);
0x00012f2c mov r0, sl | r0 = sl;
0x00012f30 bl 0x15d40 | fcn_00015d40 (r0, r1);
0x00012f34 strd sl, fp, [sp, 8] | __asm ("strd sl, fp, [var_ch]");
0x00012f38 ldr r2, [pc, 0x58] | r2 = "MEMWRITEOOB64";
0x00012f3c strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x00012f40 ldr r3, [r4] | r3 = *(r4);
0x00012f44 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";
0x00012f48 str r3, [sp] | *(sp) = r3;
0x00012f4c ldr r3, [sp, 0x24] | r3 = var_24h;
0x00012f50 ldr r0, [r8] | r0 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012f54 bl 0x10abc | 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)
0x00012f58 mov r0, r5 | r0 = r5;
0x00012f5c ldr r4, [r8] | r4 = "%s: error!: bad page address %llu, mtd%d has %d eraseblocks (%llu bytes)\n";
0x00012f60 bl 0x10a2c | strerror (r0);
0x00012f64 str r5, [sp] | *(sp) = r5;
0x00012f68 ldr r3, [pc, 0x3c] | r3 = "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_";
0x00012f6c mov r2, 8 | r2 = 8;
0x00012f70 ldr r1, [pc, 0x38] | r1 = *(0x12fac);
0x00012f74 str r0, [sp, 4] | var_4h = r0;
0x00012f78 mov r0, r4 | r0 = r4;
0x00012f7c bl 0x10abc | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_mtd_d__offset__llu__eraseblock__llu_", r4, r5)
0x00012f80 b 0x12d58 | 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/mtdinfo @ 0x12fb8 */
| #include <stdint.h>
|
; (fcn) fcn.00012fb8 () | void fcn_00012fb8 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| r0 = arg1;
| r1 = arg2;
0x00012fb8 subs r3, r1, 0 | r3 = r1 - 0;
0x00012fbc push {r0, r1, r2, lr} |
0x00012fc0 ldr r2, [r0, 0xe0] | r2 = *((r0 + 0xe0));
| if (r3 >= r1) {
0x00012fc4 blt 0x12fd4 |
0x00012fc8 cmp r3, r2 |
| if (r3 >= r2) {
0x00012fcc movlt r0, 0 | r0 = 0;
| }
| if (r3 < r2) {
0x00012fd0 blt 0x13004 | goto label_0;
| }
| }
0x00012fd4 str r2, [sp, 4] | var_4h = r2;
0x00012fd8 ldr r2, [r0] | r2 = *(r0);
0x00012fdc ldr r0, [pc, 0x28] |
0x00012fe0 str r2, [sp] | *(sp) = r2;
0x00012fe4 ldr r1, [pc, 0x24] | r1 = stderr;
0x00012fe8 ldr r2, [pc, 0x24] | r2 = "_s:_error_:_bad_eraseblock_number__d__mtd_d_has__d_eraseblocks";
0x00012fec ldr r0, [r0] | r0 = *(0x13008);
0x00012ff0 bl 0x10abc | r0 = fprintf (r0, r1, r2)
0x00012ff4 bl 0x10b88 | errno_location ();
0x00012ff8 mov r3, 0x16 | r3 = 0x16;
0x00012ffc str r3, [r0] | *(r0) = r3;
0x00013000 mvn r0, 0 | r0 = ~0;
| label_0:
0x00013004 add sp, sp, 0xc |
0x00013008 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/mtdinfo @ 0x13018 */
| #include <stdint.h>
|
; (fcn) fcn.00013018 () | void fcn_00013018 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
| r1 = arg2;
0x00013018 push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x0001301c ldr r5, [pc, 0x5c] |
0x00013020 mov r7, r1 | r7 = r1;
0x00013024 mov r6, r2 | r6 = r2;
0x00013028 mov r8, r0 | r8 = r0;
0x0001302c bl 0x10b88 | errno_location ();
0x00013030 mov r3, r6 | r3 = r6;
0x00013034 ldr r2, [pc, 0x48] | r2 = stderr;
0x00013038 ldr r1, [pc, 0x48] | r1 = "libmtd";
0x0001303c ldr r4, [r0] | r4 = *(r0);
0x00013040 stm sp, {r7, r8} | *(sp) = r7;
| *((sp + 4)) = r8;
0x00013044 ldr r0, [r5] | r0 = *(0x1307c);
0x00013048 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4)
0x0001304c mov r0, r4 | r0 = r4;
0x00013050 ldr r5, [r5] | r5 = *(0x1307c);
0x00013054 bl 0x10a2c | strerror (r0);
0x00013058 str r4, [sp] | *(sp) = r4;
0x0001305c ldr r3, [pc, 0x28] | r3 = "_s:_error_:__s_ioctl_failed_for_eraseblock__d__mtd_d_";
0x00013060 mov r2, 8 | r2 = 8;
0x00013064 ldr r1, [pc, 0x24] | r1 = *(0x1308c);
0x00013068 str r0, [sp, 4] | var_4h = r0;
0x0001306c mov r0, r5 | r0 = r5;
0x00013070 bl 0x10abc | fprintf (r0, r1, r2, "_s:_error_:__s_ioctl_failed_for_eraseblock__d__mtd_d_", r4)
0x00013074 mvn r0, 0 | r0 = ~0;
0x00013078 add sp, sp, 8 |
0x0001307c 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/mtdinfo @ 0x13094 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00013094 () | void fcn_00013094 (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;
0x00013094 push {r4, r5, r6, r7, r8, fp, lr} |
0x00013098 add fp, sp, 0x18 |
0x0001309c sub sp, sp, 0x44 |
0x000130a0 ldr r7, [r0] | r7 = *(r0);
0x000130a4 mov r8, r1 | r8 = r1;
0x000130a8 mov r0, r7 | r0 = r7;
0x000130ac mov r6, r3 | r6 = r3;
0x000130b0 mov r5, r2 | r5 = r2;
0x000130b4 bl 0x10ba0 | strlen (r0);
0x000130b8 mov r2, r8 | r2 = r8;
0x000130bc mov r1, r7 | r1 = r7;
0x000130c0 add r0, r0, 0x39 | r0 += 0x39;
0x000130c4 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000130c8 sub sp, sp, r0 |
0x000130cc add r4, sp, 8 | r4 += var_8h;
0x000130d0 mov r0, r4 | r0 = r4;
0x000130d4 bl 0x10b70 | sprintf (r0, r1, r2);
0x000130d8 mov r2, 0x32 | r2 = 0x32;
0x000130dc sub r1, fp, 0x50 | r1 -= var_50h;
0x000130e0 mov r0, r4 | r0 = r4;
0x000130e4 bl 0x128bc | r0 = fcn_000128bc (r0, r1);
0x000130e8 cmp r0, 0 |
| if (r0 < 0) {
0x000130ec blt 0x13134 | goto label_1;
| }
0x000130f0 mov r3, r6 | r3 = r6;
0x000130f4 mov r2, r5 | r2 = r5;
0x000130f8 ldr r1, [pc, 0x8c] | r1 = *(0x13188);
0x000130fc sub r0, fp, 0x50 | r0 -= var_50h;
0x00013100 bl 0x10b04 | r0 = sscanf (r0, r1, r2);
0x00013104 cmp r0, 2 |
| if (r0 == 2) {
0x00013108 beq 0x1313c | goto label_2;
| }
0x0001310c bl 0x10b88 | errno_location ();
0x00013110 mov r3, 0x16 | r3 = 0x16;
0x00013114 ldr r2, [pc, 0x74] | r2 = *(0x1318c);
0x00013118 ldr r1, [pc, 0x74] | r1 = "libmtd";
0x0001311c str r3, [r0] | *(r0) = r3;
0x00013120 ldr r0, [pc, 0x70] |
0x00013124 mov r3, r4 | r3 = r4;
0x00013128 ldr r0, [r0] | r0 = "_s:_error_:___s__does_not_have_major:minor_format";
0x0001312c bl 0x10abc | fprintf ("_s:_error_:___s__does_not_have_major:minor_format", "libmtd", r2, r3)
| label_0:
0x00013130 mvn r0, 0 | r0 = ~0;
| do {
| label_1:
0x00013134 sub sp, fp, 0x18 |
0x00013138 pop {r4, r5, r6, r7, r8, fp, pc} |
| label_2:
0x0001313c ldr r3, [r5] | r3 = *(r5);
0x00013140 cmp r3, 0 |
| if (r3 < 0) {
0x00013144 blt 0x13158 | goto label_3;
| }
0x00013148 ldr r3, [r6] | r3 = *(r6);
0x0001314c cmp r3, 0 |
| if (r3 < 0) {
0x00013150 movge r0, 0 | r0 = 0;
| }
0x00013154 bge 0x13134 |
| } while (r3 >= 0);
| label_3:
0x00013158 bl 0x10b88 | errno_location ();
0x0001315c mov r3, 0x16 | r3 = 0x16;
0x00013160 ldr r2, [pc, 0x28] | r2 = *(0x1318c);
0x00013164 ldr r1, [pc, 0x30] | r1 = stderr;
0x00013168 str r3, [r0] | *(r0) = r3;
0x0001316c ldr r0, [pc, 0x24] |
0x00013170 ldr r3, [r6] | r3 = *(r6);
0x00013174 str r4, [sp, 4] | var_4h = r4;
0x00013178 str r3, [sp] | *(sp) = r3;
0x0001317c ldr r3, [r5] | r3 = *(r5);
0x00013180 ldr r0, [r0] | r0 = "_s:_error_:___s__does_not_have_major:minor_format";
0x00013184 bl 0x10abc | fprintf ("_s:_error_:___s__does_not_have_major:minor_format", r1, r2, r3, r4)
0x00013188 b 0x13130 | 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/mtdinfo @ 0x134e0 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000134e0 () | void fcn_000134e0 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
0x000134e0 push {r0, r1, r2, r4, r5, lr} |
0x000134e4 mov r1, 0x38 | r1 = 0x38;
0x000134e8 mov r0, 1 | r0 = 1;
0x000134ec bl 0x10aa4 | r0 = calloc (r0, r1);
0x000134f0 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x000134f4 bne 0x13544 |
0x000134f8 bl 0x10b88 | errno_location ();
0x000134fc ldr r5, [pc, 0x1ec] |
0x00013500 ldr r2, [pc, 0x1ec] | r2 = stderr;
0x00013504 ldr r1, [pc, 0x1ec] | r1 = "libmtd";
0x00013508 ldr r4, [r0] | r4 = *(r0);
0x0001350c ldr r0, [r5] | r0 = *(0x136ec);
0x00013510 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x00013514 mov r0, r4 | r0 = r4;
0x00013518 ldr r5, [r5] | r5 = *(0x136ec);
0x0001351c bl 0x10a2c | strerror (r0);
0x00013520 str r4, [sp] | *(sp) = r4;
0x00013524 ldr r3, [pc, 0x1d0] | r3 = "%s: error!: out of memory\n";
0x00013528 mov r2, 8 | r2 = 8;
0x0001352c ldr r1, [pc, 0x1cc] | r1 = *(0x136fc);
0x00013530 str r0, [sp, 4] | var_4h = r0;
0x00013534 mov r0, r5 | r0 = r5;
0x00013538 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x0001353c mvn r0, 0 | r0 = ~0;
0x00013540 bl 0x10b94 | exit (r0);
| }
0x00013544 ldrb r3, [r4, 0x34] | r3 = *((r4 + 0x34));
0x00013548 ldr r1, [pc, 0x1b4] | r1 = "%*serror %d (%s)\n";
0x0001354c bic r3, r3, 6 | r3 = BIT_MASK (r3, 6);
0x00013550 strb r3, [r4, 0x34] | *((r4 + 0x34)) = r3;
0x00013554 ldr r0, [pc, 0x1ac] | r0 = "class_mtd";
0x00013558 bl 0x133f0 | r0 = fcn_000133f0 ("class_mtd", r1);
0x0001355c cmp r0, 0 |
0x00013560 str r0, [r4] | *(r4) = r0;
| if (r0 == 0) {
0x00013564 beq 0x136e4 | goto label_1;
| }
0x00013568 ldr r1, [pc, 0x19c] | r1 = "_sys";
0x0001356c bl 0x133f0 | r0 = fcn_000133f0 (r0, "_sys");
0x00013570 cmp r0, 0 |
0x00013574 str r0, [r4, 4] | *((r4 + 4)) = r0;
| if (r0 == 0) {
0x00013578 beq 0x136e4 | goto label_1;
| }
0x0001357c ldr r1, [pc, 0x18c] | r1 = *(0x1370c);
0x00013580 bl 0x133f0 | r0 = fcn_000133f0 (r0, r1);
0x00013584 cmp r0, 0 |
0x00013588 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| if (r0 == 0) {
0x0001358c beq 0x136e4 | goto label_1;
| }
0x00013590 mov r0, r4 | r0 = r4;
0x00013594 bl 0x126bc | r0 = fcn_000126bc (r0);
0x00013598 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x0001359c bne 0x135e8 | goto label_2;
| }
0x000135a0 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000135a4 bl 0x10bf4 | free (r0);
0x000135a8 ldr r0, [r4] | r0 = *(r4);
0x000135ac bl 0x10bf4 | free (r0);
0x000135b0 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x000135b4 bl 0x10bf4 | free (r0);
0x000135b8 str r5, [r4] | *(r4) = r5;
0x000135bc str r5, [r4, 4] | *((r4 + 4)) = r5;
0x000135c0 str r5, [r4, 0xc] | *((r4 + 0xc)) = r5;
0x000135c4 bl 0x15268 | r0 = fcn_00015268 ();
0x000135c8 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x000135cc bne 0x135dc | goto label_3;
| }
0x000135d0 mov r0, r4 | r0 = r4;
0x000135d4 bl 0x10bf4 | free (r0);
| label_0:
0x000135d8 mov r4, 0 | r4 = 0;
| do {
| label_3:
0x000135dc mov r0, r4 | r0 = r4;
0x000135e0 add sp, sp, 0xc |
0x000135e4 pop {r4, r5, pc} |
| label_2:
0x000135e8 ldr r1, [pc, 0x124] | r1 = "name";
0x000135ec ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000135f0 bl 0x133f0 | r0 = fcn_000133f0 (r0, "name");
0x000135f4 cmp r0, 0 |
0x000135f8 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r0 == 0) {
0x000135fc beq 0x136e4 | goto label_1;
| }
0x00013600 ldr r1, [pc, 0x110] | r1 = "dev";
0x00013604 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00013608 bl 0x133f0 | r0 = fcn_000133f0 (r0, "dev");
0x0001360c cmp r0, 0 |
0x00013610 str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
| if (r0 == 0) {
0x00013614 beq 0x136e4 | goto label_1;
| }
0x00013618 ldr r1, [pc, 0xfc] | r1 = "type";
0x0001361c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00013620 bl 0x133f0 | r0 = fcn_000133f0 (r0, "type");
0x00013624 cmp r0, 0 |
0x00013628 str r0, [r4, 0x14] | *((r4 + 0x14)) = r0;
| if (r0 == 0) {
0x0001362c beq 0x136e4 | goto label_1;
| }
0x00013630 ldr r1, [pc, 0xe8] | r1 = "erasesize";
0x00013634 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00013638 bl 0x133f0 | r0 = fcn_000133f0 (r0, "erasesize");
0x0001363c cmp r0, 0 |
0x00013640 str r0, [r4, 0x18] | *((r4 + 0x18)) = r0;
| if (r0 == 0) {
0x00013644 beq 0x136e4 | goto label_1;
| }
0x00013648 ldr r1, [pc, 0xd4] | r1 = "size";
0x0001364c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00013650 bl 0x133f0 | r0 = fcn_000133f0 (r0, "size");
0x00013654 cmp r0, 0 |
0x00013658 str r0, [r4, 0x1c] | *((r4 + 0x1c)) = r0;
| if (r0 == 0) {
0x0001365c beq 0x136e4 | goto label_1;
| }
0x00013660 ldr r1, [pc, 0xc0] | r1 = "writesize";
0x00013664 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00013668 bl 0x133f0 | r0 = fcn_000133f0 (r0, "writesize");
0x0001366c cmp r0, 0 |
0x00013670 str r0, [r4, 0x20] | *((r4 + 0x20)) = r0;
| if (r0 == 0) {
0x00013674 beq 0x136e4 | goto label_1;
| }
0x00013678 ldr r1, [pc, 0xac] | r1 = "subpagesize";
0x0001367c ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00013680 bl 0x133f0 | r0 = fcn_000133f0 (r0, "subpagesize");
0x00013684 cmp r0, 0 |
0x00013688 str r0, [r4, 0x24] | *((r4 + 0x24)) = r0;
| if (r0 == 0) {
0x0001368c beq 0x136e4 | goto label_1;
| }
0x00013690 ldr r1, [pc, 0x98] | r1 = "oobsize";
0x00013694 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x00013698 bl 0x133f0 | r0 = fcn_000133f0 (r0, "oobsize");
0x0001369c cmp r0, 0 |
0x000136a0 str r0, [r4, 0x28] | *((r4 + 0x28)) = r0;
| if (r0 == 0) {
0x000136a4 beq 0x136e4 | goto label_1;
| }
0x000136a8 ldr r1, [pc, 0x84] | r1 = "oobavail";
0x000136ac ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000136b0 bl 0x133f0 | r0 = fcn_000133f0 (r0, "oobavail");
0x000136b4 cmp r0, 0 |
0x000136b8 str r0, [r4, 0x2c] | *((r4 + 0x2c)) = r0;
| if (r0 == 0) {
0x000136bc beq 0x136e4 | goto label_1;
| }
0x000136c0 ldr r1, [pc, 0x70] | r1 = "numeraseregions";
0x000136c4 ldr r0, [r4, 4] | r0 = *((r4 + 4));
0x000136c8 bl 0x133f0 | r0 = fcn_000133f0 (r0, "numeraseregions");
0x000136cc cmp r0, 0 |
| if (r0 == 0) {
0x000136d0 ldrbne r3, [r4, 0x34] | r3 = *((r4 + 0x34));
| }
0x000136d4 str r0, [r4, 0x30] | *((r4 + 0x30)) = r0;
| if (r0 == 0) {
0x000136d8 orrne r3, r3, 1 | r3 |= 1;
| }
| if (r0 == 0) {
0x000136dc strbne r3, [r4, 0x34] | *((r4 + 0x34)) = r3;
| }
0x000136e0 bne 0x135dc |
| } while (r0 != 0);
| label_1:
0x000136e4 mov r0, r4 | r0 = r4;
0x000136e8 bl 0x13464 | fcn_00013464 (r0);
0x000136ec b 0x135d8 | 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/mtdinfo @ 0x137bc */
| #include <stdint.h>
|
; (fcn) fcn.000137bc () | void fcn_000137bc (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:
0x0001320c ldrb r3, [r1, 0xc] | r3 = *((r1 + 0xc));
0x00013210 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00013214 orr r3, r3, 1 | r3 |= 1;
0x00013218 sub sp, sp, 0x110 |
0x0001321c strb r3, [r1, 0xc] | *((r1 + 0xc)) = r3;
0x00013220 mov r5, r0 | r5 = r0;
0x00013224 ldr r0, [r0] | r0 = *(r0);
0x00013228 mov r4, r1 | r4 = r1;
0x0001322c bl 0x10b58 | r0 = opendir ();
0x00013230 mov r8, r0 | r8 = r0;
0x00013234 bl 0x10b88 | errno_location ();
0x00013238 cmp r8, 0 |
0x0001323c mov r6, r0 | r6 = r0;
| if (r8 != 0) {
0x00013240 bne 0x13290 | goto label_4;
| }
0x00013244 ldr r4, [r0] | r4 = *(r0);
0x00013248 ldr r6, [pc, 0x17c] | r6 = *(0x133c8);
0x0001324c ldr r3, [r5] | r3 = *(r5);
0x00013250 ldr r2, [pc, 0x178] | r2 = stderr;
0x00013254 ldr r1, [pc, 0x178] | r1 = "libmtd";
| label_2:
0x00013258 ldr r0, [r6] | r0 = *(r6);
0x0001325c bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00013260 mov r0, r4 | r0 = r4;
0x00013264 ldr r5, [r6] | r5 = *(r6);
0x00013268 bl 0x10a2c | strerror (r0);
0x0001326c str r4, [sp] | *(sp) = r4;
0x00013270 ldr r3, [pc, 0x160] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00013274 mov r2, 8 | r2 = 8;
0x00013278 ldr r1, [pc, 0x15c] | r1 = *(0x133d8);
0x0001327c str r0, [sp, 4] | var_4h = r0;
0x00013280 mov r0, r5 | r0 = r5;
0x00013284 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| do {
0x00013288 mvn r0, 0 | r0 = ~0;
0x0001328c b 0x133c4 | goto label_5;
| label_4:
0x00013290 ldr sl, [pc, 0x148] | sl = "mtd_d_s";
0x00013294 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00013298 mov sb, 0 | sb = 0;
0x0001329c str r3, [r4, 4] | *((r4 + 4)) = r3;
| label_0:
0x000132a0 str sb, [r6] | *(r6) = sb;
0x000132a4 mov r0, r8 | r0 = r8;
0x000132a8 bl 0x10aec | r0 = readdir64 ();
0x000132ac cmp r0, 0 |
| if (r0 == 0) {
0x000132b0 beq 0x13340 | goto label_6;
| }
0x000132b4 add r7, r0, 0x13 | r7 = r0 + 0x13;
0x000132b8 mov r0, r7 | r0 = r7;
0x000132bc bl 0x10ba0 | r0 = strlen (r0);
0x000132c0 cmp r0, 0xfe |
| if (r0 < 0xfe) {
0x000132c4 bls 0x132f8 | goto label_7;
| }
0x000132c8 ldr r0, [pc, 0xfc] |
0x000132cc str r7, [sp] | *(sp) = r7;
0x000132d0 ldr r2, [pc, 0xf8] | r2 = stderr;
0x000132d4 ldr r3, [r5] | r3 = *(r5);
0x000132d8 ldr r1, [pc, 0x104] | r1 = "mtd_d_s";
0x000132dc ldr r0, [r0] | r0 = *(0x133c8);
0x000132e0 bl 0x10abc | fprintf (r0, "mtd_d_s", r2, r3)
0x000132e4 mov r3, 0x16 | r3 = 0x16;
0x000132e8 str r3, [r6] | *(r6) = r3;
| label_1:
0x000132ec mov r0, r8 | r0 = r8;
0x000132f0 bl 0x10bc4 | closedir ();
0x000132f4 b 0x13288 |
| } while (1);
| label_7:
0x000132f8 add r3, sp, 0x10 | r3 += var_10h;
0x000132fc add r2, sp, 0xc | r2 += var_ch;
0x00013300 mov r1, sl | r1 = sl;
0x00013304 mov r0, r7 | r0 = r7;
0x00013308 bl 0x10b04 | r0 = sscanf (r0, r1, r2);
0x0001330c cmp r0, 1 |
| if (r0 != 1) {
0x00013310 bne 0x132a0 | goto label_0;
| }
0x00013314 ldr r3, [r4] | r3 = *(r4);
0x00013318 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x0001331c add r3, r3, 1 | r3++;
0x00013320 str r3, [r4] | *(r4) = r3;
0x00013324 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00013328 cmp r2, r3 |
0x0001332c ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r2 >= r3) {
0x00013330 strlt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x00013334 cmp r3, r2 |
| if (r3 >= r2) {
0x00013338 strlt r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x0001333c b 0x132a0 | goto label_0;
| label_6:
0x00013340 ldr r7, [r6] | r7 = *(r6);
0x00013344 cmp r7, 0 |
| if (r7 != 0) {
0x00013348 beq 0x13390 |
0x0001334c ldr r4, [pc, 0x78] |
0x00013350 ldr r3, [r5] | r3 = *(r5);
0x00013354 ldr r2, [pc, 0x74] | r2 = stderr;
0x00013358 ldr r1, [pc, 0x88] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x0001335c ldr r0, [r4] | r0 = *(0x133c8);
0x00013360 bl 0x10abc | fprintf (r0, "%s: error!: invalid entry in %s: \"%s\"\n", r2, r3, r4)
0x00013364 mov r0, r7 | r0 = r7;
0x00013368 ldr r4, [r4] | r4 = *(0x133c8);
0x0001336c bl 0x10a2c | strerror (r0);
0x00013370 str r7, [sp] | *(sp) = r7;
0x00013374 ldr r3, [pc, 0x5c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00013378 mov r2, 8 | r2 = 8;
0x0001337c ldr r1, [pc, 0x58] | r1 = *(0x133d8);
0x00013380 str r0, [sp, 4] | var_4h = r0;
0x00013384 mov r0, r4 | r0 = r4;
0x00013388 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n")
0x0001338c b 0x132ec | goto label_1;
| }
0x00013390 mov r0, r8 | r0 = r8;
0x00013394 bl 0x10bc4 | r0 = closedir ();
0x00013398 cmp r0, 0 |
| if (r0 != 0) {
0x0001339c beq 0x133b8 |
0x000133a0 ldr r4, [r6] | r4 = *(r6);
0x000133a4 ldr r3, [r5] | r3 = *(r5);
0x000133a8 ldr r6, [pc, 0x1c] | r6 = *(0x133c8);
0x000133ac ldr r2, [pc, 0x1c] | r2 = stderr;
0x000133b0 ldr r1, [pc, 0x34] | r1 = "%s: error!: readdir failed on \"%s\"\n";
0x000133b4 b 0x13258 | goto label_2;
| }
0x000133b8 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x000133bc cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x000133c0 streq r0, [r4, 4] | *((r4 + 4)) = r0;
| }
| label_5:
0x000133c4 add sp, sp, 0x110 |
0x000133c8 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
0x000137bc mov r3, r1 | r3 = r1;
0x000137c0 push {r4, lr} |
0x000137c4 mov r2, 0x10 | r2 = 0x10;
0x000137c8 mov r4, r0 | r4 = r0;
0x000137cc mov r1, 0 | r1 = 0;
0x000137d0 mov r0, r3 | r0 = r3;
0x000137d4 bl 0x10b34 | memset (r0, r1, r2);
0x000137d8 ldrb r2, [r4, 0x34] | r2 = *((r4 + 0x34));
0x000137dc tst r2, 1 |
| if ((r2 & 1) == 0) {
0x000137e0 bne 0x137ec |
0x000137e4 pop {r4, lr} |
0x000137e8 b 0x15350 |
| } else {
0x000137ec mov r1, r0 | r1 = r0;
0x000137f0 mov r0, r4 | r0 = r4;
0x000137f4 pop {r4, lr} |
0x000137f8 b 0x1320c | goto label_3;
| }
0x00015350 push {r4, lr} |
0x00015354 sub sp, sp, 0xa0 |
0x00015358 mov r4, r0 | r4 = r0;
0x0001535c mov r0, sp | r0 = sp;
0x00015360 bl 0x150e0 | r0 = fcn_000150e0 (r0);
0x00015364 cmp r0, 0 |
| if (r0 != 0) {
0x00015368 mvneq r3, 0x80000000 | r3 = ~0x80000000;
| }
| if (r0 == 0) {
0x0001536c beq 0x153a0 | goto label_8;
| }
0x00015370 mvn r0, 0 | r0 = ~0;
0x00015374 b 0x153b4 | goto label_9;
| do {
0x00015378 ldr r3, [r4] | r3 = *(r4);
0x0001537c ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00015380 add r3, r3, 1 | r3++;
0x00015384 str r3, [r4] | *(r4) = r3;
0x00015388 ldr r3, [sp] | r3 = *(sp);
0x0001538c cmp r3, r2 |
0x00015390 ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r3 <= r2) {
0x00015394 strgt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x00015398 cmp r3, r2 |
| if (r3 < r2) {
0x0001539c bge 0x153a4 |
| label_8:
0x000153a0 str r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x000153a4 mov r0, sp | r0 = sp;
0x000153a8 bl 0x14f7c | r0 = fcn_00014f7c (r0);
0x000153ac cmp r0, 0 |
0x000153b0 bne 0x15378 |
| } while (r0 != 0);
| label_9:
0x000153b4 add sp, sp, 0xa0 |
0x000153b8 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/mtdinfo @ 0x137fc */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000137fc () | void fcn_000137fc (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;
0x000137fc push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013800 add r6, r2, 4 | r6 = r2 + 4;
0x00013804 add fp, sp, 0x20 |
0x00013808 sub sp, sp, 0x5c |
0x0001380c mov r5, r1 | r5 = r1;
0x00013810 mov r7, r0 | r7 = r0;
0x00013814 mov r4, r2 | r4 = r2;
0x00013818 mov r1, 0 | r1 = 0;
0x0001381c mov r2, 0xfc | r2 = 0xfc;
0x00013820 mov r0, r6 | r0 = r6;
0x00013824 bl 0x10b34 | memset (r0, r1, r2);
0x00013828 str r5, [r4] | *(r4) = r5;
0x0001382c mov r1, r5 | r1 = r5;
0x00013830 mov r0, r7 | r0 = r7;
0x00013834 bl 0x1373c | r0 = fcn_0001373c (r0, r1);
0x00013838 cmp r0, 0 |
| if (r0 != 0) {
0x0001383c bne 0x13854 | goto label_4;
| }
0x00013840 bl 0x10b88 | errno_location ();
0x00013844 mov r3, 0x13 | r3 = 0x13;
0x00013848 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x0001384c mvn r5, 0 | r5 = ~0;
0x00013850 b 0x13870 | goto label_1;
| label_4:
0x00013854 ldrb r3, [r7, 0x34] | r3 = *((r7 + 0x34));
0x00013858 tst r3, 1 |
| if ((r3 & 1) == 0) {
0x0001385c bne 0x1387c |
0x00013860 mov r0, r5 | r0 = r5;
0x00013864 mov r1, r4 | r1 = r4;
0x00013868 bl 0x15a74 | r0 = fcn_00015a74 (r0, r1);
0x0001386c mov r5, r0 | r5 = r0;
| label_1:
0x00013870 mov r0, r5 | r0 = r5;
0x00013874 sub sp, fp, 0x20 |
0x00013878 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x0001387c add r3, r4, 8 | r3 = r4 + 8;
0x00013880 mov r2, r6 | r2 = r6;
0x00013884 mov r1, r5 | r1 = r5;
0x00013888 add r0, r7, 8 | r0 = r7 + 8;
0x0001388c bl 0x13094 | r0 = fcn_00013094 (r0, r1);
0x00013890 subs sl, r0, 0 | sl = r0 - 0;
0x00013894 bne 0x1384c |
| } while (sl != r0);
0x00013898 ldr r8, [r7, 0xc] | r8 = *((r7 + 0xc));
0x0001389c mov sb, sp | sb = sp;
0x000138a0 mov r0, r8 | r0 = r8;
0x000138a4 bl 0x10ba0 | strlen (r0);
0x000138a8 mov r2, r5 | r2 = r5;
0x000138ac mov r1, r8 | r1 = r8;
0x000138b0 add r6, r4, 0x51 | r6 = r4 + 0x51;
0x000138b4 add r0, r0, 0x6b | r0 += 0x6b;
0x000138b8 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000138bc sub sp, sp, r0 |
0x000138c0 add r3, sp, 0x10 | r3 += s;
0x000138c4 mov r0, r3 | r0 = r3;
0x000138c8 str r3, [fp, -0x68] | var_68h = r3;
0x000138cc bl 0x10b70 | sprintf (r0, r1, r2);
0x000138d0 ldr r3, [fp, -0x68] | r3 = var_68h;
0x000138d4 mov r2, 0x80 | r2 = 0x80;
0x000138d8 mov r1, r6 | r1 = r6;
0x000138dc mov r0, r3 | r0 = r3;
0x000138e0 bl 0x128bc | fcn_000128bc (r0, r1);
0x000138e4 mov sp, sb |
0x000138e8 cmp r0, 0 |
| if (r0 < 0) {
0x000138ec blt 0x1384c | goto label_0;
| }
0x000138f0 add r6, r6, r0 | r6 += r0;
0x000138f4 strb sl, [r6, -1] | *((r6 - 1)) = sl;
0x000138f8 ldr r6, [r7, 0x10] | r6 = *((r7 + 0x10));
0x000138fc add r8, r4, 0x10 | r8 = r4 + 0x10;
0x00013900 mov r0, r6 | r0 = r6;
0x00013904 bl 0x10ba0 | strlen (r0);
0x00013908 mov r2, r5 | r2 = r5;
0x0001390c mov r1, r6 | r1 = r6;
0x00013910 add r0, r0, 0x6b | r0 += 0x6b;
0x00013914 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013918 sub sp, sp, r0 |
0x0001391c add r3, sp, 0x10 | r3 += s;
0x00013920 mov r0, r3 | r0 = r3;
0x00013924 str r3, [fp, -0x68] | var_68h = r3;
0x00013928 bl 0x10b70 | sprintf (r0, r1, r2);
0x0001392c ldr r3, [fp, -0x68] | r3 = var_68h;
0x00013930 mov r2, 0x41 | r2 = 0x41;
0x00013934 mov r1, r8 | r1 = r8;
0x00013938 mov r0, r3 | r0 = r3;
0x0001393c bl 0x128bc | fcn_000128bc (r0, r1);
0x00013940 mov sp, sb |
0x00013944 cmp r0, 0 |
| if (r0 < 0) {
0x00013948 blt 0x1384c | goto label_0;
| }
0x0001394c add r0, r8, r0 | r0 = r8 + r0;
0x00013950 strb sl, [r0, -1] | *((r0 - 1)) = sl;
0x00013954 add r2, r4, 0xe4 | r2 = r4 + 0xe4;
0x00013958 mov r1, r5 | r1 = r5;
0x0001395c ldr r0, [r7, 0x14] | r0 = *((r7 + 0x14));
0x00013960 bl 0x12c04 | r0 = fcn_00012c04 (r0, r1);
0x00013964 cmp r0, 0 |
| if (r0 != 0) {
0x00013968 bne 0x1384c | goto label_0;
| }
0x0001396c ldr sl, [r7, 0x18] | sl = *((r7 + 0x18));
0x00013970 mov r0, sl | r0 = sl;
0x00013974 bl 0x10ba0 | strlen (r0);
0x00013978 mov r2, r5 | r2 = r5;
0x0001397c mov r1, sl | r1 = sl;
0x00013980 add r0, r0, 0x39 | r0 += 0x39;
0x00013984 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013988 sub sp, sp, r0 |
0x0001398c add r6, sp, 0x10 | r6 += s;
0x00013990 mov r0, r6 | r0 = r6;
0x00013994 bl 0x10b70 | sprintf (r0, r1, r2);
0x00013998 add r1, r4, 0xd8 | r1 = r4 + 0xd8;
0x0001399c mov r0, r6 | r0 = r6;
0x000139a0 bl 0x12a50 | fcn_00012a50 (r0, r1);
0x000139a4 mov sp, sb |
0x000139a8 cmp r0, 0 |
| if (r0 != 0) {
0x000139ac bne 0x1384c | goto label_0;
| }
0x000139b0 add r2, r4, 0xe8 | r2 = r4 + 0xe8;
0x000139b4 mov r1, r5 | r1 = r5;
0x000139b8 ldr r0, [r7, 0x1c] | r0 = *((r7 + 0x1c));
0x000139bc bl 0x12c04 | r0 = fcn_00012c04 (r0, r1);
0x000139c0 cmp r0, 0 |
| if (r0 != 0) {
0x000139c4 bne 0x1384c | goto label_0;
| }
0x000139c8 add r2, r4, 0xec | r2 = r4 + 0xec;
0x000139cc mov r1, r5 | r1 = r5;
0x000139d0 ldr r0, [r7, 0x20] | r0 = *((r7 + 0x20));
0x000139d4 bl 0x12c04 | r0 = fcn_00012c04 (r0, r1);
0x000139d8 cmp r0, 0 |
| if (r0 != 0) {
0x000139dc bne 0x1384c | goto label_0;
| }
0x000139e0 add r2, r4, 0xf0 | r2 = r4 + 0xf0;
0x000139e4 mov r1, r5 | r1 = r5;
0x000139e8 ldr r0, [r7, 0x24] | r0 = *((r7 + 0x24));
0x000139ec bl 0x12c04 | r0 = fcn_00012c04 (r0, r1);
0x000139f0 cmp r0, 0 |
| if (r0 != 0) {
0x000139f4 bne 0x1384c | goto label_0;
| }
0x000139f8 add r2, r4, 0xf4 | r2 = r4 + 0xf4;
0x000139fc mov r1, r5 | r1 = r5;
0x00013a00 ldr r0, [r7, 0x28] | r0 = *((r7 + 0x28));
0x00013a04 bl 0x12c04 | r0 = fcn_00012c04 (r0, r1);
0x00013a08 cmp r0, 0 |
| if (r0 != 0) {
0x00013a0c beq 0x13a28 |
0x00013a10 mov r0, r5 | r0 = r5;
0x00013a14 bl 0x1555c | r0 = fcn_0001555c (r0);
0x00013a18 cmp r0, 0 |
| if (r0 >= 0) {
0x00013a1c movlt r3, 0 | r3 = 0;
| }
| if (r0 < 0) {
0x00013a20 strge r0, [r4, 0xf4] | *((r4 + 0xf4)) = r0;
| }
| if (r0 < 0) {
0x00013a24 strlt r3, [r4, 0xf4] | *((r4 + 0xf4)) = r3;
| goto label_5;
| }
| }
| label_5:
0x00013a28 add r2, r4, 0xf8 | r2 = r4 + 0xf8;
0x00013a2c mov r1, r5 | r1 = r5;
0x00013a30 ldr r0, [r7, 0x2c] | r0 = *((r7 + 0x2c));
0x00013a34 bl 0x12c04 | r0 = fcn_00012c04 (r0, r1);
0x00013a38 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 != r0) {
0x00013a3c bne 0x1384c | goto label_0;
| }
0x00013a40 ldr r7, [r7, 0x30] | r7 = *((r7 + 0x30));
0x00013a44 mov sl, sp | sl = sp;
0x00013a48 mov r0, r7 | r0 = r7;
0x00013a4c bl 0x10ba0 | strlen (r0);
0x00013a50 mov r2, r5 | r2 = r5;
0x00013a54 mov r1, r7 | r1 = r7;
0x00013a58 add r0, r0, 0x39 | r0 += 0x39;
0x00013a5c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013a60 sub sp, sp, r0 |
0x00013a64 add sb, sp, 0x10 | sb += s;
0x00013a68 mov r0, sb | r0 = sb;
0x00013a6c bl 0x10b70 | sprintf (r0, r1, r2);
0x00013a70 mov r1, 0x80000 | r1 = 0x80000;
0x00013a74 mov r0, sb | r0 = sb;
0x00013a78 bl 0x10b4c | r0 = open64 ();
0x00013a7c cmn r0, 1 |
0x00013a80 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x00013a84 bne 0x13a90 |
0x00013a88 mov sp, sl |
0x00013a8c b 0x13870 | goto label_1;
| }
0x00013a90 mov r2, 0x32 | r2 = 0x32;
0x00013a94 sub r1, fp, 0x58 | r1 -= buf;
0x00013a98 bl 0x10ae0 | r0 = read (r0, r1, r2);
0x00013a9c cmn r0, 1 |
| if (r0 != 1) {
0x00013aa0 bne 0x13af8 | goto label_6;
| }
0x00013aa4 bl 0x10b88 | errno_location ();
0x00013aa8 ldr r6, [pc, 0x294] |
0x00013aac mov r3, sb | r3 = sb;
0x00013ab0 ldr r2, [pc, 0x290] | r2 = stderr;
0x00013ab4 ldr r1, [pc, 0x290] | r1 = "libmtd";
0x00013ab8 ldr r4, [r0] | r4 = *(r0);
0x00013abc ldr r0, [r6] | r0 = *(0x13d40);
0x00013ac0 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00013ac4 mov r0, r4 | r0 = r4;
0x00013ac8 ldr r6, [r6] | r6 = *(0x13d40);
0x00013acc bl 0x10a2c | strerror (r0);
0x00013ad0 str r4, [sp] | *(sp) = r4;
0x00013ad4 ldr r3, [pc, 0x274] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00013ad8 mov r2, 8 | r2 = 8;
0x00013adc ldr r1, [pc, 0x270] | r1 = *(0x13d50);
0x00013ae0 str r0, [sp, 4] | var_4h = r0;
0x00013ae4 mov r0, r6 | r0 = r6;
0x00013ae8 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| do {
0x00013aec mov r0, r5 | r0 = r5;
0x00013af0 bl 0x10bdc | close (r0);
0x00013af4 b 0x13be0 | goto label_7;
| label_6:
0x00013af8 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x00013afc bne 0x13b28 | goto label_8;
| }
0x00013b00 ldr r2, [pc, 0x240] | r2 = stderr;
0x00013b04 ldr r1, [pc, 0x24c] | r1 = "%*serror %d (%s)\n";
0x00013b08 mov r3, sb | r3 = sb;
| label_2:
0x00013b0c ldr r0, [pc, 0x230] |
0x00013b10 ldr r0, [r0] | r0 = *(0x13d40);
0x00013b14 bl 0x10abc | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_3:
0x00013b18 bl 0x10b88 | errno_location ();
0x00013b1c mov r3, 0x16 | r3 = 0x16;
0x00013b20 str r3, [r0] | *(r0) = r3;
0x00013b24 b 0x13aec |
| } while (1);
| label_8:
0x00013b28 sub r3, fp, 0x24 | r3 -= var_24h;
0x00013b2c add r0, r3, r0 | r0 = r3 + r0;
0x00013b30 strb r6, [r0, -0x34] | *((r0 - 0x34)) = r6;
0x00013b34 sub r2, fp, 0x64 | r2 -= var_64h;
0x00013b38 ldr r1, [pc, 0x21c] | r1 = "%s: error!: contents of \"%s\" is too long\n";
0x00013b3c sub r0, fp, 0x58 | r0 -= buf;
0x00013b40 bl 0x10b04 | r0 = sscanf (r0, "%s: error!: contents of \"%s\" is too long\n", r2);
0x00013b44 cmp r0, 1 |
| if (r0 == 1) {
0x00013b48 movne r3, sb | r3 = sb;
| }
| if (r0 == 1) {
0x00013b4c ldrne r2, [pc, 0x1f4] | r2 = "libmtd";
| }
| if (r0 != 1) {
0x00013b50 ldrne r1, [pc, 0x208] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
| goto label_9;
| }
| if (r0 != 1) {
| label_9:
0x00013b54 bne 0x13b0c | goto label_2;
| }
0x00013b58 ldrd r2, r3, [fp, -0x64] | __asm ("ldrd r2, r3, [var_64h]");
0x00013b5c cmp r2, 0 |
0x00013b60 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x00013b64 bge 0x13b88 |
0x00013b68 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00013b6c ldr r3, [pc, 0x1d0] | r3 = *(0x13d40);
0x00013b70 str sb, [sp, 8] | var_8h = sb;
0x00013b74 ldr r2, [pc, 0x1cc] | r2 = stderr;
0x00013b78 ldr r1, [pc, 0x1e4] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
0x00013b7c ldr r0, [r3] | r0 = *(0x13d40);
0x00013b80 bl 0x10abc | fprintf (r0, "_s:_error_:_cannot_read_integer_from___s_", r2, r3)
0x00013b84 b 0x13b18 | goto label_3;
| }
0x00013b88 mov r0, r5 | r0 = r5;
0x00013b8c bl 0x10bdc | r0 = close (r0);
0x00013b90 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 == r0) {
0x00013b94 beq 0x13be8 | goto label_10;
| }
0x00013b98 bl 0x10b88 | errno_location ();
0x00013b9c ldr r5, [pc, 0x1a0] |
0x00013ba0 mov r3, sb | r3 = sb;
0x00013ba4 ldr r2, [pc, 0x19c] | r2 = stderr;
0x00013ba8 ldr r1, [pc, 0x1b8] | r1 = "_s:_error_:_negative_value__lld_in___s_";
0x00013bac ldr r4, [r0] | r4 = *(r0);
0x00013bb0 ldr r0, [r5] | r0 = *(0x13d40);
0x00013bb4 bl 0x10abc | fprintf (r0, "_s:_error_:_negative_value__lld_in___s_", r2, r3, r4, r5)
0x00013bb8 mov r0, r4 | r0 = r4;
0x00013bbc ldr r5, [r5] | r5 = *(0x13d40);
0x00013bc0 bl 0x10a2c | strerror (r0);
0x00013bc4 str r4, [sp] | *(sp) = r4;
0x00013bc8 ldr r3, [pc, 0x180] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00013bcc mov r2, 8 | r2 = 8;
0x00013bd0 ldr r1, [pc, 0x17c] | r1 = *(0x13d50);
0x00013bd4 str r0, [sp, 4] | var_4h = r0;
0x00013bd8 mov r0, r5 | r0 = r5;
0x00013bdc bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| do {
| label_7:
0x00013be0 mov sp, sl |
0x00013be4 b 0x1384c | goto label_0;
| label_10:
0x00013be8 ldrd r2, r3, [fp, -0x64] | __asm ("ldrd r2, r3, [var_64h]");
0x00013bec mov r1, 0 | r1 = 0;
0x00013bf0 adds r6, r2, 0x80000000 | r6 = r2 + 0x80000000;
0x00013bf4 adc r7, r3, 0 | __asm ("adc r7, r3, 0");
0x00013bf8 mvn r0, 0 | r0 = ~0;
0x00013bfc cmp r7, r1 |
0x00013c00 cmpeq r6, r0 | __asm ("cmpeq r6, r0");
| if (r7 < r1) {
0x00013c04 bls 0x13c34 | goto label_11;
| }
0x00013c08 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00013c0c ldr r3, [pc, 0x130] | r3 = *(0x13d40);
0x00013c10 str sb, [sp, 8] | var_8h = sb;
0x00013c14 ldr r2, [pc, 0x12c] | r2 = stderr;
0x00013c18 ldr r0, [r3] | r0 = *(0x13d40);
0x00013c1c ldr r1, [pc, 0x148] | r1 = "%s: error!: close failed on \"%s\"\n";
0x00013c20 bl 0x10abc | r0 = fprintf (r0, "%s: error!: close failed on \"%s\"\n", r2, r3)
0x00013c24 bl 0x10b88 | errno_location ();
0x00013c28 mov r3, 0x16 | r3 = 0x16;
0x00013c2c str r3, [r0] | *(r0) = r3;
0x00013c30 b 0x13be0 |
| } while (1);
| label_11:
0x00013c34 lsl r3, r2, 0x15 | r3 = r2 << 0x15;
0x00013c38 ldrb r2, [r4, 0xfc] | r2 = *((r4 + 0xfc));
0x00013c3c mov sp, sl |
0x00013c40 bic r2, r2, 1 | r2 = BIT_MASK (r2, 1);
0x00013c44 orr r2, r2, r3, lsr 31 | r2 |= (r3 >> 31);
0x00013c48 strb r2, [r4, 0xfc] | *((r4 + 0xfc)) = r2;
0x00013c4c ldr r2, [r4, 0xe4] | r2 = *((r4 + 0xe4));
0x00013c50 ldrd r0, r1, [r4, 0xd8] | __asm ("ldrd r0, r1, [r4, 0xd8]");
0x00013c54 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00013c58 bl 0x15c6c | fcn_00015c6c (r0);
0x00013c5c ldr r1, [pc, 0x10c] | r1 = "%s: error!: value %lld read from file \"%s\" is out of range\n";
0x00013c60 str r0, [r4, 0xe0] | *((r4 + 0xe0)) = r0;
0x00013c64 mov r0, r8 | r0 = r8;
0x00013c68 bl 0x10b64 | r0 = strcmp (r0, r1);
0x00013c6c cmp r0, 0 |
| if (r0 != 0) {
0x00013c70 moveq r0, 4 | r0 = 4;
| }
| if (r0 != 0) {
0x00013c74 beq 0x13d1c |
0x00013c78 ldr r1, [pc, 0xf4] | r1 = "nand";
0x00013c7c mov r0, r8 | r0 = r8;
0x00013c80 bl 0x10b64 | r0 = strcmp (r0, "nand");
0x00013c84 cmp r0, 0 |
| if (r0 != 0) {
0x00013c88 moveq r0, 8 | r0 = 8;
| }
| if (r0 == 0) {
0x00013c8c beq 0x13d1c | goto label_12;
| }
0x00013c90 ldr r1, [pc, 0xe0] | r1 = "mlc_nand";
0x00013c94 mov r0, r8 | r0 = r8;
0x00013c98 bl 0x10b64 | r0 = strcmp (r0, "mlc_nand");
0x00013c9c cmp r0, 0 |
| if (r0 != 0) {
0x00013ca0 moveq r0, 3 | r0 = 3;
| }
| if (r0 == 0) {
0x00013ca4 beq 0x13d1c | goto label_12;
| }
0x00013ca8 ldr r1, [pc, 0xcc] | r1 = *(0x13d78);
0x00013cac mov r0, r8 | r0 = r8;
0x00013cb0 bl 0x10b64 | r0 = strcmp (r0, r1);
0x00013cb4 cmp r0, 0 |
| if (r0 != 0) {
0x00013cb8 moveq r0, 2 | r0 = 2;
| }
| if (r0 == 0) {
0x00013cbc beq 0x13d1c | goto label_12;
| }
0x00013cc0 ldr r1, [pc, 0xb8] | r1 = *(0x13d7c);
0x00013cc4 mov r0, r8 | r0 = r8;
0x00013cc8 bl 0x10b64 | r0 = strcmp (r0, r1);
0x00013ccc cmp r0, 0 |
| if (r0 == 0) {
0x00013cd0 beq 0x13d1c | goto label_12;
| }
0x00013cd4 ldr r1, [pc, 0xa8] | r1 = "absent";
0x00013cd8 mov r0, r8 | r0 = r8;
0x00013cdc bl 0x10b64 | r0 = strcmp (r0, "absent");
0x00013ce0 cmp r0, 0 |
| if (r0 != 0) {
0x00013ce4 moveq r0, 6 | r0 = 6;
| }
| if (r0 == 0) {
0x00013ce8 beq 0x13d1c | goto label_12;
| }
0x00013cec ldr r1, [pc, 0x94] | r1 = "dataflash";
0x00013cf0 mov r0, r8 | r0 = r8;
0x00013cf4 bl 0x10b64 | r0 = strcmp (r0, "dataflash");
0x00013cf8 cmp r0, 0 |
| if (r0 != 0) {
0x00013cfc moveq r0, 1 | r0 = 1;
| }
| if (r0 == 0) {
0x00013d00 beq 0x13d1c | goto label_12;
| }
0x00013d04 ldr r1, [pc, 0x80] | r1 = "ram";
0x00013d08 mov r0, r8 | r0 = r8;
0x00013d0c bl 0x10b64 | r0 = strcmp (r0, "ram");
0x00013d10 cmp r0, 0 |
| if (r0 != 0) {
0x00013d14 moveq r0, 7 | r0 = 7;
| }
| if (r0 != 0) {
0x00013d18 mvnne r0, 0 | r0 = ~0;
| goto label_12;
| }
| }
| label_12:
0x00013d1c str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
0x00013d20 sub r0, r0, 4 | r0 -= 4;
0x00013d24 bics r3, r0, 4 | __asm ("bics r3, r0, 4");
0x00013d28 ldrb r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
0x00013d2c bic r2, r3, 2 | r2 = BIT_MASK (r3, 2);
| if (r0 != 0) {
0x00013d30 moveq r3, 2 | r3 = 2;
| }
| if (r0 == 0) {
0x00013d34 movne r3, 0 | r3 = 0;
| }
0x00013d38 orr r3, r3, r2 | r3 |= r2;
0x00013d3c strb r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
0x00013d40 b 0x13870 | 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/mtdinfo @ 0x13d90 */
| #include <stdint.h>
|
; (fcn) fcn.00013d90 () | void fcn_00013d90 (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;
0x00013d90 ldrb r3, [r0, 0x34] | r3 = *((r0 + 0x34));
0x00013d94 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00013d98 tst r3, 1 |
0x00013d9c sub sp, sp, 0x88 |
0x00013da0 mov r4, r1 | r4 = r1;
0x00013da4 mov r7, r2 | r7 = r2;
| if ((r3 & 1) != 0) {
0x00013da8 bne 0x13dc0 | goto label_3;
| }
0x00013dac mov r1, r2 | r1 = r2;
0x00013db0 mov r0, r4 | r0 = r4;
0x00013db4 bl 0x15588 | fcn_00015588 (r0, r1);
| do {
| label_2:
0x00013db8 add sp, sp, 0x88 |
0x00013dbc pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_3:
0x00013dc0 mov r5, r0 | r5 = r0;
0x00013dc4 add r1, sp, 0x20 | r1 += var_20h;
0x00013dc8 mov r0, r4 | r0 = r4;
0x00013dcc bl 0x10a38 | r0 = stat64 ();
0x00013dd0 cmp r0, 0 |
| if (r0 == 0) {
0x00013dd4 beq 0x13e28 | goto label_4;
| }
0x00013dd8 bl 0x10b88 | errno_location ();
0x00013ddc ldr r6, [pc, 0x144] | r6 = *(0x13f24);
0x00013de0 mov r3, r4 | r3 = r4;
0x00013de4 ldr r2, [pc, 0x140] | r2 = stderr;
0x00013de8 ldr r1, [pc, 0x140] | r1 = "libmtd";
0x00013dec ldr r5, [r0] | r5 = *(r0);
0x00013df0 ldr r0, [r6] | r0 = *(0x13f24);
0x00013df4 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x00013df8 mov r0, r5 | r0 = r5;
0x00013dfc ldr r4, [r6] | r4 = *(0x13f24);
0x00013e00 bl 0x10a2c | strerror (r0);
0x00013e04 str r5, [sp] | *(sp) = r5;
0x00013e08 ldr r3, [pc, 0x124] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x00013e0c mov r2, 8 | r2 = 8;
0x00013e10 ldr r1, [pc, 0x120] | r1 = *(0x13f34);
0x00013e14 str r0, [sp, 4] | var_4h = r0;
0x00013e18 mov r0, r4 | r0 = r4;
0x00013e1c bl 0x10abc | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4, r5)
| label_0:
0x00013e20 mvn r0, 0 | r0 = ~0;
0x00013e24 b 0x13db8 |
| } while (1);
| label_4:
0x00013e28 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00013e2c and r3, r3, 0xf000 | r3 &= 0xf000;
0x00013e30 cmp r3, 0x2000 |
| if (r3 != 0x2000) {
0x00013e34 beq 0x13e60 |
0x00013e38 ldr r0, [pc, 0xe8] |
0x00013e3c mov r3, r4 | r3 = r4;
0x00013e40 ldr r2, [pc, 0xe4] | r2 = stderr;
0x00013e44 ldr r1, [pc, 0xf0] | r1 = "%*serror %d (%s)\n";
0x00013e48 ldr r0, [r0] | r0 = *(0x13f24);
0x00013e4c bl 0x10abc | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x00013e50 bl 0x10b88 | errno_location ();
0x00013e54 mov r3, 0x16 | r3 = 0x16;
0x00013e58 str r3, [r0] | *(r0) = r3;
0x00013e5c b 0x13e20 | goto label_0;
| }
0x00013e60 ldrd r8, sb, [sp, 0x40] | __asm ("ldrd r8, sb, [var_40h]");
0x00013e64 mov r0, r8 | r0 = r8;
0x00013e68 mov r1, sb | r1 = sb;
0x00013e6c bl 0x10a5c | gnu_dev_major ();
0x00013e70 mov r1, sb | r1 = sb;
0x00013e74 mov sl, r0 | sl = r0;
0x00013e78 mov r0, r8 | r0 = r8;
0x00013e7c bl 0x10a8c | gnu_dev_minor ();
0x00013e80 add r1, sp, 0x10 | r1 += var_10h;
0x00013e84 mov r8, r0 | r8 = r0;
0x00013e88 mov r0, r5 | r0 = r5;
0x00013e8c bl 0x137bc | r0 = fcn_000137bc (r0, r1);
0x00013e90 cmp r0, 0 |
| if (r0 != 0) {
0x00013e94 bne 0x13e20 | goto label_0;
| }
0x00013e98 bl 0x10b88 | errno_location ();
0x00013e9c ldr r4, [sp, 0x14] | r4 = var_14h;
0x00013ea0 add sb, r5, 8 | sb = r5 + 8;
0x00013ea4 mov r6, r0 | r6 = r0;
| do {
0x00013ea8 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00013eac cmp r4, r3 |
| if (r4 > r3) {
0x00013eb0 bgt 0x13eec | goto label_5;
| }
0x00013eb4 add r3, sp, 0xc | r3 += var_ch;
0x00013eb8 add r2, sp, 8 | r2 += var_8h;
0x00013ebc mov r1, r4 | r1 = r4;
0x00013ec0 mov r0, sb | r0 = sb;
0x00013ec4 bl 0x13094 | r0 = fcn_00013094 (r0, r1);
0x00013ec8 cmp r0, 0 |
| if (r0 == 0) {
0x00013ecc beq 0x13ef8 | goto label_6;
| }
0x00013ed0 ldr r3, [r6] | r3 = *(r6);
0x00013ed4 cmp r3, 2 |
| if (r3 != 2) {
0x00013ed8 bne 0x13ee4 | goto label_7;
| }
| label_1:
0x00013edc add r4, r4, 1 | r4++;
0x00013ee0 b 0x13ea8 |
| } while (1);
| label_7:
0x00013ee4 cmp r3, 0 |
| if (r3 != 0) {
0x00013ee8 bne 0x13e20 | goto label_0;
| }
| label_5:
0x00013eec mov r3, 0x13 | r3 = 0x13;
0x00013ef0 str r3, [r6] | *(r6) = r3;
0x00013ef4 b 0x13e20 | goto label_0;
| label_6:
0x00013ef8 ldr r3, [sp, 8] | r3 = var_8h;
0x00013efc cmp sl, r3 |
| if (sl != r3) {
0x00013f00 bne 0x13edc | goto label_1;
| }
0x00013f04 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00013f08 cmp r8, r3 |
| if (r8 != r3) {
0x00013f0c bne 0x13edc | goto label_1;
| }
0x00013f10 str r0, [r6] | *(r6) = r0;
0x00013f14 mov r2, r7 | r2 = r7;
0x00013f18 mov r1, r4 | r1 = r4;
0x00013f1c mov r0, r5 | r0 = r5;
0x00013f20 bl 0x137fc | fcn_000137fc (r0, r1);
0x00013f24 b 0x13db8 | 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/mtdinfo @ 0x13f88 */
| #include <stdint.h>
|
; (fcn) fcn.00013f88 () | void fcn_00013f88 (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;
0x00013f88 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013f8c mov r4, r1 | r4 = r1;
0x00013f90 sub sp, sp, 0x1c |
0x00013f94 mov r6, r0 | r6 = r0;
0x00013f98 mov r1, r3 | r1 = r3;
0x00013f9c mov r0, r4 | r0 = r4;
0x00013fa0 mov fp, r2 |
0x00013fa4 mov sl, r3 | sl = r3;
0x00013fa8 ldr r7, [sp, 0x40] | r7 = *(arg_40h);
0x00013fac bl 0x12fb8 | r0 = fcn_00012fb8 (r0, r1);
0x00013fb0 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00013fb4 bne 0x140a0 | goto label_1;
| }
0x00013fb8 add r1, sl, r7 | r1 = sl + r7;
0x00013fbc sub r1, r1, 1 | r1--;
0x00013fc0 mov r0, r4 | r0 = r4;
0x00013fc4 bl 0x12fb8 | r0 = fcn_00012fb8 (r0, r1);
0x00013fc8 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00013fcc bne 0x140a0 | goto label_1;
| }
0x00013fd0 ldr r3, [r4, 0xe4] | r3 = *((r4 + 0xe4));
0x00013fd4 smull r0, r1, sl, r3 | r0:r1 = sl * r3;
0x00013fd8 strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [var_8h]");
0x00013fdc smull r0, r1, r3, r7 | r0:r1 = r3 * r7;
0x00013fe0 ldrb r3, [r6, 0x34] | r3 = *((r6 + 0x34));
0x00013fe4 strd r0, r1, [sp, 0x10] | __asm ("strd r0, r1, [var_10h]");
0x00013fe8 tst r3, 2 |
| if ((r3 & 2) == 0) {
0x00013fec bne 0x14048 |
0x00013ff0 add r2, sp, 8 | r2 += var_8h;
0x00013ff4 ldr r1, [pc, 0xd4] | r1 = *(0x140cc);
0x00013ff8 mov r0, fp | r0 = fp;
0x00013ffc bl 0x10a14 | r0 = ioctl (r0, r1);
0x00014000 cmp r0, 0 |
| if (r0 == 0) {
0x00014004 beq 0x140a0 | goto label_1;
| }
0x00014008 bl 0x10b88 | r0 = errno_location ();
0x0001400c ldr r3, [r0] | r3 = *(r0);
0x00014010 cmp r3, 0x19 |
| if (r3 == 0x19) {
0x00014014 bne 0x14030 |
0x00014018 ldrb r3, [r6, 0x34] | r3 = *((r6 + 0x34));
0x0001401c tst r3, 6 |
0x00014020 biceq r3, r3, 4 | __asm ("biceq r3, r3, 4");
| if ((r3 & 6) != 0) {
0x00014024 orreq r3, r3, 2 | r3 |= 2;
| }
| if ((r3 & 6) != 0) {
0x00014028 strbeq r3, [r6, 0x34] | *((r6 + 0x34)) = r3;
| }
| if ((r3 & 6) == 0) {
0x0001402c beq 0x14048 | goto label_2;
| }
| }
0x00014030 ldr r2, [pc, 0x9c] | r2 = *(0x140d0);
| label_0:
0x00014034 mov r1, sl | r1 = sl;
0x00014038 ldr r0, [r4] | r0 = *(r4);
0x0001403c bl 0x13018 | r0 = fcn_00013018 (r0, r1);
0x00014040 mov r5, r0 | r5 = r0;
0x00014044 b 0x140a0 |
| } else {
| label_2:
0x00014048 ldrd r0, r1, [sp, 8] | __asm ("ldrd r0, r1, [var_8h]");
0x0001404c ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [var_10h]");
0x00014050 mov r7, 0 | r7 = 0;
0x00014054 adds r8, r0, r2 | r8 = r0 + r2;
0x00014058 adc sb, r1, r3 | __asm ("adc sb, r1, r3");
0x0001405c mvn r6, 0 | r6 = ~0;
0x00014060 cmp sb, r7 |
0x00014064 cmpeq r8, r6 | __asm ("cmpeq r8, r6");
| if (sb < r7) {
0x00014068 bls 0x140ac | goto label_3;
| }
0x0001406c ldr r1, [r4, 0xe4] | r1 = *((r4 + 0xe4));
0x00014070 mvn r0, 0 | r0 = ~0;
0x00014074 bl 0x15aa8 | fcn_00015aa8 (r0, r1);
0x00014078 ldr r2, [pc, 0x58] | r2 = "MEMERASE64";
0x0001407c ldr r1, [pc, 0x58] | r1 = "libmtd";
0x00014080 mvn r5, 0 | r5 = ~0;
0x00014084 mov r3, r0 | r3 = r0;
0x00014088 ldr r0, [pc, 0x50] |
0x0001408c ldr r0, [r0] | r0 = "_s:_error_:_this_system_can_address_only__u_eraseblocks";
0x00014090 bl 0x10abc | r0 = fprintf ("_s:_error_:_this_system_can_address_only__u_eraseblocks", "libmtd", "MEMERASE64", r3, r4, r5)
0x00014094 bl 0x10b88 | errno_location ();
0x00014098 mov r3, 0x16 | r3 = 0x16;
0x0001409c str r3, [r0] | *(r0) = r3;
| }
| do {
| label_1:
0x000140a0 mov r0, r5 | r0 = r5;
0x000140a4 add sp, sp, 0x1c |
0x000140a8 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_3:
0x000140ac stm sp, {r0, r2} | *(sp) = r0;
| *((sp + 4)) = r2;
0x000140b0 ldr r1, [pc, 0x2c] | r1 = stderr;
0x000140b4 mov r2, sp | r2 = sp;
0x000140b8 mov r0, fp | r0 = fp;
0x000140bc bl 0x10a14 | r0 = ioctl (r0, r1);
0x000140c0 cmp r0, 0 |
0x000140c4 bge 0x140a0 |
| } while (r0 >= 0);
0x000140c8 ldr r2, [pc, 0x18] | r2 = *(0x140e4);
0x000140cc b 0x14034 | 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/mtdinfo @ 0x14104 */
| #include <stdint.h>
|
; (fcn) fcn.00014104 () | void fcn_00014104 (int32_t arg2, int32_t fd) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r1 = arg2;
| r0 = fd;
0x00014104 push {r0, r1, r4, r5, r6, lr} |
0x00014108 subs r6, r1, 0 | r6 = r1 - 0;
| if (r6 >= r1) {
0x0001410c bge 0x14128 | goto label_1;
| }
0x00014110 bl 0x10b88 | errno_location ();
0x00014114 mov r3, 0x13 | r3 = 0x13;
0x00014118 str r3, [r0] | *(r0) = r3;
| label_0:
0x0001411c mvn r0, 0 | r0 = ~0;
| do {
0x00014120 add sp, sp, 8 |
0x00014124 pop {r4, r5, r6, pc} |
| label_1:
0x00014128 str r6, [r2, 0xc] | *((r2 + 0xc)) = r6;
0x0001412c ldr r1, [pc, 0x5c] | r1 = *(0x1418c);
0x00014130 bl 0x10a14 | r0 = ioctl (r0, r1);
0x00014134 cmp r0, 0 |
| if (r0 < 0) {
0x00014138 movge r0, 0 | r0 = 0;
| }
0x0001413c bge 0x14120 |
| } while (r0 >= 0);
0x00014140 bl 0x10b88 | errno_location ();
0x00014144 ldr r5, [pc, 0x48] |
0x00014148 ldr r3, [pc, 0x48] | r3 = stderr;
0x0001414c ldr r2, [pc, 0x48] | r2 = "MEMGETREGIONINFO";
0x00014150 ldr r1, [pc, 0x48] | r1 = "libmtd";
0x00014154 ldr r4, [r0] | r4 = *(r0);
0x00014158 str r6, [sp] | *(sp) = r6;
0x0001415c ldr r0, [r5] | r0 = *(0x14190);
0x00014160 bl 0x10abc | fprintf (r0, "libmtd", "MEMGETREGIONINFO", r3, r4, r5, r6)
0x00014164 mov r0, r4 | r0 = r4;
0x00014168 ldr r5, [r5] | r5 = *(0x14190);
0x0001416c bl 0x10a2c | strerror (r0);
0x00014170 str r4, [sp] | *(sp) = r4;
0x00014174 ldr r3, [pc, 0x28] | r3 = "%s: error!: %s ioctl failed for erase region %d\n";
0x00014178 mov r2, 8 | r2 = 8;
0x0001417c ldr r1, [pc, 0x24] | r1 = *(0x141a4);
0x00014180 str r0, [sp, 4] | var_4h = r0;
0x00014184 mov r0, r5 | r0 = r5;
0x00014188 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: %s ioctl failed for erase region %d\n", r4)
0x0001418c b 0x1411c | 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/mtdinfo @ 0x1431c */
| #include <stdint.h>
|
; (fcn) fcn.0001431c () | void fcn_0001431c (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;
0x0001431c push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00014320 mov fp, r1 |
0x00014324 sub sp, sp, 0x14 |
0x00014328 mov r1, r2 | r1 = r2;
0x0001432c mov sb, r0 | sb = r0;
0x00014330 mov sl, r2 | sl = r2;
0x00014334 mov r5, r3 | r5 = r3;
0x00014338 ldr r8, [sp, 0x3c] | r8 = *(arg_3ch);
0x0001433c bl 0x12fb8 | r0 = fcn_00012fb8 (r0, r1);
0x00014340 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00014344 bne 0x14398 | goto label_0;
| }
0x00014348 cmp r5, 0 |
0x0001434c ldr r3, [sb, 0xe4] | r3 = *((sb + 0xe4));
| if (r5 >= 0) {
0x00014350 blt 0x14360 |
0x00014354 add r2, r5, r8 | r2 = r5 + r8;
0x00014358 cmp r2, r3 |
| if (r2 <= r3) {
0x0001435c ble 0x143a4 | goto label_3;
| }
| }
0x00014360 str r3, [sp, 8] | var_8h = r3;
0x00014364 ldr r0, [pc, 0x128] |
0x00014368 ldr r3, [sb] | r3 = *(sb);
0x0001436c str r8, [sp] | *(sp) = r8;
0x00014370 str r3, [sp, 4] | var_4h = r3;
0x00014374 ldr r2, [pc, 0x11c] | r2 = stderr;
0x00014378 mov r3, r5 | r3 = r5;
0x0001437c ldr r1, [pc, 0x118] | r1 = "libmtd";
0x00014380 ldr r0, [r0] | r0 = *(0x14490);
0x00014384 bl 0x10abc | r0 = fprintf (r0, "libmtd", r2, r3)
0x00014388 bl 0x10b88 | errno_location ();
0x0001438c mov r3, 0x16 | r3 = 0x16;
0x00014390 str r3, [r0] | *(r0) = r3;
| do {
0x00014394 mvn r4, 0 | r4 = ~0;
| label_0:
0x00014398 mov r0, r4 | r0 = r4;
0x0001439c add sp, sp, 0x14 |
0x000143a0 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_3:
0x000143a4 mov r6, r5 | r6 = r5;
0x000143a8 asr r7, r5, 0x1f | r7 = r5 >> 0x1f;
0x000143ac smlal r6, r7, r3, sl | __asm ("smlal r6, r7, r3, sl");
0x000143b0 str r4, [sp] | *(sp) = r4;
0x000143b4 mov r3, r7 | r3 = r7;
0x000143b8 mov r2, r6 | r2 = r6;
0x000143bc mov r0, fp | r0 = fp;
0x000143c0 bl 0x10bac | lseek64 ();
0x000143c4 cmp r7, r1 |
0x000143c8 cmpeq r6, r0 | __asm ("cmpeq r6, r0");
| if (r7 != r1) {
0x000143cc moveq r7, r4 | r7 = r4;
| }
| if (r7 == r1) {
0x000143d0 beq 0x14430 | goto label_4;
| }
0x000143d4 bl 0x10b88 | errno_location ();
0x000143d8 ldr r5, [pc, 0xb4] |
0x000143dc mov r2, r6 | r2 = r6;
0x000143e0 mov r3, r7 | r3 = r7;
0x000143e4 ldr r1, [pc, 0xb4] | r1 = "_s:_error_:_bad_offset__d_or_length__d__mtd_d_eraseblock_size_is__d";
0x000143e8 ldr r4, [r0] | r4 = *(r0);
0x000143ec strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x000143f0 ldr r3, [sb] | r3 = *(sb);
0x000143f4 ldr r0, [r5] | r0 = *(0x14490);
0x000143f8 ldr r2, [pc, 0x98] | r2 = stderr;
0x000143fc bl 0x10abc | fprintf (r0, "_s:_error_:_bad_offset__d_or_length__d__mtd_d_eraseblock_size_is__d", r2, r3, r4, r5)
0x00014400 ldr r5, [r5] | r5 = *(0x14490);
| label_2:
0x00014404 mov r0, r4 | r0 = r4;
0x00014408 bl 0x10a2c | strerror (r0);
0x0001440c str r4, [sp] | *(sp) = r4;
0x00014410 ldr r3, [pc, 0x8c] | r3 = "%s: error!: cannot seek mtd%d to offset %lld\n";
0x00014414 mov r2, 8 | r2 = 8;
0x00014418 ldr r1, [pc, 0x88] | r1 = *(0x144a4);
0x0001441c str r0, [sp, 4] | var_4h = r0;
0x00014420 mov r0, r5 | r0 = r5;
0x00014424 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot seek mtd%d to offset %lld\n", r4)
0x00014428 b 0x14394 |
| } while (1);
| label_1:
0x0001442c add r7, r7, r0 | r7 += r0;
| label_4:
0x00014430 cmp r8, r7 |
| if (r8 <= r7) {
0x00014434 ble 0x14398 | goto label_0;
| }
0x00014438 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x0001443c sub r6, r8, r7 | r6 = r8 - r7;
0x00014440 mov r2, r6 | r2 = r6;
0x00014444 add r1, r3, r7 | r1 = r3 + r7;
0x00014448 mov r0, fp | r0 = fp;
0x0001444c bl 0x10ae0 | r0 = read (r0, r1, r2);
0x00014450 cmp r0, 0 |
| if (r0 >= 0) {
0x00014454 bge 0x1442c | goto label_1;
| }
0x00014458 bl 0x10b88 | errno_location ();
0x0001445c ldr r8, [pc, 0x30] | r8 = *(0x14490);
0x00014460 ldr r3, [sb] | r3 = *(sb);
0x00014464 add r5, r5, r7 | r5 += r7;
0x00014468 ldr r2, [pc, 0x28] | r2 = stderr;
0x0001446c ldr r1, [pc, 0x38] | r1 = "%*serror %d (%s)\n";
0x00014470 ldr r4, [r0] | r4 = *(r0);
0x00014474 str r5, [sp, 8] | var_8h = r5;
0x00014478 str r3, [sp] | *(sp) = r3;
0x0001447c str sl, [sp, 4] | var_4h = sl;
0x00014480 mov r3, r6 | r3 = r6;
0x00014484 ldr r0, [r8] | r0 = *(0x14490);
0x00014488 bl 0x10abc | fprintf (r0, "%*serror %d (%s)\n", r2, r3, r4, r5)
0x0001448c ldr r5, [r8] | r5 = *(0x14490);
0x00014490 b 0x14404 | 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/mtdinfo @ 0x14538 */
| #include <stdint.h>
|
; (fcn) fcn.00014538 () | void fcn_00014538 (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;
0x00014538 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001453c sub sp, sp, 0x134 |
0x00014540 str r0, [sp, 0x34] | var_34h = r0;
0x00014544 mov r5, r1 | r5 = r1;
0x00014548 mov r7, r2 | r7 = r2;
0x0001454c mov r1, 0 | r1 = 0;
0x00014550 mov r2, 0x30 | r2 = 0x30;
0x00014554 add r0, sp, 0x38 | r0 += s;
0x00014558 str r3, [sp, 0x24] | var_24h = r3;
0x0001455c ldr r6, [sp, 0x160] | r6 = *(arg_160h);
0x00014560 ldr sl, [sp, 0x168] | sl = *(arg_168h);
0x00014564 ldrb r8, [sp, 0x16c] | r8 = *(arg_16ch);
0x00014568 bl 0x10b34 | memset (r0, r1, r2);
0x0001456c ldr r1, [sp, 0x24] | r1 = var_24h;
0x00014570 mov r0, r5 | r0 = r5;
0x00014574 bl 0x12fb8 | r0 = fcn_00012fb8 (r0, r1);
0x00014578 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x0001457c bne 0x146ec | goto label_3;
| }
0x00014580 ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x00014584 ldr fp, [r5, 0xe4] | fp = *((r5 + 0xe4));
0x00014588 cmp r3, 0 |
| if (r3 >= 0) {
0x0001458c blt 0x1459c |
0x00014590 add r3, r3, r6 | r3 += r6;
0x00014594 cmp r3, fp |
| if (r3 <= fp) {
0x00014598 ble 0x145d8 | goto label_5;
| }
| }
0x0001459c str fp, [sp, 8] | var_8h = fp;
0x000145a0 ldr r0, [pc, 0x328] |
0x000145a4 ldr r3, [r5] | r3 = *(r5);
0x000145a8 ldr r2, [pc, 0x324] | r2 = stderr;
0x000145ac str r3, [sp, 4] | var_4h = r3;
0x000145b0 str r6, [sp] | *(sp) = r6;
0x000145b4 ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x000145b8 ldr r1, [pc, 0x318] | r1 = "libmtd";
0x000145bc ldr r0, [r0] | r0 = *(0x148cc);
0x000145c0 bl 0x10abc | r0 = fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
| do {
0x000145c4 bl 0x10b88 | errno_location ();
0x000145c8 mov r3, 0x16 | r3 = 0x16;
0x000145cc str r3, [r0] | *(r0) = r3;
| label_1:
0x000145d0 mvn r4, 0 | r4 = ~0;
0x000145d4 b 0x146ec | goto label_3;
| label_5:
0x000145d8 ldr sb, [r5, 0xec] | sb = *((r5 + 0xec));
0x000145dc ldr r0, [sp, 0x158] | r0 = *(arg_158h);
0x000145e0 mov r1, sb | r1 = sb;
0x000145e4 bl 0x15c4c | fcn_00015c4c (r0, r1);
0x000145e8 cmp r1, 0 |
| if (r1 == 0) {
0x000145ec beq 0x14618 | goto label_6;
| }
0x000145f0 str sb, [sp, 4] | var_4h = sb;
0x000145f4 ldr r3, [r5] | r3 = *(r5);
0x000145f8 ldr r2, [pc, 0x2d4] | r2 = stderr;
0x000145fc str r3, [sp] | *(sp) = r3;
0x00014600 ldr r1, [pc, 0x2d4] | r1 = "_s:_error_:_bad_offset__d_or_length__d__mtd_d_eraseblock_size_is__d";
0x00014604 ldr r3, [sp, 0x158] | r3 = *(arg_158h);
| label_0:
0x00014608 ldr r0, [pc, 0x2c0] |
0x0001460c ldr r0, [r0] | r0 = *(0x148cc);
0x00014610 bl 0x10abc | fprintf (r0, "_s:_error_:_bad_offset__d_or_length__d__mtd_d_eraseblock_size_is__d", r2, r3)
0x00014614 b 0x145c4 |
| } while (1);
| label_6:
0x00014618 mov r1, sb | r1 = sb;
0x0001461c mov r0, r6 | r0 = r6;
0x00014620 bl 0x15c4c | fcn_00015c4c (r0, r1);
0x00014624 subs r4, r1, 0 | r4 = r1 - 0;
| if (r4 != r1) {
0x00014628 beq 0x14648 |
0x0001462c str sb, [sp, 4] | var_4h = sb;
0x00014630 ldr r3, [r5] | r3 = *(r5);
0x00014634 ldr r2, [pc, 0x298] | r2 = stderr;
0x00014638 str r3, [sp] | *(sp) = r3;
0x0001463c ldr r1, [pc, 0x29c] | r1 = "%s: error!: write offset %d is not aligned to mtd%d min. I/O size %d\n";
0x00014640 mov r3, r6 | r3 = r6;
0x00014644 b 0x14608 | goto label_0;
| }
0x00014648 ldr r2, [sp, 0x158] | r2 = *(arg_158h);
0x0001464c ldr r1, [sp, 0x24] | r1 = var_24h;
0x00014650 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x00014654 smlal r2, r3, fp, r1 | __asm ("smlal r2, r3, fp, r1");
0x00014658 strd r2, r3, [sp, 0x18] | __asm ("strd r2, r3, [var_18h]");
0x0001465c ldr r3, [sp, 0x164] | r3 = *(s2);
0x00014660 cmp r3, 0 |
| if (r3 == 0) {
0x00014664 beq 0x14818 | goto label_7;
| }
0x00014668 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x0001466c ldr r1, [pc, 0x270] | r1 = "%s: error!: write length %d is not aligned to mtd%d min. I/O size %d\n";
0x00014670 strd r2, r3, [sp, 0x38] | __asm ("strd r2, r3, [s]");
0x00014674 mov r2, r6 | r2 = r6;
0x00014678 asr r3, r6, 0x1f | r3 = r6 >> 0x1f;
0x0001467c strd r2, r3, [sp, 0x40] | __asm ("strd r2, r3, [var_40h]");
0x00014680 mov r2, sl | r2 = sl;
0x00014684 asr r3, sl, 0x1f | r3 = sl >> 0x1f;
0x00014688 strd r2, r3, [sp, 0x28] | __asm ("strd r2, r3, [var_28h]");
0x0001468c strd r2, r3, [sp, 0x48] | __asm ("strd r2, r3, [var_48h]");
0x00014690 ldr r3, [sp, 0x15c] | r3 = *(ptr);
0x00014694 add r2, sp, 0x38 | r2 += s;
0x00014698 str r3, [sp, 0x50] | var_50h = r3;
0x0001469c ldr r3, [sp, 0x164] | r3 = *(s2);
0x000146a0 mov r0, r7 | r0 = r7;
0x000146a4 str r4, [sp, 0x54] | var_54h = r4;
0x000146a8 str r3, [sp, 0x58] | var_58h = r3;
0x000146ac str r4, [sp, 0x5c] | var_5ch = r4;
0x000146b0 strb r8, [sp, 0x60] | var_60h = r8;
0x000146b4 bl 0x10a14 | r0 = ioctl (r0, r1);
0x000146b8 cmp r0, 0 |
| if (r0 != 0) {
0x000146bc beq 0x146ec |
0x000146c0 bl 0x10b88 | r0 = errno_location ();
0x000146c4 ldr r3, [r0] | r3 = *(r0);
0x000146c8 mov sb, r0 | sb = r0;
0x000146cc cmp r3, 0x19 |
0x000146d0 cmpne r3, 0x5f | __asm ("cmpne r3, 0x5f");
| if (r3 == 0x19) {
0x000146d4 beq 0x146f8 | goto label_8;
| }
0x000146d8 ldr r2, [pc, 0x208] | r2 = *(0x148e4);
0x000146dc ldr r1, [sp, 0x24] | r1 = var_24h;
0x000146e0 ldr r0, [r5] | r0 = *(r5);
0x000146e4 bl 0x13018 | r0 = fcn_00013018 (r0, r1);
0x000146e8 mov r4, r0 | r4 = r0;
| }
| label_3:
0x000146ec mov r0, r4 | r0 = r4;
0x000146f0 add sp, sp, 0x134 |
0x000146f4 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_8:
0x000146f8 cmp r8, 1 |
| if (r8 != 1) {
0x000146fc bne 0x147d8 | goto label_9;
| }
0x00014700 add r2, sp, 0x68 | r2 += var_68h;
0x00014704 ldr r1, [pc, 0x1e0] | r1 = "MEMWRITE";
0x00014708 mov r0, r7 | r0 = r7;
0x0001470c bl 0x10a14 | r0 = ioctl (r0, "MEMWRITE");
0x00014710 subs fp, r0, 0 |
| if (fp != r0) {
0x00014714 beq 0x1475c |
0x00014718 ldr r4, [sb] | r4 = *(sb);
0x0001471c ldr r5, [pc, 0x1ac] | r5 = *(0x148cc);
0x00014720 ldr r2, [pc, 0x1ac] | r2 = stderr;
0x00014724 ldr r1, [pc, 0x1c4] | r1 = *(0x148ec);
| label_2:
0x00014728 ldr r0, [r5] | r0 = *(r5);
0x0001472c bl 0x10abc | fprintf (r0, r1, r2, r3, r4, r5)
0x00014730 ldr r5, [r5] | r5 = *(r5);
| label_4:
0x00014734 mov r0, r4 | r0 = r4;
0x00014738 bl 0x10a2c | strerror (r0);
0x0001473c str r4, [sp] | *(sp) = r4;
0x00014740 ldr r3, [pc, 0x1ac] | r3 = "_s:_error_:_MEMGETOOBSEL_failed";
0x00014744 mov r2, 8 | r2 = 8;
0x00014748 ldr r1, [pc, 0x1a8] | r1 = *(0x148f4);
0x0001474c str r0, [sp, 4] | var_4h = r0;
0x00014750 mov r0, r5 | r0 = r5;
0x00014754 bl 0x10abc | fprintf (r0, r1, r2, "_s:_error_:_MEMGETOOBSEL_failed", r4)
0x00014758 b 0x145d0 | goto label_1;
| }
0x0001475c mov r0, sl | r0 = sl;
0x00014760 bl 0x10a80 | malloc (r0);
0x00014764 mov r2, sl | r2 = sl;
0x00014768 ldr r1, [sp, 0x164] | r1 = *(s2);
0x0001476c str r0, [sp, 0x30] | var_30h = r0;
0x00014770 bl 0x10a68 | memcpy (r0, r1, r2);
0x00014774 ldr r2, [sp, 0x68] | r2 = var_68h;
0x00014778 cmp r2, 2 |
| if (r2 != 2) {
0x0001477c addeq r8, sp, 0x70 | r8 += var_70h;
| }
| if (r2 == 2) {
0x00014780 beq 0x147c8 | goto label_10;
| }
0x00014784 ldr r0, [sp, 0x6c] | r0 = s1;
0x00014788 ldr r3, [sp, 0x30] | r3 = var_30h;
0x0001478c ldr r2, [r5, 0xf0] | r2 = *((r5 + 0xf0));
0x00014790 add r1, r3, r0 | r1 = r3 + r0;
0x00014794 ldr r3, [sp, 0x164] | r3 = *(s2);
0x00014798 sub r2, r2, r0 | r2 -= r0;
0x0001479c add r0, r3, r0 | r0 = r3 + r0;
0x000147a0 bl 0x10a68 | memcpy (r0, r1, r2);
0x000147a4 b 0x147d8 | goto label_9;
| do {
0x000147a8 ldr r3, [sp, 0x30] | r3 = var_30h;
0x000147ac ldr r0, [r8, -8] | r0 = *((r8 - 8));
0x000147b0 add r1, r3, fp | r1 = r3 + fp;
0x000147b4 ldr r3, [sp, 0x164] | r3 = *(s2);
0x000147b8 mov r2, sl | r2 = sl;
0x000147bc add r0, r3, r0 | r0 = r3 + r0;
0x000147c0 bl 0x10a68 | memcpy (r0, r1, r2);
0x000147c4 add fp, fp, sl |
| label_10:
0x000147c8 add r8, r8, 8 | r8 += 8;
0x000147cc ldr sl, [r8, -4] | sl = *((r8 - 4));
0x000147d0 cmp sl, 0 |
0x000147d4 bne 0x147a8 |
| } while (sl != 0);
| label_9:
0x000147d8 ldr r3, [sp, 0x164] | r3 = *(s2);
0x000147dc mov r1, r5 | r1 = r5;
0x000147e0 str r3, [sp, 0x10] | var_10h = r3;
0x000147e4 ldrd r2, r3, [sp, 0x28] | __asm ("ldrd r2, r3, [var_28h]");
0x000147e8 ldr r0, [sp, 0x34] | r0 = var_34h;
0x000147ec strd r2, r3, [sp, 8] | __asm ("strd r2, r3, [var_8h]");
0x000147f0 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x000147f4 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x000147f8 mov r2, r7 | r2 = r7;
0x000147fc bl 0x144f4 | r0 = fcn_000144f4 (r0, r1, r2, r3, r4);
0x00014800 cmp r0, 0 |
| if (r0 >= 0) {
0x00014804 ldrlt r4, [sb] | r4 = *(sb);
| }
| if (r0 >= 0) {
0x00014808 ldrlt r5, [pc, 0xc0] | r5 = obj.stderr;
| }
| if (r0 >= 0) {
0x0001480c ldrlt r2, [pc, 0xc0] | r2 = "libmtd";
| }
| if (r0 < 0) {
0x00014810 ldrlt r1, [pc, 0xe4] | r1 = "%s: error!: cannot write to OOB\n";
| goto label_11;
| }
| if (r0 < 0) {
| label_11:
0x00014814 blt 0x14728 | goto label_2;
| }
| label_7:
0x00014818 ldr r3, [sp, 0x15c] | r3 = *(ptr);
0x0001481c cmp r3, 0 |
| if (r3 == 0) {
0x00014820 beq 0x146ec | goto label_3;
| }
0x00014824 mov r3, 0 | r3 = 0;
0x00014828 str r3, [sp] | *(sp) = r3;
0x0001482c mov r0, r7 | r0 = r7;
0x00014830 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00014834 bl 0x10bac | lseek64 ();
0x00014838 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x0001483c cmp r1, r3 |
0x00014840 cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| if (r1 != r3) {
0x00014844 beq 0x14878 |
0x00014848 bl 0x10b88 | errno_location ();
0x0001484c ldr r6, [pc, 0x7c] | r6 = *(0x148cc);
0x00014850 ldrd r2, r3, [sp, 0x18] | __asm ("ldrd r2, r3, [var_18h]");
0x00014854 ldr r1, [pc, 0xa4] | r1 = "%s: error!: cannot write to OOB\n";
0x00014858 ldr r4, [r0] | r4 = *(r0);
0x0001485c strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00014860 ldr r2, [pc, 0x6c] | r2 = stderr;
0x00014864 ldr r3, [r5] | r3 = *(r5);
0x00014868 ldr r0, [r6] | r0 = *(0x148cc);
0x0001486c bl 0x10abc | fprintf (r0, "%s: error!: cannot write to OOB\n", r2, r3, r4, r5, r6)
0x00014870 ldr r5, [r6] | r5 = *(0x148cc);
0x00014874 b 0x14734 | goto label_4;
| }
0x00014878 mov r2, r6 | r2 = r6;
0x0001487c ldr r1, [sp, 0x15c] | r1 = *(ptr);
0x00014880 mov r0, r7 | r0 = r7;
0x00014884 bl 0x10ab0 | r0 = write (r0, r1, r2);
0x00014888 cmp r6, r0 |
| if (r6 == r0) {
0x0001488c beq 0x146ec | goto label_3;
| }
0x00014890 bl 0x10b88 | errno_location ();
0x00014894 ldr r3, [sp, 0x158] | r3 = *(arg_158h);
0x00014898 ldr r7, [pc, 0x30] | r7 = *(0x148cc);
0x0001489c ldr r2, [pc, 0x30] | r2 = stderr;
0x000148a0 ldr r1, [pc, 0x5c] | r1 = "%s: error!: cannot seek mtd%d to offset %lld\n";
0x000148a4 ldr r4, [r0] | r4 = *(r0);
0x000148a8 str r3, [sp, 8] | var_8h = r3;
0x000148ac ldr r3, [sp, 0x24] | r3 = var_24h;
0x000148b0 str r3, [sp, 4] | var_4h = r3;
0x000148b4 ldr r3, [r5] | r3 = *(r5);
0x000148b8 str r3, [sp] | *(sp) = r3;
0x000148bc mov r3, r6 | r3 = r6;
0x000148c0 ldr r0, [r7] | r0 = *(0x148cc);
0x000148c4 bl 0x10abc | fprintf (r0, "%s: error!: cannot seek mtd%d to offset %lld\n", r2, r3, r4)
0x000148c8 ldr r5, [r7] | r5 = *(0x148cc);
0x000148cc b 0x14734 | 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/mtdinfo @ 0x14f7c */
| #include <stdint.h>
|
; (fcn) fcn.00014f7c () | void fcn_00014f7c (int32_t arg1) {
| int32_t var_0h;
| int32_t var_8h;
| r0 = arg1;
0x00014f7c push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x00014f80 mov r4, r0 | r4 = r0;
0x00014f84 ldr r3, [r4, 0x94] | r3 = *((r4 + 0x94));
0x00014f88 ldr r0, [r0, 0x9c] | r0 = *((r0 + 0x9c));
0x00014f8c ldr r2, [r4, 0x98] | r2 = *((r4 + 0x98));
0x00014f90 sub r5, r0, r3 | r5 = r0 - r3;
0x00014f94 cmp r2, r5 |
| if (r2 > r5) {
0x00014f98 bgt 0x14fb0 | goto label_4;
| }
0x00014f9c mov r0, r3 | r0 = r3;
0x00014fa0 bl 0x10bf4 | free (r0);
0x00014fa4 mov r0, 0 | r0 = 0;
| do {
| label_3:
0x00014fa8 add sp, sp, 8 |
0x00014fac pop {r4, r5, r6, r7, r8, pc} |
| label_4:
0x00014fb0 add r3, r4, 0x90 | r3 = r4 + 0x90;
0x00014fb4 str r3, [sp] | *(sp) = r3;
0x00014fb8 mov r2, r4 | r2 = r4;
0x00014fbc add r3, r4, 8 | r3 = r4 + 8;
0x00014fc0 ldr r1, [pc, 0xf8] | r1 = *(0x150bc);
0x00014fc4 bl 0x10b04 | r0 = sscanf (r0, r1, r2);
0x00014fc8 cmp r0, 3 |
| if (r0 == 3) {
0x00014fcc beq 0x14ff0 | goto label_5;
| }
0x00014fd0 ldr r3, [pc, 0xe8] | r3 = *(0x150bc);
0x00014fd4 ldr r2, [pc, 0xe8] | r2 = "mtd_d:__llx__x";
0x00014fd8 ldr r1, [pc, 0xe8] | r1 = "libmtd";
| label_2:
0x00014fdc ldr r0, [pc, 0xe8] |
0x00014fe0 ldr r0, [r0] | r0 = "%s: error!: \"%s\" pattern not found\n";
0x00014fe4 bl 0x10abc | fprintf ("%s: error!: \"%s\" pattern not found\n", "libmtd", "mtd_d:__llx__x", r3)
| label_0:
0x00014fe8 mvn r0, 0 | r0 = ~0;
0x00014fec b 0x14fa8 |
| } while (1);
| label_5:
0x00014ff0 ldr r8, [r4, 0x98] | r8 = *((r4 + 0x98));
0x00014ff4 mov r1, 0x22 | r1 = 0x22;
0x00014ff8 sub r2, r8, r5 | r2 = r8 - r5;
0x00014ffc ldr r0, [r4, 0x9c] | r0 = *((r4 + 0x9c));
0x00015000 bl 0x10ad4 | r0 = memchr (r0, r1, r2);
0x00015004 cmp r0, 0 |
0x00015008 bne 0x15024 |
| while (r8 <= r2) {
0x0001500c ldr r2, [pc, 0xb0] | r2 = "mtd_d:__llx__x";
0x00015010 ldr r1, [pc, 0xb8] | r1 = stderr;
| label_1:
0x00015014 ldr r3, [pc, 0xb0] | r3 = "%s: error!: \"%s\" pattern not found\n";
0x00015018 ldr r0, [r3] | r0 = "%s: error!: \"%s\" pattern not found\n";
0x0001501c bl 0x10abc | fprintf ("%s: error!: \"%s\" pattern not found\n", r1, "mtd_d:__llx__x", "%s: error!: \"%s\" pattern not found\n")
0x00015020 b 0x14fe8 | goto label_0;
0x00015024 ldr r7, [r4, 0x94] | r7 = *((r4 + 0x94));
0x00015028 add r6, r0, 1 | r6 = r0 + 1;
0x0001502c sub r2, r6, r7 | r2 = r6 - r7;
0x00015030 cmp r8, r2 |
0x00015034 ble 0x1500c |
| }
0x00015038 sub r2, r8, r2 | r2 = r8 - r2;
0x0001503c mov r1, 0x22 | r1 = 0x22;
0x00015040 mov r0, r6 | r0 = r6;
0x00015044 bl 0x10ad4 | r0 = memchr (r0, r1, r2);
0x00015048 subs r5, r0, 0 | r5 = r0 - 0;
0x0001504c bne 0x1505c |
| while (r8 <= r7) {
0x00015050 ldr r2, [pc, 0x6c] | r2 = "mtd_d:__llx__x";
0x00015054 ldr r1, [pc, 0x78] | r1 = "%s: error!: opening \" not found\n";
0x00015058 b 0x15014 | goto label_1;
0x0001505c sub r7, r5, r7 | r7 = r5 - r7;
0x00015060 cmp r8, r7 |
0x00015064 ble 0x15050 |
| }
0x00015068 sub r7, r5, r6 | r7 = r5 - r6;
0x0001506c cmp r7, 0x7f |
| if (r7 <= 0x7f) {
0x00015070 ldrgt r3, [r4] | r3 = *(r4);
| }
| if (r7 <= 0x7f) {
0x00015074 ldrgt r2, [pc, 0x48] | r2 = "libmtd";
| }
| if (r7 > 0x7f) {
0x00015078 ldrgt r1, [pc, 0x58] | r1 = "%s: error!: too long mtd%d device name\n";
| goto label_6;
| }
| if (r7 > 0x7f) {
| label_6:
0x0001507c bgt 0x14fdc | goto label_2;
| }
0x00015080 mov r2, r7 | r2 = r7;
0x00015084 mov r1, r6 | r1 = r6;
0x00015088 add r0, r4, 0x10 | r0 = r4 + 0x10;
0x0001508c bl 0x10a68 | memcpy (r0, r1, r2);
0x00015090 add r7, r4, r7 | r7 = r4 + r7;
0x00015094 mov r3, 0 | r3 = 0;
0x00015098 strb r3, [r7, 0x10] | *((r7 + 0x10)) = r3;
0x0001509c ldrb r3, [r5, 1] | r3 = *((r5 + 1));
0x000150a0 cmp r3, 0xa |
| if (r3 != 0xa) {
0x000150a4 addeq r5, r5, 2 | r5 += 2;
| }
| if (r3 != 0xa) {
0x000150a8 streq r5, [r4, 0x9c] | *((r4 + 0x9c)) = r5;
| }
| if (r3 == 0xa) {
0x000150ac moveq r0, 1 | r0 = 1;
| goto label_7;
| }
| if (r3 == 0xa) {
| label_7:
0x000150b0 beq 0x14fa8 | goto label_3;
| }
0x000150b4 ldr r2, [pc, 8] | r2 = "libmtd";
0x000150b8 ldr r1, [pc, 0x1c] | r1 = "%s: error!: too long mtd%d device name\n";
0x000150bc b 0x15014 | 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/mtdinfo @ 0x150e0 */
| #include <stdint.h>
|
; (fcn) fcn.000150e0 () | void fcn_000150e0 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
0x000150e0 push {r0, r1, r4, r5, r6, r7, r8, lr} |
0x000150e4 mov r5, r0 | r5 = r0;
0x000150e8 mov r1, 0 | r1 = 0;
0x000150ec ldr r0, [pc, 0x150] | r0 = *(0x15240);
0x000150f0 bl 0x10b4c | r0 = open64 ();
0x000150f4 cmn r0, 1 |
0x000150f8 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x000150fc beq 0x15238 | goto label_0;
| }
0x00015100 mov r0, 0x1000 | r0 = 0x1000;
0x00015104 bl 0x10a80 | r0 = malloc (r0);
0x00015108 subs r1, r0, 0 | r1 = r0 - 0;
| if (r1 == r0) {
0x0001510c bne 0x1515c |
0x00015110 bl 0x10b88 | errno_location ();
0x00015114 ldr r5, [pc, 0x12c] |
0x00015118 ldr r2, [pc, 0x12c] | r2 = stderr;
0x0001511c ldr r1, [pc, 0x12c] | r1 = "libmtd";
0x00015120 ldr r4, [r0] | r4 = *(r0);
0x00015124 ldr r0, [r5] | r0 = "_proc_mtd";
0x00015128 bl 0x10abc | fprintf ("_proc_mtd", "libmtd", r2, r3, r4, "_proc_mtd")
0x0001512c mov r0, r4 | r0 = r4;
0x00015130 ldr r5, [r5] | r5 = "_proc_mtd";
0x00015134 bl 0x10a2c | strerror (r0);
0x00015138 str r4, [sp] | *(sp) = r4;
0x0001513c ldr r3, [pc, 0x110] | r3 = "%s: error!: out of memory\n";
0x00015140 mov r2, 8 | r2 = 8;
0x00015144 ldr r1, [pc, 0x10c] | r1 = *(0x15254);
0x00015148 str r0, [sp, 4] | var_4h = r0;
0x0001514c mov r0, r5 | r0 = r5;
0x00015150 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4)
0x00015154 mvn r0, 0 | r0 = ~0;
0x00015158 bl 0x10b94 | exit (r0);
| }
0x0001515c str r1, [r5, 0x94] | *((r5 + 0x94)) = r1;
0x00015160 mov r2, 0x1000 | r2 = 0x1000;
0x00015164 mov r0, r4 | r0 = r4;
0x00015168 bl 0x10ae0 | r0 = read (r0, r1, r2);
0x0001516c cmn r0, 1 |
0x00015170 mov r7, r0 | r7 = r0;
| if (r0 != 1) {
0x00015174 bne 0x151d8 | goto label_1;
| }
0x00015178 bl 0x10b88 | errno_location ();
0x0001517c ldr r7, [pc, 0xc4] |
0x00015180 ldr r3, [pc, 0xbc] | r3 = *(0x15240);
0x00015184 ldr r2, [pc, 0xc0] | r2 = stderr;
0x00015188 ldr r1, [pc, 0xcc] | r1 = "%*serror %d (%s)\n";
0x0001518c ldr r6, [r0] | r6 = *(r0);
0x00015190 ldr r0, [r7] | r0 = "_proc_mtd";
0x00015194 bl 0x10abc | fprintf ("_proc_mtd", "%*serror %d (%s)\n", r2, r3, r4, r5, r6)
0x00015198 mov r0, r6 | r0 = r6;
0x0001519c ldr r7, [r7] | r7 = "_proc_mtd";
0x000151a0 bl 0x10a2c | strerror (r0);
0x000151a4 str r6, [sp] | *(sp) = r6;
0x000151a8 ldr r3, [pc, 0xa4] | r3 = "%s: error!: out of memory\n";
0x000151ac mov r2, 8 | r2 = 8;
0x000151b0 ldr r1, [pc, 0xa0] | r1 = *(0x15254);
0x000151b4 str r0, [sp, 4] | var_4h = r0;
0x000151b8 mov r0, r7 | r0 = r7;
0x000151bc bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: out of memory\n", r4, r5, r6)
| do {
0x000151c0 ldr r0, [r5, 0x94] | r0 = *((r5 + 0x94));
0x000151c4 bl 0x10bf4 | free (r0);
0x000151c8 mov r0, r4 | r0 = r4;
0x000151cc bl 0x10bdc | close (r0);
0x000151d0 mvn r4, 0 | r4 = ~0;
0x000151d4 b 0x15238 | goto label_0;
| label_1:
0x000151d8 cmp r0, 0x1e |
| if (r0 >= 0x1e) {
0x000151dc bls 0x151fc |
0x000151e0 ldr r6, [r5, 0x94] | r6 = *((r5 + 0x94));
0x000151e4 mov r2, 0x1f | r2 = 0x1f;
0x000151e8 ldr r1, [pc, 0x70] | r1 = "%s: error!: cannot read \"%s\"\n";
0x000151ec mov r0, r6 | r0 = r6;
0x000151f0 bl 0x10af8 | r0 = memcmp (r0, "%s: error!: cannot read \"%s\"\n", r2);
0x000151f4 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x000151f8 beq 0x15220 | goto label_2;
| }
| }
0x000151fc ldr r3, [pc, 0x5c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x00015200 ldr r0, [pc, 0x40] |
0x00015204 str r3, [sp] | *(sp) = r3;
0x00015208 ldr r2, [pc, 0x3c] | r2 = stderr;
0x0001520c ldr r3, [pc, 0x30] | r3 = *(0x15240);
0x00015210 ldr r1, [pc, 0x4c] | r1 = "dev:____size___erasesize__name";
0x00015214 ldr r0, [r0] | r0 = "_proc_mtd";
0x00015218 bl 0x10abc | fprintf ("_proc_mtd", "dev:____size___erasesize__name", r2, "%s: error!: cannot read \"%s\"\n")
0x0001521c b 0x151c0 |
| } while (1);
| label_2:
0x00015220 add r6, r6, 0x1f | r6 += 0x1f;
0x00015224 mov r0, r4 | r0 = r4;
0x00015228 str r7, [r5, 0x98] | *((r5 + 0x98)) = r7;
0x0001522c str r6, [r5, 0x9c] | *((r5 + 0x9c)) = r6;
0x00015230 bl 0x10bdc | close (r0);
0x00015234 mov r4, r8 | r4 = r8;
| label_0:
0x00015238 mov r0, r4 | r0 = r4;
0x0001523c add sp, sp, 8 |
0x00015240 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/mtdinfo @ 0x15268 */
| #include <stdint.h>
|
; (fcn) fcn.00015268 () | void fcn_00015268 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
0x00015268 push {r0, r1, r2, r4, r5, lr} |
0x0001526c ldr r0, [pc, 0x74] | r0 = *(0x152e4);
0x00015270 mov r1, 4 | r1 = 4;
0x00015274 bl 0x10b7c | r0 = access (r0, r1);
0x00015278 cmp r0, 0 |
| if (r0 != 0) {
0x0001527c moveq r0, 1 | r0 = 1;
| }
| if (r0 != 0) {
0x00015280 beq 0x152e0 |
0x00015284 bl 0x10b88 | r0 = errno_location ();
0x00015288 ldr r4, [r0] | r4 = *(r0);
0x0001528c cmp r4, 2 |
| if (r4 != 2) {
0x00015290 moveq r3, 0 | r3 = 0;
| }
| if (r4 != 2) {
0x00015294 streq r3, [r0] | *(r0) = r3;
| }
| if (r4 != 2) {
0x00015298 beq 0x152dc |
0x0001529c ldr r5, [pc, 0x48] |
0x000152a0 ldr r3, [pc, 0x40] | r3 = *(0x152e4);
0x000152a4 ldr r2, [pc, 0x44] | r2 = stderr;
0x000152a8 ldr r1, [pc, 0x44] | r1 = "libmtd";
0x000152ac ldr r0, [r5] | r0 = "_proc_mtd";
0x000152b0 bl 0x10abc | fprintf ("_proc_mtd", "libmtd", r2, r3, r4, "_proc_mtd")
0x000152b4 mov r0, r4 | r0 = r4;
0x000152b8 ldr r5, [r5] | r5 = "_proc_mtd";
0x000152bc bl 0x10a2c | strerror (r0);
0x000152c0 str r4, [sp] | *(sp) = r4;
0x000152c4 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot read \"%s\"\n";
0x000152c8 mov r2, 8 | r2 = 8;
0x000152cc ldr r1, [pc, 0x28] | r1 = *(0x152f8);
0x000152d0 str r0, [sp, 4] | var_4h = r0;
0x000152d4 mov r0, r5 | r0 = r5;
0x000152d8 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot read \"%s\"\n", r4)
| }
0x000152dc mov r0, 0 | r0 = 0;
| }
0x000152e0 add sp, sp, 0xc |
0x000152e4 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/mtdinfo @ 0x153bc */
| #include <stdint.h>
|
; (fcn) fcn.000153bc () | void fcn_000153bc (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;
0x000153bc push {r4, r5, r6, r7, lr} |
0x000153c0 sub sp, sp, 0x1bc |
0x000153c4 add r1, sp, 8 | r1 += var_8h;
0x000153c8 mov r5, r0 | r5 = r0;
0x000153cc bl 0x10a38 | r0 = stat64 ();
0x000153d0 subs r1, r0, 0 | r1 = r0 - 0;
| if (r1 == r0) {
0x000153d4 beq 0x15430 | goto label_1;
| }
0x000153d8 bl 0x10b88 | errno_location ();
0x000153dc ldr r6, [pc, 0x158] | r6 = *(0x15538);
0x000153e0 mov r3, r5 | r3 = r5;
0x000153e4 ldr r2, [pc, 0x154] | r2 = stderr;
0x000153e8 ldr r1, [pc, 0x154] | r1 = "libmtd";
0x000153ec ldr r4, [r0] | r4 = *(r0);
0x000153f0 ldr r0, [r6] | r0 = *(0x15538);
0x000153f4 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x000153f8 mov r0, r4 | r0 = r4;
0x000153fc ldr r5, [r6] | r5 = *(0x15538);
0x00015400 bl 0x10a2c | strerror (r0);
0x00015404 str r4, [sp] | *(sp) = r4;
0x00015408 ldr r3, [pc, 0x138] | r3 = "%s: error!: cannot open \"%s\"\n";
0x0001540c mov r2, 8 | r2 = 8;
0x00015410 ldr r1, [pc, 0x134] | r1 = *(0x15548);
0x00015414 str r0, [sp, 4] | var_4h = r0;
0x00015418 mov r0, r5 | r0 = r5;
0x0001541c bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| do {
0x00015420 mvn r4, 0 | r4 = ~0;
| label_0:
0x00015424 mov r0, r4 | r0 = r4;
0x00015428 add sp, sp, 0x1bc |
0x0001542c pop {r4, r5, r6, r7, pc} |
| label_1:
0x00015430 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00015434 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00015438 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x0001543c beq 0x15468 | goto label_2;
| }
0x00015440 bl 0x10b88 | errno_location ();
0x00015444 mov r3, 0x16 | r3 = 0x16;
0x00015448 ldr r2, [pc, 0xf0] | r2 = stderr;
0x0001544c ldr r1, [pc, 0xfc] | r1 = "%*serror %d (%s)\n";
0x00015450 str r3, [r0] | *(r0) = r3;
0x00015454 ldr r0, [pc, 0xe0] |
0x00015458 mov r3, r5 | r3 = r5;
0x0001545c ldr r0, [r0] | r0 = *(0x15538);
0x00015460 bl 0x10abc | fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x00015464 b 0x15420 |
| } while (1);
| label_2:
0x00015468 mov r0, r5 | r0 = r5;
0x0001546c bl 0x10b4c | r0 = open64 ();
0x00015470 cmn r0, 1 |
0x00015474 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00015478 bne 0x154c8 |
0x0001547c bl 0x10b88 | errno_location ();
0x00015480 ldr r7, [pc, 0xb4] | r7 = *(0x15538);
0x00015484 mov r3, r5 | r3 = r5;
0x00015488 ldr r2, [pc, 0xb0] | r2 = stderr;
0x0001548c ldr r1, [pc, 0xb0] | r1 = "libmtd";
0x00015490 ldr r6, [r0] | r6 = *(r0);
0x00015494 ldr r0, [r7] | r0 = *(0x15538);
0x00015498 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5, r6)
0x0001549c mov r0, r6 | r0 = r6;
0x000154a0 ldr r5, [r7] | r5 = *(0x15538);
0x000154a4 bl 0x10a2c | strerror (r0);
0x000154a8 str r6, [sp] | *(sp) = r6;
0x000154ac ldr r3, [pc, 0x94] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000154b0 mov r2, 8 | r2 = 8;
0x000154b4 ldr r1, [pc, 0x90] | r1 = *(0x15548);
0x000154b8 str r0, [sp, 4] | var_4h = r0;
0x000154bc mov r0, r5 | r0 = r5;
0x000154c0 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5, r6)
0x000154c4 b 0x15424 | goto label_0;
| }
0x000154c8 add r2, sp, 0x70 | r2 += var_70h;
0x000154cc ldr r1, [pc, 0x80] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x000154d0 bl 0x10a14 | r0 = ioctl (r0, "%s: error!: \"%s\" is not a character device\n");
0x000154d4 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 < r0) {
0x000154d8 ldrge r6, [sp, 0x174] | r6 = var_174h;
| }
| if (r6 < r0) {
0x000154dc bge 0x1552c |
0x000154e0 bl 0x10b88 | r0 = errno_location ();
0x000154e4 ldr r5, [r0] | r5 = *(r0);
0x000154e8 cmp r5, 0x5f |
| if (r5 == 0x5f) {
0x000154ec beq 0x1552c | goto label_3;
| }
0x000154f0 ldr r7, [pc, 0x44] |
0x000154f4 ldr r2, [pc, 0x44] | r2 = stderr;
0x000154f8 ldr r1, [pc, 0x58] | r1 = *(0x15554);
0x000154fc ldr r0, [r7] | r0 = *(0x15538);
0x00015500 bl 0x10abc | fprintf (r0, r1, r2)
0x00015504 mov r0, r5 | r0 = r5;
0x00015508 ldr r7, [r7] | r7 = *(0x15538);
0x0001550c bl 0x10a2c | strerror (r0);
0x00015510 str r5, [sp] | *(sp) = r5;
0x00015514 ldr r3, [pc, 0x2c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00015518 mov r2, 8 | r2 = 8;
0x0001551c ldr r1, [pc, 0x28] | r1 = *(0x15548);
0x00015520 str r0, [sp, 4] | var_4h = r0;
0x00015524 mov r0, r7 | r0 = r7;
0x00015528 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4, r5)
| }
| label_3:
0x0001552c mov r0, r4 | r0 = r4;
0x00015530 bl 0x10bdc | close (r0);
0x00015534 mov r4, r6 | r4 = r6;
0x00015538 b 0x15424 | 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/mtdinfo @ 0x15588 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00015588 () | void fcn_00015588 (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;
0x00015588 push {r4, r5, r6, r7, r8, sb, lr} |
0x0001558c sub sp, sp, 0x144 |
0x00015590 mov r2, 0 | r2 = 0;
0x00015594 mov r3, 0 | r3 = 0;
0x00015598 mov r4, r1 | r4 = r1;
0x0001559c add r1, sp, 0x38 | r1 += var_38h;
0x000155a0 mov r6, r0 | r6 = r0;
0x000155a4 strd r2, r3, [sp, 0x10] | __asm ("strd r2, r3, [var_10h]");
0x000155a8 bl 0x10a38 | r0 = stat64 ();
0x000155ac cmp r0, 0 |
| if (r0 != 0) {
0x000155b0 beq 0x15618 |
0x000155b4 bl 0x10b88 | errno_location ();
0x000155b8 ldr r8, [pc, 0x450] |
0x000155bc mov r3, r6 | r3 = r6;
0x000155c0 ldr r2, [pc, 0x44c] | r2 = stderr;
0x000155c4 ldr r1, [pc, 0x44c] | r1 = "libmtd";
0x000155c8 ldr r7, [r0] | r7 = *(r0);
0x000155cc mov r5, r0 | r5 = r0;
0x000155d0 ldr r0, [r8] | r0 = *(0x15a0c);
0x000155d4 bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4, r5)
0x000155d8 mov r0, r7 | r0 = r7;
0x000155dc ldr r8, [r8] | r8 = *(0x15a0c);
0x000155e0 bl 0x10a2c | strerror (r0);
0x000155e4 ldr r3, [pc, 0x430] | r3 = "%s: error!: cannot open \"%s\"\n";
0x000155e8 str r7, [sp] | *(sp) = r7;
0x000155ec mov r2, 8 | r2 = 8;
0x000155f0 ldr r1, [pc, 0x428] | r1 = *(0x15a1c);
0x000155f4 str r0, [sp, 4] | var_4h = r0;
0x000155f8 mov r0, r8 | r0 = r8;
0x000155fc bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n")
0x00015600 ldr r3, [r5] | r3 = *(r5);
0x00015604 cmp r3, 2 |
| if (r3 != 2) {
0x00015608 bne 0x15618 | goto label_5;
| }
0x0001560c ldr r1, [pc, 0x400] | r1 = stderr;
0x00015610 ldr r0, [pc, 0x40c] | r0 = "%*serror %d (%s)\n";
0x00015614 bl 0x10a20 | printf ("%*serror %d (%s)\n", r1);
| }
| label_5:
0x00015618 ldr r3, [sp, 0x48] | r3 = var_48h;
0x0001561c and r3, r3, 0xf000 | r3 &= 0xf000;
0x00015620 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00015624 beq 0x15654 | goto label_6;
| }
0x00015628 bl 0x10b88 | errno_location ();
0x0001562c mov r3, 0x16 | r3 = 0x16;
0x00015630 ldr r2, [pc, 0x3dc] | r2 = stderr;
0x00015634 ldr r1, [pc, 0x3ec] | r1 = "%s: MTD subsystem is old and does not support sysfs, so MTD character device nodes have to exist\n";
0x00015638 str r3, [r0] | *(r0) = r3;
0x0001563c ldr r0, [pc, 0x3cc] |
0x00015640 mov r3, r6 | r3 = r6;
0x00015644 ldr r0, [r0] | r0 = *(0x15a0c);
0x00015648 bl 0x10abc | fprintf (r0, "%s: MTD subsystem is old and does not support sysfs, so MTD character device nodes have to exist\n", r2, r3)
| do {
| label_0:
0x0001564c mvn r5, 0 | r5 = ~0;
0x00015650 b 0x15738 | goto label_4;
| label_6:
0x00015654 mov r2, 0x100 | r2 = 0x100;
0x00015658 mov r1, 0 | r1 = 0;
0x0001565c mov r0, r4 | r0 = r4;
0x00015660 bl 0x10b34 | memset (r0, r1, r2);
0x00015664 ldrd r8, sb, [sp, 0x58] | __asm ("ldrd r8, sb, [var_58h]");
0x00015668 mov r1, sb | r1 = sb;
0x0001566c mov r0, r8 | r0 = r8;
0x00015670 bl 0x10a5c | gnu_dev_major ();
0x00015674 mov r1, sb | r1 = sb;
0x00015678 mov r5, r0 | r5 = r0;
0x0001567c str r0, [r4, 4] | *((r4 + 4)) = r0;
0x00015680 mov r0, r8 | r0 = r8;
0x00015684 bl 0x10a8c | gnu_dev_minor ();
0x00015688 cmp r5, 0x5a |
0x0001568c str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r5 == 0x5a) {
0x00015690 beq 0x156cc | goto label_7;
| }
0x00015694 bl 0x10b88 | errno_location ();
0x00015698 mov r3, 0x16 | r3 = 0x16;
0x0001569c ldr r2, [pc, 0x370] | r2 = stderr;
0x000156a0 ldr r1, [pc, 0x384] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x000156a4 str r3, [r0] | *(r0) = r3;
0x000156a8 mov r3, 0x5a | r3 = 0x5a;
0x000156ac str r3, [sp, 4] | var_4h = r3;
0x000156b0 ldr r0, [pc, 0x358] |
0x000156b4 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x000156b8 str r3, [sp] | *(sp) = r3;
0x000156bc mov r3, r6 | r3 = r6;
0x000156c0 ldr r0, [r0] | r0 = *(0x15a0c);
0x000156c4 bl 0x10abc | fprintf (r0, "%s: error!: \"%s\" is not a character device\n", r2, r3)
0x000156c8 b 0x1564c |
| } while (1);
| label_7:
0x000156cc add r0, r0, r0, lsr 31 | r0 += (r0 >> 31);
0x000156d0 asr r0, r0, 1 | r0 >>= 1;
0x000156d4 str r0, [r4] | *(r4) = r0;
0x000156d8 mov r1, 0 | r1 = 0;
0x000156dc mov r0, r6 | r0 = r6;
0x000156e0 bl 0x10b4c | r0 = open64 ();
0x000156e4 cmn r0, 1 |
0x000156e8 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x000156ec bne 0x15744 |
0x000156f0 bl 0x10b88 | errno_location ();
0x000156f4 ldr r7, [pc, 0x314] | r7 = *(0x15a0c);
0x000156f8 mov r3, r6 | r3 = r6;
0x000156fc ldr r2, [pc, 0x310] | r2 = stderr;
0x00015700 ldr r1, [pc, 0x310] | r1 = "libmtd";
0x00015704 ldr r4, [r0] | r4 = *(r0);
0x00015708 ldr r0, [r7] | r0 = *(0x15a0c);
0x0001570c bl 0x10abc | fprintf (r0, "libmtd", r2, r3, r4)
0x00015710 mov r0, r4 | r0 = r4;
0x00015714 ldr r6, [r7] | r6 = *(0x15a0c);
0x00015718 bl 0x10a2c | strerror (r0);
0x0001571c str r4, [sp] | *(sp) = r4;
0x00015720 ldr r3, [pc, 0x2f4] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00015724 mov r2, 8 | r2 = 8;
0x00015728 ldr r1, [pc, 0x2f0] | r1 = *(0x15a1c);
0x0001572c str r0, [sp, 4] | var_4h = r0;
0x00015730 mov r0, r6 | r0 = r6;
0x00015734 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| label_4:
0x00015738 mov r0, r5 | r0 = r5;
0x0001573c add sp, sp, 0x144 |
0x00015740 pop {r4, r5, r6, r7, r8, sb, pc} |
| }
0x00015744 add r2, sp, 0x18 | r2 += var_18h;
0x00015748 ldr r1, [pc, 0x2e0] | r1 = "%s: error!: \"%s\" has major number %d, MTD devices have major %d\n";
0x0001574c bl 0x10a14 | r0 = ioctl (r0, "%s: error!: \"%s\" has major number %d, MTD devices have major %d\n");
0x00015750 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00015754 beq 0x157a8 | goto label_8;
| }
0x00015758 bl 0x10b88 | errno_location ();
0x0001575c ldr r6, [pc, 0x2ac] |
0x00015760 ldr r2, [pc, 0x2ac] | r2 = stderr;
0x00015764 ldr r1, [pc, 0x2c8] | r1 = *(0x15a30);
0x00015768 ldr r4, [r0] | r4 = *(r0);
0x0001576c ldr r0, [r6] | r0 = *(0x15a0c);
0x00015770 bl 0x10abc | fprintf (r0, r1, r2, r3, r4, r5, r6)
0x00015774 mov r0, r4 | r0 = r4;
0x00015778 ldr r6, [r6] | r6 = *(0x15a0c);
0x0001577c bl 0x10a2c | strerror (r0);
0x00015780 ldr r3, [pc, 0x294] | r3 = "%s: error!: cannot open \"%s\"\n";
0x00015784 ldr r1, [pc, 0x294] | r1 = *(0x15a1c);
0x00015788 mov r2, 8 | r2 = 8;
0x0001578c str r4, [sp] | *(sp) = r4;
0x00015790 str r0, [sp, 4] | var_4h = r0;
0x00015794 mov r0, r6 | r0 = r6;
| do {
| label_1:
0x00015798 bl 0x10abc | fprintf (r0, r1, r2, "%s: error!: cannot open \"%s\"\n", r4)
| label_2:
0x0001579c mov r0, r5 | r0 = r5;
0x000157a0 bl 0x10bdc | close (r0);
0x000157a4 b 0x1564c | goto label_0;
| label_8:
0x000157a8 add r2, sp, 0x10 | r2 += var_10h;
0x000157ac ldr r1, [pc, 0x284] | r1 = "_s:_error_:_MEMGETINFO_ioctl_request_failed";
0x000157b0 mov r0, r5 | r0 = r5;
0x000157b4 bl 0x10a14 | r0 = ioctl (r0, "_s:_error_:_MEMGETINFO_ioctl_request_failed");
0x000157b8 cmn r0, 1 |
| if (r0 == 1) {
0x000157bc ldrbne r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
| if (r0 == 1) {
0x000157c0 orrne r3, r3, 2 | r3 |= 2;
| }
| if (r0 != 1) {
0x000157c4 bne 0x15820 | goto label_9;
| }
0x000157c8 bl 0x10b88 | r0 = errno_location ();
0x000157cc ldr r7, [r0] | r7 = *(r0);
0x000157d0 cmp r7, 0x5f |
| if (r7 != 0x5f) {
0x000157d4 streq r8, [r0] | *(r0) = r8;
| }
| if (r7 != 0x5f) {
0x000157d8 ldrbeq r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
0x000157dc biceq r3, r3, 2 | __asm ("biceq r3, r3, 2");
| if (r7 == 0x5f) {
0x000157e0 beq 0x15820 | goto label_9;
| }
0x000157e4 ldr r4, [pc, 0x224] |
0x000157e8 ldr r2, [pc, 0x224] | r2 = stderr;
0x000157ec ldr r1, [pc, 0x248] | r1 = *(0x15a38);
0x000157f0 ldr r0, [r4] | r0 = *(0x15a0c);
0x000157f4 bl 0x10abc | fprintf (r0, r1, r2, r3, r4)
0x000157f8 mov r0, r7 | r0 = r7;
0x000157fc ldr r4, [r4] | r4 = *(0x15a0c);
0x00015800 bl 0x10a2c | strerror (r0);
0x00015804 str r7, [sp] | *(sp) = r7;
0x00015808 ldr r3, [pc, 0x20c] | r3 = "%s: error!: cannot open \"%s\"\n";
0x0001580c mov r2, 8 | r2 = 8;
0x00015810 ldr r1, [pc, 0x208] | r1 = *(0x15a1c);
0x00015814 str r0, [sp, 4] | var_4h = r0;
0x00015818 mov r0, r4 | r0 = r4;
0x0001581c b 0x15798 |
| } while (1);
| label_9:
0x00015820 strb r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
0x00015824 ldr r3, [sp, 0x28] | r3 = var_28h;
0x00015828 ldrb r7, [sp, 0x18] | r7 = var_18h;
0x0001582c ldr r0, [sp, 0x20] | r0 = var_20h;
0x00015830 ldr r2, [sp, 0x24] | r2 = var_24h;
0x00015834 ldr ip, [sp, 0x2c] | ip = var_2ch;
0x00015838 mov r1, 0 | r1 = 0;
0x0001583c cmp r3, 0 |
0x00015840 str r7, [r4, 0xc] | *((r4 + 0xc)) = r7;
0x00015844 strd r0, r1, [r4, 0xd8] | __asm ("strd r0, r1, [r4, 0xd8]");
0x00015848 str r2, [r4, 0xe4] | *((r4 + 0xe4)) = r2;
0x0001584c str r3, [r4, 0xe8] | *((r4 + 0xe8)) = r3;
0x00015850 str ip, [r4, 0xf0] | *((r4 + 0xf0)) = ip;
| if (r3 > 0) {
0x00015854 bgt 0x15878 | goto label_10;
| }
0x00015858 str r3, [sp, 4] | var_4h = r3;
0x0001585c str r6, [sp] | *(sp) = r6;
0x00015860 ldr r2, [pc, 0x1ac] | r2 = stderr;
0x00015864 ldr r3, [r4] | r3 = *(r4);
0x00015868 ldr r1, [pc, 0x1d0] | r1 = "%s: error!: MEMGETBADBLOCK ioctl failed\n";
| do {
0x0001586c ldr r0, [pc, 0x19c] |
0x00015870 ldr r0, [r0] | r0 = *(0x15a0c);
0x00015874 b 0x15798 | goto label_1;
| label_10:
0x00015878 cmp r2, r3 |
0x0001587c cmpge r2, 0 | __asm ("cmpge r2, 0");
| if (r2 > r3) {
0x00015880 bgt 0x1589c | goto label_11;
| }
0x00015884 str r2, [sp, 4] | var_4h = r2;
0x00015888 str r6, [sp] | *(sp) = r6;
0x0001588c ldr r2, [pc, 0x180] | r2 = stderr;
0x00015890 ldr r3, [r4] | r3 = *(r4);
0x00015894 ldr r1, [pc, 0x1a8] | r1 = "_s:_error_:_mtd_d___s__has_insane_min._I_O_unit_size__d";
0x00015898 b 0x1586c |
| } while (1);
| label_11:
0x0001589c orrs r3, r0, r1 | r3 = r0 | r1;
| if (r3 != r0) {
0x000158a0 beq 0x158b4 |
0x000158a4 asr r3, r2, 0x1f | r3 = r2 >> 0x1f;
0x000158a8 cmp r0, r2 |
0x000158ac sbcs ip, r1, r3 | __asm ("sbcs ip, r1, r3");
| if (r0 >= r2) {
0x000158b0 bge 0x158d8 | goto label_12;
| }
| }
0x000158b4 strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [var_8h]");
0x000158b8 ldr r0, [pc, 0x150] |
0x000158bc str r6, [sp] | *(sp) = r6;
0x000158c0 ldr r2, [pc, 0x14c] | r2 = stderr;
0x000158c4 ldr r3, [r4] | r3 = *(r4);
0x000158c8 ldr r1, [pc, 0x178] | r1 = "%s: error!: mtd%d (%s) has insane eraseblock size %d\n";
0x000158cc ldr r0, [r0] | r0 = *(0x15a0c);
0x000158d0 bl 0x10abc | fprintf (r0, "%s: error!: mtd%d (%s) has insane eraseblock size %d\n", r2, r3, r4, r5, r6)
0x000158d4 b 0x1579c | goto label_2;
| label_12:
0x000158d8 bl 0x15c6c | fcn_00015c6c (r0);
0x000158dc str r0, [r4, 0xe0] | *((r4 + 0xe0)) = r0;
0x000158e0 cmp r7, 8 |
| if (r7 > 8) {
| /* switch table (9 cases) at 0x158ec */
0x000158e4 ldrls pc, [pc, r7, lsl 2] | offset_0 = r7 << 2;
| pc = *((pc + offset_0));
| }
0x000158e8 b 0x1579c | goto label_2;
0x00015910 ldr r0, [pc, 0xf8] |
0x00015914 str r6, [sp] | *(sp) = r6;
0x00015918 ldr r2, [pc, 0xf4] | r2 = stderr;
0x0001591c ldr r3, [r4] | r3 = *(r4);
0x00015920 ldr r1, [pc, 0x124] | r1 = "%s: error!: mtd%d (%s) has insane size %lld\n";
0x00015924 ldr r0, [r0] | r0 = *(0x15a0c);
0x00015928 bl 0x10abc | fprintf (r0, "%s: error!: mtd%d (%s) has insane size %lld\n", r2, r3, r4, r5, r6)
0x0001592c b 0x1579c | goto label_2;
0x00015930 ldr r1, [pc, 0x118] | r1 = "_s:_error_:_mtd_d___s__is_removable_and_is_not_present";
| label_3:
0x00015934 add r0, r4, 0x10 | r0 = r4 + 0x10;
0x00015938 bl 0x10a08 | strcpy (r0, "_s:_error_:_mtd_d___s__is_removable_and_is_not_present");
0x0001593c ldr r3, [sp, 0x1c] | r3 = var_1ch;
0x00015940 mov r0, r5 | r0 = r5;
0x00015944 tst r3, 0x400 |
| if ((r3 & 0x400) == 0) {
0x00015948 ldrbne r3, [r4, 0xfc] | r3 = *((r4 + 0xfc));
| }
| if ((r3 & 0x400) == 0) {
0x0001594c orrne r3, r3, 1 | r3 |= 1;
| }
| if ((r3 & 0x400) == 0) {
0x00015950 strbne r3, [r4, 0xfc] | *((r4 + 0xfc)) = r3;
| }
0x00015954 ldr r3, [r4, 0xe8] | r3 = *((r4 + 0xe8));
0x00015958 str r3, [r4, 0xec] | *((r4 + 0xec)) = r3;
0x0001595c bl 0x10bdc | close (r0);
0x00015960 mov r0, r6 | r0 = r6;
0x00015964 bl 0x153bc | r0 = fcn_000153bc (r0);
0x00015968 bic r0, r0, r0, asr 31 | r0 = BIT_MASK (r0, r0);
0x0001596c str r0, [r4, 0xf4] | *((r4 + 0xf4)) = r0;
0x00015970 add r0, sp, 0xa0 | r0 += var_a0h;
0x00015974 bl 0x150e0 | fcn_000150e0 (r0);
0x00015978 subs r5, r0, 0 | r5 -= var_a0h;
| if (r5 != var_a0h) {
0x0001597c bne 0x1564c | goto label_0;
| }
| do {
0x00015980 add r0, sp, 0xa0 | r0 += var_a0h;
0x00015984 bl 0x14f7c | r0 = fcn_00014f7c (r0);
0x00015988 cmp r0, 0 |
| if (r0 == 0) {
0x0001598c bne 0x159f0 |
0x00015990 ldr r3, [pc, 0xbc] | r3 = "ram";
0x00015994 ldr r0, [pc, 0x74] |
0x00015998 str r3, [sp] | *(sp) = r3;
0x0001599c ldr r2, [pc, 0x70] | r2 = stderr;
0x000159a0 ldr r3, [r4] | r3 = *(r4);
0x000159a4 ldr r1, [pc, 0xac] | r1 = "_proc_mtd";
0x000159a8 ldr r0, [r0] | r0 = *(0x15a0c);
0x000159ac bl 0x10abc | r0 = fprintf (r0, "_proc_mtd", r2, "ram")
0x000159b0 bl 0x10b88 | errno_location ();
0x000159b4 mov r3, 2 | r3 = 2;
0x000159b8 str r3, [r0] | *(r0) = r3;
0x000159bc b 0x1564c | goto label_0;
0x000159c0 ldr r1, [pc, 0x94] | r1 = "_s:_error_:_mtd_d_not_found_in___s_";
0x000159c4 b 0x15934 | goto label_3;
0x000159c8 ldr r1, [pc, 0x90] | r1 = *(0x15a5c);
0x000159cc b 0x15934 | goto label_3;
0x000159d0 ldr r1, [pc, 0x8c] | r1 = *(0x15a60);
0x000159d4 b 0x15934 | goto label_3;
0x000159d8 ldr r1, [pc, 0x88] | r1 = "nand";
0x000159dc b 0x15934 | goto label_3;
0x000159e0 ldr r1, [pc, 0x84] | r1 = "mlc_nand";
0x000159e4 b 0x15934 | goto label_3;
0x000159e8 ldr r1, [pc, 0x80] | r1 = "dataflash";
0x000159ec b 0x15934 | goto label_3;
| }
0x000159f0 ldr r3, [r4] | r3 = *(r4);
0x000159f4 ldr r2, [sp, 0xa0] | r2 = var_a0h;
0x000159f8 cmp r2, r3 |
0x000159fc bne 0x15980 |
| } while (r2 != r3);
0x00015a00 add r1, sp, 0xb0 | r1 += src;
0x00015a04 add r0, r4, 0x51 | r0 = r4 + 0x51;
0x00015a08 bl 0x10a08 | strcpy (r0, r1);
0x00015a0c b 0x15738 | 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/mtdinfo @ 0x10c64 */
| #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_18h;
| r0 = argc;
| r1 = argv;
0x00010c64 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00010c68 ldr sb, [pc, 0x284] | sb = "ubi_info";
0x00010c6c ldr sl, [pc, 0x284] | sl = "auMhV";
0x00010c70 ldr r5, [pc, 0x284] | r5 = "auMhV";
0x00010c74 sub sp, sp, 0x18 |
0x00010c78 mov r6, r0 | r6 = r0;
0x00010c7c mov r8, r1 | r8 = r1;
| label_0:
0x00010c80 mov r7, 0 | r7 = 0;
0x00010c84 str r7, [sp] | *(sp) = r7;
0x00010c88 mov r3, sb | r3 = sb;
0x00010c8c mov r2, sl | r2 = sl;
0x00010c90 mov r1, r8 | r1 = r8;
0x00010c94 mov r0, r6 | r0 = r6;
0x00010c98 bl 0x10a44 | r0 = getopt_long ();
0x00010c9c cmn r0, 1 |
0x00010ca0 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00010ca4 beq 0x10d74 | goto label_3;
| }
0x00010ca8 cmp r0, 0x56 |
| if (r0 == 0x56) {
0x00010cac beq 0x10d3c | goto label_4;
| }
| if (r0 > 0x56) {
0x00010cb0 bgt 0x10cd8 | goto label_5;
| }
0x00010cb4 cmp r0, 0x3a |
| if (r0 == 0x3a) {
0x00010cb8 beq 0x10d50 | goto label_6;
| }
0x00010cbc cmp r0, 0x4d |
| if (r0 == 0x4d) {
0x00010cc0 beq 0x10d0c | goto label_7;
| }
| do {
0x00010cc4 ldr r3, [pc, 0x234] | r3 = *(0x10efc);
0x00010cc8 ldr r0, [pc, 0x234] | r0 = stderr;
0x00010ccc ldr r1, [r3] | r1 = *(0x10efc);
0x00010cd0 bl 0x10bb8 | fputs (r0, r1);
0x00010cd4 b 0x10d64 | goto label_8;
| label_5:
0x00010cd8 cmp r0, 0x68 |
| if (r0 == 0x68) {
0x00010cdc beq 0x10d18 | goto label_9;
| }
0x00010ce0 cmp r0, 0x75 |
| if (r0 == 0x75) {
0x00010ce4 beq 0x10d00 | goto label_10;
| }
0x00010ce8 cmp r0, 0x61 |
0x00010cec bne 0x10cc4 |
| } while (r0 != 0x61);
0x00010cf0 ldrb r3, [r5] | r3 = *(r5);
0x00010cf4 orr r3, r3, 1 | r3 |= 1;
| do {
| label_1:
0x00010cf8 strb r3, [r5] | *(r5) = r3;
0x00010cfc b 0x10c80 | goto label_0;
| label_10:
0x00010d00 ldrb r3, [r5] | r3 = *(r5);
0x00010d04 orr r3, r3, 2 | r3 |= 2;
0x00010d08 b 0x10cf8 |
| } while (1);
| label_7:
0x00010d0c ldrb r3, [r5] | r3 = *(r5);
0x00010d10 orr r3, r3, 4 | r3 |= 4;
0x00010d14 b 0x10cf8 | goto label_1;
| label_9:
0x00010d18 ldr r3, [pc, 0x1e8] | r3 = "Use__h_for_help";
0x00010d1c ldr r2, [pc, 0x1e8] | r2 = *(0x10f08);
0x00010d20 str r3, [sp] | *(sp) = r3;
0x00010d24 ldr r1, [pc, 0x1e4] | r1 = "2.1.0";
0x00010d28 mov r3, 0xa | r3 = 0xa;
0x00010d2c ldr r0, [pc, 0x1e0] | r0 = "mtdinfo";
0x00010d30 bl 0x10a20 | printf ("mtdinfo", "2.1.0", r2, "Use__h_for_help");
| do {
0x00010d34 mov r0, r7 | r0 = r7;
0x00010d38 bl 0x10b94 | exit (r0);
| label_4:
0x00010d3c ldr r2, [pc, 0x1c8] | r2 = *(0x10f08);
0x00010d40 ldr r1, [pc, 0x1c8] | r1 = "2.1.0";
0x00010d44 ldr r0, [pc, 0x1cc] | r0 = "%1$s version %2$s - a tool to print MTD information.\n\nUsage: %1$s <MTD node file path> [--map | -M] [--ubi-info | -u]\n %1$s --all [--ubi-info | -u]\n %1$s [--help | --version]\n\nOptions:\n-u, --ubi-info print what would UBI layout be if it was put\n on this MTD device\n-M, --map print eraseblock map\n-a, --all print information about all MTD devices\n Note: `--all' may give less info per device\n than, e.g., `mtdinfo /dev/mtdX'\n-h, --help print help message\n-V, --version print program version\n\nExamples:\n %1$s /dev/mtd0 print information MTD device /dev/mtd0\n %1$s /dev/mtd0 -u print information MTD device /dev/mtd0\n %4$*3$s and include UBI layout information\n %1$s -a print information about all MTD devices\n";
0x00010d48 bl 0x10a20 | printf ("%1$s version %2$s - a tool to print MTD information.\n\nUsage: %1$s <MTD node file path> [--map | -M] [--ubi-info | -u]\n %1$s --all [--ubi-info | -u]\n %1$s [--help | --version]\n\nOptions:\n-u, --ubi-info print what would UBI layout be if it was put\n on this MTD device\n-M, --map print eraseblock map\n-a, --all print information about all MTD devices\n Note: `--all' may give less info per device\n than, e.g., `mtdinfo /dev/mtdX'\n-h, --help print help message\n-V, --version print program version\n\nExamples:\n %1$s /dev/mtd0 print information MTD device /dev/mtd0\n %1$s /dev/mtd0 -u print information MTD device /dev/mtd0\n %4$*3$s and include UBI layout information\n %1$s -a print information about all MTD devices\n", "2.1.0", r2);
0x00010d4c b 0x10d34 |
| } while (1);
| label_6:
0x00010d50 ldr r3, [pc, 0x1a8] | r3 = *(0x10efc);
0x00010d54 ldr r2, [pc, 0x1b4] | r2 = "2.1.0";
0x00010d58 ldr r1, [pc, 0x1bc] | r1 = "%s (mtd-utils) %s\n";
0x00010d5c ldr r0, [r3] | r0 = *(0x10efc);
0x00010d60 bl 0x10abc | fprintf (r0, "%s (mtd-utils) %s\n", "2.1.0", r3)
| label_8:
0x00010d64 mvn r4, 0 | r4 = ~0;
| label_2:
0x00010d68 mov r0, r4 | r0 = r4;
0x00010d6c add sp, sp, 0x18 |
0x00010d70 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_3:
0x00010d74 ldr r3, [pc, 0x1a4] |
0x00010d78 sub r2, r6, 1 | r2 = r6 - 1;
0x00010d7c ldr r3, [r3] | r3 = "_s:_error_:_parameter_is_missing";
0x00010d80 cmp r2, r3 |
| if (r2 != r3) {
0x00010d84 bne 0x10dd4 | goto label_11;
| }
0x00010d88 ldr r2, [r8, r2, lsl 2] | offset_0 = r2 << 2;
| r2 = *((r8 + offset_0));
0x00010d8c ldr r3, [pc, 0x168] | r3 = "auMhV";
0x00010d90 str r2, [r3, 4] | *((r3 + 4)) = r2;
| do {
0x00010d94 ldr r5, [pc, 0x160] | r5 = "auMhV";
0x00010d98 ldrb r3, [r5] | r3 = *(r5);
0x00010d9c tst r3, 1 |
| if ((r3 & 1) != 0) {
0x00010da0 beq 0x10db4 |
0x00010da4 ldr r2, [r5, 4] | r2 = *((r5 + 4));
0x00010da8 cmp r2, 0 |
| if (r2 == 0) {
0x00010dac movne r2, 0 | r2 = 0;
| }
| if (r2 != 0) {
0x00010db0 strne r2, [r5, 4] | *((r5 + 4)) = r2;
| goto label_12;
| }
| }
| label_12:
0x00010db4 tst r3, 4 |
| if ((r3 & 4) == 0) {
0x00010db8 beq 0x10df4 | goto label_13;
| }
0x00010dbc ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x00010dc0 cmp r3, 0 |
| if (r3 != 0) {
0x00010dc4 bne 0x10df4 | goto label_13;
| }
0x00010dc8 ldr r2, [pc, 0x140] | r2 = "2.1.0";
0x00010dcc ldr r1, [pc, 0x150] | r1 = optind;
0x00010dd0 b 0x10de4 | goto label_14;
| label_11:
0x00010dd4 cmp r6, r3 |
0x00010dd8 ble 0x10d94 |
| } while (r6 <= r3);
0x00010ddc ldr r2, [pc, 0x12c] | r2 = "2.1.0";
0x00010de0 ldr r1, [pc, 0x140] | r1 = "%s: error!: -M requires MTD device node name\n";
| label_14:
0x00010de4 ldr r3, [pc, 0x114] | r3 = *(0x10efc);
0x00010de8 ldr r0, [r3] | r0 = *(0x10efc);
| do {
0x00010dec bl 0x10abc | fprintf (r0, "%s: error!: -M requires MTD device node name\n", "2.1.0", r3)
0x00010df0 b 0x10d68 | goto label_2;
| label_13:
0x00010df4 bl 0x134e0 | r0 = fcn_000134e0 ();
0x00010df8 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 != r0) {
0x00010dfc bne 0x10e54 | goto label_15;
| }
0x00010e00 bl 0x10b88 | errno_location ();
0x00010e04 ldr r6, [pc, 0xf4] | r6 = *(0x10efc);
0x00010e08 ldr r2, [pc, 0x100] | r2 = "2.1.0";
0x00010e0c ldr r5, [r0] | r5 = *(r0);
0x00010e10 ldr r0, [r6] | r0 = *(0x10efc);
0x00010e14 cmp r5, 0 |
| if (r5 != 0) {
0x00010e18 ldreq r1, [pc, 0x10c] | r1 = "%s: error!: MTD is not present in the system\n";
| }
| if (r5 == 0) {
0x00010e1c ldrne r1, [pc, 0x10c] | r1 = "%s: error!: cannot open libmtd\n";
| }
0x00010e20 beq 0x10dec |
| } while (r5 == 0);
| do {
0x00010e24 bl 0x10abc | fprintf (r0, r1)
0x00010e28 mov r0, r5 | r0 = r5;
0x00010e2c ldr r6, [r6] | r6 = *(r6);
0x00010e30 bl 0x10a2c | strerror (r0);
0x00010e34 str r5, [sp] | *(sp) = r5;
0x00010e38 ldr r3, [pc, 0xc8] | r3 = "Use__h_for_help";
0x00010e3c mov r2, 9 | r2 = 9;
0x00010e40 ldr r1, [pc, 0xec] | r1 = "%s: error!: cannot open libmtd\n";
0x00010e44 str r0, [sp, 4] | var_4h = r0;
0x00010e48 mov r0, r6 | r0 = r6;
0x00010e4c bl 0x10abc | fprintf (r0, "%s: error!: cannot open libmtd\n", r2, "Use__h_for_help", r4, r5)
0x00010e50 b 0x10d68 | goto label_2;
| label_15:
0x00010e54 add r1, sp, 8 | r1 += var_8h;
0x00010e58 bl 0x137bc | r0 = fcn_000137bc (r0, r1);
0x00010e5c cmp r0, 0 |
| if (r0 == 0) {
0x00010e60 beq 0x10e80 | goto label_16;
| }
0x00010e64 bl 0x10b88 | errno_location ();
0x00010e68 ldr r6, [pc, 0x90] | r6 = *(0x10efc);
0x00010e6c ldr r2, [pc, 0x9c] | r2 = "2.1.0";
0x00010e70 ldr r1, [pc, 0xc0] | r1 = "%*serror %d (%s)\n";
0x00010e74 ldr r5, [r0] | r5 = *(r0);
0x00010e78 ldr r0, [r6] | r0 = *(0x10efc);
0x00010e7c b 0x10e24 |
| } while (1);
| label_16:
0x00010e80 ldrb r3, [r5] | r3 = *(r5);
0x00010e84 tst r3, 1 |
| if ((r3 & 1) != 0) {
0x00010e88 bne 0x10ed0 | goto label_17;
| }
0x00010e8c ldr r1, [r5, 4] | r1 = *((r5 + 4));
0x00010e90 cmp r1, 0 |
| if (r1 == 0) {
0x00010e94 beq 0x10ed0 | goto label_17;
| }
0x00010e98 mov r0, r6 | r0 = r6;
0x00010e9c bl 0x11054 | r0 = fcn_00011054 (r0);
0x00010ea0 subs r2, r0, 0 | r2 = r0 - 0;
| if (r2 < r0) {
0x00010ea4 blt 0x10ee8 | goto label_18;
| }
0x00010ea8 add r1, sp, 8 | r1 += var_8h;
0x00010eac mov r0, r6 | r0 = r6;
0x00010eb0 bl 0x11318 | r0 = fcn_00011318 (r0, r1);
| do {
0x00010eb4 cmp r0, 0 |
0x00010eb8 mov r5, r0 | r5 = r0;
| if (r0 != 0) {
0x00010ebc bne 0x10ee8 | goto label_18;
| }
0x00010ec0 mov r0, r6 | r0 = r6;
0x00010ec4 bl 0x13464 | fcn_00013464 (r0);
0x00010ec8 mov r4, r5 | r4 = r5;
0x00010ecc b 0x10d68 | goto label_2;
| label_17:
0x00010ed0 ldrb r2, [r5] | r2 = *(r5);
0x00010ed4 add r1, sp, 8 | r1 += var_8h;
0x00010ed8 and r2, r2, 1 | r2 &= 1;
0x00010edc mov r0, r6 | r0 = r6;
0x00010ee0 bl 0x1178c | fcn_0001178c (r0, r1);
0x00010ee4 b 0x10eb4 |
| } while (1);
| label_18:
0x00010ee8 mov r0, r6 | r0 = r6;
0x00010eec bl 0x13464 | fcn_00013464 (r0);
0x00010ef0 b 0x10d68 | goto label_2;
| }
[*] Function fprintf used 110 times mtdinfo