[*] Binary protection state of ubiupdatevol
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function sprintf tear down of ubiupdatevol
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubiupdatevol @ 0x117f4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000117f4 () | void fcn_000117f4 (int32_t arg1, int32_t arg2) {
| int32_t var_14h_2;
| int32_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x000117f4 push {r4, r5, r6, r7, fp, lr} |
0x000117f8 add fp, sp, 0x14 |
0x000117fc mov r6, r1 | r6 = r1;
0x00011800 mov r7, r2 | r7 = r2;
0x00011804 mov r4, r3 | r4 = r3;
0x00011808 mov r5, r0 | r5 = r0;
0x0001180c bl 0x10a4c | strlen (r0);
0x00011810 mov r3, r7 | r3 = r7;
0x00011814 mov r2, r6 | r2 = r6;
0x00011818 mov r1, r5 | r1 = r5;
0x0001181c add r0, r0, 0x6b | r0 += 0x6b;
0x00011820 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00011824 sub sp, sp, r0 |
0x00011828 mov r0, sp | r0 = sp;
0x0001182c bl 0x10a28 | sprintf (r0, r1, r2)
0x00011830 mov r1, r4 | r1 = r4;
0x00011834 mov r0, sp | r0 = sp;
0x00011838 bl 0x11738 | fcn_00011738 (r0, r1);
0x0001183c sub sp, fp, 0x14 |
0x00011840 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/ubiupdatevol @ 0x11c98 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00011c98 () | void fcn_00011c98 (int32_t arg2, char * s) {
| int32_t var_14h_2;
| int32_t var_14h;
| r1 = arg2;
| r0 = s;
0x00011c98 push {r4, r5, r6, r7, fp, lr} |
0x00011c9c ldr r4, [r0] | r4 = *(r0);
0x00011ca0 add fp, sp, 0x14 |
0x00011ca4 mov r0, r4 | r0 = r4;
0x00011ca8 mov r6, r3 | r6 = r3;
0x00011cac mov r7, r1 | r7 = r1;
0x00011cb0 mov r5, r2 | r5 = r2;
0x00011cb4 bl 0x10a4c | strlen (r0);
0x00011cb8 mov r2, r7 | r2 = r7;
0x00011cbc mov r1, r4 | r1 = r4;
0x00011cc0 add r0, r0, 0x39 | r0 += 0x39;
0x00011cc4 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00011cc8 sub sp, sp, r0 |
0x00011ccc mov r0, sp | r0 = sp;
0x00011cd0 bl 0x10a28 | sprintf (r0, r1, r2)
0x00011cd4 mov r2, r6 | r2 = r6;
0x00011cd8 mov r1, r5 | r1 = r5;
0x00011cdc mov r0, sp | r0 = sp;
0x00011ce0 bl 0x11bc0 | fcn_00011bc0 (r0, r1);
0x00011ce4 sub sp, fp, 0x14 |
0x00011ce8 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/ubiupdatevol @ 0x1266c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.0001266c () | void fcn_0001266c (int32_t arg2, char * s) {
| int32_t var_b4h;
| int32_t var_ach;
| int32_t var_a8h;
| int32_t var_a4h;
| int32_t var_a0h;
| int32_t var_9ch;
| int32_t var_8ch;
| int32_t var_7ch;
| int32_t var_6ch;
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_sp_b4h;
| int32_t var_sp_6ch;
| int32_t var_20h_2;
| int32_t var_20h;
| r1 = arg2;
| r0 = s;
0x0001266c push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012670 add fp, sp, 0x20 |
0x00012674 sub sp, sp, 0x9c |
0x00012678 mov r6, r0 | r6 = r0;
0x0001267c ldr r0, [r0, 0x40] | r0 = *((r0 + 0x40));
0x00012680 mov r5, r1 | r5 = r1;
0x00012684 bl 0x10a4c | strlen (r0);
0x00012688 sub r1, fp, 0x8c | r1 -= var_8ch;
0x0001268c add r0, r0, 0x6b | r0 += 0x6b;
0x00012690 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012694 sub sp, sp, r0 |
0x00012698 mov r0, r5 | r0 = r5;
0x0001269c bl 0x10914 | r0 = stat64 ();
0x000126a0 cmp r0, 0 |
| if (r0 == 0) {
0x000126a4 beq 0x126fc | goto label_5;
| }
0x000126a8 bl 0x10a34 | errno_location ();
0x000126ac ldr r6, [pc, 0x1e8] | r6 = *(0x12898);
0x000126b0 mov r3, r5 | r3 = r5;
0x000126b4 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x000126b8 ldr r1, [pc, 0x1e4] | r1 = "libubi";
0x000126bc ldr r4, [r0] | r4 = *(r0);
0x000126c0 ldr r0, [r6] | r0 = *(0x12898);
0x000126c4 bl 0x1098c | fprintf (r0, "libubi", r2, r3, r4, r5, r6);
0x000126c8 mov r0, r4 | r0 = r4;
0x000126cc ldr r5, [r6] | r5 = *(0x12898);
0x000126d0 bl 0x10908 | strerror (r0);
0x000126d4 str r4, [sp] | *(sp) = r4;
0x000126d8 ldr r3, [pc, 0x1c8] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x000126dc mov r2, 8 | r2 = 8;
0x000126e0 ldr r1, [pc, 0x1c4] | r1 = *(0x128a8);
0x000126e4 str r0, [sp, 4] | var_4h = r0;
0x000126e8 mov r0, r5 | r0 = r5;
0x000126ec bl 0x1098c | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4);
| do {
| label_0:
0x000126f0 mvn r0, 0 | r0 = ~0;
| label_4:
0x000126f4 sub sp, fp, 0x20 |
0x000126f8 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_5:
0x000126fc ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x00012700 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00012704 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00012708 beq 0x12734 | goto label_6;
| }
0x0001270c ldr r0, [pc, 0x188] |
0x00012710 mov r3, r5 | r3 = r5;
0x00012714 ldr r2, [pc, 0x184] | r2 = stderr;
0x00012718 ldr r1, [pc, 0x190] | r1 = "%*serror %d (%s)\n";
0x0001271c ldr r0, [r0] | r0 = *(0x12898);
0x00012720 bl 0x1098c | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3);
0x00012724 bl 0x10a34 | errno_location ();
0x00012728 mov r3, 0x16 | r3 = 0x16;
| label_1:
0x0001272c str r3, [r0] | *(r0) = r3;
0x00012730 b 0x126f0 |
| } while (1);
| label_6:
0x00012734 ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x00012738 mov r1, r3 | r1 = r3;
0x0001273c mov r0, r2 | r0 = r2;
0x00012740 strd r2, r3, [fp, -0xb4] | __asm ("strd r2, r3, [var_b4h]");
0x00012744 bl 0x1092c | gnu_dev_major ();
0x00012748 ldrd r2, r3, [fp, -0xb4] | __asm ("ldrd r2, r3, [var_b4h]");
0x0001274c mov r1, r3 | r1 = r3;
0x00012750 mov sb, r0 | sb = r0;
0x00012754 mov r0, r2 | r0 = r2;
0x00012758 bl 0x1095c | gnu_dev_minor ();
0x0001275c sub r1, fp, 0xa4 | r1 -= var_a4h;
0x00012760 mov r7, r0 | r7 = r0;
0x00012764 mov r0, r6 | r0 = r6;
0x00012768 bl 0x1233c | r0 = fcn_0001233c (r0, r1);
0x0001276c cmp r0, 0 |
| if (r0 != 0) {
0x00012770 addeq r8, sp, 8 | r8 += var_b4h;
| }
| if (r0 != 0) {
0x00012774 ldreq r4, [fp, -0xa0] | r4 = var_a0h;
| }
| if (r0 == 0) {
0x00012778 addeq sl, r6, 0x18 | sl = r6 + 0x18;
| goto label_7;
| }
| if (r0 != 0) {
| label_7:
0x0001277c bne 0x126f0 | goto label_0;
| }
| do {
0x00012780 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012784 cmp r4, r3 |
| if (r4 > r3) {
0x00012788 bgt 0x12800 | goto label_8;
| }
0x0001278c sub r3, fp, 0xa8 | r3 -= var_a8h;
0x00012790 sub r2, fp, 0xac | r2 -= var_ach;
0x00012794 mov r1, r4 | r1 = r4;
0x00012798 mov r0, sl | r0 = sl;
0x0001279c bl 0x11c98 | r0 = fcn_00011c98 (r0, r1);
0x000127a0 cmp r0, 0 |
| if (r0 == 0) {
0x000127a4 beq 0x127f4 | goto label_9;
| }
0x000127a8 bl 0x10a34 | r0 = errno_location ();
0x000127ac ldr r3, [r0] | r3 = *(r0);
0x000127b0 cmp r3, 2 |
| if (r3 != 2) {
0x000127b4 bne 0x127c0 | goto label_10;
| }
| label_2:
0x000127b8 add r4, r4, 1 | r4++;
0x000127bc b 0x12780 |
| } while (1);
| label_10:
0x000127c0 cmp r3, 0 |
| if (r3 != 0) {
0x000127c4 bne 0x126f0 | goto label_0;
| }
| label_3:
0x000127c8 ldr r0, [pc, 0xcc] |
0x000127cc mov r3, r5 | r3 = r5;
0x000127d0 str r7, [sp, 4] | var_4h = r7;
0x000127d4 str sb, [sp] | *(sp) = sb;
0x000127d8 ldr r2, [pc, 0xc0] | r2 = stderr;
0x000127dc ldr r1, [pc, 0xd0] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x000127e0 ldr r0, [r0] | r0 = *(0x12898);
0x000127e4 bl 0x1098c | r0 = fprintf (r0, "%s: error!: \"%s\" is not a character device\n", r2, r3);
0x000127e8 bl 0x10a34 | errno_location ();
0x000127ec mov r3, 0x13 | r3 = 0x13;
0x000127f0 b 0x1272c | goto label_1;
| label_9:
0x000127f4 ldr r3, [fp, -0xac] | r3 = var_ach;
0x000127f8 cmp r3, sb |
| if (r3 != sb) {
0x000127fc bne 0x127b8 | goto label_2;
| }
| label_8:
0x00012800 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012804 cmp r4, r3 |
| if (r4 > r3) {
0x00012808 bgt 0x127c8 | goto label_3;
| }
0x0001280c cmp r7, 0 |
| if (r7 == 0) {
0x00012810 moveq r0, 1 | r0 = 1;
| goto label_11;
| }
| if (r7 == 0) {
| label_11:
0x00012814 beq 0x126f4 | goto label_4;
| }
0x00012818 sub r3, r7, 1 | r3 = r7 - 1;
0x0001281c mov r2, r4 | r2 = r4;
0x00012820 ldr r1, [r6, 0x40] | r1 = *((r6 + 0x40));
0x00012824 mov r0, r8 | r0 = r8;
0x00012828 bl 0x10a28 | sprintf (r0, r1, r2)
0x0001282c mov r1, 0 | r1 = 0;
0x00012830 mov r0, r8 | r0 = r8;
0x00012834 bl 0x10a04 | r0 = open64 ();
0x00012838 cmn r0, 1 |
| if (r0 == 1) {
0x0001283c beq 0x127c8 | goto label_3;
| }
0x00012840 bl 0x10a88 | r0 = close (r0);
0x00012844 cmp r0, 0 |
| if (r0 != 0) {
0x00012848 beq 0x12894 |
0x0001284c bl 0x10a34 | errno_location ();
0x00012850 ldr r5, [pc, 0x44] |
0x00012854 mov r3, r8 | r3 = r8;
0x00012858 ldr r2, [pc, 0x40] | r2 = stderr;
0x0001285c ldr r1, [pc, 0x54] | r1 = "%s: error!: \"%s\" has major:minor %d:%d, but this does not correspond to any existing UBI device or volume\n";
0x00012860 ldr r4, [r0] | r4 = *(r0);
0x00012864 ldr r0, [r5] | r0 = *(0x12898);
0x00012868 bl 0x1098c | fprintf (r0, "%s: error!: \"%s\" has major:minor %d:%d, but this does not correspond to any existing UBI device or volume\n", r2, r3, r4, r5);
0x0001286c mov r0, r4 | r0 = r4;
0x00012870 ldr r5, [r5] | r5 = *(0x12898);
0x00012874 bl 0x10908 | strerror (r0);
0x00012878 str r4, [sp] | *(sp) = r4;
0x0001287c ldr r3, [pc, 0x24] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x00012880 mov r2, 8 | r2 = 8;
0x00012884 ldr r1, [pc, 0x20] | r1 = *(0x128a8);
0x00012888 str r0, [sp, 4] | var_4h = r0;
0x0001288c mov r0, r5 | r0 = r5;
0x00012890 bl 0x1098c | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4);
| }
0x00012894 mov r0, 2 | r0 = 2;
0x00012898 b 0x126f4 | goto label_4;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubiupdatevol @ 0x12c74 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012c74 () | void fcn_00012c74 (int32_t arg2, char * s) {
| int32_t var_74h;
| int32_t var_ch_2;
| int32_t var_ch;
| r1 = arg2;
| r0 = s;
0x00012c74 push {r4, r5, fp, lr} |
0x00012c78 add fp, sp, 0xc |
0x00012c7c sub sp, sp, 0x68 |
0x00012c80 ldr r4, [r0, 0x10] | r4 = *((r0 + 0x10));
0x00012c84 mov r5, r1 | r5 = r1;
0x00012c88 mov r0, r4 | r0 = r4;
0x00012c8c bl 0x10a4c | strlen (r0);
0x00012c90 mov r2, r5 | r2 = r5;
0x00012c94 mov r1, r4 | r1 = r4;
0x00012c98 add r0, r0, 0x39 | r0 += 0x39;
0x00012c9c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012ca0 sub sp, sp, r0 |
0x00012ca4 mov r0, sp | r0 = sp;
0x00012ca8 bl 0x10a28 | sprintf (r0, r1, r2)
0x00012cac sub r1, fp, 0x74 | r1 -= var_74h;
0x00012cb0 mov r0, sp | r0 = sp;
0x00012cb4 bl 0x10914 | r0 = stat64 ();
0x00012cb8 clz r0, r0 | r0 &= r0;
0x00012cbc lsr r0, r0, 5 | r0 >>= 5;
0x00012cc0 sub sp, fp, 0xc |
0x00012cc4 pop {r4, r5, fp, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubiupdatevol @ 0x12cc8 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012cc8 () | void fcn_00012cc8 (int32_t arg1, int32_t arg2) {
| int32_t var_128h;
| int32_t var_124h;
| int32_t var_0h;
| int32_t var_4h;
| char * s;
| int32_t var_20h_2;
| int32_t var_20h;
| r0 = arg1;
| r1 = arg2;
0x00012cc8 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012ccc add sl, r2, 4 | sl = r2 + 4;
0x00012cd0 add fp, sp, 0x20 |
0x00012cd4 sub sp, sp, 0x114 |
0x00012cd8 mov r6, r1 | r6 = r1;
0x00012cdc mov r5, r0 | r5 = r0;
0x00012ce0 mov r4, r2 | r4 = r2;
0x00012ce4 mov r1, 0 | r1 = 0;
0x00012ce8 mov r2, 0x54 | r2 = 0x54;
0x00012cec mov r0, sl | r0 = sl;
0x00012cf0 bl 0x109f8 | memset (r0, r1, r2);
0x00012cf4 str r6, [r4] | *(r4) = r6;
0x00012cf8 mov r1, r6 | r1 = r6;
0x00012cfc mov r0, r5 | r0 = r5;
0x00012d00 bl 0x12c74 | r0 = fcn_00012c74 (r0, r1);
0x00012d04 cmp r0, 0 |
0x00012d08 bne 0x12d14 |
| while (r8 == r0) {
| label_0:
0x00012d0c mvn r0, 0 | r0 = ~0;
0x00012d10 b 0x12fd8 | goto label_3;
0x00012d14 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00012d18 bl 0x10a10 | r0 = opendir ();
0x00012d1c subs r8, r0, 0 | r8 = r0 - 0;
0x00012d20 beq 0x12d0c |
| }
0x00012d24 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00012d28 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x00012d2c bl 0x10a34 | r0 = errno_location ();
0x00012d30 mov sb, r0 | sb = r0;
| do {
| label_1:
0x00012d34 mov r3, 0 | r3 = 0;
0x00012d38 str r3, [sb] | *(sb) = r3;
0x00012d3c mov r0, r8 | r0 = r8;
0x00012d40 bl 0x109c8 | r0 = readdir64 ();
0x00012d44 cmp r0, 0 |
| if (r0 == 0) {
0x00012d48 beq 0x12de4 | goto label_4;
| }
0x00012d4c add r7, r0, 0x13 | r7 = r0 + 0x13;
0x00012d50 mov r0, r7 | r0 = r7;
0x00012d54 bl 0x10a4c | r0 = strlen (r0);
0x00012d58 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00012d5c bls 0x12d88 |
0x00012d60 ldr r0, [pc, 0x278] |
0x00012d64 str r7, [sp] | *(sp) = r7;
0x00012d68 ldr r2, [pc, 0x274] | r2 = stderr;
0x00012d6c ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012d70 ldr r1, [pc, 0x270] | r1 = "libubi";
0x00012d74 ldr r0, [r0] | r0 = *(0x12fdc);
0x00012d78 bl 0x1098c | fprintf (r0, "libubi", r2, r3);
| label_2:
0x00012d7c mov r0, r8 | r0 = r8;
0x00012d80 bl 0x10a70 | closedir ();
0x00012d84 b 0x12d0c | goto label_0;
| }
0x00012d88 sub r3, fp, 0x124 | r3 -= var_124h;
0x00012d8c str r3, [sp] | *(sp) = r3;
0x00012d90 sub r2, fp, 0x128 | r2 -= var_128h;
0x00012d94 sub r3, fp, 0x12c | r3 -= s;
0x00012d98 ldr r1, [pc, 0x24c] | r1 = "_s:_error_:_invalid_entry_in__s:___s_";
0x00012d9c mov r0, r7 | r0 = r7;
0x00012da0 bl 0x109d4 | r0 = sscanf (r0, "_s:_error_:_invalid_entry_in__s:___s_", r2);
0x00012da4 cmp r0, 2 |
0x00012da8 bne 0x12d34 |
| } while (r0 != 2);
0x00012dac ldr r3, [fp, -0x128] | r3 = var_128h;
0x00012db0 cmp r3, r6 |
| if (r3 != r6) {
0x00012db4 bne 0x12d34 | goto label_1;
| }
0x00012db8 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00012dbc ldr r2, [r4, 0x10] | r2 = *((r4 + 0x10));
0x00012dc0 add r3, r3, 1 | r3++;
0x00012dc4 str r3, [r4, 8] | *((r4 + 8)) = r3;
0x00012dc8 ldr r3, [fp, -0x12c] | r3 = s;
0x00012dcc cmp r2, r3 |
0x00012dd0 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
| if (r2 >= r3) {
0x00012dd4 strlt r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x00012dd8 cmp r3, r2 |
| if (r3 >= r2) {
0x00012ddc strlt r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
| }
0x00012de0 b 0x12d34 | goto label_1;
| label_4:
0x00012de4 ldr r7, [sb] | r7 = *(sb);
0x00012de8 cmp r7, 0 |
| if (r7 != 0) {
0x00012dec beq 0x12e34 |
0x00012df0 ldr r4, [pc, 0x1e8] |
0x00012df4 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012df8 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x00012dfc ldr r1, [pc, 0x1ec] | r1 = "ubi_d__d_s";
0x00012e00 ldr r0, [r4] | r0 = *(0x12fdc);
0x00012e04 bl 0x1098c | fprintf (r0, "ubi_d__d_s", r2, r3, r4);
0x00012e08 mov r0, r7 | r0 = r7;
0x00012e0c ldr r4, [r4] | r4 = *(0x12fdc);
0x00012e10 bl 0x10908 | strerror (r0);
0x00012e14 str r7, [sp] | *(sp) = r7;
0x00012e18 ldr r3, [pc, 0x1d4] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x00012e1c mov r2, 8 | r2 = 8;
0x00012e20 ldr r1, [pc, 0x1d0] | r1 = *(0x12ff4);
0x00012e24 str r0, [sp, 4] | var_4h = r0;
0x00012e28 mov r0, r4 | r0 = r4;
0x00012e2c bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n");
0x00012e30 b 0x12d7c | goto label_2;
| }
0x00012e34 mov r0, r8 | r0 = r8;
0x00012e38 bl 0x10a70 | r0 = closedir ();
0x00012e3c cmp r0, 0 |
| if (r0 != 0) {
0x00012e40 beq 0x12e8c |
0x00012e44 ldr r6, [pc, 0x194] | r6 = *(0x12fdc);
0x00012e48 ldr r4, [sb] | r4 = *(sb);
0x00012e4c ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012e50 ldr r2, [pc, 0x18c] | r2 = stderr;
0x00012e54 ldr r1, [pc, 0x1a0] | r1 = "%*serror %d (%s)\n";
0x00012e58 ldr r0, [r6] | r0 = *(0x12fdc);
0x00012e5c bl 0x1098c | fprintf (r0, "%*serror %d (%s)\n", r2, r3, r4, r5, r6);
0x00012e60 mov r0, r4 | r0 = r4;
0x00012e64 ldr r5, [r6] | r5 = *(0x12fdc);
0x00012e68 bl 0x10908 | strerror (r0);
0x00012e6c str r4, [sp] | *(sp) = r4;
0x00012e70 ldr r3, [pc, 0x17c] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x00012e74 mov r2, 8 | r2 = 8;
0x00012e78 ldr r1, [pc, 0x178] | r1 = *(0x12ff4);
0x00012e7c str r0, [sp, 4] | var_4h = r0;
0x00012e80 mov r0, r5 | r0 = r5;
0x00012e84 bl 0x1098c | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n", r4);
0x00012e88 b 0x12d0c | goto label_0;
| }
0x00012e8c ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00012e90 add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00012e94 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00012e98 streq r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| }
0x00012e9c add r3, r4, 0x18 | r3 = r4 + 0x18;
0x00012ea0 mov r1, r6 | r1 = r6;
0x00012ea4 add r0, r5, 0x18 | r0 = r5 + 0x18;
0x00012ea8 bl 0x11c98 | r0 = fcn_00011c98 (r0, r1);
0x00012eac cmp r0, 0 |
| if (r0 != 0) {
0x00012eb0 bne 0x12d0c | goto label_0;
| }
0x00012eb4 mov r2, sl | r2 = sl;
0x00012eb8 mov r1, r6 | r1 = r6;
0x00012ebc ldr r0, [r5, 0x3c] | r0 = *((r5 + 0x3c));
0x00012ec0 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012ec4 cmp r0, 0 |
| if (r0 != 0) {
0x00012ec8 bne 0x12d0c | goto label_0;
| }
0x00012ecc add r2, r4, 0x20 | r2 = r4 + 0x20;
0x00012ed0 mov r1, r6 | r1 = r6;
0x00012ed4 ldr r0, [r5, 0x1c] | r0 = *((r5 + 0x1c));
0x00012ed8 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012edc cmp r0, 0 |
| if (r0 != 0) {
0x00012ee0 bne 0x12d0c | goto label_0;
| }
0x00012ee4 add r2, r4, 0x1c | r2 = r4 + 0x1c;
0x00012ee8 mov r1, r6 | r1 = r6;
0x00012eec ldr r0, [r5, 0x20] | r0 = *((r5 + 0x20));
0x00012ef0 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012ef4 cmp r0, 0 |
| if (r0 != 0) {
0x00012ef8 bne 0x12d0c | goto label_0;
| }
0x00012efc add r2, r4, 0x38 | r2 = r4 + 0x38;
0x00012f00 mov r1, r6 | r1 = r6;
0x00012f04 ldr r0, [r5, 0x24] | r0 = *((r5 + 0x24));
0x00012f08 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012f0c cmp r0, 0 |
| if (r0 != 0) {
0x00012f10 bne 0x12d0c | goto label_0;
| }
0x00012f14 add r2, r4, 0x3c | r2 = r4 + 0x3c;
0x00012f18 mov r1, r6 | r1 = r6;
0x00012f1c ldr r0, [r5, 0x28] | r0 = *((r5 + 0x28));
0x00012f20 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012f24 cmp r0, 0 |
| if (r0 != 0) {
0x00012f28 bne 0x12d0c | goto label_0;
| }
0x00012f2c add r2, r4, 0x48 | r2 = r4 + 0x48;
0x00012f30 mov r1, r6 | r1 = r6;
0x00012f34 ldr r0, [r5, 0x30] | r0 = *((r5 + 0x30));
0x00012f38 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012f3c cmp r0, 0 |
| if (r0 != 0) {
0x00012f40 bne 0x12d0c | goto label_0;
| }
0x00012f44 ldr r8, [r5, 0x2c] | r8 = *((r5 + 0x2c));
0x00012f48 mov sb, sp | sb = sp;
0x00012f4c mov r0, r8 | r0 = r8;
0x00012f50 bl 0x10a4c | strlen (r0);
0x00012f54 mov r2, r6 | r2 = r6;
0x00012f58 mov r1, r8 | r1 = r8;
0x00012f5c add r0, r0, 0x39 | r0 += 0x39;
0x00012f60 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012f64 sub sp, sp, r0 |
0x00012f68 add r7, sp, 8 | r7 += s;
0x00012f6c mov r0, r7 | r0 = r7;
0x00012f70 bl 0x10a28 | sprintf (r0, r1, r2)
0x00012f74 add r1, r4, 0x40 | r1 = r4 + 0x40;
0x00012f78 mov r0, r7 | r0 = r7;
0x00012f7c bl 0x11588 | fcn_00011588 (r0, r1);
0x00012f80 mov sp, sb |
0x00012f84 cmp r0, 0 |
| if (r0 != 0) {
0x00012f88 bne 0x12d0c | goto label_0;
| }
0x00012f8c add r2, r4, 0x4c | r2 = r4 + 0x4c;
0x00012f90 mov r1, r6 | r1 = r6;
0x00012f94 ldr r0, [r5, 0x34] | r0 = *((r5 + 0x34));
0x00012f98 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012f9c cmp r0, 0 |
| if (r0 != 0) {
0x00012fa0 bne 0x12d0c | goto label_0;
| }
0x00012fa4 add r2, r4, 0x50 | r2 = r4 + 0x50;
0x00012fa8 mov r1, r6 | r1 = r6;
0x00012fac ldr r0, [r5, 0x38] | r0 = *((r5 + 0x38));
0x00012fb0 bl 0x117ac | r0 = fcn_000117ac (r0, r1);
0x00012fb4 cmp r0, 0 |
| if (r0 != 0) {
0x00012fb8 bne 0x12d0c | goto label_0;
| }
0x00012fbc ldr r3, [r4, 0x3c] | r3 = *((r4 + 0x3c));
0x00012fc0 ldr r2, [r4, 0x20] | r2 = *((r4 + 0x20));
0x00012fc4 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x00012fc8 ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x00012fcc strd r6, r7, [r4, 0x30] | __asm ("strd r6, r7, [r4, 0x30]");
0x00012fd0 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x00012fd4 strd r6, r7, [r4, 0x28] | __asm ("strd r6, r7, [r4, 0x28]");
| label_3:
0x00012fd8 sub sp, fp, 0x20 |
0x00012fdc pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubiupdatevol @ 0x131f0 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000131f0 () | void fcn_000131f0 (int32_t arg1, int32_t arg2) {
| char * s1;
| int32_t var_0h;
| int32_t var_20h_2;
| int32_t var_20h;
| r0 = arg1;
| r1 = arg2;
0x000131f0 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000131f4 add sb, r3, 8 | sb = r3 + 8;
0x000131f8 add fp, sp, 0x20 |
0x000131fc sub sp, sp, 0x3c |
0x00013200 mov r5, r1 | r5 = r1;
0x00013204 mov r6, r2 | r6 = r2;
0x00013208 mov r1, 0 | r1 = 0;
0x0001320c mov r2, 0xb0 | r2 = 0xb0;
0x00013210 mov r7, r0 | r7 = r0;
0x00013214 mov r0, sb | r0 = sb;
0x00013218 mov r4, r3 | r4 = r3;
0x0001321c bl 0x109f8 | memset (r0, r1, r2);
0x00013220 ldr sl, [r7, 0x48] | sl = *((r7 + 0x48));
0x00013224 stm r4, {r5, r6} | *(r4) = r5;
| *((r4 + 4)) = r6;
0x00013228 mov r0, sl | r0 = sl;
0x0001322c bl 0x10a4c | strlen (r0);
0x00013230 mov r8, sp | r8 = sp;
0x00013234 mov r3, r6 | r3 = r6;
0x00013238 mov r2, r5 | r2 = r5;
0x0001323c mov r1, sl | r1 = sl;
0x00013240 add r0, r0, 0x6b | r0 += 0x6b;
0x00013244 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013248 sub sp, sp, r0 |
0x0001324c mov r0, sp | r0 = sp;
0x00013250 bl 0x10a28 | sprintf (r0, r1, r2)
0x00013254 mov r0, sp | r0 = sp;
0x00013258 add r2, r4, 0xc | r2 = r4 + 0xc;
0x0001325c mov r1, sb | r1 = sb;
0x00013260 bl 0x11bc0 | fcn_00011bc0 (r0, r1);
0x00013264 mov sp, r8 |
0x00013268 cmp r0, 0 |
0x0001326c beq 0x13280 |
| while (r8 < r0) {
| label_0:
0x00013270 mvn r8, 0 | r8 = ~0;
| label_1:
0x00013274 mov r0, r8 | r0 = r8;
0x00013278 sub sp, fp, 0x20 |
0x0001327c pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00013280 ldr sb, [r7, 0x44] | sb = *((r7 + 0x44));
0x00013284 mov r0, sb | r0 = sb;
0x00013288 bl 0x10a4c | strlen (r0);
0x0001328c mov r3, r6 | r3 = r6;
0x00013290 mov r2, r5 | r2 = r5;
0x00013294 mov r1, sb | r1 = sb;
0x00013298 add r0, r0, 0x6b | r0 += 0x6b;
0x0001329c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000132a0 sub sp, sp, r0 |
0x000132a4 mov r0, sp | r0 = sp;
0x000132a8 bl 0x10a28 | sprintf (r0, r1, r2)
0x000132ac mov r0, sp | r0 = sp;
0x000132b0 mov r2, 0x32 | r2 = 0x32;
0x000132b4 sub r1, fp, 0x58 | r1 -= s1;
0x000132b8 bl 0x11844 | fcn_00011844 (r0, r1);
0x000132bc mov sp, r8 |
0x000132c0 subs r8, r0, 0 | r8 = r0 - 0;
0x000132c4 blt 0x13270 |
| }
0x000132c8 mov r2, r8 | r2 = r8;
0x000132cc ldr r1, [pc, 0x174] | r1 = *(0x13444);
0x000132d0 sub r0, fp, 0x58 | r0 -= s1;
0x000132d4 bl 0x109b0 | r0 = strncmp (r0, r1, r2);
0x000132d8 cmp r0, 0 |
| if (r0 != 0) {
0x000132dc moveq r3, 4 | r3 = 4;
| }
| if (r0 != 0) {
0x000132e0 beq 0x13300 |
0x000132e4 mov r2, r8 | r2 = r8;
0x000132e8 ldr r1, [pc, 0x15c] | r1 = "static";
0x000132ec sub r0, fp, 0x58 | r0 -= s1;
0x000132f0 bl 0x109b0 | r0 = strncmp (r0, "static", r2);
0x000132f4 cmp r0, 0 |
| if (r0 != 0) {
0x000132f8 bne 0x13420 | goto label_2;
| }
0x000132fc mov r3, 3 | r3 = 3;
| }
0x00013300 str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x00013304 mov r2, r6 | r2 = r6;
0x00013308 add r3, r4, 0x14 | r3 = r4 + 0x14;
0x0001330c mov r1, r5 | r1 = r5;
0x00013310 ldr r0, [r7, 0x4c] | r0 = *((r7 + 0x4c));
0x00013314 bl 0x117f4 | r0 = fcn_000117f4 (r0, r1);
0x00013318 cmp r0, 0 |
| if (r0 != 0) {
0x0001331c bne 0x13270 | goto label_0;
| }
0x00013320 ldr r8, [r7, 0x50] | r8 = *((r7 + 0x50));
0x00013324 mov sb, sp | sb = sp;
0x00013328 mov r0, r8 | r0 = r8;
0x0001332c bl 0x10a4c | strlen (r0);
0x00013330 mov r3, r6 | r3 = r6;
0x00013334 mov r2, r5 | r2 = r5;
0x00013338 mov r1, r8 | r1 = r8;
0x0001333c add r0, r0, 0x6b | r0 += 0x6b;
0x00013340 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013344 sub sp, sp, r0 |
0x00013348 mov r0, sp | r0 = sp;
0x0001334c bl 0x10a28 | sprintf (r0, r1, r2)
0x00013350 mov r0, sp | r0 = sp;
0x00013354 add r1, r4, 0x18 | r1 = r4 + 0x18;
0x00013358 bl 0x11588 | fcn_00011588 (r0, r1);
0x0001335c mov sp, sb |
0x00013360 cmp r0, 0 |
| if (r0 != 0) {
0x00013364 bne 0x13270 | goto label_0;
| }
0x00013368 add r3, r4, 0x28 | r3 = r4 + 0x28;
0x0001336c mov r2, r6 | r2 = r6;
0x00013370 mov r1, r5 | r1 = r5;
0x00013374 ldr r0, [r7, 0x54] | r0 = *((r7 + 0x54));
0x00013378 bl 0x117f4 | r0 = fcn_000117f4 (r0, r1);
0x0001337c cmp r0, 0 |
| if (r0 != 0) {
0x00013380 bne 0x13270 | goto label_0;
| }
0x00013384 add r3, r4, 0x2c | r3 = r4 + 0x2c;
0x00013388 mov r2, r6 | r2 = r6;
0x0001338c mov r1, r5 | r1 = r5;
0x00013390 ldr r0, [r7, 0x58] | r0 = *((r7 + 0x58));
0x00013394 bl 0x117f4 | r0 = fcn_000117f4 (r0, r1);
0x00013398 cmp r0, 0 |
| if (r0 != 0) {
0x0001339c bne 0x13270 | goto label_0;
| }
0x000133a0 add r3, r4, 0x30 | r3 = r4 + 0x30;
0x000133a4 mov r2, r6 | r2 = r6;
0x000133a8 mov r1, r5 | r1 = r5;
0x000133ac ldr r0, [r7, 0x5c] | r0 = *((r7 + 0x5c));
0x000133b0 bl 0x117f4 | r0 = fcn_000117f4 (r0, r1);
0x000133b4 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 != r0) {
0x000133b8 bne 0x13270 | goto label_0;
| }
0x000133bc ldr r1, [r4, 0x28] | r1 = *((r4 + 0x28));
0x000133c0 ldr r0, [r4, 0x2c] | r0 = *((r4 + 0x2c));
0x000133c4 ldr r7, [r7, 0x60] | r7 = *((r7 + 0x60));
0x000133c8 smull r2, r3, r0, r1 | r2:r3 = r0 * r1;
0x000133cc mov r0, r7 | r0 = r7;
0x000133d0 strd r2, r3, [r4, 0x20] | __asm ("strd r2, r3, [r4, 0x20]");
0x000133d4 bl 0x10a4c | strlen (r0);
0x000133d8 mov r3, r6 | r3 = r6;
0x000133dc mov r2, r5 | r2 = r5;
0x000133e0 mov r1, r7 | r1 = r7;
0x000133e4 add r0, r0, 0x6b | r0 += 0x6b;
0x000133e8 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000133ec sub sp, sp, r0 |
0x000133f0 mov r0, sp | r0 = sp;
0x000133f4 bl 0x10a28 | sprintf (r0, r1, r2)
0x000133f8 mov r0, sp | r0 = sp;
0x000133fc mov r2, 0x81 | r2 = 0x81;
0x00013400 add r1, r4, 0x34 | r1 = r4 + 0x34;
0x00013404 bl 0x11844 | fcn_00011844 (r0, r1);
0x00013408 mov sp, sb |
0x0001340c cmp r0, 0 |
| if (r0 < 0) {
0x00013410 blt 0x13270 | goto label_0;
| }
0x00013414 add r4, r4, r0 | r4 += r0;
0x00013418 strb r8, [r4, 0x33] | *((r4 + 0x33)) = r8;
0x0001341c b 0x13274 | goto label_1;
| label_2:
0x00013420 ldr r0, [pc, 0x28] |
0x00013424 sub r3, fp, 0x58 | r3 -= s1;
0x00013428 ldr r2, [pc, 0x24] | r2 = stderr;
0x0001342c ldr r1, [pc, 0x24] | r1 = "libubi";
0x00013430 ldr r0, [r0] | r0 = "dynamic";
0x00013434 bl 0x1098c | r0 = fprintf ("dynamic", "libubi", r2, r3);
0x00013438 bl 0x10a34 | errno_location ();
0x0001343c mov r3, 0x16 | r3 = 0x16;
0x00013440 str r3, [r0] | *(r0) = r3;
0x00013444 b 0x13270 | goto label_0;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/sbin/ubiupdatevol @ 0x1345c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.0001345c () | void fcn_0001345c (int32_t arg1, int32_t arg2) {
| int32_t var_b4h;
| int32_t var_b0h;
| int32_t var_ach;
| int32_t var_a8h;
| int32_t var_a4h;
| int32_t var_a0h;
| int32_t var_9ch;
| int32_t var_8ch;
| int32_t var_7ch;
| int32_t var_6ch;
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_bch;
| int32_t var_sp_6ch;
| int32_t var_20h_2;
| int32_t var_20h;
| r0 = arg1;
| r1 = arg2;
0x0001345c push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013460 add fp, sp, 0x20 |
0x00013464 sub sp, sp, 0xa4 |
0x00013468 mov r5, r0 | r5 = r0;
0x0001346c mov r6, r1 | r6 = r1;
0x00013470 mov sb, r2 | sb = r2;
0x00013474 bl 0x1266c | r0 = fcn_0001266c (r0, r1);
0x00013478 cmp r0, 2 |
| if (r0 == 2) {
0x0001347c beq 0x134a4 | goto label_7;
| }
0x00013480 cmp r0, 1 |
0x00013484 beq 0x13494 |
| while (1) {
| label_0:
0x00013488 mvn r0, 0 | r0 = ~0;
| label_1:
0x0001348c sub sp, fp, 0x20 |
0x00013490 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00013494 bl 0x10a34 | errno_location ();
0x00013498 mov r3, 0x13 | r3 = 0x13;
0x0001349c str r3, [r0] | *(r0) = r3;
0x000134a0 b 0x13488 |
| }
| label_7:
0x000134a4 ldr r0, [r5, 0x40] | r0 = *((r5 + 0x40));
0x000134a8 str sp, [fp, -0xb0] | var_b0h = sp;
0x000134ac bl 0x10a4c | strlen (r0);
0x000134b0 sub r1, fp, 0x8c | r1 -= var_8ch;
0x000134b4 add r0, r0, 0x6b | r0 += 0x6b;
0x000134b8 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000134bc sub sp, sp, r0 |
0x000134c0 mov r0, r6 | r0 = r6;
0x000134c4 bl 0x10914 | stat64 ();
0x000134c8 add r7, sp, 8 | r7 += var_8h;
0x000134cc cmp r0, 0 |
| if (r0 != 0) {
0x000134d0 beq 0x13520 |
0x000134d4 bl 0x10a34 | errno_location ();
0x000134d8 ldr sl, [pc, 0x200] | sl = obj.stderr;
0x000134dc mov r3, r6 | r3 = r6;
0x000134e0 ldr r2, [pc, 0x1fc] | r2 = stderr;
0x000134e4 ldr r1, [pc, 0x1fc] | r1 = "libubi";
0x000134e8 ldr r7, [r0] | r7 = *(r0);
0x000134ec ldr r0, [sl] | r0 = *(sl);
0x000134f0 bl 0x1098c | fprintf (r0, "libubi", r2, r3);
0x000134f4 mov r0, r7 | r0 = r7;
0x000134f8 ldr r6, [sl] | r6 = *(sl);
0x000134fc bl 0x10908 | strerror (r0);
0x00013500 ldr r3, [pc, 0x1e4] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x00013504 ldr r1, [pc, 0x1e4] | r1 = *(0x136ec);
0x00013508 mov r2, 8 | r2 = 8;
0x0001350c str r7, [sp] | *(sp) = r7;
0x00013510 str r0, [sp, 4] | var_4h = r0;
0x00013514 mov r0, r6 | r0 = r6;
| label_6:
0x00013518 bl 0x1098c | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_");
0x0001351c b 0x13554 |
| } else {
0x00013520 ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x00013524 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00013528 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x0001352c beq 0x1357c | goto label_8;
| }
0x00013530 bl 0x10a34 | errno_location ();
0x00013534 ldr r2, [pc, 0x1a8] | r2 = stderr;
0x00013538 ldr r1, [pc, 0x1b4] | r1 = "%*serror %d (%s)\n";
0x0001353c mov r3, 0x16 | r3 = 0x16;
0x00013540 str r3, [r0] | *(r0) = r3;
0x00013544 mov r3, r6 | r3 = r6;
| label_2:
0x00013548 ldr r0, [pc, 0x190] |
0x0001354c ldr r0, [r0] | r0 = *(0x136dc);
0x00013550 bl 0x1098c | fprintf (r0, "%*serror %d (%s)\n", r2, r3);
| }
| label_3:
0x00013554 mvn r3, 0 | r3 = ~0;
| label_5:
0x00013558 cmp r3, 0 |
0x0001355c ldr sp, [fp, -0xb0] | sp = var_b0h;
| if (r3 != 0) {
0x00013560 bne 0x13488 | goto label_0;
| }
0x00013564 mov r3, sb | r3 = sb;
0x00013568 mov r2, r8 | r2 = r8;
0x0001356c mov r1, r4 | r1 = r4;
0x00013570 mov r0, r5 | r0 = r5;
0x00013574 bl 0x131f0 | fcn_000131f0 (r0, r1);
0x00013578 b 0x1348c | goto label_1;
| label_8:
0x0001357c ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x00013580 mov r1, r3 | r1 = r3;
0x00013584 mov r0, r2 | r0 = r2;
0x00013588 strd r2, r3, [fp, -0xbc] | __asm ("strd r2, r3, [var_8h]");
0x0001358c bl 0x1092c | gnu_dev_major ();
0x00013590 ldrd r2, r3, [fp, -0xbc] | __asm ("ldrd r2, r3, [var_8h]");
0x00013594 mov r1, r3 | r1 = r3;
0x00013598 mov sl, r0 | sl = r0;
0x0001359c mov r0, r2 | r0 = r2;
0x000135a0 bl 0x1095c | r0 = gnu_dev_minor ();
0x000135a4 subs r3, r0, 0 | r3 = r0 - 0;
0x000135a8 str r3, [fp, -0xbc] | var_8h = r3;
| if (r3 == r0) {
0x000135ac bne 0x135cc |
0x000135b0 bl 0x10a34 | errno_location ();
0x000135b4 mov r3, 0x16 | r3 = 0x16;
0x000135b8 ldr r2, [pc, 0x124] | r2 = stderr;
0x000135bc ldr r1, [pc, 0x134] | r1 = "%s: error!: \"%s\" is not a character device\n";
0x000135c0 str r3, [r0] | *(r0) = r3;
0x000135c4 mov r3, r6 | r3 = r6;
0x000135c8 b 0x13548 | goto label_2;
| }
0x000135cc sub r1, fp, 0xa4 | r1 -= var_a4h;
0x000135d0 mov r0, r5 | r0 = r5;
0x000135d4 bl 0x1233c | r0 = fcn_0001233c (r0, r1);
0x000135d8 cmp r0, 0 |
| if (r0 != 0) {
0x000135dc bne 0x13554 | goto label_3;
| }
0x000135e0 bl 0x10a34 | errno_location ();
0x000135e4 ldr r4, [fp, -0xa0] | r4 = var_a0h;
0x000135e8 add r3, r5, 0x18 | r3 = r5 + 0x18;
0x000135ec str r3, [fp, -0xb4] | var_b4h = r3;
0x000135f0 mov r6, r0 | r6 = r0;
| label_4:
0x000135f4 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x000135f8 cmp r4, r3 |
| if (r4 > r3) {
0x000135fc bgt 0x1363c | goto label_9;
| }
0x00013600 sub r3, fp, 0xa8 | r3 -= var_a8h;
0x00013604 sub r2, fp, 0xac | r2 -= var_ach;
0x00013608 mov r1, r4 | r1 = r4;
0x0001360c ldr r0, [fp, -0xb4] | r0 = var_b4h;
0x00013610 bl 0x11c98 | r0 = fcn_00011c98 (r0, r1);
0x00013614 cmp r0, 0 |
| if (r0 == 0) {
0x00013618 beq 0x13630 | goto label_10;
| }
0x0001361c ldr r3, [r6] | r3 = *(r6);
0x00013620 cmp r3, 2 |
| if (r3 != 2) {
0x00013624 bne 0x13554 | goto label_3;
| }
| do {
0x00013628 add r4, r4, 1 | r4++;
0x0001362c b 0x135f4 | goto label_4;
| label_10:
0x00013630 ldr r3, [fp, -0xac] | r3 = var_ach;
0x00013634 cmp sl, r3 |
0x00013638 bne 0x13628 |
| } while (sl != r3);
| label_9:
0x0001363c ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00013640 cmp r4, r3 |
| if (r4 <= r3) {
0x00013644 movgt r3, 0x13 | r3 = 0x13;
| }
| if (r4 > r3) {
0x00013648 strgt r3, [r6] | *(r6) = r3;
| goto label_11;
| }
| if (r4 > r3) {
| label_11:
0x0001364c bgt 0x13554 | goto label_3;
| }
0x00013650 ldr r3, [fp, -0xbc] | r3 = var_8h;
0x00013654 mov r2, r4 | r2 = r4;
0x00013658 sub r8, r3, 1 | r8 = r3 - 1;
0x0001365c mov r3, r8 | r3 = r8;
0x00013660 ldr r1, [r5, 0x40] | r1 = *((r5 + 0x40));
0x00013664 mov r0, r7 | r0 = r7;
0x00013668 bl 0x10a28 | sprintf (r0, r1, r2)
0x0001366c mov r1, 0 | r1 = 0;
0x00013670 mov r0, r7 | r0 = r7;
0x00013674 bl 0x10a04 | r0 = open64 ();
0x00013678 cmn r0, 1 |
| if (r0 != 1) {
0x0001367c moveq r2, 0x13 | r2 = 0x13;
| }
0x00013680 mov r3, r0 | r3 = r0;
| if (r0 == 1) {
0x00013684 streq r2, [r6] | *(r6) = r2;
| goto label_12;
| }
| if (r0 == 1) {
| label_12:
0x00013688 beq 0x13558 | goto label_5;
| }
0x0001368c bl 0x10a88 | r0 = close (r0);
0x00013690 subs r3, r0, 0 | r3 = r0 - 0;
| if (r3 == r0) {
0x00013694 streq r3, [r6] | *(r6) = r3;
| goto label_13;
| }
| if (r3 == r0) {
| label_13:
0x00013698 beq 0x13558 | goto label_5;
| }
0x0001369c ldr sl, [pc, 0x3c] | sl = obj.stderr;
0x000136a0 ldr r6, [r6] | r6 = *(r6);
0x000136a4 mov r3, r7 | r3 = r7;
0x000136a8 ldr r2, [pc, 0x34] | r2 = stderr;
0x000136ac ldr r1, [pc, 0x48] | r1 = "_s:_error_:___s__is_not_a_volume_character_device";
0x000136b0 ldr r0, [sl] | r0 = *(sl);
0x000136b4 bl 0x1098c | fprintf (r0, "_s:_error_:___s__is_not_a_volume_character_device", r2, r3, r4, r5, r6);
0x000136b8 mov r0, r6 | r0 = r6;
0x000136bc ldr r7, [sl] | r7 = *(sl);
0x000136c0 bl 0x10908 | strerror (r0);
0x000136c4 str r6, [sp] | *(sp) = r6;
0x000136c8 ldr r3, [pc, 0x1c] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x000136cc mov r2, 8 | r2 = 8;
0x000136d0 ldr r1, [pc, 0x18] | r1 = *(0x136ec);
0x000136d4 str r0, [sp, 4] | var_4h = r0;
0x000136d8 mov r0, r7 | r0 = r7;
0x000136dc b 0x13518 | goto label_6;
| }
[*] Function sprintf used 11 times ubiupdatevol