[*] Binary protection state of ubinfo
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function sprintf tear down of ubinfo
; 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/ubinfo @ 0x11e60 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00011e60 () | void fcn_00011e60 (int32_t arg1, int32_t arg2) {
| int32_t var_14h_2;
| int32_t var_14h;
| r0 = arg1;
| r1 = arg2;
0x00011e60 push {r4, r5, r6, r7, fp, lr} |
0x00011e64 add fp, sp, 0x14 |
0x00011e68 mov r6, r1 | r6 = r1;
0x00011e6c mov r7, r2 | r7 = r2;
0x00011e70 mov r4, r3 | r4 = r3;
0x00011e74 mov r5, r0 | r5 = r0;
0x00011e78 bl 0x10b3c | strlen (r0);
0x00011e7c mov r3, r7 | r3 = r7;
0x00011e80 mov r2, r6 | r2 = r6;
0x00011e84 mov r1, r5 | r1 = r5;
0x00011e88 add r0, r0, 0x6b | r0 += 0x6b;
0x00011e8c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00011e90 sub sp, sp, r0 |
0x00011e94 mov r0, sp | r0 = sp;
0x00011e98 bl 0x10b18 | sprintf (r0, r1, r2)
0x00011e9c mov r1, r4 | r1 = r4;
0x00011ea0 mov r0, sp | r0 = sp;
0x00011ea4 bl 0x11da4 | fcn_00011da4 (r0, r1);
0x00011ea8 sub sp, fp, 0x14 |
0x00011eac 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/ubinfo @ 0x12304 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012304 () | void fcn_00012304 (int32_t arg2, char * s) {
| int32_t var_14h_2;
| int32_t var_14h;
| r1 = arg2;
| r0 = s;
0x00012304 push {r4, r5, r6, r7, fp, lr} |
0x00012308 ldr r4, [r0] | r4 = *(r0);
0x0001230c add fp, sp, 0x14 |
0x00012310 mov r0, r4 | r0 = r4;
0x00012314 mov r6, r3 | r6 = r3;
0x00012318 mov r7, r1 | r7 = r1;
0x0001231c mov r5, r2 | r5 = r2;
0x00012320 bl 0x10b3c | strlen (r0);
0x00012324 mov r2, r7 | r2 = r7;
0x00012328 mov r1, r4 | r1 = r4;
0x0001232c add r0, r0, 0x39 | r0 += 0x39;
0x00012330 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012334 sub sp, sp, r0 |
0x00012338 mov r0, sp | r0 = sp;
0x0001233c bl 0x10b18 | sprintf (r0, r1, r2)
0x00012340 mov r2, r6 | r2 = r6;
0x00012344 mov r1, r5 | r1 = r5;
0x00012348 mov r0, sp | r0 = sp;
0x0001234c bl 0x1222c | fcn_0001222c (r0, r1);
0x00012350 sub sp, fp, 0x14 |
0x00012354 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/ubinfo @ 0x12cd8 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012cd8 () | void fcn_00012cd8 (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;
0x00012cd8 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012cdc add fp, sp, 0x20 |
0x00012ce0 sub sp, sp, 0x9c |
0x00012ce4 mov r6, r0 | r6 = r0;
0x00012ce8 ldr r0, [r0, 0x40] | r0 = *((r0 + 0x40));
0x00012cec mov r5, r1 | r5 = r1;
0x00012cf0 bl 0x10b3c | strlen (r0);
0x00012cf4 sub r1, fp, 0x8c | r1 -= var_8ch;
0x00012cf8 add r0, r0, 0x6b | r0 += 0x6b;
0x00012cfc bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012d00 sub sp, sp, r0 |
0x00012d04 mov r0, r5 | r0 = r5;
0x00012d08 bl 0x109e0 | r0 = stat64 ();
0x00012d0c cmp r0, 0 |
| if (r0 == 0) {
0x00012d10 beq 0x12d68 | goto label_5;
| }
0x00012d14 bl 0x10b24 | errno_location ();
0x00012d18 ldr r6, [pc, 0x1e8] | r6 = *(0x12f04);
0x00012d1c mov r3, r5 | r3 = r5;
0x00012d20 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x00012d24 ldr r1, [pc, 0x1e4] | r1 = "libubi";
0x00012d28 ldr r4, [r0] | r4 = *(r0);
0x00012d2c ldr r0, [r6] | r0 = *(0x12f04);
0x00012d30 bl 0x10a64 | fprintf (r0, "libubi", r2, r3, r4, r5, r6);
0x00012d34 mov r0, r4 | r0 = r4;
0x00012d38 ldr r5, [r6] | r5 = *(0x12f04);
0x00012d3c bl 0x109d4 | strerror (r0);
0x00012d40 str r4, [sp] | *(sp) = r4;
0x00012d44 ldr r3, [pc, 0x1c8] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x00012d48 mov r2, 8 | r2 = 8;
0x00012d4c ldr r1, [pc, 0x1c4] | r1 = *(0x12f14);
0x00012d50 str r0, [sp, 4] | var_4h = r0;
0x00012d54 mov r0, r5 | r0 = r5;
0x00012d58 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n", r4);
| do {
| label_0:
0x00012d5c mvn r0, 0 | r0 = ~0;
| label_4:
0x00012d60 sub sp, fp, 0x20 |
0x00012d64 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_5:
0x00012d68 ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x00012d6c and r3, r3, 0xf000 | r3 &= 0xf000;
0x00012d70 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00012d74 beq 0x12da0 | goto label_6;
| }
0x00012d78 ldr r0, [pc, 0x188] |
0x00012d7c mov r3, r5 | r3 = r5;
0x00012d80 ldr r2, [pc, 0x184] | r2 = stderr;
0x00012d84 ldr r1, [pc, 0x190] | r1 = "_serror__d___s_";
0x00012d88 ldr r0, [r0] | r0 = *(0x12f04);
0x00012d8c bl 0x10a64 | r0 = fprintf (r0, "_serror__d___s_", r2, r3);
0x00012d90 bl 0x10b24 | errno_location ();
0x00012d94 mov r3, 0x16 | r3 = 0x16;
| label_1:
0x00012d98 str r3, [r0] | *(r0) = r3;
0x00012d9c b 0x12d5c |
| } while (1);
| label_6:
0x00012da0 ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x00012da4 mov r1, r3 | r1 = r3;
0x00012da8 mov r0, r2 | r0 = r2;
0x00012dac strd r2, r3, [fp, -0xb4] | __asm ("strd r2, r3, [var_b4h]");
0x00012db0 bl 0x10a04 | gnu_dev_major ();
0x00012db4 ldrd r2, r3, [fp, -0xb4] | __asm ("ldrd r2, r3, [var_b4h]");
0x00012db8 mov r1, r3 | r1 = r3;
0x00012dbc mov sb, r0 | sb = r0;
0x00012dc0 mov r0, r2 | r0 = r2;
0x00012dc4 bl 0x10a40 | gnu_dev_minor ();
0x00012dc8 sub r1, fp, 0xa4 | r1 -= var_a4h;
0x00012dcc mov r7, r0 | r7 = r0;
0x00012dd0 mov r0, r6 | r0 = r6;
0x00012dd4 bl 0x129a8 | r0 = fcn_000129a8 (r0, r1);
0x00012dd8 cmp r0, 0 |
| if (r0 != 0) {
0x00012ddc addeq r8, sp, 8 | r8 += var_b4h;
| }
| if (r0 != 0) {
0x00012de0 ldreq r4, [fp, -0xa0] | r4 = var_a0h;
| }
| if (r0 == 0) {
0x00012de4 addeq sl, r6, 0x18 | sl = r6 + 0x18;
| goto label_7;
| }
| if (r0 != 0) {
| label_7:
0x00012de8 bne 0x12d5c | goto label_0;
| }
| do {
0x00012dec ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012df0 cmp r4, r3 |
| if (r4 > r3) {
0x00012df4 bgt 0x12e6c | goto label_8;
| }
0x00012df8 sub r3, fp, 0xa8 | r3 -= var_a8h;
0x00012dfc sub r2, fp, 0xac | r2 -= var_ach;
0x00012e00 mov r1, r4 | r1 = r4;
0x00012e04 mov r0, sl | r0 = sl;
0x00012e08 bl 0x12304 | r0 = fcn_00012304 (r0, r1);
0x00012e0c cmp r0, 0 |
| if (r0 == 0) {
0x00012e10 beq 0x12e60 | goto label_9;
| }
0x00012e14 bl 0x10b24 | r0 = errno_location ();
0x00012e18 ldr r3, [r0] | r3 = *(r0);
0x00012e1c cmp r3, 2 |
| if (r3 != 2) {
0x00012e20 bne 0x12e2c | goto label_10;
| }
| label_2:
0x00012e24 add r4, r4, 1 | r4++;
0x00012e28 b 0x12dec |
| } while (1);
| label_10:
0x00012e2c cmp r3, 0 |
| if (r3 != 0) {
0x00012e30 bne 0x12d5c | goto label_0;
| }
| label_3:
0x00012e34 ldr r0, [pc, 0xcc] |
0x00012e38 mov r3, r5 | r3 = r5;
0x00012e3c str r7, [sp, 4] | var_4h = r7;
0x00012e40 str sb, [sp] | *(sp) = sb;
0x00012e44 ldr r2, [pc, 0xc0] | r2 = stderr;
0x00012e48 ldr r1, [pc, 0xd0] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x00012e4c ldr r0, [r0] | r0 = *(0x12f04);
0x00012e50 bl 0x10a64 | r0 = fprintf (r0, "_s:_error_:___s__is_not_a_character_device", r2, r3);
0x00012e54 bl 0x10b24 | errno_location ();
0x00012e58 mov r3, 0x13 | r3 = 0x13;
0x00012e5c b 0x12d98 | goto label_1;
| label_9:
0x00012e60 ldr r3, [fp, -0xac] | r3 = var_ach;
0x00012e64 cmp r3, sb |
| if (r3 != sb) {
0x00012e68 bne 0x12e24 | goto label_2;
| }
| label_8:
0x00012e6c ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012e70 cmp r4, r3 |
| if (r4 > r3) {
0x00012e74 bgt 0x12e34 | goto label_3;
| }
0x00012e78 cmp r7, 0 |
| if (r7 == 0) {
0x00012e7c moveq r0, 1 | r0 = 1;
| goto label_11;
| }
| if (r7 == 0) {
| label_11:
0x00012e80 beq 0x12d60 | goto label_4;
| }
0x00012e84 sub r3, r7, 1 | r3 = r7 - 1;
0x00012e88 mov r2, r4 | r2 = r4;
0x00012e8c ldr r1, [r6, 0x40] | r1 = *((r6 + 0x40));
0x00012e90 mov r0, r8 | r0 = r8;
0x00012e94 bl 0x10b18 | sprintf (r0, r1, r2)
0x00012e98 mov r1, 0 | r1 = 0;
0x00012e9c mov r0, r8 | r0 = r8;
0x00012ea0 bl 0x10af4 | r0 = open64 ();
0x00012ea4 cmn r0, 1 |
| if (r0 == 1) {
0x00012ea8 beq 0x12e34 | goto label_3;
| }
0x00012eac bl 0x10b6c | r0 = close (r0);
0x00012eb0 cmp r0, 0 |
| if (r0 != 0) {
0x00012eb4 beq 0x12f00 |
0x00012eb8 bl 0x10b24 | errno_location ();
0x00012ebc ldr r5, [pc, 0x44] |
0x00012ec0 mov r3, r8 | r3 = r8;
0x00012ec4 ldr r2, [pc, 0x40] | r2 = stderr;
0x00012ec8 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";
0x00012ecc ldr r4, [r0] | r4 = *(r0);
0x00012ed0 ldr r0, [r5] | r0 = *(0x12f04);
0x00012ed4 bl 0x10a64 | fprintf (r0, "_s:_error_:___s__has_major:minor__d:_d__but_this_does_not_correspond_to_any_existing_UBI_device_or_volume", r2, r3, r4, r5);
0x00012ed8 mov r0, r4 | r0 = r4;
0x00012edc ldr r5, [r5] | r5 = *(0x12f04);
0x00012ee0 bl 0x109d4 | strerror (r0);
0x00012ee4 str r4, [sp] | *(sp) = r4;
0x00012ee8 ldr r3, [pc, 0x24] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x00012eec mov r2, 8 | r2 = 8;
0x00012ef0 ldr r1, [pc, 0x20] | r1 = *(0x12f14);
0x00012ef4 str r0, [sp, 4] | var_4h = r0;
0x00012ef8 mov r0, r5 | r0 = r5;
0x00012efc bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n", r4);
| }
0x00012f00 mov r0, 2 | r0 = 2;
0x00012f04 b 0x12d60 | 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/ubinfo @ 0x132e0 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000132e0 () | void fcn_000132e0 (int32_t arg2, char * s) {
| int32_t var_74h;
| int32_t var_ch_2;
| int32_t var_ch;
| r1 = arg2;
| r0 = s;
0x000132e0 push {r4, r5, fp, lr} |
0x000132e4 add fp, sp, 0xc |
0x000132e8 sub sp, sp, 0x68 |
0x000132ec ldr r4, [r0, 0x10] | r4 = *((r0 + 0x10));
0x000132f0 mov r5, r1 | r5 = r1;
0x000132f4 mov r0, r4 | r0 = r4;
0x000132f8 bl 0x10b3c | strlen (r0);
0x000132fc mov r2, r5 | r2 = r5;
0x00013300 mov r1, r4 | r1 = r4;
0x00013304 add r0, r0, 0x39 | r0 += 0x39;
0x00013308 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x0001330c sub sp, sp, r0 |
0x00013310 mov r0, sp | r0 = sp;
0x00013314 bl 0x10b18 | sprintf (r0, r1, r2)
0x00013318 sub r1, fp, 0x74 | r1 -= var_74h;
0x0001331c mov r0, sp | r0 = sp;
0x00013320 bl 0x109e0 | r0 = stat64 ();
0x00013324 clz r0, r0 | r0 &= r0;
0x00013328 lsr r0, r0, 5 | r0 >>= 5;
0x0001332c sub sp, fp, 0xc |
0x00013330 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/ubinfo @ 0x13334 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00013334 () | void fcn_00013334 (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;
0x00013334 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013338 add sl, r2, 4 | sl = r2 + 4;
0x0001333c add fp, sp, 0x20 |
0x00013340 sub sp, sp, 0x114 |
0x00013344 mov r6, r1 | r6 = r1;
0x00013348 mov r5, r0 | r5 = r0;
0x0001334c mov r4, r2 | r4 = r2;
0x00013350 mov r1, 0 | r1 = 0;
0x00013354 mov r2, 0x54 | r2 = 0x54;
0x00013358 mov r0, sl | r0 = sl;
0x0001335c bl 0x10adc | memset (r0, r1, r2);
0x00013360 str r6, [r4] | *(r4) = r6;
0x00013364 mov r1, r6 | r1 = r6;
0x00013368 mov r0, r5 | r0 = r5;
0x0001336c bl 0x132e0 | r0 = fcn_000132e0 (r0, r1);
0x00013370 cmp r0, 0 |
0x00013374 bne 0x13380 |
| while (r8 == r0) {
| label_0:
0x00013378 mvn r0, 0 | r0 = ~0;
0x0001337c b 0x13644 | goto label_3;
0x00013380 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00013384 bl 0x10b00 | r0 = opendir ();
0x00013388 subs r8, r0, 0 | r8 = r0 - 0;
0x0001338c beq 0x13378 |
| }
0x00013390 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00013394 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x00013398 bl 0x10b24 | r0 = errno_location ();
0x0001339c mov sb, r0 | sb = r0;
| do {
| label_1:
0x000133a0 mov r3, 0 | r3 = 0;
0x000133a4 str r3, [sb] | *(sb) = r3;
0x000133a8 mov r0, r8 | r0 = r8;
0x000133ac bl 0x10aa0 | r0 = readdir64 ();
0x000133b0 cmp r0, 0 |
| if (r0 == 0) {
0x000133b4 beq 0x13450 | goto label_4;
| }
0x000133b8 add r7, r0, 0x13 | r7 = r0 + 0x13;
0x000133bc mov r0, r7 | r0 = r7;
0x000133c0 bl 0x10b3c | r0 = strlen (r0);
0x000133c4 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x000133c8 bls 0x133f4 |
0x000133cc ldr r0, [pc, 0x278] |
0x000133d0 str r7, [sp] | *(sp) = r7;
0x000133d4 ldr r2, [pc, 0x274] | r2 = stderr;
0x000133d8 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000133dc ldr r1, [pc, 0x270] | r1 = "libubi";
0x000133e0 ldr r0, [r0] | r0 = *(0x13648);
0x000133e4 bl 0x10a64 | fprintf (r0, "libubi", r2, r3);
| label_2:
0x000133e8 mov r0, r8 | r0 = r8;
0x000133ec bl 0x10b54 | closedir ();
0x000133f0 b 0x13378 | goto label_0;
| }
0x000133f4 sub r3, fp, 0x124 | r3 -= var_124h;
0x000133f8 str r3, [sp] | *(sp) = r3;
0x000133fc sub r2, fp, 0x128 | r2 -= var_128h;
0x00013400 sub r3, fp, 0x12c | r3 -= s;
0x00013404 ldr r1, [pc, 0x24c] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x00013408 mov r0, r7 | r0 = r7;
0x0001340c bl 0x10aac | r0 = sscanf (r0, "%s: error!: invalid entry in %s: \"%s\"\n", r2);
0x00013410 cmp r0, 2 |
0x00013414 bne 0x133a0 |
| } while (r0 != 2);
0x00013418 ldr r3, [fp, -0x128] | r3 = var_128h;
0x0001341c cmp r3, r6 |
| if (r3 != r6) {
0x00013420 bne 0x133a0 | goto label_1;
| }
0x00013424 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00013428 ldr r2, [r4, 0x10] | r2 = *((r4 + 0x10));
0x0001342c add r3, r3, 1 | r3++;
0x00013430 str r3, [r4, 8] | *((r4 + 8)) = r3;
0x00013434 ldr r3, [fp, -0x12c] | r3 = s;
0x00013438 cmp r2, r3 |
0x0001343c ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
| if (r2 >= r3) {
0x00013440 strlt r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x00013444 cmp r3, r2 |
| if (r3 >= r2) {
0x00013448 strlt r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
| }
0x0001344c b 0x133a0 | goto label_1;
| label_4:
0x00013450 ldr r7, [sb] | r7 = *(sb);
0x00013454 cmp r7, 0 |
| if (r7 != 0) {
0x00013458 beq 0x134a0 |
0x0001345c ldr r4, [pc, 0x1e8] |
0x00013460 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00013464 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x00013468 ldr r1, [pc, 0x1ec] | r1 = "ubi%d_%d%s";
0x0001346c ldr r0, [r4] | r0 = *(0x13648);
0x00013470 bl 0x10a64 | fprintf (r0, "ubi%d_%d%s", r2, r3, r4);
0x00013474 mov r0, r7 | r0 = r7;
0x00013478 ldr r4, [r4] | r4 = *(0x13648);
0x0001347c bl 0x109d4 | strerror (r0);
0x00013480 str r7, [sp] | *(sp) = r7;
0x00013484 ldr r3, [pc, 0x1d4] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x00013488 mov r2, 8 | r2 = 8;
0x0001348c ldr r1, [pc, 0x1d0] | r1 = *(0x13660);
0x00013490 str r0, [sp, 4] | var_4h = r0;
0x00013494 mov r0, r4 | r0 = r4;
0x00013498 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_");
0x0001349c b 0x133e8 | goto label_2;
| }
0x000134a0 mov r0, r8 | r0 = r8;
0x000134a4 bl 0x10b54 | r0 = closedir ();
0x000134a8 cmp r0, 0 |
| if (r0 != 0) {
0x000134ac beq 0x134f8 |
0x000134b0 ldr r6, [pc, 0x194] | r6 = *(0x13648);
0x000134b4 ldr r4, [sb] | r4 = *(sb);
0x000134b8 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000134bc ldr r2, [pc, 0x18c] | r2 = stderr;
0x000134c0 ldr r1, [pc, 0x1a0] | r1 = "_serror__d___s_";
0x000134c4 ldr r0, [r6] | r0 = *(0x13648);
0x000134c8 bl 0x10a64 | fprintf (r0, "_serror__d___s_", r2, r3, r4, r5, r6);
0x000134cc mov r0, r4 | r0 = r4;
0x000134d0 ldr r5, [r6] | r5 = *(0x13648);
0x000134d4 bl 0x109d4 | strerror (r0);
0x000134d8 str r4, [sp] | *(sp) = r4;
0x000134dc ldr r3, [pc, 0x17c] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x000134e0 mov r2, 8 | r2 = 8;
0x000134e4 ldr r1, [pc, 0x178] | r1 = *(0x13660);
0x000134e8 str r0, [sp, 4] | var_4h = r0;
0x000134ec mov r0, r5 | r0 = r5;
0x000134f0 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_", r4);
0x000134f4 b 0x13378 | goto label_0;
| }
0x000134f8 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x000134fc add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00013500 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00013504 streq r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| }
0x00013508 add r3, r4, 0x18 | r3 = r4 + 0x18;
0x0001350c mov r1, r6 | r1 = r6;
0x00013510 add r0, r5, 0x18 | r0 = r5 + 0x18;
0x00013514 bl 0x12304 | r0 = fcn_00012304 (r0, r1);
0x00013518 cmp r0, 0 |
| if (r0 != 0) {
0x0001351c bne 0x13378 | goto label_0;
| }
0x00013520 mov r2, sl | r2 = sl;
0x00013524 mov r1, r6 | r1 = r6;
0x00013528 ldr r0, [r5, 0x3c] | r0 = *((r5 + 0x3c));
0x0001352c bl 0x11e18 | r0 = fcn_00011e18 (r0, r1);
0x00013530 cmp r0, 0 |
| if (r0 != 0) {
0x00013534 bne 0x13378 | goto label_0;
| }
0x00013538 add r2, r4, 0x20 | r2 = r4 + 0x20;
0x0001353c mov r1, r6 | r1 = r6;
0x00013540 ldr r0, [r5, 0x1c] | r0 = *((r5 + 0x1c));
0x00013544 bl 0x11e18 | r0 = fcn_00011e18 (r0, r1);
0x00013548 cmp r0, 0 |
| if (r0 != 0) {
0x0001354c bne 0x13378 | goto label_0;
| }
0x00013550 add r2, r4, 0x1c | r2 = r4 + 0x1c;
0x00013554 mov r1, r6 | r1 = r6;
0x00013558 ldr r0, [r5, 0x20] | r0 = *((r5 + 0x20));
0x0001355c bl 0x11e18 | r0 = fcn_00011e18 (r0, r1);
0x00013560 cmp r0, 0 |
| if (r0 != 0) {
0x00013564 bne 0x13378 | goto label_0;
| }
0x00013568 add r2, r4, 0x38 | r2 = r4 + 0x38;
0x0001356c mov r1, r6 | r1 = r6;
0x00013570 ldr r0, [r5, 0x24] | r0 = *((r5 + 0x24));
0x00013574 bl 0x11e18 | r0 = fcn_00011e18 (r0, r1);
0x00013578 cmp r0, 0 |
| if (r0 != 0) {
0x0001357c bne 0x13378 | goto label_0;
| }
0x00013580 add r2, r4, 0x3c | r2 = r4 + 0x3c;
0x00013584 mov r1, r6 | r1 = r6;
0x00013588 ldr r0, [r5, 0x28] | r0 = *((r5 + 0x28));
0x0001358c bl 0x11e18 | r0 = fcn_00011e18 (r0, r1);
0x00013590 cmp r0, 0 |
| if (r0 != 0) {
0x00013594 bne 0x13378 | goto label_0;
| }
0x00013598 add r2, r4, 0x48 | r2 = r4 + 0x48;
0x0001359c mov r1, r6 | r1 = r6;
0x000135a0 ldr r0, [r5, 0x30] | r0 = *((r5 + 0x30));
0x000135a4 bl 0x11e18 | r0 = fcn_00011e18 (r0, r1);
0x000135a8 cmp r0, 0 |
| if (r0 != 0) {
0x000135ac bne 0x13378 | goto label_0;
| }
0x000135b0 ldr r8, [r5, 0x2c] | r8 = *((r5 + 0x2c));
0x000135b4 mov sb, sp | sb = sp;
0x000135b8 mov r0, r8 | r0 = r8;
0x000135bc bl 0x10b3c | strlen (r0);
0x000135c0 mov r2, r6 | r2 = r6;
0x000135c4 mov r1, r8 | r1 = r8;
0x000135c8 add r0, r0, 0x39 | r0 += 0x39;
0x000135cc bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000135d0 sub sp, sp, r0 |
0x000135d4 add r7, sp, 8 | r7 += s;
0x000135d8 mov r0, r7 | r0 = r7;
0x000135dc bl 0x10b18 | sprintf (r0, r1, r2)
0x000135e0 add r1, r4, 0x40 | r1 = r4 + 0x40;
0x000135e4 mov r0, r7 | r0 = r7;
0x000135e8 bl 0x11bf4 | fcn_00011bf4 (r0, r1);
0x000135ec mov sp, sb |
0x000135f0 cmp r0, 0 |
| if (r0 != 0) {
0x000135f4 bne 0x13378 | goto label_0;
| }
0x000135f8 add r2, r4, 0x4c | r2 = r4 + 0x4c;
0x000135fc mov r1, r6 | r1 = r6;
0x00013600 ldr r0, [r5, 0x34] | r0 = *((r5 + 0x34));
0x00013604 bl 0x11e18 | r0 = fcn_00011e18 (r0, r1);
0x00013608 cmp r0, 0 |
| if (r0 != 0) {
0x0001360c bne 0x13378 | goto label_0;
| }
0x00013610 add r2, r4, 0x50 | r2 = r4 + 0x50;
0x00013614 mov r1, r6 | r1 = r6;
0x00013618 ldr r0, [r5, 0x38] | r0 = *((r5 + 0x38));
0x0001361c bl 0x11e18 | r0 = fcn_00011e18 (r0, r1);
0x00013620 cmp r0, 0 |
| if (r0 != 0) {
0x00013624 bne 0x13378 | goto label_0;
| }
0x00013628 ldr r3, [r4, 0x3c] | r3 = *((r4 + 0x3c));
0x0001362c ldr r2, [r4, 0x20] | r2 = *((r4 + 0x20));
0x00013630 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x00013634 ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x00013638 strd r6, r7, [r4, 0x30] | __asm ("strd r6, r7, [r4, 0x30]");
0x0001363c smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x00013640 strd r6, r7, [r4, 0x28] | __asm ("strd r6, r7, [r4, 0x28]");
| label_3:
0x00013644 sub sp, fp, 0x20 |
0x00013648 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/ubinfo @ 0x1385c */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.0001385c () | void fcn_0001385c (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;
0x0001385c push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013860 add sb, r3, 8 | sb = r3 + 8;
0x00013864 add fp, sp, 0x20 |
0x00013868 sub sp, sp, 0x3c |
0x0001386c mov r5, r1 | r5 = r1;
0x00013870 mov r6, r2 | r6 = r2;
0x00013874 mov r1, 0 | r1 = 0;
0x00013878 mov r2, 0xb0 | r2 = 0xb0;
0x0001387c mov r7, r0 | r7 = r0;
0x00013880 mov r0, sb | r0 = sb;
0x00013884 mov r4, r3 | r4 = r3;
0x00013888 bl 0x10adc | memset (r0, r1, r2);
0x0001388c ldr sl, [r7, 0x48] | sl = *((r7 + 0x48));
0x00013890 stm r4, {r5, r6} | *(r4) = r5;
| *((r4 + 4)) = r6;
0x00013894 mov r0, sl | r0 = sl;
0x00013898 bl 0x10b3c | strlen (r0);
0x0001389c mov r8, sp | r8 = sp;
0x000138a0 mov r3, r6 | r3 = r6;
0x000138a4 mov r2, r5 | r2 = r5;
0x000138a8 mov r1, sl | r1 = sl;
0x000138ac add r0, r0, 0x6b | r0 += 0x6b;
0x000138b0 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000138b4 sub sp, sp, r0 |
0x000138b8 mov r0, sp | r0 = sp;
0x000138bc bl 0x10b18 | sprintf (r0, r1, r2)
0x000138c0 mov r0, sp | r0 = sp;
0x000138c4 add r2, r4, 0xc | r2 = r4 + 0xc;
0x000138c8 mov r1, sb | r1 = sb;
0x000138cc bl 0x1222c | fcn_0001222c (r0, r1);
0x000138d0 mov sp, r8 |
0x000138d4 cmp r0, 0 |
0x000138d8 beq 0x138ec |
| while (r8 < r0) {
| label_0:
0x000138dc mvn r8, 0 | r8 = ~0;
| label_1:
0x000138e0 mov r0, r8 | r0 = r8;
0x000138e4 sub sp, fp, 0x20 |
0x000138e8 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x000138ec ldr sb, [r7, 0x44] | sb = *((r7 + 0x44));
0x000138f0 mov r0, sb | r0 = sb;
0x000138f4 bl 0x10b3c | strlen (r0);
0x000138f8 mov r3, r6 | r3 = r6;
0x000138fc mov r2, r5 | r2 = r5;
0x00013900 mov r1, sb | r1 = sb;
0x00013904 add r0, r0, 0x6b | r0 += 0x6b;
0x00013908 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x0001390c sub sp, sp, r0 |
0x00013910 mov r0, sp | r0 = sp;
0x00013914 bl 0x10b18 | sprintf (r0, r1, r2)
0x00013918 mov r0, sp | r0 = sp;
0x0001391c mov r2, 0x32 | r2 = 0x32;
0x00013920 sub r1, fp, 0x58 | r1 -= s1;
0x00013924 bl 0x11eb0 | fcn_00011eb0 (r0, r1);
0x00013928 mov sp, r8 |
0x0001392c subs r8, r0, 0 | r8 = r0 - 0;
0x00013930 blt 0x138dc |
| }
0x00013934 mov r2, r8 | r2 = r8;
0x00013938 ldr r1, [pc, 0x174] | r1 = *(0x13ab0);
0x0001393c sub r0, fp, 0x58 | r0 -= s1;
0x00013940 bl 0x10a88 | r0 = strncmp (r0, r1, r2);
0x00013944 cmp r0, 0 |
| if (r0 != 0) {
0x00013948 moveq r3, 4 | r3 = 4;
| }
| if (r0 != 0) {
0x0001394c beq 0x1396c |
0x00013950 mov r2, r8 | r2 = r8;
0x00013954 ldr r1, [pc, 0x15c] | r1 = "static\n";
0x00013958 sub r0, fp, 0x58 | r0 -= s1;
0x0001395c bl 0x10a88 | r0 = strncmp (r0, "static\n", r2);
0x00013960 cmp r0, 0 |
| if (r0 != 0) {
0x00013964 bne 0x13a8c | goto label_2;
| }
0x00013968 mov r3, 3 | r3 = 3;
| }
0x0001396c str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x00013970 mov r2, r6 | r2 = r6;
0x00013974 add r3, r4, 0x14 | r3 = r4 + 0x14;
0x00013978 mov r1, r5 | r1 = r5;
0x0001397c ldr r0, [r7, 0x4c] | r0 = *((r7 + 0x4c));
0x00013980 bl 0x11e60 | r0 = fcn_00011e60 (r0, r1);
0x00013984 cmp r0, 0 |
| if (r0 != 0) {
0x00013988 bne 0x138dc | goto label_0;
| }
0x0001398c ldr r8, [r7, 0x50] | r8 = *((r7 + 0x50));
0x00013990 mov sb, sp | sb = sp;
0x00013994 mov r0, r8 | r0 = r8;
0x00013998 bl 0x10b3c | strlen (r0);
0x0001399c mov r3, r6 | r3 = r6;
0x000139a0 mov r2, r5 | r2 = r5;
0x000139a4 mov r1, r8 | r1 = r8;
0x000139a8 add r0, r0, 0x6b | r0 += 0x6b;
0x000139ac bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x000139b0 sub sp, sp, r0 |
0x000139b4 mov r0, sp | r0 = sp;
0x000139b8 bl 0x10b18 | sprintf (r0, r1, r2)
0x000139bc mov r0, sp | r0 = sp;
0x000139c0 add r1, r4, 0x18 | r1 = r4 + 0x18;
0x000139c4 bl 0x11bf4 | fcn_00011bf4 (r0, r1);
0x000139c8 mov sp, sb |
0x000139cc cmp r0, 0 |
| if (r0 != 0) {
0x000139d0 bne 0x138dc | goto label_0;
| }
0x000139d4 add r3, r4, 0x28 | r3 = r4 + 0x28;
0x000139d8 mov r2, r6 | r2 = r6;
0x000139dc mov r1, r5 | r1 = r5;
0x000139e0 ldr r0, [r7, 0x54] | r0 = *((r7 + 0x54));
0x000139e4 bl 0x11e60 | r0 = fcn_00011e60 (r0, r1);
0x000139e8 cmp r0, 0 |
| if (r0 != 0) {
0x000139ec bne 0x138dc | goto label_0;
| }
0x000139f0 add r3, r4, 0x2c | r3 = r4 + 0x2c;
0x000139f4 mov r2, r6 | r2 = r6;
0x000139f8 mov r1, r5 | r1 = r5;
0x000139fc ldr r0, [r7, 0x58] | r0 = *((r7 + 0x58));
0x00013a00 bl 0x11e60 | r0 = fcn_00011e60 (r0, r1);
0x00013a04 cmp r0, 0 |
| if (r0 != 0) {
0x00013a08 bne 0x138dc | goto label_0;
| }
0x00013a0c add r3, r4, 0x30 | r3 = r4 + 0x30;
0x00013a10 mov r2, r6 | r2 = r6;
0x00013a14 mov r1, r5 | r1 = r5;
0x00013a18 ldr r0, [r7, 0x5c] | r0 = *((r7 + 0x5c));
0x00013a1c bl 0x11e60 | r0 = fcn_00011e60 (r0, r1);
0x00013a20 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 != r0) {
0x00013a24 bne 0x138dc | goto label_0;
| }
0x00013a28 ldr r1, [r4, 0x28] | r1 = *((r4 + 0x28));
0x00013a2c ldr r0, [r4, 0x2c] | r0 = *((r4 + 0x2c));
0x00013a30 ldr r7, [r7, 0x60] | r7 = *((r7 + 0x60));
0x00013a34 smull r2, r3, r0, r1 | r2:r3 = r0 * r1;
0x00013a38 mov r0, r7 | r0 = r7;
0x00013a3c strd r2, r3, [r4, 0x20] | __asm ("strd r2, r3, [r4, 0x20]");
0x00013a40 bl 0x10b3c | strlen (r0);
0x00013a44 mov r3, r6 | r3 = r6;
0x00013a48 mov r2, r5 | r2 = r5;
0x00013a4c mov r1, r7 | r1 = r7;
0x00013a50 add r0, r0, 0x6b | r0 += 0x6b;
0x00013a54 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013a58 sub sp, sp, r0 |
0x00013a5c mov r0, sp | r0 = sp;
0x00013a60 bl 0x10b18 | sprintf (r0, r1, r2)
0x00013a64 mov r0, sp | r0 = sp;
0x00013a68 mov r2, 0x81 | r2 = 0x81;
0x00013a6c add r1, r4, 0x34 | r1 = r4 + 0x34;
0x00013a70 bl 0x11eb0 | fcn_00011eb0 (r0, r1);
0x00013a74 mov sp, sb |
0x00013a78 cmp r0, 0 |
| if (r0 < 0) {
0x00013a7c blt 0x138dc | goto label_0;
| }
0x00013a80 add r4, r4, r0 | r4 += r0;
0x00013a84 strb r8, [r4, 0x33] | *((r4 + 0x33)) = r8;
0x00013a88 b 0x138e0 | goto label_1;
| label_2:
0x00013a8c ldr r0, [pc, 0x28] |
0x00013a90 sub r3, fp, 0x58 | r3 -= s1;
0x00013a94 ldr r2, [pc, 0x24] | r2 = stderr;
0x00013a98 ldr r1, [pc, 0x24] | r1 = "libubi";
0x00013a9c ldr r0, [r0] | r0 = "dynamic\n";
0x00013aa0 bl 0x10a64 | r0 = fprintf ("dynamic\n", "libubi", r2, r3);
0x00013aa4 bl 0x10b24 | errno_location ();
0x00013aa8 mov r3, 0x16 | r3 = 0x16;
0x00013aac str r3, [r0] | *(r0) = r3;
0x00013ab0 b 0x138dc | 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/ubinfo @ 0x13ac8 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00013ac8 () | void fcn_00013ac8 (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;
0x00013ac8 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013acc add fp, sp, 0x20 |
0x00013ad0 sub sp, sp, 0xa4 |
0x00013ad4 mov r5, r0 | r5 = r0;
0x00013ad8 mov r6, r1 | r6 = r1;
0x00013adc mov sb, r2 | sb = r2;
0x00013ae0 bl 0x12cd8 | r0 = fcn_00012cd8 (r0, r1);
0x00013ae4 cmp r0, 2 |
| if (r0 == 2) {
0x00013ae8 beq 0x13b10 | goto label_7;
| }
0x00013aec cmp r0, 1 |
0x00013af0 beq 0x13b00 |
| while (1) {
| label_0:
0x00013af4 mvn r0, 0 | r0 = ~0;
| label_1:
0x00013af8 sub sp, fp, 0x20 |
0x00013afc pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00013b00 bl 0x10b24 | errno_location ();
0x00013b04 mov r3, 0x13 | r3 = 0x13;
0x00013b08 str r3, [r0] | *(r0) = r3;
0x00013b0c b 0x13af4 |
| }
| label_7:
0x00013b10 ldr r0, [r5, 0x40] | r0 = *((r5 + 0x40));
0x00013b14 str sp, [fp, -0xb0] | var_b0h = sp;
0x00013b18 bl 0x10b3c | strlen (r0);
0x00013b1c sub r1, fp, 0x8c | r1 -= var_8ch;
0x00013b20 add r0, r0, 0x6b | r0 += 0x6b;
0x00013b24 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00013b28 sub sp, sp, r0 |
0x00013b2c mov r0, r6 | r0 = r6;
0x00013b30 bl 0x109e0 | stat64 ();
0x00013b34 add r7, sp, 8 | r7 += var_8h;
0x00013b38 cmp r0, 0 |
| if (r0 != 0) {
0x00013b3c beq 0x13b8c |
0x00013b40 bl 0x10b24 | errno_location ();
0x00013b44 ldr sl, [pc, 0x200] | sl = obj.stderr;
0x00013b48 mov r3, r6 | r3 = r6;
0x00013b4c ldr r2, [pc, 0x1fc] | r2 = stderr;
0x00013b50 ldr r1, [pc, 0x1fc] | r1 = "libubi";
0x00013b54 ldr r7, [r0] | r7 = *(r0);
0x00013b58 ldr r0, [sl] | r0 = *(sl);
0x00013b5c bl 0x10a64 | fprintf (r0, "libubi", r2, r3);
0x00013b60 mov r0, r7 | r0 = r7;
0x00013b64 ldr r6, [sl] | r6 = *(sl);
0x00013b68 bl 0x109d4 | strerror (r0);
0x00013b6c ldr r3, [pc, 0x1e4] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x00013b70 ldr r1, [pc, 0x1e4] | r1 = *(0x13d58);
0x00013b74 mov r2, 8 | r2 = 8;
0x00013b78 str r7, [sp] | *(sp) = r7;
0x00013b7c str r0, [sp, 4] | var_4h = r0;
0x00013b80 mov r0, r6 | r0 = r6;
| label_6:
0x00013b84 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n");
0x00013b88 b 0x13bc0 |
| } else {
0x00013b8c ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x00013b90 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00013b94 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00013b98 beq 0x13be8 | goto label_8;
| }
0x00013b9c bl 0x10b24 | errno_location ();
0x00013ba0 ldr r2, [pc, 0x1a8] | r2 = stderr;
0x00013ba4 ldr r1, [pc, 0x1b4] | r1 = "_serror__d___s_";
0x00013ba8 mov r3, 0x16 | r3 = 0x16;
0x00013bac str r3, [r0] | *(r0) = r3;
0x00013bb0 mov r3, r6 | r3 = r6;
| label_2:
0x00013bb4 ldr r0, [pc, 0x190] |
0x00013bb8 ldr r0, [r0] | r0 = *(0x13d48);
0x00013bbc bl 0x10a64 | fprintf (r0, "_serror__d___s_", r2, r3);
| }
| label_3:
0x00013bc0 mvn r3, 0 | r3 = ~0;
| label_5:
0x00013bc4 cmp r3, 0 |
0x00013bc8 ldr sp, [fp, -0xb0] | sp = var_b0h;
| if (r3 != 0) {
0x00013bcc bne 0x13af4 | goto label_0;
| }
0x00013bd0 mov r3, sb | r3 = sb;
0x00013bd4 mov r2, r8 | r2 = r8;
0x00013bd8 mov r1, r4 | r1 = r4;
0x00013bdc mov r0, r5 | r0 = r5;
0x00013be0 bl 0x1385c | fcn_0001385c (r0, r1);
0x00013be4 b 0x13af8 | goto label_1;
| label_8:
0x00013be8 ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x00013bec mov r1, r3 | r1 = r3;
0x00013bf0 mov r0, r2 | r0 = r2;
0x00013bf4 strd r2, r3, [fp, -0xbc] | __asm ("strd r2, r3, [var_8h]");
0x00013bf8 bl 0x10a04 | gnu_dev_major ();
0x00013bfc ldrd r2, r3, [fp, -0xbc] | __asm ("ldrd r2, r3, [var_8h]");
0x00013c00 mov r1, r3 | r1 = r3;
0x00013c04 mov sl, r0 | sl = r0;
0x00013c08 mov r0, r2 | r0 = r2;
0x00013c0c bl 0x10a40 | r0 = gnu_dev_minor ();
0x00013c10 subs r3, r0, 0 | r3 = r0 - 0;
0x00013c14 str r3, [fp, -0xbc] | var_8h = r3;
| if (r3 == r0) {
0x00013c18 bne 0x13c38 |
0x00013c1c bl 0x10b24 | errno_location ();
0x00013c20 mov r3, 0x16 | r3 = 0x16;
0x00013c24 ldr r2, [pc, 0x124] | r2 = stderr;
0x00013c28 ldr r1, [pc, 0x134] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x00013c2c str r3, [r0] | *(r0) = r3;
0x00013c30 mov r3, r6 | r3 = r6;
0x00013c34 b 0x13bb4 | goto label_2;
| }
0x00013c38 sub r1, fp, 0xa4 | r1 -= var_a4h;
0x00013c3c mov r0, r5 | r0 = r5;
0x00013c40 bl 0x129a8 | r0 = fcn_000129a8 (r0, r1);
0x00013c44 cmp r0, 0 |
| if (r0 != 0) {
0x00013c48 bne 0x13bc0 | goto label_3;
| }
0x00013c4c bl 0x10b24 | errno_location ();
0x00013c50 ldr r4, [fp, -0xa0] | r4 = var_a0h;
0x00013c54 add r3, r5, 0x18 | r3 = r5 + 0x18;
0x00013c58 str r3, [fp, -0xb4] | var_b4h = r3;
0x00013c5c mov r6, r0 | r6 = r0;
| label_4:
0x00013c60 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00013c64 cmp r4, r3 |
| if (r4 > r3) {
0x00013c68 bgt 0x13ca8 | goto label_9;
| }
0x00013c6c sub r3, fp, 0xa8 | r3 -= var_a8h;
0x00013c70 sub r2, fp, 0xac | r2 -= var_ach;
0x00013c74 mov r1, r4 | r1 = r4;
0x00013c78 ldr r0, [fp, -0xb4] | r0 = var_b4h;
0x00013c7c bl 0x12304 | r0 = fcn_00012304 (r0, r1);
0x00013c80 cmp r0, 0 |
| if (r0 == 0) {
0x00013c84 beq 0x13c9c | goto label_10;
| }
0x00013c88 ldr r3, [r6] | r3 = *(r6);
0x00013c8c cmp r3, 2 |
| if (r3 != 2) {
0x00013c90 bne 0x13bc0 | goto label_3;
| }
| do {
0x00013c94 add r4, r4, 1 | r4++;
0x00013c98 b 0x13c60 | goto label_4;
| label_10:
0x00013c9c ldr r3, [fp, -0xac] | r3 = var_ach;
0x00013ca0 cmp sl, r3 |
0x00013ca4 bne 0x13c94 |
| } while (sl != r3);
| label_9:
0x00013ca8 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00013cac cmp r4, r3 |
| if (r4 <= r3) {
0x00013cb0 movgt r3, 0x13 | r3 = 0x13;
| }
| if (r4 > r3) {
0x00013cb4 strgt r3, [r6] | *(r6) = r3;
| goto label_11;
| }
| if (r4 > r3) {
| label_11:
0x00013cb8 bgt 0x13bc0 | goto label_3;
| }
0x00013cbc ldr r3, [fp, -0xbc] | r3 = var_8h;
0x00013cc0 mov r2, r4 | r2 = r4;
0x00013cc4 sub r8, r3, 1 | r8 = r3 - 1;
0x00013cc8 mov r3, r8 | r3 = r8;
0x00013ccc ldr r1, [r5, 0x40] | r1 = *((r5 + 0x40));
0x00013cd0 mov r0, r7 | r0 = r7;
0x00013cd4 bl 0x10b18 | sprintf (r0, r1, r2)
0x00013cd8 mov r1, 0 | r1 = 0;
0x00013cdc mov r0, r7 | r0 = r7;
0x00013ce0 bl 0x10af4 | r0 = open64 ();
0x00013ce4 cmn r0, 1 |
| if (r0 != 1) {
0x00013ce8 moveq r2, 0x13 | r2 = 0x13;
| }
0x00013cec mov r3, r0 | r3 = r0;
| if (r0 == 1) {
0x00013cf0 streq r2, [r6] | *(r6) = r2;
| goto label_12;
| }
| if (r0 == 1) {
| label_12:
0x00013cf4 beq 0x13bc4 | goto label_5;
| }
0x00013cf8 bl 0x10b6c | r0 = close (r0);
0x00013cfc subs r3, r0, 0 | r3 = r0 - 0;
| if (r3 == r0) {
0x00013d00 streq r3, [r6] | *(r6) = r3;
| goto label_13;
| }
| if (r3 == r0) {
| label_13:
0x00013d04 beq 0x13bc4 | goto label_5;
| }
0x00013d08 ldr sl, [pc, 0x3c] | sl = obj.stderr;
0x00013d0c ldr r6, [r6] | r6 = *(r6);
0x00013d10 mov r3, r7 | r3 = r7;
0x00013d14 ldr r2, [pc, 0x34] | r2 = stderr;
0x00013d18 ldr r1, [pc, 0x48] | r1 = "%s: error!: \"%s\" is not a volume character device\n";
0x00013d1c ldr r0, [sl] | r0 = *(sl);
0x00013d20 bl 0x10a64 | fprintf (r0, "%s: error!: \"%s\" is not a volume character device\n", r2, r3, r4, r5, r6);
0x00013d24 mov r0, r6 | r0 = r6;
0x00013d28 ldr r7, [sl] | r7 = *(sl);
0x00013d2c bl 0x109d4 | strerror (r0);
0x00013d30 str r6, [sp] | *(sp) = r6;
0x00013d34 ldr r3, [pc, 0x1c] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x00013d38 mov r2, 8 | r2 = 8;
0x00013d3c ldr r1, [pc, 0x18] | r1 = *(0x13d58);
0x00013d40 str r0, [sp, 4] | var_4h = r0;
0x00013d44 mov r0, r7 | r0 = r7;
0x00013d48 b 0x13b84 | goto label_6;
| }
[*] Function sprintf used 11 times ubinfo