[*] Binary protection state of ubiblock
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf tear down of ubiblock
; 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/ubiblock @ 0x10e74 */
| #include <stdint.h>
|
; (fcn) fcn.00010e74 () | void fcn_00010e74 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| char * buf;
| char * s;
| int32_t var_4ch;
| r0 = arg1;
| r1 = arg2;
0x00010e74 push {r4, r5, r6, r7, lr} |
0x00010e78 mov r6, r1 | r6 = r1;
0x00010e7c sub sp, sp, 0x4c |
0x00010e80 mov r1, 0 | r1 = 0;
0x00010e84 mov r5, r0 | r5 = r0;
0x00010e88 bl 0x108ac | r0 = open64 ();
0x00010e8c cmn r0, 1 |
0x00010e90 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00010e94 beq 0x10ff0 | goto label_2;
| }
0x00010e98 mov r2, 0x32 | r2 = 0x32;
0x00010e9c add r1, sp, 0x14 | r1 += buf;
0x00010ea0 bl 0x10858 | r0 = read (r0, r1, r2);
0x00010ea4 cmn r0, 1 |
| if (r0 != 1) {
0x00010ea8 bne 0x10f00 | goto label_3;
| }
0x00010eac bl 0x108dc | errno_location ();
0x00010eb0 ldr r7, [pc, 0x144] | r7 = *(0x10ff8);
0x00010eb4 mov r3, r5 | r3 = r5;
0x00010eb8 ldr r2, [pc, 0x140] | r2 = stderr;
0x00010ebc ldr r1, [pc, 0x140] | r1 = "libubi";
0x00010ec0 ldr r6, [r0] | r6 = *(r0);
0x00010ec4 ldr r0, [r7] | r0 = *(0x10ff8);
0x00010ec8 bl 0x10840 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00010ecc mov r0, r6 | r0 = r6;
0x00010ed0 ldr r5, [r7] | r5 = *(0x10ff8);
0x00010ed4 bl 0x107c8 | strerror (r0);
0x00010ed8 str r6, [sp] | *(sp) = r6;
0x00010edc ldr r3, [pc, 0x124] | r3 = "_s:_error_:_cannot_read___s_";
0x00010ee0 mov r2, 8 | r2 = 8;
0x00010ee4 ldr r1, [pc, 0x120] | r1 = *(0x11008);
0x00010ee8 str r0, [sp, 4] | var_4h = r0;
0x00010eec mov r0, r5 | r0 = r5;
0x00010ef0 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_read___s_", r4, r5, r6)
| do {
0x00010ef4 mov r0, r4 | r0 = r4;
0x00010ef8 bl 0x10924 | close (r0);
0x00010efc b 0x10fec | goto label_4;
| label_3:
0x00010f00 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x00010f04 bne 0x10f30 | goto label_5;
| }
0x00010f08 ldr r2, [pc, 0xf0] | r2 = stderr;
0x00010f0c ldr r1, [pc, 0xfc] | r1 = "_serror__d___s_";
0x00010f10 mov r3, r5 | r3 = r5;
| label_0:
0x00010f14 ldr r0, [pc, 0xe0] |
0x00010f18 ldr r0, [r0] | r0 = *(0x10ff8);
0x00010f1c bl 0x10840 | r0 = fprintf (r0, "_serror__d___s_", r2, r3)
| label_1:
0x00010f20 bl 0x108dc | errno_location ();
0x00010f24 mov r3, 0x16 | r3 = 0x16;
0x00010f28 str r3, [r0] | *(r0) = r3;
0x00010f2c b 0x10ef4 |
| } while (1);
| label_5:
0x00010f30 add r3, sp, 0x48 | r3 += s;
0x00010f34 add r0, r3, r0 | r0 = r3 + r0;
0x00010f38 mov r3, 0 | r3 = 0;
0x00010f3c strb r3, [r0, -0x34] | buf = r3;
0x00010f40 mov r2, r6 | r2 = r6;
0x00010f44 ldr r1, [pc, 0xc8] | r1 = "_s:_error_:_contents_of___s__is_too_long";
0x00010f48 add r0, sp, 0x14 | r0 += buf;
0x00010f4c bl 0x10888 | r0 = sscanf (r0, "_s:_error_:_contents_of___s__is_too_long", r2);
0x00010f50 cmp r0, 1 |
| if (r0 == 1) {
0x00010f54 movne r3, r5 | r3 = r5;
| }
| if (r0 == 1) {
0x00010f58 ldrne r2, [pc, 0xa0] | r2 = "libubi";
| }
| if (r0 != 1) {
0x00010f5c ldrne r1, [pc, 0xb4] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
| goto label_6;
| }
| if (r0 != 1) {
| label_6:
0x00010f60 bne 0x10f14 | goto label_0;
| }
0x00010f64 ldrd r2, r3, [r6] | __asm ("ldrd r2, r3, [r6]");
0x00010f68 cmp r2, 0 |
0x00010f6c sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x00010f70 bge 0x10f94 |
0x00010f74 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00010f78 ldr r3, [pc, 0x7c] | r3 = *(0x10ff8);
0x00010f7c str r5, [sp, 8] | var_8h = r5;
0x00010f80 ldr r2, [pc, 0x78] | r2 = stderr;
0x00010f84 ldr r1, [pc, 0x90] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
0x00010f88 ldr r0, [r3] | r0 = *(0x10ff8);
0x00010f8c bl 0x10840 | fprintf (r0, "_s:_error_:_cannot_read_integer_from___s_", r2, r3, r4, r5)
0x00010f90 b 0x10f20 | goto label_1;
| }
0x00010f94 mov r0, r4 | r0 = r4;
0x00010f98 bl 0x10924 | r0 = close (r0);
0x00010f9c subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00010fa0 beq 0x10ff0 |
0x00010fa4 bl 0x108dc | errno_location ();
0x00010fa8 ldr r6, [pc, 0x4c] | r6 = *(0x10ff8);
0x00010fac mov r3, r5 | r3 = r5;
0x00010fb0 ldr r2, [pc, 0x48] | r2 = stderr;
0x00010fb4 ldr r1, [pc, 0x64] | r1 = "_s:_error_:_negative_value__lld_in___s_";
0x00010fb8 ldr r4, [r0] | r4 = *(r0);
0x00010fbc ldr r0, [r6] | r0 = *(0x10ff8);
0x00010fc0 bl 0x10840 | fprintf (r0, "_s:_error_:_negative_value__lld_in___s_", r2, r3, r4, r5, r6)
0x00010fc4 mov r0, r4 | r0 = r4;
0x00010fc8 ldr r5, [r6] | r5 = *(0x10ff8);
0x00010fcc bl 0x107c8 | strerror (r0);
0x00010fd0 str r4, [sp] | *(sp) = r4;
0x00010fd4 ldr r3, [pc, 0x2c] | r3 = "_s:_error_:_cannot_read___s_";
0x00010fd8 mov r2, 8 | r2 = 8;
0x00010fdc ldr r1, [pc, 0x28] | r1 = *(0x11008);
0x00010fe0 str r0, [sp, 4] | var_4h = r0;
0x00010fe4 mov r0, r5 | r0 = r5;
0x00010fe8 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_read___s_", r4)
| label_4:
0x00010fec mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00010ff0 mov r0, r4 | r0 = r4;
0x00010ff4 add sp, sp, 0x4c |
0x00010ff8 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/ubiblock @ 0x11024 */
| #include <stdint.h>
|
; (fcn) fcn.00011024 () | void fcn_00011024 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_0h_2;
| int32_t var_8h;
| int32_t var_10h;
| int32_t var_10h_2;
| int32_t var_1ch;
| r0 = arg1;
| r1 = arg2;
0x00011024 push {r4, r5, lr} |
0x00011028 sub sp, sp, 0x1c |
0x0001102c mov r4, r1 | r4 = r1;
0x00011030 add r1, sp, 0x10 | r1 += var_10h;
0x00011034 mov r5, r0 | r5 = r0;
0x00011038 bl 0x10e74 | r0 = fcn_00010e74 (r0, r1);
0x0001103c cmp r0, 0 |
| if (r0 == 0) {
0x00011040 bne 0x11080 |
0x00011044 ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [var_10h]");
0x00011048 cmp r2, 0x80000000 |
0x0001104c sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 >= 0x80000000) {
0x00011050 strlt r2, [r4] | *(r4) = r2;
| }
| if (r2 < 0x80000000) {
0x00011054 blt 0x11084 | goto label_0;
| }
0x00011058 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x0001105c ldr r3, [pc, 0x28] | r3 = *(0x11088);
0x00011060 str r5, [sp, 8] | var_8h = r5;
0x00011064 ldr r2, [pc, 0x24] | r2 = stderr;
0x00011068 ldr r0, [r3] | r0 = *(0x11088);
0x0001106c ldr r1, [pc, 0x20] | r1 = "libubi";
0x00011070 bl 0x10840 | r0 = fprintf (r0, "libubi", r2, r3, r4, r5)
0x00011074 bl 0x108dc | errno_location ();
0x00011078 mov r3, 0x16 | r3 = 0x16;
0x0001107c str r3, [r0] | *(r0) = r3;
| }
0x00011080 mvn r0, 0 | r0 = ~0;
| label_0:
0x00011084 add sp, sp, 0x1c |
0x00011088 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/ubiblock @ 0x11130 */
| #include <stdint.h>
|
; (fcn) fcn.00011130 () | void fcn_00011130 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| void * buf;
| int32_t var_10h;
| r0 = arg1;
| r1 = arg2;
0x00011130 push {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr} |
0x00011134 mov r8, r1 | r8 = r1;
0x00011138 mov r1, 0 | r1 = 0;
0x0001113c mov r5, r0 | r5 = r0;
0x00011140 mov r7, r2 | r7 = r2;
0x00011144 bl 0x108ac | r0 = open64 ();
0x00011148 cmn r0, 1 |
0x0001114c mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00011150 beq 0x11298 | goto label_2;
| }
0x00011154 mov r2, r7 | r2 = r7;
0x00011158 mov r1, r8 | r1 = r8;
0x0001115c bl 0x10858 | r0 = read (r0, r1, r2);
0x00011160 cmn r0, 1 |
0x00011164 mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x00011168 bne 0x111c0 | goto label_3;
| }
| label_0:
0x0001116c bl 0x108dc | errno_location ();
0x00011170 ldr r7, [pc, 0x12c] | r7 = *(0x112a0);
0x00011174 mov r3, r5 | r3 = r5;
0x00011178 ldr r2, [pc, 0x128] | r2 = stderr;
0x0001117c ldr r1, [pc, 0x128] | r1 = "libubi";
0x00011180 ldr r6, [r0] | r6 = *(r0);
0x00011184 ldr r0, [r7] | r0 = *(0x112a0);
0x00011188 bl 0x10840 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x0001118c mov r0, r6 | r0 = r6;
0x00011190 ldr r5, [r7] | r5 = *(0x112a0);
0x00011194 bl 0x107c8 | strerror (r0);
0x00011198 str r6, [sp] | *(sp) = r6;
0x0001119c ldr r3, [pc, 0x10c] | r3 = "_s:_error_:_cannot_read___s_";
0x000111a0 mov r2, 8 | r2 = 8;
0x000111a4 ldr r1, [pc, 0x108] | r1 = *(0x112b0);
0x000111a8 str r0, [sp, 4] | var_4h = r0;
0x000111ac mov r0, r5 | r0 = r5;
0x000111b0 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_read___s_", r4, r5, r6)
| do {
0x000111b4 mov r0, r4 | r0 = r4;
0x000111b8 bl 0x10924 | close (r0);
0x000111bc b 0x11294 | goto label_4;
| label_3:
0x000111c0 cmp r7, r0 |
| if (r7 != r0) {
0x000111c4 bne 0x111f0 | goto label_5;
| }
0x000111c8 ldr r0, [pc, 0xd4] |
0x000111cc mov r3, r5 | r3 = r5;
0x000111d0 ldr r2, [pc, 0xd0] | r2 = stderr;
0x000111d4 ldr r1, [pc, 0xdc] | r1 = "_serror__d___s_";
0x000111d8 ldr r0, [r0] | r0 = *(0x112a0);
0x000111dc bl 0x10840 | r0 = fprintf (r0, "_serror__d___s_", r2, r3)
| label_1:
0x000111e0 bl 0x108dc | errno_location ();
0x000111e4 mov r3, 0x16 | r3 = 0x16;
0x000111e8 str r3, [r0] | *(r0) = r3;
0x000111ec b 0x111b4 |
| } while (1);
| label_5:
0x000111f0 mov r3, 0 | r3 = 0;
0x000111f4 strb r3, [r8, r0] | *((r8 + r0)) = r3;
0x000111f8 mov r2, 1 | r2 = 1;
0x000111fc add r1, sp, 0xc | r1 += buf;
0x00011200 mov r0, r4 | r0 = r4;
0x00011204 bl 0x10858 | r0 = read (r0, r1, r2);
0x00011208 cmp r0, 1 |
| if (r0 == 1) {
0x0001120c beq 0x1116c | goto label_0;
| }
0x00011210 cmp r0, 0 |
| if (r0 != 0) {
0x00011214 beq 0x11238 |
0x00011218 ldr r0, [pc, 0x84] |
0x0001121c str r7, [sp] | *(sp) = r7;
0x00011220 mov r3, r5 | r3 = r5;
0x00011224 ldr r2, [pc, 0x7c] | r2 = stderr;
0x00011228 ldr r1, [pc, 0x8c] | r1 = "_s:_error_:_contents_of___s__is_too_long";
0x0001122c ldr r0, [r0] | r0 = *(0x112a0);
0x00011230 bl 0x10840 | fprintf (r0, "_s:_error_:_contents_of___s__is_too_long", r2, r3)
0x00011234 b 0x111e0 | goto label_1;
| }
0x00011238 mov r0, r4 | r0 = r4;
0x0001123c bl 0x10924 | r0 = close (r0);
0x00011240 cmp r0, 0 |
| if (r0 != 0) {
0x00011244 moveq r4, r6 | r4 = r6;
| }
| if (r0 != 0) {
0x00011248 beq 0x11298 |
0x0001124c bl 0x108dc | errno_location ();
0x00011250 ldr r6, [pc, 0x4c] | r6 = *(0x112a0);
0x00011254 mov r3, r5 | r3 = r5;
0x00011258 ldr r2, [pc, 0x48] | r2 = stderr;
0x0001125c ldr r1, [pc, 0x5c] | r1 = "%s: error!: file \"%s\" contains too much data (> %d bytes)\n";
0x00011260 ldr r4, [r0] | r4 = *(r0);
0x00011264 ldr r0, [r6] | r0 = *(0x112a0);
0x00011268 bl 0x10840 | fprintf (r0, "%s: error!: file \"%s\" contains too much data (> %d bytes)\n", r2, r3, r4, r5, r6)
0x0001126c mov r0, r4 | r0 = r4;
0x00011270 ldr r5, [r6] | r5 = *(0x112a0);
0x00011274 bl 0x107c8 | strerror (r0);
0x00011278 str r4, [sp] | *(sp) = r4;
0x0001127c ldr r3, [pc, 0x2c] | r3 = "_s:_error_:_cannot_read___s_";
0x00011280 mov r2, 8 | r2 = 8;
0x00011284 ldr r1, [pc, 0x28] | r1 = *(0x112b0);
0x00011288 str r0, [sp, 4] | var_4h = r0;
0x0001128c mov r0, r5 | r0 = r5;
0x00011290 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_read___s_", r4)
| label_4:
0x00011294 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00011298 mov r0, r4 | r0 = r4;
0x0001129c add sp, sp, 0x10 |
0x000112a0 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/ubiblock @ 0x112c4 */
| #include <stdint.h>
|
; (fcn) fcn.000112c4 () | void fcn_000112c4 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
| r1 = arg2;
0x000112c4 push {r0, r1, r4, r5, r6, r7, r8, sb, sl, lr} |
0x000112c8 mov r7, r1 | r7 = r1;
0x000112cc mov sl, r0 | sl = r0;
0x000112d0 bl 0x108f4 | r0 = strlen (r0);
0x000112d4 mov r4, r0 | r4 = r0;
0x000112d8 mov sb, r0 | sb = r0;
0x000112dc mov r0, r7 | r0 = r7;
0x000112e0 bl 0x108f4 | r0 = strlen (r0);
0x000112e4 add r6, r4, r0 | r6 = r4 + r0;
0x000112e8 add r6, r6, 2 | r6 += 2;
0x000112ec mov r8, r0 | r8 = r0;
0x000112f0 mov r0, r6 | r0 = r6;
0x000112f4 bl 0x10810 | r0 = malloc (r0);
0x000112f8 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x000112fc bne 0x11354 | goto label_0;
| }
0x00011300 bl 0x108dc | errno_location ();
0x00011304 ldr r7, [pc, 0x80] | r7 = *(0x11388);
0x00011308 mov r3, r6 | r3 = r6;
0x0001130c ldr r2, [pc, 0x7c] | r2 = stderr;
0x00011310 ldr r1, [pc, 0x7c] | r1 = "libubi";
0x00011314 ldr r4, [r0] | r4 = *(r0);
0x00011318 ldr r0, [r7] | r0 = *(0x11388);
0x0001131c bl 0x10840 | fprintf (r0, "libubi", r2, r3, r4)
0x00011320 mov r0, r4 | r0 = r4;
0x00011324 ldr r6, [r7] | r6 = *(0x11388);
0x00011328 bl 0x107c8 | strerror (r0);
0x0001132c str r4, [sp] | *(sp) = r4;
0x00011330 ldr r3, [pc, 0x60] | r3 = "_s:_error_:_cannot_allocate__d_bytes";
0x00011334 mov r2, 8 | r2 = 8;
0x00011338 ldr r1, [pc, 0x5c] | r1 = *(0x11398);
0x0001133c str r0, [sp, 4] | var_4h = r0;
0x00011340 mov r0, r6 | r0 = r6;
0x00011344 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_allocate__d_bytes", r4)
| do {
0x00011348 mov r0, r5 | r0 = r5;
0x0001134c add sp, sp, 8 |
0x00011350 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_0:
0x00011354 mov r2, r4 | r2 = r4;
0x00011358 mov r1, sl | r1 = sl;
0x0001135c bl 0x107f8 | memcpy (r0, r1, r2);
0x00011360 add r3, r5, r4 | r3 = r5 + r4;
0x00011364 ldrb r3, [r3, -1] | r3 = *((r3 - 1));
0x00011368 add r2, r8, 1 | r2 = r8 + 1;
0x0001136c cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x00011370 addne r4, r4, 1 | r4++;
| }
| if (r3 == 0x2f) {
0x00011374 movne r3, 0x2f | r3 = 0x2f;
| }
| if (r3 == 0x2f) {
0x00011378 strbne r3, [r5, sb] | *((r5 + sb)) = r3;
| }
0x0001137c mov r1, r7 | r1 = r7;
0x00011380 add r0, r5, r4 | r0 = r5 + r4;
0x00011384 bl 0x107f8 | memcpy (r0, r1, r2);
0x00011388 b 0x11348 |
| } 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/ubiblock @ 0x113a0 */
| #include <stdint.h>
|
; (fcn) fcn.000113a0 () | void fcn_000113a0 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_18h;
| int32_t var_28h;
| int32_t var_28h_2;
| int32_t var_74h;
| r0 = arg1;
0x000113a0 push {r4, r5, r6, r7, lr} |
0x000113a4 sub sp, sp, 0x74 |
0x000113a8 add r1, sp, 8 | r1 += var_8h;
0x000113ac mov r5, r0 | r5 = r0;
0x000113b0 bl 0x107d4 | r0 = stat64 ();
0x000113b4 cmp r0, 0 |
| if (r0 >= 0) {
0x000113b8 bge 0x11410 | goto label_2;
| }
0x000113bc bl 0x108dc | errno_location ();
0x000113c0 ldr r6, [pc, 0xc8] | r6 = *(0x1148c);
0x000113c4 ldr r2, [pc, 0xc8] | r2 = stderr;
0x000113c8 ldr r1, [pc, 0xc8] | r1 = "libubi";
0x000113cc mov r3, r5 | r3 = r5;
0x000113d0 ldr r4, [r0] | r4 = *(r0);
| do {
| label_1:
0x000113d4 ldr r0, [r6] | r0 = *(r6);
0x000113d8 bl 0x10840 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000113dc mov r0, r4 | r0 = r4;
0x000113e0 ldr r5, [r6] | r5 = *(r6);
0x000113e4 bl 0x107c8 | strerror (r0);
0x000113e8 str r4, [sp] | *(sp) = r4;
0x000113ec ldr r3, [pc, 0xa8] | r3 = "_s:_error_:_cannot_stat___s_";
0x000113f0 mov r2, 8 | r2 = 8;
0x000113f4 ldr r1, [pc, 0xa4] | r1 = *(0x1149c);
0x000113f8 str r0, [sp, 4] | var_4h = r0;
0x000113fc mov r0, r5 | r0 = r5;
0x00011400 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_stat___s_", r4)
0x00011404 mvn r0, 0 | r0 = ~0;
| label_0:
0x00011408 add sp, sp, 0x74 |
0x0001140c pop {r4, r5, r6, r7, pc} |
| label_2:
0x00011410 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00011414 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00011418 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x0001141c beq 0x11440 | goto label_3;
| }
0x00011420 bl 0x108dc | errno_location ();
0x00011424 mov r4, 0x16 | r4 = 0x16;
0x00011428 ldr r6, [pc, 0x60] | r6 = *(0x1148c);
0x0001142c mov r3, r5 | r3 = r5;
0x00011430 ldr r2, [pc, 0x5c] | r2 = stderr;
0x00011434 ldr r1, [pc, 0x68] | r1 = "_serror__d___s_";
0x00011438 str r4, [r0] | *(r0) = r4;
0x0001143c b 0x113d4 |
| } while (1);
| label_3:
0x00011440 ldrd r6, r7, [sp, 0x28] | __asm ("ldrd r6, r7, [var_28h]");
0x00011444 mov r1, r7 | r1 = r7;
0x00011448 mov r0, r6 | r0 = r6;
0x0001144c bl 0x107ec | gnu_dev_major ();
0x00011450 mov r1, r7 | r1 = r7;
0x00011454 mov r4, r0 | r4 = r0;
0x00011458 mov r0, r6 | r0 = r6;
0x0001145c bl 0x1081c | gnu_dev_minor ();
0x00011460 cmp r4, 0x5a |
| if (r4 != 0x5a) {
0x00011464 addeq r0, r0, r0, lsr 31 | r0 += (r0 >> 31);
| }
0x00011468 asreq r0, r0, 1 | __asm ("asreq r0, r0, 1");
| if (r4 == 0x5a) {
0x0001146c beq 0x11408 | goto label_0;
| }
0x00011470 bl 0x108dc | errno_location ();
0x00011474 mov r4, 0x16 | r4 = 0x16;
0x00011478 ldr r6, [pc, 0x10] | r6 = *(0x1148c);
0x0001147c mov r3, r5 | r3 = r5;
0x00011480 ldr r2, [pc, 0xc] | r2 = stderr;
0x00011484 ldr r1, [pc, 0x1c] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x00011488 str r4, [r0] | *(r0) = r4;
0x0001148c b 0x113d4 | 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/ubiblock @ 0x114ac */
| #include <stdint.h>
|
; (fcn) fcn.000114ac () | void fcn_000114ac (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| char * s;
| int32_t var_40h;
| r0 = arg1;
| r1 = arg2;
0x000114ac push {r4, r5, r6, lr} |
0x000114b0 sub sp, sp, 0x40 |
0x000114b4 mov r4, r1 | r4 = r1;
0x000114b8 mov r5, r2 | r5 = r2;
0x000114bc add r1, sp, 0xc | r1 += s;
0x000114c0 mov r2, 0x32 | r2 = 0x32;
0x000114c4 mov r6, r0 | r6 = r0;
0x000114c8 bl 0x11130 | r0 = fcn_00011130 (r0, r1);
0x000114cc cmp r0, 0 |
| if (r0 < 0) {
0x000114d0 blt 0x11518 | goto label_1;
| }
0x000114d4 mov r3, r5 | r3 = r5;
0x000114d8 mov r2, r4 | r2 = r4;
0x000114dc ldr r1, [pc, 0x8c] | r1 = *(0x1156c);
0x000114e0 add r0, sp, 0xc | r0 += s;
0x000114e4 bl 0x10888 | r0 = sscanf (r0, r1, r2);
0x000114e8 cmp r0, 2 |
| if (r0 == 2) {
0x000114ec beq 0x11520 | goto label_2;
| }
0x000114f0 bl 0x108dc | errno_location ();
0x000114f4 mov r3, 0x16 | r3 = 0x16;
0x000114f8 ldr r2, [pc, 0x74] | r2 = "%d:%d\n";
0x000114fc ldr r1, [pc, 0x74] | r1 = "libubi";
0x00011500 str r3, [r0] | *(r0) = r3;
0x00011504 ldr r0, [pc, 0x70] |
0x00011508 mov r3, r6 | r3 = r6;
0x0001150c ldr r0, [r0] | r0 = "_s:_error_:___s__does_not_have_major:minor_format";
0x00011510 bl 0x10840 | fprintf ("_s:_error_:___s__does_not_have_major:minor_format", "libubi", "%d:%d\n", r3)
| label_0:
0x00011514 mvn r0, 0 | r0 = ~0;
| do {
| label_1:
0x00011518 add sp, sp, 0x40 |
0x0001151c pop {r4, r5, r6, pc} |
| label_2:
0x00011520 ldr r3, [r4] | r3 = *(r4);
0x00011524 cmp r3, 0 |
| if (r3 < 0) {
0x00011528 blt 0x1153c | goto label_3;
| }
0x0001152c ldr r3, [r5] | r3 = *(r5);
0x00011530 cmp r3, 0 |
| if (r3 < 0) {
0x00011534 movge r0, 0 | r0 = 0;
| }
0x00011538 bge 0x11518 |
| } while (r3 >= 0);
| label_3:
0x0001153c bl 0x108dc | errno_location ();
0x00011540 mov r3, 0x16 | r3 = 0x16;
0x00011544 ldr r2, [pc, 0x28] | r2 = "%d:%d\n";
0x00011548 ldr r1, [pc, 0x30] | r1 = stderr;
0x0001154c str r3, [r0] | *(r0) = r3;
0x00011550 ldr r0, [pc, 0x24] |
0x00011554 ldr r3, [r5] | r3 = *(r5);
0x00011558 str r6, [sp, 4] | var_4h = r6;
0x0001155c str r3, [sp] | *(sp) = r3;
0x00011560 ldr r3, [r4] | r3 = *(r4);
0x00011564 ldr r0, [r0] | r0 = "_s:_error_:___s__does_not_have_major:minor_format";
0x00011568 bl 0x10840 | fprintf ("_s:_error_:___s__does_not_have_major:minor_format", r1, "%d:%d\n", r3, r4, r5, r6)
0x0001156c b 0x11514 | 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/ubiblock @ 0x115d8 */
| #include <stdint.h>
|
; (fcn) fcn.000115d8 () | void fcn_000115d8 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| r0 = arg1;
0x000115d8 push {r0, r1, r4, r5, r6, lr} |
0x000115dc ldr r5, [pc, 0x50] |
0x000115e0 mov r6, r0 | r6 = r0;
0x000115e4 bl 0x108dc | errno_location ();
0x000115e8 mov r3, r6 | r3 = r6;
0x000115ec ldr r2, [pc, 0x44] | r2 = stderr;
0x000115f0 ldr r1, [pc, 0x44] | r1 = "libubi";
0x000115f4 ldr r4, [r0] | r4 = *(r0);
0x000115f8 ldr r0, [r5] | r0 = *(0x11630);
0x000115fc bl 0x10840 | fprintf (r0, "libubi", r2, r3, r4)
0x00011600 mov r0, r4 | r0 = r4;
0x00011604 ldr r5, [r5] | r5 = *(0x11630);
0x00011608 bl 0x107c8 | strerror (r0);
0x0001160c str r4, [sp] | *(sp) = r4;
0x00011610 ldr r3, [pc, 0x28] | r3 = "_s:_error_:_cannot_open___s_";
0x00011614 mov r2, 8 | r2 = 8;
0x00011618 ldr r1, [pc, 0x24] | r1 = *(0x11640);
0x0001161c str r0, [sp, 4] | var_4h = r0;
0x00011620 mov r0, r5 | r0 = r5;
0x00011624 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open___s_", r4)
0x00011628 mvn r0, 0 | r0 = ~0;
0x0001162c add sp, sp, 8 |
0x00011630 pop {r4, r5, r6, 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/ubiblock @ 0x1176c */
| #include <stdint.h>
|
; (fcn) fcn.0001176c () | void fcn_0001176c () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
0x0001176c push {r0, r1, r2, r3, r4, r5, r6, lr} |
0x00011770 mov r1, 0x68 | r1 = 0x68;
0x00011774 mov r0, 1 | r0 = 1;
0x00011778 bl 0x10834 | r0 = calloc (r0, r1);
0x0001177c subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00011780 beq 0x117f0 | goto label_1;
| }
0x00011784 ldr r1, [pc, 0x2fc] | r1 = *(0x11a84);
0x00011788 ldr r0, [pc, 0x2fc] | r0 = "class_misc_ubi_ctrl_";
0x0001178c bl 0x112c4 | r0 = fcn_000112c4 ("class_misc_ubi_ctrl_", r1);
0x00011790 cmp r0, 0 |
0x00011794 str r0, [r4, 4] | *((r4 + 4)) = r0;
| if (r0 == 0) {
0x00011798 beq 0x117e4 | goto label_0;
| }
0x0001179c ldr r1, [pc, 0x2ec] | r1 = "/sys";
0x000117a0 bl 0x112c4 | r0 = fcn_000112c4 (r0, "/sys");
0x000117a4 cmp r0, 0 |
0x000117a8 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r0 == 0) {
0x000117ac beq 0x117e4 | goto label_0;
| }
0x000117b0 ldr r1, [pc, 0x2dc] | r1 = "dev";
0x000117b4 ldr r0, [pc, 0x2d0] | r0 = "class_misc_ubi_ctrl_";
0x000117b8 bl 0x112c4 | r0 = fcn_000112c4 ("class_misc_ubi_ctrl_", "dev");
0x000117bc cmp r0, 0 |
0x000117c0 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| if (r0 == 0) {
0x000117c4 beq 0x117e4 | goto label_0;
| }
0x000117c8 mov r1, 0 | r1 = 0;
0x000117cc bl 0x108ac | r0 = open64 ();
0x000117d0 cmn r0, 1 |
| if (r0 != 1) {
0x000117d4 bne 0x117fc | goto label_2;
| }
0x000117d8 bl 0x108dc | errno_location ();
0x000117dc mov r3, 0 | r3 = 0;
0x000117e0 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x000117e4 mov r0, r4 | r0 = r4;
0x000117e8 bl 0x11698 | fcn_00011698 (r0);
0x000117ec mov r4, 0 | r4 = 0;
| label_1:
0x000117f0 mov r0, r4 | r0 = r4;
0x000117f4 add sp, sp, 0x10 |
0x000117f8 pop {r4, r5, r6, pc} |
| label_2:
0x000117fc bl 0x10924 | r0 = close (r0);
0x00011800 cmp r0, 0 |
| if (r0 == 0) {
0x00011804 beq 0x11854 | goto label_3;
| }
0x00011808 bl 0x108dc | errno_location ();
0x0001180c ldr r6, [pc, 0x284] |
0x00011810 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00011814 ldr r2, [pc, 0x280] | r2 = stderr;
0x00011818 ldr r1, [pc, 0x280] | r1 = "libubi";
0x0001181c ldr r5, [r0] | r5 = *(r0);
0x00011820 ldr r0, [r6] | r0 = "class_ubi";
0x00011824 bl 0x10840 | fprintf ("class_ubi", "libubi", r2, r3, r4, r5, "class_ubi")
0x00011828 mov r0, r5 | r0 = r5;
0x0001182c ldr r6, [r6] | r6 = "class_ubi";
0x00011830 bl 0x107c8 | strerror (r0);
0x00011834 str r5, [sp] | *(sp) = r5;
0x00011838 ldr r3, [pc, 0x264] | r3 = "%s: error!: close failed on \"%s\"\n";
0x0001183c mov r2, 8 | r2 = 8;
0x00011840 ldr r1, [pc, 0x260] | r1 = *(0x11aa4);
0x00011844 str r0, [sp, 4] | var_4h = r0;
0x00011848 mov r0, r6 | r0 = r6;
0x0001184c bl 0x10840 | fprintf (r0, r1, r2, "%s: error!: close failed on \"%s\"\n", r4, r5)
0x00011850 b 0x117e4 |
| } while (1);
| label_3:
0x00011854 ldr r1, [pc, 0x250] | r1 = "_serror__d___s_";
0x00011858 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x0001185c bl 0x112c4 | r0 = fcn_000112c4 (r0, "_serror__d___s_");
0x00011860 cmp r0, 0 |
0x00011864 str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
| if (r0 == 0) {
0x00011868 beq 0x117e4 | goto label_0;
| }
0x0001186c ldr r1, [pc, 0x23c] | r1 = "ubi_d";
0x00011870 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00011874 bl 0x112c4 | r0 = fcn_000112c4 (r0, "ubi_d");
0x00011878 cmp r0, 0 |
0x0001187c str r0, [r4, 0x14] | *((r4 + 0x14)) = r0;
| if (r0 == 0) {
0x00011880 beq 0x117e4 | goto label_0;
| }
0x00011884 ldr r1, [pc, 0x204] | r1 = "/sys";
0x00011888 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x0001188c bl 0x112c4 | r0 = fcn_000112c4 (r0, "/sys");
0x00011890 cmp r0, 0 |
0x00011894 str r0, [r4, 0x18] | *((r4 + 0x18)) = r0;
| if (r0 == 0) {
0x00011898 beq 0x117e4 | goto label_0;
| }
0x0001189c ldr r1, [pc, 0x210] | r1 = "version";
0x000118a0 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000118a4 bl 0x112c4 | r0 = fcn_000112c4 (r0, "version");
0x000118a8 cmp r0, 0 |
0x000118ac str r0, [r4, 0x1c] | *((r4 + 0x1c)) = r0;
| if (r0 == 0) {
0x000118b0 beq 0x117e4 | goto label_0;
| }
0x000118b4 ldr r1, [pc, 0x1fc] | r1 = "avail_eraseblocks";
0x000118b8 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000118bc bl 0x112c4 | r0 = fcn_000112c4 (r0, "avail_eraseblocks");
0x000118c0 cmp r0, 0 |
0x000118c4 str r0, [r4, 0x20] | *((r4 + 0x20)) = r0;
| if (r0 == 0) {
0x000118c8 beq 0x117e4 | goto label_0;
| }
0x000118cc ldr r1, [pc, 0x1e8] | r1 = "total_eraseblocks";
0x000118d0 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000118d4 bl 0x112c4 | r0 = fcn_000112c4 (r0, "total_eraseblocks");
0x000118d8 cmp r0, 0 |
0x000118dc str r0, [r4, 0x24] | *((r4 + 0x24)) = r0;
| if (r0 == 0) {
0x000118e0 beq 0x117e4 | goto label_0;
| }
0x000118e4 ldr r1, [pc, 0x1d4] | r1 = "bad_peb_count";
0x000118e8 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000118ec bl 0x112c4 | r0 = fcn_000112c4 (r0, "bad_peb_count");
0x000118f0 cmp r0, 0 |
0x000118f4 str r0, [r4, 0x28] | *((r4 + 0x28)) = r0;
| if (r0 == 0) {
0x000118f8 beq 0x117e4 | goto label_0;
| }
0x000118fc ldr r1, [pc, 0x1c0] | r1 = "eraseblock_size";
0x00011900 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011904 bl 0x112c4 | r0 = fcn_000112c4 (r0, "eraseblock_size");
0x00011908 cmp r0, 0 |
0x0001190c str r0, [r4, 0x2c] | *((r4 + 0x2c)) = r0;
| if (r0 == 0) {
0x00011910 beq 0x117e4 | goto label_0;
| }
0x00011914 ldr r1, [pc, 0x1ac] | r1 = "max_ec";
0x00011918 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x0001191c bl 0x112c4 | r0 = fcn_000112c4 (r0, "max_ec");
0x00011920 cmp r0, 0 |
0x00011924 str r0, [r4, 0x30] | *((r4 + 0x30)) = r0;
| if (r0 == 0) {
0x00011928 beq 0x117e4 | goto label_0;
| }
0x0001192c ldr r1, [pc, 0x198] | r1 = "reserved_for_bad";
0x00011930 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011934 bl 0x112c4 | r0 = fcn_000112c4 (r0, "reserved_for_bad");
0x00011938 cmp r0, 0 |
0x0001193c str r0, [r4, 0x34] | *((r4 + 0x34)) = r0;
| if (r0 == 0) {
0x00011940 beq 0x117e4 | goto label_0;
| }
0x00011944 ldr r1, [pc, 0x184] | r1 = "max_vol_count";
0x00011948 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x0001194c bl 0x112c4 | r0 = fcn_000112c4 (r0, "max_vol_count");
0x00011950 cmp r0, 0 |
0x00011954 str r0, [r4, 0x38] | *((r4 + 0x38)) = r0;
| if (r0 == 0) {
0x00011958 beq 0x117e4 | goto label_0;
| }
0x0001195c ldr r1, [pc, 0x170] | r1 = "min_io_size";
0x00011960 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011964 bl 0x112c4 | r0 = fcn_000112c4 (r0, "min_io_size");
0x00011968 cmp r0, 0 |
0x0001196c str r0, [r4, 0x3c] | *((r4 + 0x3c)) = r0;
| if (r0 == 0) {
0x00011970 beq 0x117e4 | goto label_0;
| }
0x00011974 ldr r1, [pc, 0x15c] | r1 = "mtd_num";
0x00011978 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x0001197c bl 0x112c4 | r0 = fcn_000112c4 (r0, "mtd_num");
0x00011980 cmp r0, 0 |
0x00011984 str r0, [r4, 0x40] | *((r4 + 0x40)) = r0;
| if (r0 == 0) {
0x00011988 beq 0x117e4 | goto label_0;
| }
0x0001198c ldr r1, [pc, 0x148] | r1 = "ubi_d__d";
0x00011990 bl 0x112c4 | r0 = fcn_000112c4 (r0, "ubi_d__d");
0x00011994 cmp r0, 0 |
0x00011998 str r0, [r4, 0x44] | *((r4 + 0x44)) = r0;
| if (r0 == 0) {
0x0001199c beq 0x117e4 | goto label_0;
| }
0x000119a0 ldr r1, [pc, 0xe8] | r1 = "/sys";
0x000119a4 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000119a8 bl 0x112c4 | r0 = fcn_000112c4 (r0, "/sys");
0x000119ac cmp r0, 0 |
0x000119b0 str r0, [r4, 0x48] | *((r4 + 0x48)) = r0;
| if (r0 == 0) {
0x000119b4 beq 0x117e4 | goto label_0;
| }
0x000119b8 ldr r1, [pc, 0x120] | r1 = "type";
0x000119bc ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000119c0 bl 0x112c4 | r0 = fcn_000112c4 (r0, "type");
0x000119c4 cmp r0, 0 |
0x000119c8 str r0, [r4, 0x4c] | *((r4 + 0x4c)) = r0;
| if (r0 == 0) {
0x000119cc beq 0x117e4 | goto label_0;
| }
0x000119d0 ldr r1, [pc, 0x10c] | r1 = "alignment";
0x000119d4 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000119d8 bl 0x112c4 | r0 = fcn_000112c4 (r0, "alignment");
0x000119dc cmp r0, 0 |
0x000119e0 str r0, [r4, 0x50] | *((r4 + 0x50)) = r0;
| if (r0 == 0) {
0x000119e4 beq 0x117e4 | goto label_0;
| }
0x000119e8 ldr r1, [pc, 0xf8] | r1 = "data_bytes";
0x000119ec ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x000119f0 bl 0x112c4 | r0 = fcn_000112c4 (r0, "data_bytes");
0x000119f4 cmp r0, 0 |
0x000119f8 str r0, [r4, 0x54] | *((r4 + 0x54)) = r0;
| if (r0 == 0) {
0x000119fc beq 0x117e4 | goto label_0;
| }
0x00011a00 ldr r1, [pc, 0xe4] | r1 = "reserved_ebs";
0x00011a04 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011a08 bl 0x112c4 | r0 = fcn_000112c4 (r0, "reserved_ebs");
0x00011a0c cmp r0, 0 |
0x00011a10 str r0, [r4, 0x58] | *((r4 + 0x58)) = r0;
| if (r0 == 0) {
0x00011a14 beq 0x117e4 | goto label_0;
| }
0x00011a18 ldr r1, [pc, 0xd0] | r1 = "usable_eb_size";
0x00011a1c ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011a20 bl 0x112c4 | r0 = fcn_000112c4 (r0, "usable_eb_size");
0x00011a24 cmp r0, 0 |
0x00011a28 str r0, [r4, 0x5c] | *((r4 + 0x5c)) = r0;
| if (r0 == 0) {
0x00011a2c beq 0x117e4 | goto label_0;
| }
0x00011a30 ldr r1, [pc, 0xbc] | r1 = "corrupted";
0x00011a34 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011a38 bl 0x112c4 | r0 = fcn_000112c4 (r0, "corrupted");
0x00011a3c cmp r0, 0 |
0x00011a40 str r0, [r4, 0x60] | *((r4 + 0x60)) = r0;
| if (r0 == 0) {
0x00011a44 beq 0x117e4 | goto label_0;
| }
0x00011a48 add r1, sp, 0xc | r1 += var_ch;
0x00011a4c ldr r0, [r4, 0x14] | r0 = *((r4 + 0x14));
0x00011a50 bl 0x11024 | r0 = fcn_00011024 (r0, r1);
0x00011a54 cmp r0, 0 |
| if (r0 != 0) {
0x00011a58 bne 0x117e4 | goto label_0;
| }
0x00011a5c ldr r3, [sp, 0xc] | r3 = var_ch;
0x00011a60 cmp r3, 1 |
| if (r3 == 1) {
0x00011a64 beq 0x117f0 | goto label_1;
| }
0x00011a68 ldr r0, [pc, 0x28] |
0x00011a6c str r3, [sp] | *(sp) = r3;
0x00011a70 ldr r2, [pc, 0x24] | r2 = stderr;
0x00011a74 mov r3, 1 | r3 = 1;
0x00011a78 ldr r1, [pc, 0x78] | r1 = "name";
0x00011a7c ldr r0, [r0] | r0 = "class_ubi";
0x00011a80 bl 0x10840 | fprintf ("class_ubi", "name", r2, r3)
0x00011a84 b 0x117e4 | 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/ubiblock @ 0x11c28 */
| #include <stdint.h>
|
; (fcn) fcn.00011c28 () | void fcn_00011c28 (int32_t arg1, void * s) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_110h;
| r0 = arg1;
| r1 = s;
0x00011c28 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00011c2c mov r4, r1 | r4 = r1;
0x00011c30 sub sp, sp, 0x110 |
0x00011c34 mov r5, r0 | r5 = r0;
0x00011c38 mov r2, 0x18 | r2 = 0x18;
0x00011c3c mov r1, 0 | r1 = 0;
0x00011c40 mov r0, r4 | r0 = r4;
0x00011c44 bl 0x108a0 | memset (r0, r1, r2);
0x00011c48 add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00011c4c add r1, r4, 0x10 | r1 = r4 + 0x10;
0x00011c50 ldr r0, [r5, 8] | r0 = *((r5 + 8));
0x00011c54 bl 0x114ac | r0 = fcn_000114ac (r0, r1);
0x00011c58 cmp r0, 0 |
| if (r0 == 0) {
0x00011c5c mvnne r3, 0 | r3 = ~0;
| }
| if (r0 == 0) {
0x00011c60 strne r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
| }
| if (r0 == 0) {
0x00011c64 strne r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x00011c68 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00011c6c bl 0x108b8 | r0 = opendir ();
0x00011c70 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00011c74 beq 0x11dd4 | goto label_2;
| }
0x00011c78 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00011c7c str r3, [r4, 4] | *((r4 + 4)) = r3;
0x00011c80 bl 0x108dc | errno_location ();
0x00011c84 ldr sl, [pc, 0x17c] | sl = "ubi_d_s";
0x00011c88 mov sb, 0 | sb = 0;
0x00011c8c mov r7, r0 | r7 = r0;
| do {
| label_0:
0x00011c90 str sb, [r7] | *(r7) = sb;
0x00011c94 mov r0, r8 | r0 = r8;
0x00011c98 bl 0x1087c | r0 = readdir64 ();
0x00011c9c cmp r0, 0 |
| if (r0 == 0) {
0x00011ca0 beq 0x11d30 | goto label_3;
| }
0x00011ca4 add r6, r0, 0x13 | r6 = r0 + 0x13;
0x00011ca8 mov r0, r6 | r0 = r6;
0x00011cac bl 0x108f4 | r0 = strlen (r0);
0x00011cb0 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00011cb4 bls 0x11ce8 |
0x00011cb8 ldr r0, [pc, 0x14c] |
0x00011cbc str r6, [sp] | *(sp) = r6;
0x00011cc0 ldr r2, [pc, 0x148] | r2 = stderr;
0x00011cc4 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00011cc8 ldr r1, [pc, 0x144] | r1 = "libubi";
0x00011ccc ldr r0, [r0] | r0 = "ubi_d_s";
0x00011cd0 bl 0x10840 | fprintf ("ubi_d_s", "libubi", r2, r3, r4, r5, r6)
0x00011cd4 mov r3, 0x16 | r3 = 0x16;
0x00011cd8 str r3, [r7] | *(r7) = r3;
| label_1:
0x00011cdc mov r0, r8 | r0 = r8;
0x00011ce0 bl 0x1090c | closedir ();
0x00011ce4 b 0x11dd4 | goto label_2;
| }
0x00011ce8 add r3, sp, 0x10 | r3 += var_10h;
0x00011cec add r2, sp, 0xc | r2 += var_ch;
0x00011cf0 mov r1, sl | r1 = sl;
0x00011cf4 mov r0, r6 | r0 = r6;
0x00011cf8 bl 0x10888 | r0 = sscanf (r0, r1, r2);
0x00011cfc cmp r0, 1 |
0x00011d00 bne 0x11c90 |
| } while (r0 != 1);
0x00011d04 ldr r3, [r4] | r3 = *(r4);
0x00011d08 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00011d0c add r3, r3, 1 | r3++;
0x00011d10 str r3, [r4] | *(r4) = r3;
0x00011d14 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00011d18 cmp r2, r3 |
0x00011d1c ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r2 >= r3) {
0x00011d20 strlt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x00011d24 cmp r3, r2 |
| if (r3 >= r2) {
0x00011d28 strlt r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x00011d2c b 0x11c90 | goto label_0;
| label_3:
0x00011d30 ldr r6, [r7] | r6 = *(r7);
0x00011d34 cmp r6, 0 |
| if (r6 != 0) {
0x00011d38 beq 0x11d80 |
0x00011d3c ldr r4, [pc, 0xc8] |
0x00011d40 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00011d44 ldr r2, [pc, 0xc4] | r2 = stderr;
0x00011d48 ldr r1, [pc, 0xc8] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x00011d4c ldr r0, [r4] | r0 = "ubi_d_s";
0x00011d50 bl 0x10840 | fprintf ("ubi_d_s", "%s: error!: invalid entry in %s: \"%s\"\n", r2, r3, "ubi_d_s")
0x00011d54 mov r0, r6 | r0 = r6;
0x00011d58 ldr r4, [r4] | r4 = "ubi_d_s";
0x00011d5c bl 0x107c8 | strerror (r0);
0x00011d60 str r6, [sp] | *(sp) = r6;
0x00011d64 ldr r3, [pc, 0xb0] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x00011d68 mov r2, 8 | r2 = 8;
0x00011d6c ldr r1, [pc, 0xac] | r1 = *(0x11e1c);
0x00011d70 str r0, [sp, 4] | var_4h = r0;
0x00011d74 mov r0, r4 | r0 = r4;
0x00011d78 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_", r4, r5, r6)
0x00011d7c b 0x11cdc | goto label_1;
| }
0x00011d80 mov r0, r8 | r0 = r8;
0x00011d84 bl 0x1090c | r0 = closedir ();
0x00011d88 cmp r0, 0 |
| if (r0 != 0) {
0x00011d8c beq 0x11ddc |
0x00011d90 ldr r6, [pc, 0x74] | r6 = "ubi_d_s";
0x00011d94 ldr r4, [r7] | r4 = *(r7);
0x00011d98 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00011d9c ldr r2, [pc, 0x6c] | r2 = stderr;
0x00011da0 ldr r1, [pc, 0x7c] | r1 = "_serror__d___s_";
0x00011da4 ldr r0, [r6] | r0 = "ubi_d_s";
0x00011da8 bl 0x10840 | fprintf ("ubi_d_s", "_serror__d___s_", r2, r3, r4, r5, "ubi_d_s")
0x00011dac mov r0, r4 | r0 = r4;
0x00011db0 ldr r5, [r6] | r5 = "ubi_d_s";
0x00011db4 bl 0x107c8 | strerror (r0);
0x00011db8 str r4, [sp] | *(sp) = r4;
0x00011dbc ldr r3, [pc, 0x58] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x00011dc0 mov r2, 8 | r2 = 8;
0x00011dc4 ldr r1, [pc, 0x54] | r1 = *(0x11e1c);
0x00011dc8 str r0, [sp, 4] | var_4h = r0;
0x00011dcc mov r0, r5 | r0 = r5;
0x00011dd0 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_", r4)
| label_2:
0x00011dd4 mvn r0, 0 | r0 = ~0;
0x00011dd8 b 0x11e00 |
| } else {
0x00011ddc ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00011de0 add r1, r4, 0xc | r1 = r4 + 0xc;
0x00011de4 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00011de8 streq r0, [r4, 4] | *((r4 + 4)) = r0;
| }
0x00011dec ldr r0, [r5, 0x14] | r0 = *((r5 + 0x14));
0x00011df0 bl 0x11024 | r0 = fcn_00011024 (r0, r1);
0x00011df4 adds r0, r0, 0 | r0 += 0;
| if (r0 == r0) {
0x00011df8 movne r0, 1 | r0 = 1;
| }
0x00011dfc rsb r0, r0, 0 | r0 -= ;
| }
0x00011e00 add sp, sp, 0x110 |
0x00011e04 pop {r4, r5, r6, r7, r8, sb, sl, 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/ubiblock @ 0x11f58 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00011f58 () | void fcn_00011f58 (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;
0x00011f58 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00011f5c add fp, sp, 0x20 |
0x00011f60 sub sp, sp, 0x9c |
0x00011f64 mov r6, r0 | r6 = r0;
0x00011f68 ldr r0, [r0, 0x40] | r0 = *((r0 + 0x40));
0x00011f6c mov r5, r1 | r5 = r1;
0x00011f70 bl 0x108f4 | strlen (r0);
0x00011f74 sub r1, fp, 0x8c | r1 -= var_8ch;
0x00011f78 add r0, r0, 0x6b | r0 += 0x6b;
0x00011f7c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00011f80 sub sp, sp, r0 |
0x00011f84 mov r0, r5 | r0 = r5;
0x00011f88 bl 0x107d4 | r0 = stat64 ();
0x00011f8c cmp r0, 0 |
| if (r0 == 0) {
0x00011f90 beq 0x11fe8 | goto label_5;
| }
0x00011f94 bl 0x108dc | errno_location ();
0x00011f98 ldr r6, [pc, 0x1e8] | r6 = *(0x12184);
0x00011f9c mov r3, r5 | r3 = r5;
0x00011fa0 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x00011fa4 ldr r1, [pc, 0x1e4] | r1 = "libubi";
0x00011fa8 ldr r4, [r0] | r4 = *(r0);
0x00011fac ldr r0, [r6] | r0 = *(0x12184);
0x00011fb0 bl 0x10840 | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00011fb4 mov r0, r4 | r0 = r4;
0x00011fb8 ldr r5, [r6] | r5 = *(0x12184);
0x00011fbc bl 0x107c8 | strerror (r0);
0x00011fc0 str r4, [sp] | *(sp) = r4;
0x00011fc4 ldr r3, [pc, 0x1c8] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x00011fc8 mov r2, 8 | r2 = 8;
0x00011fcc ldr r1, [pc, 0x1c4] | r1 = *(0x12194);
0x00011fd0 str r0, [sp, 4] | var_4h = r0;
0x00011fd4 mov r0, r5 | r0 = r5;
0x00011fd8 bl 0x10840 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n", r4)
| do {
| label_0:
0x00011fdc mvn r0, 0 | r0 = ~0;
| label_4:
0x00011fe0 sub sp, fp, 0x20 |
0x00011fe4 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_5:
0x00011fe8 ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x00011fec and r3, r3, 0xf000 | r3 &= 0xf000;
0x00011ff0 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00011ff4 beq 0x12020 | goto label_6;
| }
0x00011ff8 ldr r0, [pc, 0x188] |
0x00011ffc mov r3, r5 | r3 = r5;
0x00012000 ldr r2, [pc, 0x184] | r2 = stderr;
0x00012004 ldr r1, [pc, 0x190] | r1 = "_serror__d___s_";
0x00012008 ldr r0, [r0] | r0 = *(0x12184);
0x0001200c bl 0x10840 | r0 = fprintf (r0, "_serror__d___s_", r2, r3)
0x00012010 bl 0x108dc | errno_location ();
0x00012014 mov r3, 0x16 | r3 = 0x16;
| label_1:
0x00012018 str r3, [r0] | *(r0) = r3;
0x0001201c b 0x11fdc |
| } while (1);
| label_6:
0x00012020 ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x00012024 mov r1, r3 | r1 = r3;
0x00012028 mov r0, r2 | r0 = r2;
0x0001202c strd r2, r3, [fp, -0xb4] | __asm ("strd r2, r3, [var_b4h]");
0x00012030 bl 0x107ec | gnu_dev_major ();
0x00012034 ldrd r2, r3, [fp, -0xb4] | __asm ("ldrd r2, r3, [var_b4h]");
0x00012038 mov r1, r3 | r1 = r3;
0x0001203c mov sb, r0 | sb = r0;
0x00012040 mov r0, r2 | r0 = r2;
0x00012044 bl 0x1081c | gnu_dev_minor ();
0x00012048 sub r1, fp, 0xa4 | r1 -= var_a4h;
0x0001204c mov r7, r0 | r7 = r0;
0x00012050 mov r0, r6 | r0 = r6;
0x00012054 bl 0x11c28 | r0 = fcn_00011c28 (r0, r1);
0x00012058 cmp r0, 0 |
| if (r0 != 0) {
0x0001205c addeq r8, sp, 8 | r8 += var_b4h;
| }
| if (r0 != 0) {
0x00012060 ldreq r4, [fp, -0xa0] | r4 = var_a0h;
| }
| if (r0 == 0) {
0x00012064 addeq sl, r6, 0x18 | sl = r6 + 0x18;
| goto label_7;
| }
| if (r0 != 0) {
| label_7:
0x00012068 bne 0x11fdc | goto label_0;
| }
| do {
0x0001206c ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012070 cmp r4, r3 |
| if (r4 > r3) {
0x00012074 bgt 0x120ec | goto label_8;
| }
0x00012078 sub r3, fp, 0xa8 | r3 -= var_a8h;
0x0001207c sub r2, fp, 0xac | r2 -= var_ach;
0x00012080 mov r1, r4 | r1 = r4;
0x00012084 mov r0, sl | r0 = sl;
0x00012088 bl 0x11584 | r0 = fcn_00011584 (r0, r1);
0x0001208c cmp r0, 0 |
| if (r0 == 0) {
0x00012090 beq 0x120e0 | goto label_9;
| }
0x00012094 bl 0x108dc | r0 = errno_location ();
0x00012098 ldr r3, [r0] | r3 = *(r0);
0x0001209c cmp r3, 2 |
| if (r3 != 2) {
0x000120a0 bne 0x120ac | goto label_10;
| }
| label_2:
0x000120a4 add r4, r4, 1 | r4++;
0x000120a8 b 0x1206c |
| } while (1);
| label_10:
0x000120ac cmp r3, 0 |
| if (r3 != 0) {
0x000120b0 bne 0x11fdc | goto label_0;
| }
| label_3:
0x000120b4 ldr r0, [pc, 0xcc] |
0x000120b8 mov r3, r5 | r3 = r5;
0x000120bc str r7, [sp, 4] | var_4h = r7;
0x000120c0 str sb, [sp] | *(sp) = sb;
0x000120c4 ldr r2, [pc, 0xc0] | r2 = stderr;
0x000120c8 ldr r1, [pc, 0xd0] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x000120cc ldr r0, [r0] | r0 = *(0x12184);
0x000120d0 bl 0x10840 | r0 = fprintf (r0, "_s:_error_:___s__is_not_a_character_device", r2, r3)
0x000120d4 bl 0x108dc | errno_location ();
0x000120d8 mov r3, 0x13 | r3 = 0x13;
0x000120dc b 0x12018 | goto label_1;
| label_9:
0x000120e0 ldr r3, [fp, -0xac] | r3 = var_ach;
0x000120e4 cmp r3, sb |
| if (r3 != sb) {
0x000120e8 bne 0x120a4 | goto label_2;
| }
| label_8:
0x000120ec ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x000120f0 cmp r4, r3 |
| if (r4 > r3) {
0x000120f4 bgt 0x120b4 | goto label_3;
| }
0x000120f8 cmp r7, 0 |
| if (r7 == 0) {
0x000120fc moveq r0, 1 | r0 = 1;
| goto label_11;
| }
| if (r7 == 0) {
| label_11:
0x00012100 beq 0x11fe0 | goto label_4;
| }
0x00012104 sub r3, r7, 1 | r3 = r7 - 1;
0x00012108 mov r2, r4 | r2 = r4;
0x0001210c ldr r1, [r6, 0x40] | r1 = *((r6 + 0x40));
0x00012110 mov r0, r8 | r0 = r8;
0x00012114 bl 0x108d0 | sprintf (r0, r1, r2)
0x00012118 mov r1, 0 | r1 = 0;
0x0001211c mov r0, r8 | r0 = r8;
0x00012120 bl 0x108ac | r0 = open64 ();
0x00012124 cmn r0, 1 |
| if (r0 == 1) {
0x00012128 beq 0x120b4 | goto label_3;
| }
0x0001212c bl 0x10924 | r0 = close (r0);
0x00012130 cmp r0, 0 |
| if (r0 != 0) {
0x00012134 beq 0x12180 |
0x00012138 bl 0x108dc | errno_location ();
0x0001213c ldr r5, [pc, 0x44] |
0x00012140 mov r3, r8 | r3 = r8;
0x00012144 ldr r2, [pc, 0x40] | r2 = stderr;
0x00012148 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";
0x0001214c ldr r4, [r0] | r4 = *(r0);
0x00012150 ldr r0, [r5] | r0 = *(0x12184);
0x00012154 bl 0x10840 | 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)
0x00012158 mov r0, r4 | r0 = r4;
0x0001215c ldr r5, [r5] | r5 = *(0x12184);
0x00012160 bl 0x107c8 | strerror (r0);
0x00012164 str r4, [sp] | *(sp) = r4;
0x00012168 ldr r3, [pc, 0x24] | r3 = "%s: error!: cannot get information about \"%s\"\n";
0x0001216c mov r2, 8 | r2 = 8;
0x00012170 ldr r1, [pc, 0x20] | r1 = *(0x12194);
0x00012174 str r0, [sp, 4] | var_4h = r0;
0x00012178 mov r0, r5 | r0 = r5;
0x0001217c bl 0x10840 | fprintf (r0, r1, r2, "%s: error!: cannot get information about \"%s\"\n", r4)
| }
0x00012180 mov r0, 2 | r0 = 2;
0x00012184 b 0x11fe0 | 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/ubiblock @ 0x125b4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000125b4 () | void fcn_000125b4 (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;
0x000125b4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000125b8 add sl, r2, 4 | sl = r2 + 4;
0x000125bc add fp, sp, 0x20 |
0x000125c0 sub sp, sp, 0x114 |
0x000125c4 mov r6, r1 | r6 = r1;
0x000125c8 mov r5, r0 | r5 = r0;
0x000125cc mov r4, r2 | r4 = r2;
0x000125d0 mov r1, 0 | r1 = 0;
0x000125d4 mov r2, 0x54 | r2 = 0x54;
0x000125d8 mov r0, sl | r0 = sl;
0x000125dc bl 0x108a0 | memset (r0, r1, r2);
0x000125e0 str r6, [r4] | *(r4) = r6;
0x000125e4 mov r1, r6 | r1 = r6;
0x000125e8 mov r0, r5 | r0 = r5;
0x000125ec bl 0x12560 | r0 = fcn_00012560 (r0, r1);
0x000125f0 cmp r0, 0 |
0x000125f4 bne 0x12600 |
| while (r8 == r0) {
| label_0:
0x000125f8 mvn r0, 0 | r0 = ~0;
0x000125fc b 0x128c4 | goto label_3;
0x00012600 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00012604 bl 0x108b8 | r0 = opendir ();
0x00012608 subs r8, r0, 0 | r8 = r0 - 0;
0x0001260c beq 0x125f8 |
| }
0x00012610 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00012614 str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x00012618 bl 0x108dc | r0 = errno_location ();
0x0001261c mov sb, r0 | sb = r0;
| do {
| label_1:
0x00012620 mov r3, 0 | r3 = 0;
0x00012624 str r3, [sb] | *(sb) = r3;
0x00012628 mov r0, r8 | r0 = r8;
0x0001262c bl 0x1087c | r0 = readdir64 ();
0x00012630 cmp r0, 0 |
| if (r0 == 0) {
0x00012634 beq 0x126d0 | goto label_4;
| }
0x00012638 add r7, r0, 0x13 | r7 = r0 + 0x13;
0x0001263c mov r0, r7 | r0 = r7;
0x00012640 bl 0x108f4 | r0 = strlen (r0);
0x00012644 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00012648 bls 0x12674 |
0x0001264c ldr r0, [pc, 0x278] |
0x00012650 str r7, [sp] | *(sp) = r7;
0x00012654 ldr r2, [pc, 0x274] | r2 = stderr;
0x00012658 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x0001265c ldr r1, [pc, 0x270] | r1 = "libubi";
0x00012660 ldr r0, [r0] | r0 = *(0x128c8);
0x00012664 bl 0x10840 | fprintf (r0, "libubi", r2, r3)
| label_2:
0x00012668 mov r0, r8 | r0 = r8;
0x0001266c bl 0x1090c | closedir ();
0x00012670 b 0x125f8 | goto label_0;
| }
0x00012674 sub r3, fp, 0x124 | r3 -= var_124h;
0x00012678 str r3, [sp] | *(sp) = r3;
0x0001267c sub r2, fp, 0x128 | r2 -= var_128h;
0x00012680 sub r3, fp, 0x12c | r3 -= s;
0x00012684 ldr r1, [pc, 0x24c] | r1 = "%s: error!: invalid entry in %s: \"%s\"\n";
0x00012688 mov r0, r7 | r0 = r7;
0x0001268c bl 0x10888 | r0 = sscanf (r0, "%s: error!: invalid entry in %s: \"%s\"\n", r2);
0x00012690 cmp r0, 2 |
0x00012694 bne 0x12620 |
| } while (r0 != 2);
0x00012698 ldr r3, [fp, -0x128] | r3 = var_128h;
0x0001269c cmp r3, r6 |
| if (r3 != r6) {
0x000126a0 bne 0x12620 | goto label_1;
| }
0x000126a4 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x000126a8 ldr r2, [r4, 0x10] | r2 = *((r4 + 0x10));
0x000126ac add r3, r3, 1 | r3++;
0x000126b0 str r3, [r4, 8] | *((r4 + 8)) = r3;
0x000126b4 ldr r3, [fp, -0x12c] | r3 = s;
0x000126b8 cmp r2, r3 |
0x000126bc ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
| if (r2 >= r3) {
0x000126c0 strlt r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x000126c4 cmp r3, r2 |
| if (r3 >= r2) {
0x000126c8 strlt r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
| }
0x000126cc b 0x12620 | goto label_1;
| label_4:
0x000126d0 ldr r7, [sb] | r7 = *(sb);
0x000126d4 cmp r7, 0 |
| if (r7 != 0) {
0x000126d8 beq 0x12720 |
0x000126dc ldr r4, [pc, 0x1e8] |
0x000126e0 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000126e4 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x000126e8 ldr r1, [pc, 0x1ec] | r1 = "ubi%d_%d%s";
0x000126ec ldr r0, [r4] | r0 = *(0x128c8);
0x000126f0 bl 0x10840 | fprintf (r0, "ubi%d_%d%s", r2, r3, r4)
0x000126f4 mov r0, r7 | r0 = r7;
0x000126f8 ldr r4, [r4] | r4 = *(0x128c8);
0x000126fc bl 0x107c8 | strerror (r0);
0x00012700 str r7, [sp] | *(sp) = r7;
0x00012704 ldr r3, [pc, 0x1d4] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x00012708 mov r2, 8 | r2 = 8;
0x0001270c ldr r1, [pc, 0x1d0] | r1 = *(0x128e0);
0x00012710 str r0, [sp, 4] | var_4h = r0;
0x00012714 mov r0, r4 | r0 = r4;
0x00012718 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_")
0x0001271c b 0x12668 | goto label_2;
| }
0x00012720 mov r0, r8 | r0 = r8;
0x00012724 bl 0x1090c | r0 = closedir ();
0x00012728 cmp r0, 0 |
| if (r0 != 0) {
0x0001272c beq 0x12778 |
0x00012730 ldr r6, [pc, 0x194] | r6 = *(0x128c8);
0x00012734 ldr r4, [sb] | r4 = *(sb);
0x00012738 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x0001273c ldr r2, [pc, 0x18c] | r2 = stderr;
0x00012740 ldr r1, [pc, 0x1a0] | r1 = "_serror__d___s_";
0x00012744 ldr r0, [r6] | r0 = *(0x128c8);
0x00012748 bl 0x10840 | fprintf (r0, "_serror__d___s_", r2, r3, r4, r5, r6)
0x0001274c mov r0, r4 | r0 = r4;
0x00012750 ldr r5, [r6] | r5 = *(0x128c8);
0x00012754 bl 0x107c8 | strerror (r0);
0x00012758 str r4, [sp] | *(sp) = r4;
0x0001275c ldr r3, [pc, 0x17c] | r3 = "_s:_error_:_readdir_failed_on___s_";
0x00012760 mov r2, 8 | r2 = 8;
0x00012764 ldr r1, [pc, 0x178] | r1 = *(0x128e0);
0x00012768 str r0, [sp, 4] | var_4h = r0;
0x0001276c mov r0, r5 | r0 = r5;
0x00012770 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_readdir_failed_on___s_", r4)
0x00012774 b 0x125f8 | goto label_0;
| }
0x00012778 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x0001277c add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00012780 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00012784 streq r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| }
0x00012788 add r3, r4, 0x18 | r3 = r4 + 0x18;
0x0001278c mov r1, r6 | r1 = r6;
0x00012790 add r0, r5, 0x18 | r0 = r5 + 0x18;
0x00012794 bl 0x11584 | r0 = fcn_00011584 (r0, r1);
0x00012798 cmp r0, 0 |
| if (r0 != 0) {
0x0001279c bne 0x125f8 | goto label_0;
| }
0x000127a0 mov r2, sl | r2 = sl;
0x000127a4 mov r1, r6 | r1 = r6;
0x000127a8 ldr r0, [r5, 0x3c] | r0 = *((r5 + 0x3c));
0x000127ac bl 0x11098 | r0 = fcn_00011098 (r0, r1);
0x000127b0 cmp r0, 0 |
| if (r0 != 0) {
0x000127b4 bne 0x125f8 | goto label_0;
| }
0x000127b8 add r2, r4, 0x20 | r2 = r4 + 0x20;
0x000127bc mov r1, r6 | r1 = r6;
0x000127c0 ldr r0, [r5, 0x1c] | r0 = *((r5 + 0x1c));
0x000127c4 bl 0x11098 | r0 = fcn_00011098 (r0, r1);
0x000127c8 cmp r0, 0 |
| if (r0 != 0) {
0x000127cc bne 0x125f8 | goto label_0;
| }
0x000127d0 add r2, r4, 0x1c | r2 = r4 + 0x1c;
0x000127d4 mov r1, r6 | r1 = r6;
0x000127d8 ldr r0, [r5, 0x20] | r0 = *((r5 + 0x20));
0x000127dc bl 0x11098 | r0 = fcn_00011098 (r0, r1);
0x000127e0 cmp r0, 0 |
| if (r0 != 0) {
0x000127e4 bne 0x125f8 | goto label_0;
| }
0x000127e8 add r2, r4, 0x38 | r2 = r4 + 0x38;
0x000127ec mov r1, r6 | r1 = r6;
0x000127f0 ldr r0, [r5, 0x24] | r0 = *((r5 + 0x24));
0x000127f4 bl 0x11098 | r0 = fcn_00011098 (r0, r1);
0x000127f8 cmp r0, 0 |
| if (r0 != 0) {
0x000127fc bne 0x125f8 | goto label_0;
| }
0x00012800 add r2, r4, 0x3c | r2 = r4 + 0x3c;
0x00012804 mov r1, r6 | r1 = r6;
0x00012808 ldr r0, [r5, 0x28] | r0 = *((r5 + 0x28));
0x0001280c bl 0x11098 | r0 = fcn_00011098 (r0, r1);
0x00012810 cmp r0, 0 |
| if (r0 != 0) {
0x00012814 bne 0x125f8 | goto label_0;
| }
0x00012818 add r2, r4, 0x48 | r2 = r4 + 0x48;
0x0001281c mov r1, r6 | r1 = r6;
0x00012820 ldr r0, [r5, 0x30] | r0 = *((r5 + 0x30));
0x00012824 bl 0x11098 | r0 = fcn_00011098 (r0, r1);
0x00012828 cmp r0, 0 |
| if (r0 != 0) {
0x0001282c bne 0x125f8 | goto label_0;
| }
0x00012830 ldr r8, [r5, 0x2c] | r8 = *((r5 + 0x2c));
0x00012834 mov sb, sp | sb = sp;
0x00012838 mov r0, r8 | r0 = r8;
0x0001283c bl 0x108f4 | strlen (r0);
0x00012840 mov r2, r6 | r2 = r6;
0x00012844 mov r1, r8 | r1 = r8;
0x00012848 add r0, r0, 0x39 | r0 += 0x39;
0x0001284c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012850 sub sp, sp, r0 |
0x00012854 add r7, sp, 8 | r7 += s;
0x00012858 mov r0, r7 | r0 = r7;
0x0001285c bl 0x108d0 | sprintf (r0, r1, r2)
0x00012860 add r1, r4, 0x40 | r1 = r4 + 0x40;
0x00012864 mov r0, r7 | r0 = r7;
0x00012868 bl 0x10e74 | fcn_00010e74 (r0, r1);
0x0001286c mov sp, sb |
0x00012870 cmp r0, 0 |
| if (r0 != 0) {
0x00012874 bne 0x125f8 | goto label_0;
| }
0x00012878 add r2, r4, 0x4c | r2 = r4 + 0x4c;
0x0001287c mov r1, r6 | r1 = r6;
0x00012880 ldr r0, [r5, 0x34] | r0 = *((r5 + 0x34));
0x00012884 bl 0x11098 | r0 = fcn_00011098 (r0, r1);
0x00012888 cmp r0, 0 |
| if (r0 != 0) {
0x0001288c bne 0x125f8 | goto label_0;
| }
0x00012890 add r2, r4, 0x50 | r2 = r4 + 0x50;
0x00012894 mov r1, r6 | r1 = r6;
0x00012898 ldr r0, [r5, 0x38] | r0 = *((r5 + 0x38));
0x0001289c bl 0x11098 | r0 = fcn_00011098 (r0, r1);
0x000128a0 cmp r0, 0 |
| if (r0 != 0) {
0x000128a4 bne 0x125f8 | goto label_0;
| }
0x000128a8 ldr r3, [r4, 0x3c] | r3 = *((r4 + 0x3c));
0x000128ac ldr r2, [r4, 0x20] | r2 = *((r4 + 0x20));
0x000128b0 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x000128b4 ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x000128b8 strd r6, r7, [r4, 0x30] | __asm ("strd r6, r7, [r4, 0x30]");
0x000128bc smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x000128c0 strd r6, r7, [r4, 0x28] | __asm ("strd r6, r7, [r4, 0x28]");
| label_3:
0x000128c4 sub sp, fp, 0x20 |
0x000128c8 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/ubiblock @ 0x12adc */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012adc () | void fcn_00012adc (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;
0x00012adc push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012ae0 add sb, r3, 8 | sb = r3 + 8;
0x00012ae4 add fp, sp, 0x20 |
0x00012ae8 sub sp, sp, 0x3c |
0x00012aec mov r5, r1 | r5 = r1;
0x00012af0 mov r6, r2 | r6 = r2;
0x00012af4 mov r1, 0 | r1 = 0;
0x00012af8 mov r2, 0xb0 | r2 = 0xb0;
0x00012afc mov r7, r0 | r7 = r0;
0x00012b00 mov r0, sb | r0 = sb;
0x00012b04 mov r4, r3 | r4 = r3;
0x00012b08 bl 0x108a0 | memset (r0, r1, r2);
0x00012b0c ldr sl, [r7, 0x48] | sl = *((r7 + 0x48));
0x00012b10 stm r4, {r5, r6} | *(r4) = r5;
| *((r4 + 4)) = r6;
0x00012b14 mov r0, sl | r0 = sl;
0x00012b18 bl 0x108f4 | strlen (r0);
0x00012b1c mov r8, sp | r8 = sp;
0x00012b20 mov r3, r6 | r3 = r6;
0x00012b24 mov r2, r5 | r2 = r5;
0x00012b28 mov r1, sl | r1 = sl;
0x00012b2c add r0, r0, 0x6b | r0 += 0x6b;
0x00012b30 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012b34 sub sp, sp, r0 |
0x00012b38 mov r0, sp | r0 = sp;
0x00012b3c bl 0x108d0 | sprintf (r0, r1, r2)
0x00012b40 mov r0, sp | r0 = sp;
0x00012b44 add r2, r4, 0xc | r2 = r4 + 0xc;
0x00012b48 mov r1, sb | r1 = sb;
0x00012b4c bl 0x114ac | fcn_000114ac (r0, r1);
0x00012b50 mov sp, r8 |
0x00012b54 cmp r0, 0 |
0x00012b58 beq 0x12b6c |
| while (r8 < r0) {
| label_0:
0x00012b5c mvn r8, 0 | r8 = ~0;
| label_1:
0x00012b60 mov r0, r8 | r0 = r8;
0x00012b64 sub sp, fp, 0x20 |
0x00012b68 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00012b6c ldr sb, [r7, 0x44] | sb = *((r7 + 0x44));
0x00012b70 mov r0, sb | r0 = sb;
0x00012b74 bl 0x108f4 | strlen (r0);
0x00012b78 mov r3, r6 | r3 = r6;
0x00012b7c mov r2, r5 | r2 = r5;
0x00012b80 mov r1, sb | r1 = sb;
0x00012b84 add r0, r0, 0x6b | r0 += 0x6b;
0x00012b88 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012b8c sub sp, sp, r0 |
0x00012b90 mov r0, sp | r0 = sp;
0x00012b94 bl 0x108d0 | sprintf (r0, r1, r2)
0x00012b98 mov r0, sp | r0 = sp;
0x00012b9c mov r2, 0x32 | r2 = 0x32;
0x00012ba0 sub r1, fp, 0x58 | r1 -= s1;
0x00012ba4 bl 0x11130 | fcn_00011130 (r0, r1);
0x00012ba8 mov sp, r8 |
0x00012bac subs r8, r0, 0 | r8 = r0 - 0;
0x00012bb0 blt 0x12b5c |
| }
0x00012bb4 mov r2, r8 | r2 = r8;
0x00012bb8 ldr r1, [pc, 0x174] | r1 = *(0x12d30);
0x00012bbc sub r0, fp, 0x58 | r0 -= s1;
0x00012bc0 bl 0x10864 | r0 = strncmp (r0, r1, r2);
0x00012bc4 cmp r0, 0 |
| if (r0 != 0) {
0x00012bc8 moveq r3, 4 | r3 = 4;
| }
| if (r0 != 0) {
0x00012bcc beq 0x12bec |
0x00012bd0 mov r2, r8 | r2 = r8;
0x00012bd4 ldr r1, [pc, 0x15c] | r1 = "static\n";
0x00012bd8 sub r0, fp, 0x58 | r0 -= s1;
0x00012bdc bl 0x10864 | r0 = strncmp (r0, "static\n", r2);
0x00012be0 cmp r0, 0 |
| if (r0 != 0) {
0x00012be4 bne 0x12d0c | goto label_2;
| }
0x00012be8 mov r3, 3 | r3 = 3;
| }
0x00012bec str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x00012bf0 mov r2, r6 | r2 = r6;
0x00012bf4 add r3, r4, 0x14 | r3 = r4 + 0x14;
0x00012bf8 mov r1, r5 | r1 = r5;
0x00012bfc ldr r0, [r7, 0x4c] | r0 = *((r7 + 0x4c));
0x00012c00 bl 0x110e0 | r0 = fcn_000110e0 (r0, r1);
0x00012c04 cmp r0, 0 |
| if (r0 != 0) {
0x00012c08 bne 0x12b5c | goto label_0;
| }
0x00012c0c ldr r8, [r7, 0x50] | r8 = *((r7 + 0x50));
0x00012c10 mov sb, sp | sb = sp;
0x00012c14 mov r0, r8 | r0 = r8;
0x00012c18 bl 0x108f4 | strlen (r0);
0x00012c1c mov r3, r6 | r3 = r6;
0x00012c20 mov r2, r5 | r2 = r5;
0x00012c24 mov r1, r8 | r1 = r8;
0x00012c28 add r0, r0, 0x6b | r0 += 0x6b;
0x00012c2c bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012c30 sub sp, sp, r0 |
0x00012c34 mov r0, sp | r0 = sp;
0x00012c38 bl 0x108d0 | sprintf (r0, r1, r2)
0x00012c3c mov r0, sp | r0 = sp;
0x00012c40 add r1, r4, 0x18 | r1 = r4 + 0x18;
0x00012c44 bl 0x10e74 | fcn_00010e74 (r0, r1);
0x00012c48 mov sp, sb |
0x00012c4c cmp r0, 0 |
| if (r0 != 0) {
0x00012c50 bne 0x12b5c | goto label_0;
| }
0x00012c54 add r3, r4, 0x28 | r3 = r4 + 0x28;
0x00012c58 mov r2, r6 | r2 = r6;
0x00012c5c mov r1, r5 | r1 = r5;
0x00012c60 ldr r0, [r7, 0x54] | r0 = *((r7 + 0x54));
0x00012c64 bl 0x110e0 | r0 = fcn_000110e0 (r0, r1);
0x00012c68 cmp r0, 0 |
| if (r0 != 0) {
0x00012c6c bne 0x12b5c | goto label_0;
| }
0x00012c70 add r3, r4, 0x2c | r3 = r4 + 0x2c;
0x00012c74 mov r2, r6 | r2 = r6;
0x00012c78 mov r1, r5 | r1 = r5;
0x00012c7c ldr r0, [r7, 0x58] | r0 = *((r7 + 0x58));
0x00012c80 bl 0x110e0 | r0 = fcn_000110e0 (r0, r1);
0x00012c84 cmp r0, 0 |
| if (r0 != 0) {
0x00012c88 bne 0x12b5c | goto label_0;
| }
0x00012c8c add r3, r4, 0x30 | r3 = r4 + 0x30;
0x00012c90 mov r2, r6 | r2 = r6;
0x00012c94 mov r1, r5 | r1 = r5;
0x00012c98 ldr r0, [r7, 0x5c] | r0 = *((r7 + 0x5c));
0x00012c9c bl 0x110e0 | r0 = fcn_000110e0 (r0, r1);
0x00012ca0 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 != r0) {
0x00012ca4 bne 0x12b5c | goto label_0;
| }
0x00012ca8 ldr r1, [r4, 0x28] | r1 = *((r4 + 0x28));
0x00012cac ldr r0, [r4, 0x2c] | r0 = *((r4 + 0x2c));
0x00012cb0 ldr r7, [r7, 0x60] | r7 = *((r7 + 0x60));
0x00012cb4 smull r2, r3, r0, r1 | r2:r3 = r0 * r1;
0x00012cb8 mov r0, r7 | r0 = r7;
0x00012cbc strd r2, r3, [r4, 0x20] | __asm ("strd r2, r3, [r4, 0x20]");
0x00012cc0 bl 0x108f4 | strlen (r0);
0x00012cc4 mov r3, r6 | r3 = r6;
0x00012cc8 mov r2, r5 | r2 = r5;
0x00012ccc mov r1, r7 | r1 = r7;
0x00012cd0 add r0, r0, 0x6b | r0 += 0x6b;
0x00012cd4 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012cd8 sub sp, sp, r0 |
0x00012cdc mov r0, sp | r0 = sp;
0x00012ce0 bl 0x108d0 | sprintf (r0, r1, r2)
0x00012ce4 mov r0, sp | r0 = sp;
0x00012ce8 mov r2, 0x81 | r2 = 0x81;
0x00012cec add r1, r4, 0x34 | r1 = r4 + 0x34;
0x00012cf0 bl 0x11130 | fcn_00011130 (r0, r1);
0x00012cf4 mov sp, sb |
0x00012cf8 cmp r0, 0 |
| if (r0 < 0) {
0x00012cfc blt 0x12b5c | goto label_0;
| }
0x00012d00 add r4, r4, r0 | r4 += r0;
0x00012d04 strb r8, [r4, 0x33] | *((r4 + 0x33)) = r8;
0x00012d08 b 0x12b60 | goto label_1;
| label_2:
0x00012d0c ldr r0, [pc, 0x28] |
0x00012d10 sub r3, fp, 0x58 | r3 -= s1;
0x00012d14 ldr r2, [pc, 0x24] | r2 = stderr;
0x00012d18 ldr r1, [pc, 0x24] | r1 = "libubi";
0x00012d1c ldr r0, [r0] | r0 = "dynamic\n";
0x00012d20 bl 0x10840 | r0 = fprintf ("dynamic\n", "libubi", r2, r3)
0x00012d24 bl 0x108dc | errno_location ();
0x00012d28 mov r3, 0x16 | r3 = 0x16;
0x00012d2c str r3, [r0] | *(r0) = r3;
0x00012d30 b 0x12b5c | 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/ubiblock @ 0x1093c */
| #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;
| r0 = argc;
| r1 = argv;
| /* [10] -r-x section size 10268 named .text */
0x0001093c push {r0, r1, r4, r5, r6, r7, r8, sb, sl, lr} |
0x00010940 ldr sb, [pc, 0x3ac] | sb = "create";
0x00010944 ldr sl, [pc, 0x3ac] | sl = "c:r:h?V";
0x00010948 ldr r6, [pc, 0x3ac] | r6 = "c:r:h?V";
0x0001094c mov r7, r0 | r7 = r0;
0x00010950 mov r8, r1 | r8 = r1;
| label_0:
0x00010954 mov r5, 0 | r5 = 0;
0x00010958 str r5, [sp] | *(sp) = r5;
0x0001095c mov r3, sb | r3 = sb;
0x00010960 mov r2, sl | r2 = sl;
0x00010964 mov r1, r8 | r1 = r8;
0x00010968 mov r0, r7 | r0 = r7;
0x0001096c bl 0x107e0 | r0 = getopt_long ();
0x00010970 cmn r0, 1 |
0x00010974 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00010978 beq 0x10a44 | goto label_3;
| }
0x0001097c cmp r0, 0x63 |
| if (r0 == 0x63) {
0x00010980 beq 0x109cc | goto label_4;
| }
| if (r0 > 0x63) {
0x00010984 bgt 0x109ac | goto label_5;
| }
0x00010988 cmp r0, 0x3f |
| if (r0 == 0x3f) {
0x0001098c beq 0x10a00 | goto label_6;
| }
0x00010990 cmp r0, 0x56 |
| if (r0 == 0x56) {
0x00010994 beq 0x10a30 | goto label_7;
| }
| do {
0x00010998 ldr r3, [pc, 0x360] | r3 = *(0x10cfc);
0x0001099c ldr r0, [pc, 0x360] | r0 = stderr;
0x000109a0 ldr r1, [r3] | r1 = *(0x10cfc);
0x000109a4 bl 0x10900 | fputs (r0, r1);
0x000109a8 b 0x10a20 | goto label_8;
| label_5:
0x000109ac cmp r0, 0x68 |
| if (r0 == 0x68) {
0x000109b0 beq 0x109d8 | goto label_9;
| }
0x000109b4 cmp r0, 0x72 |
0x000109b8 bne 0x10998 |
| } while (r0 != 0x72);
| do {
0x000109bc ldr r3, [pc, 0x344] |
0x000109c0 ldr r3, [r3] | r3 = "Use__h_for_help";
0x000109c4 str r3, [r6] | *(r6) = r3;
0x000109c8 b 0x10954 | goto label_0;
| label_4:
0x000109cc mov r3, 1 | r3 = 1;
0x000109d0 str r3, [r6, 4] | *((r6 + 4)) = r3;
0x000109d4 b 0x109bc |
| } while (1);
| label_9:
0x000109d8 ldr r1, [pc, 0x32c] | r1 = optarg;
0x000109dc ldr r0, [pc, 0x32c] | r0 = "ubiblock_version_2.1.0___a_tool_to_create_remove_block_device_interface_from_UBI_volumes.";
0x000109e0 bl 0x107bc | printf ("ubiblock_version_2.1.0___a_tool_to_create_remove_block_device_interface_from_UBI_volumes.", r1)
0x000109e4 ldr r1, [pc, 0x328] | r1 = "%s\n\n";
0x000109e8 ldr r0, [pc, 0x320] | r0 = "ubiblock_version_2.1.0___a_tool_to_create_remove_block_device_interface_from_UBI_volumes.";
0x000109ec bl 0x107bc | printf ("ubiblock_version_2.1.0___a_tool_to_create_remove_block_device_interface_from_UBI_volumes.", "%s\n\n")
0x000109f0 ldr r0, [pc, 0x320] | r0 = "Usage:_ubiblock___c__r___UBI_volume_node_file_name_Example:_ubiblock___create__dev_ubi0_0";
0x000109f4 bl 0x10804 | puts ("Usage:_ubiblock___c__r___UBI_volume_node_file_name_Example:_ubiblock___create__dev_ubi0_0");
| do {
0x000109f8 mov r0, r5 | r0 = r5;
0x000109fc bl 0x108e8 | exit (r0);
| label_6:
0x00010a00 ldr r1, [pc, 0x304] | r1 = optarg;
0x00010a04 ldr r0, [pc, 0x304] | r0 = "ubiblock_version_2.1.0___a_tool_to_create_remove_block_device_interface_from_UBI_volumes.";
0x00010a08 bl 0x107bc | printf ("ubiblock_version_2.1.0___a_tool_to_create_remove_block_device_interface_from_UBI_volumes.", r1)
0x00010a0c ldr r1, [pc, 0x300] | r1 = "%s\n\n";
0x00010a10 ldr r0, [pc, 0x2f8] | r0 = "ubiblock_version_2.1.0___a_tool_to_create_remove_block_device_interface_from_UBI_volumes.";
0x00010a14 bl 0x107bc | printf ("ubiblock_version_2.1.0___a_tool_to_create_remove_block_device_interface_from_UBI_volumes.", "%s\n\n")
0x00010a18 ldr r0, [pc, 0x2f8] | r0 = "Usage:_ubiblock___c__r___UBI_volume_node_file_name_Example:_ubiblock___create__dev_ubi0_0";
0x00010a1c bl 0x10804 | puts ("Usage:_ubiblock___c__r___UBI_volume_node_file_name_Example:_ubiblock___create__dev_ubi0_0");
| label_8:
0x00010a20 mvn r4, 0 | r4 = ~0;
| label_1:
0x00010a24 mov r0, r4 | r0 = r4;
0x00010a28 add sp, sp, 8 |
0x00010a2c pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_7:
0x00010a30 ldr r2, [pc, 0x2e4] | r2 = "-c, --create create block on top of a volume\n-r, --remove remove block from volume\n-h, --help print help message\n-V, --version print program version";
0x00010a34 ldr r1, [pc, 0x2e4] | r1 = "_.1.0";
0x00010a38 ldr r0, [pc, 0x2e4] | r0 = "ubiblock";
0x00010a3c bl 0x107bc | printf ("ubiblock", "_.1.0", "-c, --create create block on top of a volume\n-r, --remove remove block from volume\n-h, --help print help message\n-V, --version print program version")
0x00010a40 b 0x109f8 |
| } while (1);
| label_3:
0x00010a44 ldr r5, [pc, 0x2b0] | r5 = "c:r:h?V";
0x00010a48 ldr r3, [r5] | r3 = "c:r:h?V";
0x00010a4c cmp r3, 0 |
| if (r3 == 0) {
0x00010a50 bne 0x10a6c |
0x00010a54 ldr r3, [pc, 0x2a4] | r3 = *(0x10cfc);
0x00010a58 ldr r2, [pc, 0x2c0] | r2 = "_.1.0";
0x00010a5c ldr r1, [pc, 0x2c4] | r1 = "%s (mtd-utils) %s\n";
0x00010a60 ldr r0, [r3] | r0 = *(0x10cfc);
0x00010a64 bl 0x10840 | fprintf (r0, "%s (mtd-utils) %s\n", "_.1.0", r3)
0x00010a68 b 0x10a24 | goto label_1;
| }
0x00010a6c bl 0x1176c | r0 = fcn_0001176c ();
0x00010a70 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00010a74 bne 0x10ae0 |
0x00010a78 bl 0x108dc | errno_location ();
0x00010a7c ldr r5, [pc, 0x27c] | r5 = *(0x10cfc);
0x00010a80 ldr r3, [r0] | r3 = *(r0);
0x00010a84 mov r6, r0 | r6 = r0;
0x00010a88 cmp r3, 0 |
| if (r3 == 0) {
0x00010a8c bne 0x10aa0 |
0x00010a90 ldr r2, [pc, 0x288] | r2 = "_.1.0";
0x00010a94 ldr r1, [pc, 0x290] | r1 = "%s: error!: invalid arguments (use -h for help)\n";
0x00010a98 ldr r0, [r5] | r0 = *(r5);
0x00010a9c bl 0x10840 | fprintf (r0, "%s: error!: invalid arguments (use -h for help)\n", "_.1.0")
| }
0x00010aa0 ldr r6, [r6] | r6 = *(r6);
0x00010aa4 ldr r2, [pc, 0x274] | r2 = "_.1.0";
0x00010aa8 ldr r1, [pc, 0x280] | r1 = "_s:_error_:_UBI_is_not_present_in_the_system";
0x00010aac ldr r0, [r5] | r0 = *(r5);
0x00010ab0 bl 0x10840 | fprintf (r0, "_s:_error_:_UBI_is_not_present_in_the_system", "_.1.0", r3, r4, r5, r6)
0x00010ab4 mov r0, r6 | r0 = r6;
0x00010ab8 ldr r5, [r5] | r5 = *(r5);
0x00010abc bl 0x107c8 | strerror (r0);
0x00010ac0 str r6, [sp] | *(sp) = r6;
0x00010ac4 ldr r3, [pc, 0x268] | r3 = "_s:_error_:_cannot_open_libubi";
0x00010ac8 mov r2, 0xa | r2 = 0xa;
0x00010acc ldr r1, [pc, 0x264] | r1 = *(0x10d34);
0x00010ad0 str r0, [sp, 4] | var_4h = r0;
0x00010ad4 mov r0, r5 | r0 = r5;
0x00010ad8 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open_libubi", r4, r5, r6)
0x00010adc b 0x10a24 | goto label_1;
| }
0x00010ae0 ldr r1, [r5] | r1 = *(r5);
0x00010ae4 bl 0x11f58 | r0 = fcn_00011f58 (r0, r1);
0x00010ae8 cmp r0, 1 |
| if (r0 != 1) {
0x00010aec bne 0x10b14 | goto label_10;
| }
0x00010af0 ldr r0, [pc, 0x208] |
0x00010af4 ldr r3, [r5] | r3 = *(r5);
0x00010af8 ldr r2, [pc, 0x220] | r2 = "_.1.0";
0x00010afc ldr r1, [pc, 0x238] | r1 = "_serror__d___s_";
0x00010b00 ldr r0, [r0] | r0 = *(0x10cfc);
| do {
0x00010b04 bl 0x10840 | fprintf (r0, "_serror__d___s_", "_.1.0", r3)
| label_2:
0x00010b08 mov r0, r8 | r0 = r8;
0x00010b0c bl 0x11698 | fcn_00011698 (r0);
0x00010b10 b 0x10a24 | goto label_1;
| label_10:
0x00010b14 cmp r0, 0 |
0x00010b18 ldr r6, [r5] | r6 = *(r5);
| if (r0 >= 0) {
0x00010b1c bge 0x10b78 | goto label_11;
| }
0x00010b20 bl 0x108dc | errno_location ();
0x00010b24 ldr r7, [pc, 0x1d4] | r7 = *(0x10cfc);
0x00010b28 mov r3, r6 | r3 = r6;
0x00010b2c ldr r2, [pc, 0x1ec] | r2 = "_.1.0";
0x00010b30 ldr r5, [r0] | r5 = *(r0);
0x00010b34 ldr r0, [r7] | r0 = *(0x10cfc);
0x00010b38 cmp r5, 0x13 |
| if (r5 != 0x13) {
0x00010b3c ldreq r1, [pc, 0x1fc] | r1 = "%s: error!: \"%s\" is not an UBI volume node\n";
| }
0x00010b40 beq 0x10b04 |
| } while (r5 == 0x13);
0x00010b44 ldr r1, [pc, 0x1f8] | r1 = "%s: error!: \"%s\" is not an UBI volume node\n";
0x00010b48 bl 0x10840 | fprintf (r0, "%s: error!: \"%s\" is not an UBI volume node\n")
0x00010b4c mov r0, r5 | r0 = r5;
0x00010b50 ldr r6, [r7] | r6 = *(r7);
0x00010b54 bl 0x107c8 | strerror (r0);
0x00010b58 ldr r3, [pc, 0x1d4] | r3 = "_s:_error_:_cannot_open_libubi";
0x00010b5c ldr r1, [pc, 0x1d4] | r1 = *(0x10d34);
0x00010b60 mov r2, 0xa | r2 = 0xa;
0x00010b64 str r5, [sp] | *(sp) = r5;
0x00010b68 str r0, [sp, 4] | var_4h = r0;
0x00010b6c mov r0, r6 | r0 = r6;
| do {
0x00010b70 bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open_libubi", r4, r5)
0x00010b74 b 0x10b08 | goto label_2;
| label_11:
0x00010b78 mov r0, r6 | r0 = r6;
0x00010b7c mov r1, 2 | r1 = 2;
0x00010b80 bl 0x108ac | r0 = open64 ();
0x00010b84 cmn r0, 1 |
0x00010b88 mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x00010b8c bne 0x10bd8 | goto label_12;
| }
0x00010b90 bl 0x108dc | errno_location ();
0x00010b94 ldr r7, [pc, 0x164] | r7 = *(0x10cfc);
0x00010b98 ldr r3, [r5] | r3 = *(r5);
0x00010b9c ldr r2, [pc, 0x17c] | r2 = "_.1.0";
0x00010ba0 ldr r1, [pc, 0x1a0] | r1 = "_s:_error_:_error_while_probing___s_";
0x00010ba4 ldr r6, [r0] | r6 = *(r0);
0x00010ba8 ldr r0, [r7] | r0 = *(0x10cfc);
0x00010bac bl 0x10840 | fprintf (r0, "_s:_error_:_error_while_probing___s_", "_.1.0", r3, r4, r5, r6)
0x00010bb0 mov r0, r6 | r0 = r6;
0x00010bb4 ldr r5, [r7] | r5 = *(0x10cfc);
0x00010bb8 bl 0x107c8 | strerror (r0);
0x00010bbc str r6, [sp] | *(sp) = r6;
0x00010bc0 ldr r3, [pc, 0x16c] | r3 = "_s:_error_:_cannot_open_libubi";
0x00010bc4 mov r2, 0xa | r2 = 0xa;
0x00010bc8 ldr r1, [pc, 0x168] | r1 = *(0x10d34);
0x00010bcc str r0, [sp, 4] | var_4h = r0;
0x00010bd0 mov r0, r5 | r0 = r5;
0x00010bd4 b 0x10b70 |
| } while (1);
| label_12:
0x00010bd8 ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x00010bdc cmp r3, 0 |
| if (r3 == 0) {
0x00010be0 beq 0x10c7c | goto label_13;
| }
0x00010be4 bl 0x124c8 | r0 = fcn_000124c8 ();
0x00010be8 cmp r0, 0 |
| if (r0 == 0) {
0x00010bec beq 0x10cdc | goto label_14;
| }
0x00010bf0 bl 0x108dc | errno_location ();
0x00010bf4 ldr r5, [pc, 0x104] | r5 = *(0x10cfc);
0x00010bf8 ldr r3, [r0] | r3 = *(r0);
0x00010bfc mov r7, r0 | r7 = r0;
0x00010c00 cmp r3, 0x26 |
| if (r3 == 0x26) {
0x00010c04 bne 0x10c18 |
0x00010c08 ldr r2, [pc, 0x110] | r2 = "_.1.0";
0x00010c0c ldr r1, [pc, 0x138] | r1 = "_s:_error_:_cannot_open_UBI_volume___s_";
0x00010c10 ldr r0, [r5] | r0 = *(r5);
0x00010c14 bl 0x10840 | fprintf (r0, "_s:_error_:_cannot_open_UBI_volume___s_", "_.1.0")
| }
0x00010c18 ldr r3, [r7] | r3 = *(r7);
0x00010c1c cmp r3, 0x19 |
| if (r3 == 0x19) {
0x00010c20 bne 0x10c34 |
0x00010c24 ldr r2, [pc, 0xf4] | r2 = "_.1.0";
0x00010c28 ldr r1, [pc, 0x120] | r1 = "%s: error!: UBI block is not present in the system\n";
0x00010c2c ldr r0, [r5] | r0 = *(r5);
0x00010c30 bl 0x10840 | fprintf (r0, "%s: error!: UBI block is not present in the system\n", "_.1.0")
| }
0x00010c34 ldr r7, [r7] | r7 = *(r7);
0x00010c38 ldr r2, [pc, 0xe0] | r2 = "_.1.0";
0x00010c3c ldr r1, [pc, 0x110] | r1 = "%s: error!: UBI block not supported (check your kernel version)\n";
| do {
0x00010c40 ldr r0, [r5] | r0 = *(r5);
0x00010c44 bl 0x10840 | fprintf (r0, "%s: error!: UBI block not supported (check your kernel version)\n", "_.1.0")
0x00010c48 mov r0, r7 | r0 = r7;
0x00010c4c ldr r5, [r5] | r5 = *(r5);
0x00010c50 bl 0x107c8 | strerror (r0);
0x00010c54 str r7, [sp] | *(sp) = r7;
0x00010c58 ldr r3, [pc, 0xd4] | r3 = "_s:_error_:_cannot_open_libubi";
0x00010c5c mov r2, 0xa | r2 = 0xa;
0x00010c60 ldr r1, [pc, 0xd0] | r1 = *(0x10d34);
0x00010c64 str r0, [sp, 4] | var_4h = r0;
0x00010c68 mov r0, r5 | r0 = r5;
0x00010c6c bl 0x10840 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open_libubi")
0x00010c70 mov r0, r6 | r0 = r6;
0x00010c74 bl 0x10924 | close (r0);
0x00010c78 b 0x10b08 | goto label_2;
| label_13:
0x00010c7c bl 0x124d8 | r0 = fcn_000124d8 ();
0x00010c80 cmp r0, 0 |
| if (r0 == 0) {
0x00010c84 beq 0x10cdc | goto label_14;
| }
0x00010c88 bl 0x108dc | errno_location ();
0x00010c8c ldr r5, [pc, 0x6c] | r5 = *(0x10cfc);
0x00010c90 ldr r3, [r0] | r3 = *(r0);
0x00010c94 mov r7, r0 | r7 = r0;
0x00010c98 cmp r3, 0x26 |
| if (r3 == 0x26) {
0x00010c9c bne 0x10cb0 |
0x00010ca0 ldr r2, [pc, 0x78] | r2 = "_.1.0";
0x00010ca4 ldr r1, [pc, 0xa0] | r1 = "_s:_error_:_cannot_open_UBI_volume___s_";
0x00010ca8 ldr r0, [r5] | r0 = *(r5);
0x00010cac bl 0x10840 | fprintf (r0, "_s:_error_:_cannot_open_UBI_volume___s_", "_.1.0")
| }
0x00010cb0 ldr r3, [r7] | r3 = *(r7);
0x00010cb4 cmp r3, 0x19 |
| if (r3 == 0x19) {
0x00010cb8 bne 0x10ccc |
0x00010cbc ldr r2, [pc, 0x5c] | r2 = "_.1.0";
0x00010cc0 ldr r1, [pc, 0x88] | r1 = "%s: error!: UBI block is not present in the system\n";
0x00010cc4 ldr r0, [r5] | r0 = *(r5);
0x00010cc8 bl 0x10840 | fprintf (r0, "%s: error!: UBI block is not present in the system\n", "_.1.0")
| }
0x00010ccc ldr r7, [r7] | r7 = *(r7);
0x00010cd0 ldr r2, [pc, 0x48] | r2 = "_.1.0";
0x00010cd4 ldr r1, [pc, 0x7c] | r1 = "_s:_error_:_cannot_create_block_device";
0x00010cd8 b 0x10c40 |
| } while (1);
| label_14:
0x00010cdc mov r0, r6 | r0 = r6;
0x00010ce0 bl 0x10924 | close (r0);
0x00010ce4 mov r0, r8 | r0 = r8;
0x00010ce8 bl 0x11698 | fcn_00011698 (r0);
0x00010cec mov r4, 0 | r4 = 0;
0x00010cf0 b 0x10a24 | goto label_1;
| }
[*] Function printf used 67 times ubiblock