[*] Binary protection state of ubirmvol
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of ubirmvol
; 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/ubirmvol @ 0x10f8c */
| #include <stdint.h>
|
; (fcn) fcn.00010f8c () | void fcn_00010f8c (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;
0x00010f8c push {r4, r5, r6, r7, lr} |
0x00010f90 mov r6, r1 | r6 = r1;
0x00010f94 sub sp, sp, 0x4c |
0x00010f98 mov r1, 0 | r1 = 0;
0x00010f9c mov r5, r0 | r5 = r0;
0x00010fa0 bl 0x10958 | r0 = open64 ();
0x00010fa4 cmn r0, 1 |
0x00010fa8 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00010fac beq 0x11108 | goto label_2;
| }
0x00010fb0 mov r2, 0x32 | r2 = 0x32;
0x00010fb4 add r1, sp, 0x14 | r1 += buf;
0x00010fb8 bl 0x10904 | r0 = read (r0, r1, r2);
0x00010fbc cmn r0, 1 |
| if (r0 != 1) {
0x00010fc0 bne 0x11018 | goto label_3;
| }
0x00010fc4 bl 0x10988 | errno_location ();
0x00010fc8 ldr r7, [pc, 0x144] | r7 = *(0x11110);
0x00010fcc mov r3, r5 | r3 = r5;
0x00010fd0 ldr r2, [pc, 0x140] | r2 = stderr;
0x00010fd4 ldr r1, [pc, 0x140] | r1 = "libubi";
0x00010fd8 ldr r6, [r0] | r6 = *(r0);
0x00010fdc ldr r0, [r7] | r0 = *(0x11110);
0x00010fe0 bl 0x108ec | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00010fe4 mov r0, r6 | r0 = r6;
0x00010fe8 ldr r5, [r7] | r5 = *(0x11110);
0x00010fec bl 0x10868 | strerror (r0);
0x00010ff0 str r6, [sp] | *(sp) = r6;
0x00010ff4 ldr r3, [pc, 0x124] | r3 = "_s:_error_:_cannot_read___s_";
0x00010ff8 mov r2, 8 | r2 = 8;
0x00010ffc ldr r1, [pc, 0x120] | r1 = *(0x11120);
0x00011000 str r0, [sp, 4] | var_4h = r0;
0x00011004 mov r0, r5 | r0 = r5;
0x00011008 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_read___s_", r4, r5, r6)
| do {
0x0001100c mov r0, r4 | r0 = r4;
0x00011010 bl 0x109d0 | close (r0);
0x00011014 b 0x11104 | goto label_4;
| label_3:
0x00011018 cmp r0, 0x32 |
| if (r0 != 0x32) {
0x0001101c bne 0x11048 | goto label_5;
| }
0x00011020 ldr r2, [pc, 0xf0] | r2 = stderr;
0x00011024 ldr r1, [pc, 0xfc] | r1 = "%*serror %d (%s)\n";
0x00011028 mov r3, r5 | r3 = r5;
| label_0:
0x0001102c ldr r0, [pc, 0xe0] |
0x00011030 ldr r0, [r0] | r0 = *(0x11110);
0x00011034 bl 0x108ec | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x00011038 bl 0x10988 | errno_location ();
0x0001103c mov r3, 0x16 | r3 = 0x16;
0x00011040 str r3, [r0] | *(r0) = r3;
0x00011044 b 0x1100c |
| } while (1);
| label_5:
0x00011048 add r3, sp, 0x48 | r3 += s;
0x0001104c add r0, r3, r0 | r0 = r3 + r0;
0x00011050 mov r3, 0 | r3 = 0;
0x00011054 strb r3, [r0, -0x34] | buf = r3;
0x00011058 mov r2, r6 | r2 = r6;
0x0001105c ldr r1, [pc, 0xc8] | r1 = "_s:_error_:_contents_of___s__is_too_long";
0x00011060 add r0, sp, 0x14 | r0 += buf;
0x00011064 bl 0x10934 | r0 = sscanf (r0, "_s:_error_:_contents_of___s__is_too_long", r2);
0x00011068 cmp r0, 1 |
| if (r0 == 1) {
0x0001106c movne r3, r5 | r3 = r5;
| }
| if (r0 == 1) {
0x00011070 ldrne r2, [pc, 0xa0] | r2 = "libubi";
| }
| if (r0 != 1) {
0x00011074 ldrne r1, [pc, 0xb4] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
| goto label_6;
| }
| if (r0 != 1) {
| label_6:
0x00011078 bne 0x1102c | goto label_0;
| }
0x0001107c ldrd r2, r3, [r6] | __asm ("ldrd r2, r3, [r6]");
0x00011080 cmp r2, 0 |
0x00011084 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 < 0) {
0x00011088 bge 0x110ac |
0x0001108c strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011090 ldr r3, [pc, 0x7c] | r3 = *(0x11110);
0x00011094 str r5, [sp, 8] | var_8h = r5;
0x00011098 ldr r2, [pc, 0x78] | r2 = stderr;
0x0001109c ldr r1, [pc, 0x90] | r1 = "_s:_error_:_cannot_read_integer_from___s_";
0x000110a0 ldr r0, [r3] | r0 = *(0x11110);
0x000110a4 bl 0x108ec | fprintf (r0, "_s:_error_:_cannot_read_integer_from___s_", r2, r3, r4, r5)
0x000110a8 b 0x11038 | goto label_1;
| }
0x000110ac mov r0, r4 | r0 = r4;
0x000110b0 bl 0x109d0 | r0 = close (r0);
0x000110b4 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x000110b8 beq 0x11108 |
0x000110bc bl 0x10988 | errno_location ();
0x000110c0 ldr r6, [pc, 0x4c] | r6 = *(0x11110);
0x000110c4 mov r3, r5 | r3 = r5;
0x000110c8 ldr r2, [pc, 0x48] | r2 = stderr;
0x000110cc ldr r1, [pc, 0x64] | r1 = "_s:_error_:_negative_value__lld_in___s_";
0x000110d0 ldr r4, [r0] | r4 = *(r0);
0x000110d4 ldr r0, [r6] | r0 = *(0x11110);
0x000110d8 bl 0x108ec | fprintf (r0, "_s:_error_:_negative_value__lld_in___s_", r2, r3, r4, r5, r6)
0x000110dc mov r0, r4 | r0 = r4;
0x000110e0 ldr r5, [r6] | r5 = *(0x11110);
0x000110e4 bl 0x10868 | strerror (r0);
0x000110e8 str r4, [sp] | *(sp) = r4;
0x000110ec ldr r3, [pc, 0x2c] | r3 = "_s:_error_:_cannot_read___s_";
0x000110f0 mov r2, 8 | r2 = 8;
0x000110f4 ldr r1, [pc, 0x28] | r1 = *(0x11120);
0x000110f8 str r0, [sp, 4] | var_4h = r0;
0x000110fc mov r0, r5 | r0 = r5;
0x00011100 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_read___s_", r4)
| label_4:
0x00011104 mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x00011108 mov r0, r4 | r0 = r4;
0x0001110c add sp, sp, 0x4c |
0x00011110 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/ubirmvol @ 0x1113c */
| #include <stdint.h>
|
; (fcn) fcn.0001113c () | void fcn_0001113c (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;
0x0001113c push {r4, r5, lr} |
0x00011140 sub sp, sp, 0x1c |
0x00011144 mov r4, r1 | r4 = r1;
0x00011148 add r1, sp, 0x10 | r1 += var_10h;
0x0001114c mov r5, r0 | r5 = r0;
0x00011150 bl 0x10f8c | r0 = fcn_00010f8c (r0, r1);
0x00011154 cmp r0, 0 |
| if (r0 == 0) {
0x00011158 bne 0x11198 |
0x0001115c ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [var_10h]");
0x00011160 cmp r2, 0x80000000 |
0x00011164 sbcs r1, r3, 0 | __asm ("sbcs r1, r3, 0");
| if (r2 >= 0x80000000) {
0x00011168 strlt r2, [r4] | *(r4) = r2;
| }
| if (r2 < 0x80000000) {
0x0001116c blt 0x1119c | goto label_0;
| }
0x00011170 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011174 ldr r3, [pc, 0x28] | r3 = *(0x111a0);
0x00011178 str r5, [sp, 8] | var_8h = r5;
0x0001117c ldr r2, [pc, 0x24] | r2 = stderr;
0x00011180 ldr r0, [r3] | r0 = *(0x111a0);
0x00011184 ldr r1, [pc, 0x20] | r1 = "libubi";
0x00011188 bl 0x108ec | r0 = fprintf (r0, "libubi", r2, r3, r4, r5)
0x0001118c bl 0x10988 | errno_location ();
0x00011190 mov r3, 0x16 | r3 = 0x16;
0x00011194 str r3, [r0] | *(r0) = r3;
| }
0x00011198 mvn r0, 0 | r0 = ~0;
| label_0:
0x0001119c add sp, sp, 0x1c |
0x000111a0 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/ubirmvol @ 0x11248 */
| #include <stdint.h>
|
; (fcn) fcn.00011248 () | void fcn_00011248 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| void * buf;
| int32_t var_10h;
| r0 = arg1;
| r1 = arg2;
0x00011248 push {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr} |
0x0001124c mov r8, r1 | r8 = r1;
0x00011250 mov r1, 0 | r1 = 0;
0x00011254 mov r5, r0 | r5 = r0;
0x00011258 mov r7, r2 | r7 = r2;
0x0001125c bl 0x10958 | r0 = open64 ();
0x00011260 cmn r0, 1 |
0x00011264 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00011268 beq 0x113b0 | goto label_2;
| }
0x0001126c mov r2, r7 | r2 = r7;
0x00011270 mov r1, r8 | r1 = r8;
0x00011274 bl 0x10904 | r0 = read (r0, r1, r2);
0x00011278 cmn r0, 1 |
0x0001127c mov r6, r0 | r6 = r0;
| if (r0 != 1) {
0x00011280 bne 0x112d8 | goto label_3;
| }
| label_0:
0x00011284 bl 0x10988 | errno_location ();
0x00011288 ldr r7, [pc, 0x12c] | r7 = *(0x113b8);
0x0001128c mov r3, r5 | r3 = r5;
0x00011290 ldr r2, [pc, 0x128] | r2 = stderr;
0x00011294 ldr r1, [pc, 0x128] | r1 = "libubi";
0x00011298 ldr r6, [r0] | r6 = *(r0);
0x0001129c ldr r0, [r7] | r0 = *(0x113b8);
0x000112a0 bl 0x108ec | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000112a4 mov r0, r6 | r0 = r6;
0x000112a8 ldr r5, [r7] | r5 = *(0x113b8);
0x000112ac bl 0x10868 | strerror (r0);
0x000112b0 str r6, [sp] | *(sp) = r6;
0x000112b4 ldr r3, [pc, 0x10c] | r3 = "_s:_error_:_cannot_read___s_";
0x000112b8 mov r2, 8 | r2 = 8;
0x000112bc ldr r1, [pc, 0x108] | r1 = *(0x113c8);
0x000112c0 str r0, [sp, 4] | var_4h = r0;
0x000112c4 mov r0, r5 | r0 = r5;
0x000112c8 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_read___s_", r4, r5, r6)
| do {
0x000112cc mov r0, r4 | r0 = r4;
0x000112d0 bl 0x109d0 | close (r0);
0x000112d4 b 0x113ac | goto label_4;
| label_3:
0x000112d8 cmp r7, r0 |
| if (r7 != r0) {
0x000112dc bne 0x11308 | goto label_5;
| }
0x000112e0 ldr r0, [pc, 0xd4] |
0x000112e4 mov r3, r5 | r3 = r5;
0x000112e8 ldr r2, [pc, 0xd0] | r2 = stderr;
0x000112ec ldr r1, [pc, 0xdc] | r1 = "%*serror %d (%s)\n";
0x000112f0 ldr r0, [r0] | r0 = *(0x113b8);
0x000112f4 bl 0x108ec | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
| label_1:
0x000112f8 bl 0x10988 | errno_location ();
0x000112fc mov r3, 0x16 | r3 = 0x16;
0x00011300 str r3, [r0] | *(r0) = r3;
0x00011304 b 0x112cc |
| } while (1);
| label_5:
0x00011308 mov r3, 0 | r3 = 0;
0x0001130c strb r3, [r8, r0] | *((r8 + r0)) = r3;
0x00011310 mov r2, 1 | r2 = 1;
0x00011314 add r1, sp, 0xc | r1 += buf;
0x00011318 mov r0, r4 | r0 = r4;
0x0001131c bl 0x10904 | r0 = read (r0, r1, r2);
0x00011320 cmp r0, 1 |
| if (r0 == 1) {
0x00011324 beq 0x11284 | goto label_0;
| }
0x00011328 cmp r0, 0 |
| if (r0 != 0) {
0x0001132c beq 0x11350 |
0x00011330 ldr r0, [pc, 0x84] |
0x00011334 str r7, [sp] | *(sp) = r7;
0x00011338 mov r3, r5 | r3 = r5;
0x0001133c ldr r2, [pc, 0x7c] | r2 = stderr;
0x00011340 ldr r1, [pc, 0x8c] | r1 = "_s:_error_:_contents_of___s__is_too_long";
0x00011344 ldr r0, [r0] | r0 = *(0x113b8);
0x00011348 bl 0x108ec | fprintf (r0, "_s:_error_:_contents_of___s__is_too_long", r2, r3)
0x0001134c b 0x112f8 | goto label_1;
| }
0x00011350 mov r0, r4 | r0 = r4;
0x00011354 bl 0x109d0 | r0 = close (r0);
0x00011358 cmp r0, 0 |
| if (r0 != 0) {
0x0001135c moveq r4, r6 | r4 = r6;
| }
| if (r0 != 0) {
0x00011360 beq 0x113b0 |
0x00011364 bl 0x10988 | errno_location ();
0x00011368 ldr r6, [pc, 0x4c] | r6 = *(0x113b8);
0x0001136c mov r3, r5 | r3 = r5;
0x00011370 ldr r2, [pc, 0x48] | r2 = stderr;
0x00011374 ldr r1, [pc, 0x5c] | r1 = "%s: error!: file \"%s\" contains too much data (> %d bytes)\n";
0x00011378 ldr r4, [r0] | r4 = *(r0);
0x0001137c ldr r0, [r6] | r0 = *(0x113b8);
0x00011380 bl 0x108ec | fprintf (r0, "%s: error!: file \"%s\" contains too much data (> %d bytes)\n", r2, r3, r4, r5, r6)
0x00011384 mov r0, r4 | r0 = r4;
0x00011388 ldr r5, [r6] | r5 = *(0x113b8);
0x0001138c bl 0x10868 | strerror (r0);
0x00011390 str r4, [sp] | *(sp) = r4;
0x00011394 ldr r3, [pc, 0x2c] | r3 = "_s:_error_:_cannot_read___s_";
0x00011398 mov r2, 8 | r2 = 8;
0x0001139c ldr r1, [pc, 0x28] | r1 = *(0x113c8);
0x000113a0 str r0, [sp, 4] | var_4h = r0;
0x000113a4 mov r0, r5 | r0 = r5;
0x000113a8 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_read___s_", r4)
| label_4:
0x000113ac mvn r4, 0 | r4 = ~0;
| }
| label_2:
0x000113b0 mov r0, r4 | r0 = r4;
0x000113b4 add sp, sp, 0x10 |
0x000113b8 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/ubirmvol @ 0x113dc */
| #include <stdint.h>
|
; (fcn) fcn.000113dc () | void fcn_000113dc (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| r0 = arg1;
| r1 = arg2;
0x000113dc push {r0, r1, r4, r5, r6, r7, r8, sb, sl, lr} |
0x000113e0 mov r7, r1 | r7 = r1;
0x000113e4 mov sl, r0 | sl = r0;
0x000113e8 bl 0x109a0 | r0 = strlen (r0);
0x000113ec mov r4, r0 | r4 = r0;
0x000113f0 mov sb, r0 | sb = r0;
0x000113f4 mov r0, r7 | r0 = r7;
0x000113f8 bl 0x109a0 | r0 = strlen (r0);
0x000113fc add r6, r4, r0 | r6 = r4 + r0;
0x00011400 add r6, r6, 2 | r6 += 2;
0x00011404 mov r8, r0 | r8 = r0;
0x00011408 mov r0, r6 | r0 = r6;
0x0001140c bl 0x108b0 | r0 = malloc (r0);
0x00011410 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x00011414 bne 0x1146c | goto label_0;
| }
0x00011418 bl 0x10988 | errno_location ();
0x0001141c ldr r7, [pc, 0x80] | r7 = *(0x114a0);
0x00011420 mov r3, r6 | r3 = r6;
0x00011424 ldr r2, [pc, 0x7c] | r2 = stderr;
0x00011428 ldr r1, [pc, 0x7c] | r1 = "libubi";
0x0001142c ldr r4, [r0] | r4 = *(r0);
0x00011430 ldr r0, [r7] | r0 = *(0x114a0);
0x00011434 bl 0x108ec | fprintf (r0, "libubi", r2, r3, r4)
0x00011438 mov r0, r4 | r0 = r4;
0x0001143c ldr r6, [r7] | r6 = *(0x114a0);
0x00011440 bl 0x10868 | strerror (r0);
0x00011444 str r4, [sp] | *(sp) = r4;
0x00011448 ldr r3, [pc, 0x60] | r3 = "_s:_error_:_cannot_allocate__d_bytes";
0x0001144c mov r2, 8 | r2 = 8;
0x00011450 ldr r1, [pc, 0x5c] | r1 = *(0x114b0);
0x00011454 str r0, [sp, 4] | var_4h = r0;
0x00011458 mov r0, r6 | r0 = r6;
0x0001145c bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_allocate__d_bytes", r4)
| do {
0x00011460 mov r0, r5 | r0 = r5;
0x00011464 add sp, sp, 8 |
0x00011468 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_0:
0x0001146c mov r2, r4 | r2 = r4;
0x00011470 mov r1, sl | r1 = sl;
0x00011474 bl 0x10898 | memcpy (r0, r1, r2);
0x00011478 add r3, r5, r4 | r3 = r5 + r4;
0x0001147c ldrb r3, [r3, -1] | r3 = *((r3 - 1));
0x00011480 add r2, r8, 1 | r2 = r8 + 1;
0x00011484 cmp r3, 0x2f |
| if (r3 == 0x2f) {
0x00011488 addne r4, r4, 1 | r4++;
| }
| if (r3 == 0x2f) {
0x0001148c movne r3, 0x2f | r3 = 0x2f;
| }
| if (r3 == 0x2f) {
0x00011490 strbne r3, [r5, sb] | *((r5 + sb)) = r3;
| }
0x00011494 mov r1, r7 | r1 = r7;
0x00011498 add r0, r5, r4 | r0 = r5 + r4;
0x0001149c bl 0x10898 | memcpy (r0, r1, r2);
0x000114a0 b 0x11460 |
| } 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/ubirmvol @ 0x114b8 */
| #include <stdint.h>
|
; (fcn) fcn.000114b8 () | void fcn_000114b8 (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;
0x000114b8 push {r4, r5, r6, r7, lr} |
0x000114bc sub sp, sp, 0x74 |
0x000114c0 add r1, sp, 8 | r1 += var_8h;
0x000114c4 mov r5, r0 | r5 = r0;
0x000114c8 bl 0x10874 | r0 = stat64 ();
0x000114cc cmp r0, 0 |
| if (r0 >= 0) {
0x000114d0 bge 0x11528 | goto label_2;
| }
0x000114d4 bl 0x10988 | errno_location ();
0x000114d8 ldr r6, [pc, 0xc8] | r6 = *(0x115a4);
0x000114dc ldr r2, [pc, 0xc8] | r2 = stderr;
0x000114e0 ldr r1, [pc, 0xc8] | r1 = "libubi";
0x000114e4 mov r3, r5 | r3 = r5;
0x000114e8 ldr r4, [r0] | r4 = *(r0);
| do {
| label_1:
0x000114ec ldr r0, [r6] | r0 = *(r6);
0x000114f0 bl 0x108ec | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000114f4 mov r0, r4 | r0 = r4;
0x000114f8 ldr r5, [r6] | r5 = *(r6);
0x000114fc bl 0x10868 | strerror (r0);
0x00011500 str r4, [sp] | *(sp) = r4;
0x00011504 ldr r3, [pc, 0xa8] | r3 = "_s:_error_:_cannot_stat___s_";
0x00011508 mov r2, 8 | r2 = 8;
0x0001150c ldr r1, [pc, 0xa4] | r1 = *(0x115b4);
0x00011510 str r0, [sp, 4] | var_4h = r0;
0x00011514 mov r0, r5 | r0 = r5;
0x00011518 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_stat___s_", r4)
0x0001151c mvn r0, 0 | r0 = ~0;
| label_0:
0x00011520 add sp, sp, 0x74 |
0x00011524 pop {r4, r5, r6, r7, pc} |
| label_2:
0x00011528 ldr r3, [sp, 0x18] | r3 = var_18h;
0x0001152c and r3, r3, 0xf000 | r3 &= 0xf000;
0x00011530 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00011534 beq 0x11558 | goto label_3;
| }
0x00011538 bl 0x10988 | errno_location ();
0x0001153c mov r4, 0x16 | r4 = 0x16;
0x00011540 ldr r6, [pc, 0x60] | r6 = *(0x115a4);
0x00011544 mov r3, r5 | r3 = r5;
0x00011548 ldr r2, [pc, 0x5c] | r2 = stderr;
0x0001154c ldr r1, [pc, 0x68] | r1 = "%*serror %d (%s)\n";
0x00011550 str r4, [r0] | *(r0) = r4;
0x00011554 b 0x114ec |
| } while (1);
| label_3:
0x00011558 ldrd r6, r7, [sp, 0x28] | __asm ("ldrd r6, r7, [var_28h]");
0x0001155c mov r1, r7 | r1 = r7;
0x00011560 mov r0, r6 | r0 = r6;
0x00011564 bl 0x1088c | gnu_dev_major ();
0x00011568 mov r1, r7 | r1 = r7;
0x0001156c mov r4, r0 | r4 = r0;
0x00011570 mov r0, r6 | r0 = r6;
0x00011574 bl 0x108c8 | gnu_dev_minor ();
0x00011578 cmp r4, 0x5a |
| if (r4 != 0x5a) {
0x0001157c addeq r0, r0, r0, lsr 31 | r0 += (r0 >> 31);
| }
0x00011580 asreq r0, r0, 1 | __asm ("asreq r0, r0, 1");
| if (r4 == 0x5a) {
0x00011584 beq 0x11520 | goto label_0;
| }
0x00011588 bl 0x10988 | errno_location ();
0x0001158c mov r4, 0x16 | r4 = 0x16;
0x00011590 ldr r6, [pc, 0x10] | r6 = *(0x115a4);
0x00011594 mov r3, r5 | r3 = r5;
0x00011598 ldr r2, [pc, 0xc] | r2 = stderr;
0x0001159c ldr r1, [pc, 0x1c] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x000115a0 str r4, [r0] | *(r0) = r4;
0x000115a4 b 0x114ec | 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/ubirmvol @ 0x115c4 */
| #include <stdint.h>
|
; (fcn) fcn.000115c4 () | void fcn_000115c4 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| char * s;
| int32_t var_40h;
| r0 = arg1;
| r1 = arg2;
0x000115c4 push {r4, r5, r6, lr} |
0x000115c8 sub sp, sp, 0x40 |
0x000115cc mov r4, r1 | r4 = r1;
0x000115d0 mov r5, r2 | r5 = r2;
0x000115d4 add r1, sp, 0xc | r1 += s;
0x000115d8 mov r2, 0x32 | r2 = 0x32;
0x000115dc mov r6, r0 | r6 = r0;
0x000115e0 bl 0x11248 | r0 = fcn_00011248 (r0, r1);
0x000115e4 cmp r0, 0 |
| if (r0 < 0) {
0x000115e8 blt 0x11630 | goto label_1;
| }
0x000115ec mov r3, r5 | r3 = r5;
0x000115f0 mov r2, r4 | r2 = r4;
0x000115f4 ldr r1, [pc, 0x8c] | r1 = *(0x11684);
0x000115f8 add r0, sp, 0xc | r0 += s;
0x000115fc bl 0x10934 | r0 = sscanf (r0, r1, r2);
0x00011600 cmp r0, 2 |
| if (r0 == 2) {
0x00011604 beq 0x11638 | goto label_2;
| }
0x00011608 bl 0x10988 | errno_location ();
0x0001160c mov r3, 0x16 | r3 = 0x16;
0x00011610 ldr r2, [pc, 0x74] | r2 = "%d:%d\n";
0x00011614 ldr r1, [pc, 0x74] | r1 = "libubi";
0x00011618 str r3, [r0] | *(r0) = r3;
0x0001161c ldr r0, [pc, 0x70] |
0x00011620 mov r3, r6 | r3 = r6;
0x00011624 ldr r0, [r0] | r0 = "_s:_error_:___s__does_not_have_major:minor_format";
0x00011628 bl 0x108ec | fprintf ("_s:_error_:___s__does_not_have_major:minor_format", "libubi", "%d:%d\n", r3)
| label_0:
0x0001162c mvn r0, 0 | r0 = ~0;
| do {
| label_1:
0x00011630 add sp, sp, 0x40 |
0x00011634 pop {r4, r5, r6, pc} |
| label_2:
0x00011638 ldr r3, [r4] | r3 = *(r4);
0x0001163c cmp r3, 0 |
| if (r3 < 0) {
0x00011640 blt 0x11654 | goto label_3;
| }
0x00011644 ldr r3, [r5] | r3 = *(r5);
0x00011648 cmp r3, 0 |
| if (r3 < 0) {
0x0001164c movge r0, 0 | r0 = 0;
| }
0x00011650 bge 0x11630 |
| } while (r3 >= 0);
| label_3:
0x00011654 bl 0x10988 | errno_location ();
0x00011658 mov r3, 0x16 | r3 = 0x16;
0x0001165c ldr r2, [pc, 0x28] | r2 = "%d:%d\n";
0x00011660 ldr r1, [pc, 0x30] | r1 = stderr;
0x00011664 str r3, [r0] | *(r0) = r3;
0x00011668 ldr r0, [pc, 0x24] |
0x0001166c ldr r3, [r5] | r3 = *(r5);
0x00011670 str r6, [sp, 4] | var_4h = r6;
0x00011674 str r3, [sp] | *(sp) = r3;
0x00011678 ldr r3, [r4] | r3 = *(r4);
0x0001167c ldr r0, [r0] | r0 = "_s:_error_:___s__does_not_have_major:minor_format";
0x00011680 bl 0x108ec | fprintf ("_s:_error_:___s__does_not_have_major:minor_format", r1, "%d:%d\n", r3, r4, r5, r6)
0x00011684 b 0x1162c | 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/ubirmvol @ 0x116f0 */
| #include <stdint.h>
|
; (fcn) fcn.000116f0 () | void fcn_000116f0 (int32_t arg1) {
| int32_t var_0h;
| int32_t var_4h;
| r0 = arg1;
0x000116f0 push {r0, r1, r4, r5, r6, lr} |
0x000116f4 ldr r5, [pc, 0x50] |
0x000116f8 mov r6, r0 | r6 = r0;
0x000116fc bl 0x10988 | errno_location ();
0x00011700 mov r3, r6 | r3 = r6;
0x00011704 ldr r2, [pc, 0x44] | r2 = stderr;
0x00011708 ldr r1, [pc, 0x44] | r1 = "libubi";
0x0001170c ldr r4, [r0] | r4 = *(r0);
0x00011710 ldr r0, [r5] | r0 = *(0x11748);
0x00011714 bl 0x108ec | fprintf (r0, "libubi", r2, r3, r4)
0x00011718 mov r0, r4 | r0 = r4;
0x0001171c ldr r5, [r5] | r5 = *(0x11748);
0x00011720 bl 0x10868 | strerror (r0);
0x00011724 str r4, [sp] | *(sp) = r4;
0x00011728 ldr r3, [pc, 0x28] | r3 = "_s:_error_:_cannot_open___s_";
0x0001172c mov r2, 8 | r2 = 8;
0x00011730 ldr r1, [pc, 0x24] | r1 = *(0x11758);
0x00011734 str r0, [sp, 4] | var_4h = r0;
0x00011738 mov r0, r5 | r0 = r5;
0x0001173c bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_open___s_", r4)
0x00011740 mvn r0, 0 | r0 = ~0;
0x00011744 add sp, sp, 8 |
0x00011748 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/ubirmvol @ 0x11884 */
| #include <stdint.h>
|
; (fcn) fcn.00011884 () | void fcn_00011884 () {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_10h;
0x00011884 push {r0, r1, r2, r3, r4, r5, r6, lr} |
0x00011888 mov r1, 0x68 | r1 = 0x68;
0x0001188c mov r0, 1 | r0 = 1;
0x00011890 bl 0x108e0 | r0 = calloc (r0, r1);
0x00011894 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00011898 beq 0x11908 | goto label_1;
| }
0x0001189c ldr r1, [pc, 0x2fc] | r1 = *(0x11b9c);
0x000118a0 ldr r0, [pc, 0x2fc] | r0 = "class_misc_ubi_ctrl_";
0x000118a4 bl 0x113dc | r0 = fcn_000113dc ("class_misc_ubi_ctrl_", r1);
0x000118a8 cmp r0, 0 |
0x000118ac str r0, [r4, 4] | *((r4 + 4)) = r0;
| if (r0 == 0) {
0x000118b0 beq 0x118fc | goto label_0;
| }
0x000118b4 ldr r1, [pc, 0x2ec] | r1 = "/sys";
0x000118b8 bl 0x113dc | r0 = fcn_000113dc (r0, "/sys");
0x000118bc cmp r0, 0 |
0x000118c0 str r0, [r4, 8] | *((r4 + 8)) = r0;
| if (r0 == 0) {
0x000118c4 beq 0x118fc | goto label_0;
| }
0x000118c8 ldr r1, [pc, 0x2dc] | r1 = "dev";
0x000118cc ldr r0, [pc, 0x2d0] | r0 = "class_misc_ubi_ctrl_";
0x000118d0 bl 0x113dc | r0 = fcn_000113dc ("class_misc_ubi_ctrl_", "dev");
0x000118d4 cmp r0, 0 |
0x000118d8 str r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| if (r0 == 0) {
0x000118dc beq 0x118fc | goto label_0;
| }
0x000118e0 mov r1, 0 | r1 = 0;
0x000118e4 bl 0x10958 | r0 = open64 ();
0x000118e8 cmn r0, 1 |
| if (r0 != 1) {
0x000118ec bne 0x11914 | goto label_2;
| }
0x000118f0 bl 0x10988 | errno_location ();
0x000118f4 mov r3, 0 | r3 = 0;
0x000118f8 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x000118fc mov r0, r4 | r0 = r4;
0x00011900 bl 0x117b0 | fcn_000117b0 (r0);
0x00011904 mov r4, 0 | r4 = 0;
| label_1:
0x00011908 mov r0, r4 | r0 = r4;
0x0001190c add sp, sp, 0x10 |
0x00011910 pop {r4, r5, r6, pc} |
| label_2:
0x00011914 bl 0x109d0 | r0 = close (r0);
0x00011918 cmp r0, 0 |
| if (r0 == 0) {
0x0001191c beq 0x1196c | goto label_3;
| }
0x00011920 bl 0x10988 | errno_location ();
0x00011924 ldr r6, [pc, 0x284] |
0x00011928 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x0001192c ldr r2, [pc, 0x280] | r2 = stderr;
0x00011930 ldr r1, [pc, 0x280] | r1 = "libubi";
0x00011934 ldr r5, [r0] | r5 = *(r0);
0x00011938 ldr r0, [r6] | r0 = "class_ubi";
0x0001193c bl 0x108ec | fprintf ("class_ubi", "libubi", r2, r3, r4, r5, "class_ubi")
0x00011940 mov r0, r5 | r0 = r5;
0x00011944 ldr r6, [r6] | r6 = "class_ubi";
0x00011948 bl 0x10868 | strerror (r0);
0x0001194c str r5, [sp] | *(sp) = r5;
0x00011950 ldr r3, [pc, 0x264] | r3 = "%s: error!: close failed on \"%s\"\n";
0x00011954 mov r2, 8 | r2 = 8;
0x00011958 ldr r1, [pc, 0x260] | r1 = *(0x11bbc);
0x0001195c str r0, [sp, 4] | var_4h = r0;
0x00011960 mov r0, r6 | r0 = r6;
0x00011964 bl 0x108ec | fprintf (r0, r1, r2, "%s: error!: close failed on \"%s\"\n", r4, r5)
0x00011968 b 0x118fc |
| } while (1);
| label_3:
0x0001196c ldr r1, [pc, 0x250] | r1 = "%*serror %d (%s)\n";
0x00011970 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00011974 bl 0x113dc | r0 = fcn_000113dc (r0, "%*serror %d (%s)\n");
0x00011978 cmp r0, 0 |
0x0001197c str r0, [r4, 0x10] | *((r4 + 0x10)) = r0;
| if (r0 == 0) {
0x00011980 beq 0x118fc | goto label_0;
| }
0x00011984 ldr r1, [pc, 0x23c] | r1 = "ubi_d";
0x00011988 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x0001198c bl 0x113dc | r0 = fcn_000113dc (r0, "ubi_d");
0x00011990 cmp r0, 0 |
0x00011994 str r0, [r4, 0x14] | *((r4 + 0x14)) = r0;
| if (r0 == 0) {
0x00011998 beq 0x118fc | goto label_0;
| }
0x0001199c ldr r1, [pc, 0x204] | r1 = "/sys";
0x000119a0 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000119a4 bl 0x113dc | r0 = fcn_000113dc (r0, "/sys");
0x000119a8 cmp r0, 0 |
0x000119ac str r0, [r4, 0x18] | *((r4 + 0x18)) = r0;
| if (r0 == 0) {
0x000119b0 beq 0x118fc | goto label_0;
| }
0x000119b4 ldr r1, [pc, 0x210] | r1 = "version";
0x000119b8 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000119bc bl 0x113dc | r0 = fcn_000113dc (r0, "version");
0x000119c0 cmp r0, 0 |
0x000119c4 str r0, [r4, 0x1c] | *((r4 + 0x1c)) = r0;
| if (r0 == 0) {
0x000119c8 beq 0x118fc | goto label_0;
| }
0x000119cc ldr r1, [pc, 0x1fc] | r1 = "avail_eraseblocks";
0x000119d0 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000119d4 bl 0x113dc | r0 = fcn_000113dc (r0, "avail_eraseblocks");
0x000119d8 cmp r0, 0 |
0x000119dc str r0, [r4, 0x20] | *((r4 + 0x20)) = r0;
| if (r0 == 0) {
0x000119e0 beq 0x118fc | goto label_0;
| }
0x000119e4 ldr r1, [pc, 0x1e8] | r1 = "total_eraseblocks";
0x000119e8 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x000119ec bl 0x113dc | r0 = fcn_000113dc (r0, "total_eraseblocks");
0x000119f0 cmp r0, 0 |
0x000119f4 str r0, [r4, 0x24] | *((r4 + 0x24)) = r0;
| if (r0 == 0) {
0x000119f8 beq 0x118fc | goto label_0;
| }
0x000119fc ldr r1, [pc, 0x1d4] | r1 = "bad_peb_count";
0x00011a00 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011a04 bl 0x113dc | r0 = fcn_000113dc (r0, "bad_peb_count");
0x00011a08 cmp r0, 0 |
0x00011a0c str r0, [r4, 0x28] | *((r4 + 0x28)) = r0;
| if (r0 == 0) {
0x00011a10 beq 0x118fc | goto label_0;
| }
0x00011a14 ldr r1, [pc, 0x1c0] | r1 = "eraseblock_size";
0x00011a18 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011a1c bl 0x113dc | r0 = fcn_000113dc (r0, "eraseblock_size");
0x00011a20 cmp r0, 0 |
0x00011a24 str r0, [r4, 0x2c] | *((r4 + 0x2c)) = r0;
| if (r0 == 0) {
0x00011a28 beq 0x118fc | goto label_0;
| }
0x00011a2c ldr r1, [pc, 0x1ac] | r1 = "max_ec";
0x00011a30 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011a34 bl 0x113dc | r0 = fcn_000113dc (r0, "max_ec");
0x00011a38 cmp r0, 0 |
0x00011a3c str r0, [r4, 0x30] | *((r4 + 0x30)) = r0;
| if (r0 == 0) {
0x00011a40 beq 0x118fc | goto label_0;
| }
0x00011a44 ldr r1, [pc, 0x198] | r1 = "reserved_for_bad";
0x00011a48 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011a4c bl 0x113dc | r0 = fcn_000113dc (r0, "reserved_for_bad");
0x00011a50 cmp r0, 0 |
0x00011a54 str r0, [r4, 0x34] | *((r4 + 0x34)) = r0;
| if (r0 == 0) {
0x00011a58 beq 0x118fc | goto label_0;
| }
0x00011a5c ldr r1, [pc, 0x184] | r1 = "max_vol_count";
0x00011a60 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011a64 bl 0x113dc | r0 = fcn_000113dc (r0, "max_vol_count");
0x00011a68 cmp r0, 0 |
0x00011a6c str r0, [r4, 0x38] | *((r4 + 0x38)) = r0;
| if (r0 == 0) {
0x00011a70 beq 0x118fc | goto label_0;
| }
0x00011a74 ldr r1, [pc, 0x170] | r1 = "min_io_size";
0x00011a78 ldr r0, [r4, 0x10] | r0 = *((r4 + 0x10));
0x00011a7c bl 0x113dc | r0 = fcn_000113dc (r0, "min_io_size");
0x00011a80 cmp r0, 0 |
0x00011a84 str r0, [r4, 0x3c] | *((r4 + 0x3c)) = r0;
| if (r0 == 0) {
0x00011a88 beq 0x118fc | goto label_0;
| }
0x00011a8c ldr r1, [pc, 0x15c] | r1 = "mtd_num";
0x00011a90 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00011a94 bl 0x113dc | r0 = fcn_000113dc (r0, "mtd_num");
0x00011a98 cmp r0, 0 |
0x00011a9c str r0, [r4, 0x40] | *((r4 + 0x40)) = r0;
| if (r0 == 0) {
0x00011aa0 beq 0x118fc | goto label_0;
| }
0x00011aa4 ldr r1, [pc, 0x148] | r1 = "ubi_d__d";
0x00011aa8 bl 0x113dc | r0 = fcn_000113dc (r0, "ubi_d__d");
0x00011aac cmp r0, 0 |
0x00011ab0 str r0, [r4, 0x44] | *((r4 + 0x44)) = r0;
| if (r0 == 0) {
0x00011ab4 beq 0x118fc | goto label_0;
| }
0x00011ab8 ldr r1, [pc, 0xe8] | r1 = "/sys";
0x00011abc ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011ac0 bl 0x113dc | r0 = fcn_000113dc (r0, "/sys");
0x00011ac4 cmp r0, 0 |
0x00011ac8 str r0, [r4, 0x48] | *((r4 + 0x48)) = r0;
| if (r0 == 0) {
0x00011acc beq 0x118fc | goto label_0;
| }
0x00011ad0 ldr r1, [pc, 0x120] | r1 = "type";
0x00011ad4 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011ad8 bl 0x113dc | r0 = fcn_000113dc (r0, "type");
0x00011adc cmp r0, 0 |
0x00011ae0 str r0, [r4, 0x4c] | *((r4 + 0x4c)) = r0;
| if (r0 == 0) {
0x00011ae4 beq 0x118fc | goto label_0;
| }
0x00011ae8 ldr r1, [pc, 0x10c] | r1 = "alignment";
0x00011aec ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011af0 bl 0x113dc | r0 = fcn_000113dc (r0, "alignment");
0x00011af4 cmp r0, 0 |
0x00011af8 str r0, [r4, 0x50] | *((r4 + 0x50)) = r0;
| if (r0 == 0) {
0x00011afc beq 0x118fc | goto label_0;
| }
0x00011b00 ldr r1, [pc, 0xf8] | r1 = "data_bytes";
0x00011b04 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011b08 bl 0x113dc | r0 = fcn_000113dc (r0, "data_bytes");
0x00011b0c cmp r0, 0 |
0x00011b10 str r0, [r4, 0x54] | *((r4 + 0x54)) = r0;
| if (r0 == 0) {
0x00011b14 beq 0x118fc | goto label_0;
| }
0x00011b18 ldr r1, [pc, 0xe4] | r1 = "reserved_ebs";
0x00011b1c ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011b20 bl 0x113dc | r0 = fcn_000113dc (r0, "reserved_ebs");
0x00011b24 cmp r0, 0 |
0x00011b28 str r0, [r4, 0x58] | *((r4 + 0x58)) = r0;
| if (r0 == 0) {
0x00011b2c beq 0x118fc | goto label_0;
| }
0x00011b30 ldr r1, [pc, 0xd0] | r1 = "usable_eb_size";
0x00011b34 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011b38 bl 0x113dc | r0 = fcn_000113dc (r0, "usable_eb_size");
0x00011b3c cmp r0, 0 |
0x00011b40 str r0, [r4, 0x5c] | *((r4 + 0x5c)) = r0;
| if (r0 == 0) {
0x00011b44 beq 0x118fc | goto label_0;
| }
0x00011b48 ldr r1, [pc, 0xbc] | r1 = "corrupted";
0x00011b4c ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x00011b50 bl 0x113dc | r0 = fcn_000113dc (r0, "corrupted");
0x00011b54 cmp r0, 0 |
0x00011b58 str r0, [r4, 0x60] | *((r4 + 0x60)) = r0;
| if (r0 == 0) {
0x00011b5c beq 0x118fc | goto label_0;
| }
0x00011b60 add r1, sp, 0xc | r1 += var_ch;
0x00011b64 ldr r0, [r4, 0x14] | r0 = *((r4 + 0x14));
0x00011b68 bl 0x1113c | r0 = fcn_0001113c (r0, r1);
0x00011b6c cmp r0, 0 |
| if (r0 != 0) {
0x00011b70 bne 0x118fc | goto label_0;
| }
0x00011b74 ldr r3, [sp, 0xc] | r3 = var_ch;
0x00011b78 cmp r3, 1 |
| if (r3 == 1) {
0x00011b7c beq 0x11908 | goto label_1;
| }
0x00011b80 ldr r0, [pc, 0x28] |
0x00011b84 str r3, [sp] | *(sp) = r3;
0x00011b88 ldr r2, [pc, 0x24] | r2 = stderr;
0x00011b8c mov r3, 1 | r3 = 1;
0x00011b90 ldr r1, [pc, 0x78] | r1 = "name";
0x00011b94 ldr r0, [r0] | r0 = "class_ubi";
0x00011b98 bl 0x108ec | fprintf ("class_ubi", "name", r2, r3)
0x00011b9c b 0x118fc | 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/ubirmvol @ 0x11d40 */
| #include <stdint.h>
|
; (fcn) fcn.00011d40 () | void fcn_00011d40 (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;
0x00011d40 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00011d44 mov r4, r1 | r4 = r1;
0x00011d48 sub sp, sp, 0x110 |
0x00011d4c mov r5, r0 | r5 = r0;
0x00011d50 mov r2, 0x18 | r2 = 0x18;
0x00011d54 mov r1, 0 | r1 = 0;
0x00011d58 mov r0, r4 | r0 = r4;
0x00011d5c bl 0x1094c | memset (r0, r1, r2);
0x00011d60 add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00011d64 add r1, r4, 0x10 | r1 = r4 + 0x10;
0x00011d68 ldr r0, [r5, 8] | r0 = *((r5 + 8));
0x00011d6c bl 0x115c4 | r0 = fcn_000115c4 (r0, r1);
0x00011d70 cmp r0, 0 |
| if (r0 == 0) {
0x00011d74 mvnne r3, 0 | r3 = ~0;
| }
| if (r0 == 0) {
0x00011d78 strne r3, [r4, 0x14] | *((r4 + 0x14)) = r3;
| }
| if (r0 == 0) {
0x00011d7c strne r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x00011d80 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x00011d84 bl 0x10964 | r0 = opendir ();
0x00011d88 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00011d8c beq 0x11eec | goto label_2;
| }
0x00011d90 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x00011d94 str r3, [r4, 4] | *((r4 + 4)) = r3;
0x00011d98 bl 0x10988 | errno_location ();
0x00011d9c ldr sl, [pc, 0x17c] | sl = "ubi%d%s";
0x00011da0 mov sb, 0 | sb = 0;
0x00011da4 mov r7, r0 | r7 = r0;
| do {
| label_0:
0x00011da8 str sb, [r7] | *(r7) = sb;
0x00011dac mov r0, r8 | r0 = r8;
0x00011db0 bl 0x10928 | r0 = readdir64 ();
0x00011db4 cmp r0, 0 |
| if (r0 == 0) {
0x00011db8 beq 0x11e48 | goto label_3;
| }
0x00011dbc add r6, r0, 0x13 | r6 = r0 + 0x13;
0x00011dc0 mov r0, r6 | r0 = r6;
0x00011dc4 bl 0x109a0 | r0 = strlen (r0);
0x00011dc8 cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00011dcc bls 0x11e00 |
0x00011dd0 ldr r0, [pc, 0x14c] |
0x00011dd4 str r6, [sp] | *(sp) = r6;
0x00011dd8 ldr r2, [pc, 0x148] | r2 = stderr;
0x00011ddc ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00011de0 ldr r1, [pc, 0x144] | r1 = "libubi";
0x00011de4 ldr r0, [r0] | r0 = "ubi%d%s";
0x00011de8 bl 0x108ec | fprintf ("ubi%d%s", "libubi", r2, r3, r4, r5, r6)
0x00011dec mov r3, 0x16 | r3 = 0x16;
0x00011df0 str r3, [r7] | *(r7) = r3;
| label_1:
0x00011df4 mov r0, r8 | r0 = r8;
0x00011df8 bl 0x109b8 | closedir ();
0x00011dfc b 0x11eec | goto label_2;
| }
0x00011e00 add r3, sp, 0x10 | r3 += var_10h;
0x00011e04 add r2, sp, 0xc | r2 += var_ch;
0x00011e08 mov r1, sl | r1 = sl;
0x00011e0c mov r0, r6 | r0 = r6;
0x00011e10 bl 0x10934 | r0 = sscanf (r0, r1, r2);
0x00011e14 cmp r0, 1 |
0x00011e18 bne 0x11da8 |
| } while (r0 != 1);
0x00011e1c ldr r3, [r4] | r3 = *(r4);
0x00011e20 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00011e24 add r3, r3, 1 | r3++;
0x00011e28 str r3, [r4] | *(r4) = r3;
0x00011e2c ldr r3, [sp, 0xc] | r3 = var_ch;
0x00011e30 cmp r2, r3 |
0x00011e34 ldr r2, [r4, 4] | r2 = *((r4 + 4));
| if (r2 >= r3) {
0x00011e38 strlt r3, [r4, 8] | *((r4 + 8)) = r3;
| }
0x00011e3c cmp r3, r2 |
| if (r3 >= r2) {
0x00011e40 strlt r3, [r4, 4] | *((r4 + 4)) = r3;
| }
0x00011e44 b 0x11da8 | goto label_0;
| label_3:
0x00011e48 ldr r6, [r7] | r6 = *(r7);
0x00011e4c cmp r6, 0 |
| if (r6 != 0) {
0x00011e50 beq 0x11e98 |
0x00011e54 ldr r4, [pc, 0xc8] |
0x00011e58 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00011e5c ldr r2, [pc, 0xc4] | r2 = stderr;
0x00011e60 ldr r1, [pc, 0xc8] | r1 = "_s:_error_:_invalid_entry_in__s:___s_";
0x00011e64 ldr r0, [r4] | r0 = "ubi%d%s";
0x00011e68 bl 0x108ec | fprintf ("ubi%d%s", "_s:_error_:_invalid_entry_in__s:___s_", r2, r3, "ubi%d%s")
0x00011e6c mov r0, r6 | r0 = r6;
0x00011e70 ldr r4, [r4] | r4 = "ubi%d%s";
0x00011e74 bl 0x10868 | strerror (r0);
0x00011e78 str r6, [sp] | *(sp) = r6;
0x00011e7c ldr r3, [pc, 0xb0] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x00011e80 mov r2, 8 | r2 = 8;
0x00011e84 ldr r1, [pc, 0xac] | r1 = *(0x11f34);
0x00011e88 str r0, [sp, 4] | var_4h = r0;
0x00011e8c mov r0, r4 | r0 = r4;
0x00011e90 bl 0x108ec | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n", r4, r5, r6)
0x00011e94 b 0x11df4 | goto label_1;
| }
0x00011e98 mov r0, r8 | r0 = r8;
0x00011e9c bl 0x109b8 | r0 = closedir ();
0x00011ea0 cmp r0, 0 |
| if (r0 != 0) {
0x00011ea4 beq 0x11ef4 |
0x00011ea8 ldr r6, [pc, 0x74] | r6 = "ubi%d%s";
0x00011eac ldr r4, [r7] | r4 = *(r7);
0x00011eb0 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00011eb4 ldr r2, [pc, 0x6c] | r2 = stderr;
0x00011eb8 ldr r1, [pc, 0x7c] | r1 = "%*serror %d (%s)\n";
0x00011ebc ldr r0, [r6] | r0 = "ubi%d%s";
0x00011ec0 bl 0x108ec | fprintf ("ubi%d%s", "%*serror %d (%s)\n", r2, r3, r4, r5, "ubi%d%s")
0x00011ec4 mov r0, r4 | r0 = r4;
0x00011ec8 ldr r5, [r6] | r5 = "ubi%d%s";
0x00011ecc bl 0x10868 | strerror (r0);
0x00011ed0 str r4, [sp] | *(sp) = r4;
0x00011ed4 ldr r3, [pc, 0x58] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x00011ed8 mov r2, 8 | r2 = 8;
0x00011edc ldr r1, [pc, 0x54] | r1 = *(0x11f34);
0x00011ee0 str r0, [sp, 4] | var_4h = r0;
0x00011ee4 mov r0, r5 | r0 = r5;
0x00011ee8 bl 0x108ec | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n", r4)
| label_2:
0x00011eec mvn r0, 0 | r0 = ~0;
0x00011ef0 b 0x11f18 |
| } else {
0x00011ef4 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00011ef8 add r1, r4, 0xc | r1 = r4 + 0xc;
0x00011efc cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x00011f00 streq r0, [r4, 4] | *((r4 + 4)) = r0;
| }
0x00011f04 ldr r0, [r5, 0x14] | r0 = *((r5 + 0x14));
0x00011f08 bl 0x1113c | r0 = fcn_0001113c (r0, r1);
0x00011f0c adds r0, r0, 0 | r0 += 0;
| if (r0 == r0) {
0x00011f10 movne r0, 1 | r0 = 1;
| }
0x00011f14 rsb r0, r0, 0 | r0 -= ;
| }
0x00011f18 add sp, sp, 0x110 |
0x00011f1c 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/ubirmvol @ 0x12070 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012070 () | void fcn_00012070 (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;
0x00012070 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012074 add fp, sp, 0x20 |
0x00012078 sub sp, sp, 0x9c |
0x0001207c mov r6, r0 | r6 = r0;
0x00012080 ldr r0, [r0, 0x40] | r0 = *((r0 + 0x40));
0x00012084 mov r5, r1 | r5 = r1;
0x00012088 bl 0x109a0 | strlen (r0);
0x0001208c sub r1, fp, 0x8c | r1 -= var_8ch;
0x00012090 add r0, r0, 0x6b | r0 += 0x6b;
0x00012094 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012098 sub sp, sp, r0 |
0x0001209c mov r0, r5 | r0 = r5;
0x000120a0 bl 0x10874 | r0 = stat64 ();
0x000120a4 cmp r0, 0 |
| if (r0 == 0) {
0x000120a8 beq 0x12100 | goto label_5;
| }
0x000120ac bl 0x10988 | errno_location ();
0x000120b0 ldr r6, [pc, 0x1e8] | r6 = *(0x1229c);
0x000120b4 mov r3, r5 | r3 = r5;
0x000120b8 ldr r2, [pc, 0x1e4] | r2 = stderr;
0x000120bc ldr r1, [pc, 0x1e4] | r1 = "libubi";
0x000120c0 ldr r4, [r0] | r4 = *(r0);
0x000120c4 ldr r0, [r6] | r0 = *(0x1229c);
0x000120c8 bl 0x108ec | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x000120cc mov r0, r4 | r0 = r4;
0x000120d0 ldr r5, [r6] | r5 = *(0x1229c);
0x000120d4 bl 0x10868 | strerror (r0);
0x000120d8 str r4, [sp] | *(sp) = r4;
0x000120dc ldr r3, [pc, 0x1c8] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x000120e0 mov r2, 8 | r2 = 8;
0x000120e4 ldr r1, [pc, 0x1c4] | r1 = *(0x122ac);
0x000120e8 str r0, [sp, 4] | var_4h = r0;
0x000120ec mov r0, r5 | r0 = r5;
0x000120f0 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4)
| do {
| label_0:
0x000120f4 mvn r0, 0 | r0 = ~0;
| label_4:
0x000120f8 sub sp, fp, 0x20 |
0x000120fc pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_5:
0x00012100 ldr r3, [fp, -0x7c] | r3 = var_7ch;
0x00012104 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00012108 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x0001210c beq 0x12138 | goto label_6;
| }
0x00012110 ldr r0, [pc, 0x188] |
0x00012114 mov r3, r5 | r3 = r5;
0x00012118 ldr r2, [pc, 0x184] | r2 = stderr;
0x0001211c ldr r1, [pc, 0x190] | r1 = "%*serror %d (%s)\n";
0x00012120 ldr r0, [r0] | r0 = *(0x1229c);
0x00012124 bl 0x108ec | r0 = fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x00012128 bl 0x10988 | errno_location ();
0x0001212c mov r3, 0x16 | r3 = 0x16;
| label_1:
0x00012130 str r3, [r0] | *(r0) = r3;
0x00012134 b 0x120f4 |
| } while (1);
| label_6:
0x00012138 ldrd r2, r3, [fp, -0x6c] | __asm ("ldrd r2, r3, [var_6ch]");
0x0001213c mov r1, r3 | r1 = r3;
0x00012140 mov r0, r2 | r0 = r2;
0x00012144 strd r2, r3, [fp, -0xb4] | __asm ("strd r2, r3, [var_b4h]");
0x00012148 bl 0x1088c | gnu_dev_major ();
0x0001214c ldrd r2, r3, [fp, -0xb4] | __asm ("ldrd r2, r3, [var_b4h]");
0x00012150 mov r1, r3 | r1 = r3;
0x00012154 mov sb, r0 | sb = r0;
0x00012158 mov r0, r2 | r0 = r2;
0x0001215c bl 0x108c8 | gnu_dev_minor ();
0x00012160 sub r1, fp, 0xa4 | r1 -= var_a4h;
0x00012164 mov r7, r0 | r7 = r0;
0x00012168 mov r0, r6 | r0 = r6;
0x0001216c bl 0x11d40 | r0 = fcn_00011d40 (r0, r1);
0x00012170 cmp r0, 0 |
| if (r0 != 0) {
0x00012174 addeq r8, sp, 8 | r8 += var_b4h;
| }
| if (r0 != 0) {
0x00012178 ldreq r4, [fp, -0xa0] | r4 = var_a0h;
| }
| if (r0 == 0) {
0x0001217c addeq sl, r6, 0x18 | sl = r6 + 0x18;
| goto label_7;
| }
| if (r0 != 0) {
| label_7:
0x00012180 bne 0x120f4 | goto label_0;
| }
| do {
0x00012184 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012188 cmp r4, r3 |
| if (r4 > r3) {
0x0001218c bgt 0x12204 | goto label_8;
| }
0x00012190 sub r3, fp, 0xa8 | r3 -= var_a8h;
0x00012194 sub r2, fp, 0xac | r2 -= var_ach;
0x00012198 mov r1, r4 | r1 = r4;
0x0001219c mov r0, sl | r0 = sl;
0x000121a0 bl 0x1169c | r0 = fcn_0001169c (r0, r1);
0x000121a4 cmp r0, 0 |
| if (r0 == 0) {
0x000121a8 beq 0x121f8 | goto label_9;
| }
0x000121ac bl 0x10988 | r0 = errno_location ();
0x000121b0 ldr r3, [r0] | r3 = *(r0);
0x000121b4 cmp r3, 2 |
| if (r3 != 2) {
0x000121b8 bne 0x121c4 | goto label_10;
| }
| label_2:
0x000121bc add r4, r4, 1 | r4++;
0x000121c0 b 0x12184 |
| } while (1);
| label_10:
0x000121c4 cmp r3, 0 |
| if (r3 != 0) {
0x000121c8 bne 0x120f4 | goto label_0;
| }
| label_3:
0x000121cc ldr r0, [pc, 0xcc] |
0x000121d0 mov r3, r5 | r3 = r5;
0x000121d4 str r7, [sp, 4] | var_4h = r7;
0x000121d8 str sb, [sp] | *(sp) = sb;
0x000121dc ldr r2, [pc, 0xc0] | r2 = stderr;
0x000121e0 ldr r1, [pc, 0xd0] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x000121e4 ldr r0, [r0] | r0 = *(0x1229c);
0x000121e8 bl 0x108ec | r0 = fprintf (r0, "_s:_error_:___s__is_not_a_character_device", r2, r3)
0x000121ec bl 0x10988 | errno_location ();
0x000121f0 mov r3, 0x13 | r3 = 0x13;
0x000121f4 b 0x12130 | goto label_1;
| label_9:
0x000121f8 ldr r3, [fp, -0xac] | r3 = var_ach;
0x000121fc cmp r3, sb |
| if (r3 != sb) {
0x00012200 bne 0x121bc | goto label_2;
| }
| label_8:
0x00012204 ldr r3, [fp, -0x9c] | r3 = var_9ch;
0x00012208 cmp r4, r3 |
| if (r4 > r3) {
0x0001220c bgt 0x121cc | goto label_3;
| }
0x00012210 cmp r7, 0 |
| if (r7 == 0) {
0x00012214 moveq r0, 1 | r0 = 1;
| goto label_11;
| }
| if (r7 == 0) {
| label_11:
0x00012218 beq 0x120f8 | goto label_4;
| }
0x0001221c sub r3, r7, 1 | r3 = r7 - 1;
0x00012220 mov r2, r4 | r2 = r4;
0x00012224 ldr r1, [r6, 0x40] | r1 = *((r6 + 0x40));
0x00012228 mov r0, r8 | r0 = r8;
0x0001222c bl 0x1097c | sprintf (r0, r1, r2);
0x00012230 mov r1, 0 | r1 = 0;
0x00012234 mov r0, r8 | r0 = r8;
0x00012238 bl 0x10958 | r0 = open64 ();
0x0001223c cmn r0, 1 |
| if (r0 == 1) {
0x00012240 beq 0x121cc | goto label_3;
| }
0x00012244 bl 0x109d0 | r0 = close (r0);
0x00012248 cmp r0, 0 |
| if (r0 != 0) {
0x0001224c beq 0x12298 |
0x00012250 bl 0x10988 | errno_location ();
0x00012254 ldr r5, [pc, 0x44] |
0x00012258 mov r3, r8 | r3 = r8;
0x0001225c ldr r2, [pc, 0x40] | r2 = stderr;
0x00012260 ldr r1, [pc, 0x54] | r1 = "%s: error!: \"%s\" has major:minor %d:%d, but this does not correspond to any existing UBI device or volume\n";
0x00012264 ldr r4, [r0] | r4 = *(r0);
0x00012268 ldr r0, [r5] | r0 = *(0x1229c);
0x0001226c bl 0x108ec | fprintf (r0, "%s: error!: \"%s\" has major:minor %d:%d, but this does not correspond to any existing UBI device or volume\n", r2, r3, r4, r5)
0x00012270 mov r0, r4 | r0 = r4;
0x00012274 ldr r5, [r5] | r5 = *(0x1229c);
0x00012278 bl 0x10868 | strerror (r0);
0x0001227c str r4, [sp] | *(sp) = r4;
0x00012280 ldr r3, [pc, 0x24] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x00012284 mov r2, 8 | r2 = 8;
0x00012288 ldr r1, [pc, 0x20] | r1 = *(0x122ac);
0x0001228c str r0, [sp, 4] | var_4h = r0;
0x00012290 mov r0, r5 | r0 = r5;
0x00012294 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4)
| }
0x00012298 mov r0, 2 | r0 = 2;
0x0001229c b 0x120f8 | 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/ubirmvol @ 0x123f4 */
| #include <stdint.h>
|
; (fcn) fcn.000123f4 () | void fcn_000123f4 (int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_ch;
| int32_t var_14h;
| r1 = arg2;
0x000123f4 push {r4, r5, r6, r7, lr} |
0x000123f8 mov r7, r1 | r7 = r1;
0x000123fc sub sp, sp, 0x14 |
0x00012400 mov r1, 0 | r1 = 0;
0x00012404 mov r0, r7 | r0 = r7;
0x00012408 str r2, [sp, 0xc] | var_ch = r2;
0x0001240c bl 0x10958 | r0 = open64 ();
0x00012410 cmn r0, 1 |
0x00012414 mov r4, r0 | r4 = r0;
| if (r0 != 1) {
0x00012418 bne 0x12470 | goto label_1;
| }
0x0001241c bl 0x10988 | errno_location ();
0x00012420 ldr r6, [pc, 0x7c] |
0x00012424 mov r3, r7 | r3 = r7;
0x00012428 ldr r2, [pc, 0x78] | r2 = stderr;
0x0001242c ldr r1, [pc, 0x78] | r1 = "libubi";
0x00012430 ldr r5, [r0] | r5 = *(r0);
0x00012434 ldr r0, [r6] | r0 = *(0x124a0);
0x00012438 bl 0x108ec | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x0001243c mov r0, r5 | r0 = r5;
0x00012440 ldr r6, [r6] | r6 = *(0x124a0);
0x00012444 bl 0x10868 | strerror (r0);
0x00012448 str r5, [sp] | *(sp) = r5;
0x0001244c ldr r3, [pc, 0x5c] | r3 = "_s:_error_:_cannot_open___s_";
0x00012450 mov r2, 8 | r2 = 8;
0x00012454 ldr r1, [pc, 0x58] | r1 = *(0x124b0);
0x00012458 str r0, [sp, 4] | var_4h = r0;
0x0001245c mov r0, r6 | r0 = r6;
0x00012460 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_open___s_", r4, r5)
| do {
| label_0:
0x00012464 mov r0, r4 | r0 = r4;
0x00012468 add sp, sp, 0x14 |
0x0001246c pop {r4, r5, r6, r7, pc} |
| label_1:
0x00012470 add r2, sp, 0xc | r2 += var_ch;
0x00012474 ldr r1, [pc, 0x3c] | r1 = "%*serror %d (%s)\n";
0x00012478 bl 0x10850 | r0 = ioctl (r0, "%*serror %d (%s)\n");
0x0001247c mov r5, r0 | r5 = r0;
0x00012480 cmn r5, 1 |
0x00012484 mov r0, r4 | r0 = r4;
| if (r5 != 1) {
0x00012488 bne 0x12498 | goto label_2;
| }
0x0001248c bl 0x109d0 | close (r0);
0x00012490 mov r4, r5 | r4 = r5;
0x00012494 b 0x12464 |
| } while (1);
| label_2:
0x00012498 bl 0x109d0 | close (r0);
0x0001249c mov r4, 0 | r4 = 0;
0x000124a0 b 0x12464 | 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/ubirmvol @ 0x126cc */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000126cc () | void fcn_000126cc (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;
0x000126cc push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000126d0 add sl, r2, 4 | sl = r2 + 4;
0x000126d4 add fp, sp, 0x20 |
0x000126d8 sub sp, sp, 0x114 |
0x000126dc mov r6, r1 | r6 = r1;
0x000126e0 mov r5, r0 | r5 = r0;
0x000126e4 mov r4, r2 | r4 = r2;
0x000126e8 mov r1, 0 | r1 = 0;
0x000126ec mov r2, 0x54 | r2 = 0x54;
0x000126f0 mov r0, sl | r0 = sl;
0x000126f4 bl 0x1094c | memset (r0, r1, r2);
0x000126f8 str r6, [r4] | *(r4) = r6;
0x000126fc mov r1, r6 | r1 = r6;
0x00012700 mov r0, r5 | r0 = r5;
0x00012704 bl 0x12678 | r0 = fcn_00012678 (r0, r1);
0x00012708 cmp r0, 0 |
0x0001270c bne 0x12718 |
| while (r8 == r0) {
| label_0:
0x00012710 mvn r0, 0 | r0 = ~0;
0x00012714 b 0x129dc | goto label_3;
0x00012718 ldr r0, [r5, 0xc] | r0 = *((r5 + 0xc));
0x0001271c bl 0x10964 | r0 = opendir ();
0x00012720 subs r8, r0, 0 | r8 = r0 - 0;
0x00012724 beq 0x12710 |
| }
0x00012728 mvn r3, 0x80000000 | r3 = ~0x80000000;
0x0001272c str r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
0x00012730 bl 0x10988 | r0 = errno_location ();
0x00012734 mov sb, r0 | sb = r0;
| do {
| label_1:
0x00012738 mov r3, 0 | r3 = 0;
0x0001273c str r3, [sb] | *(sb) = r3;
0x00012740 mov r0, r8 | r0 = r8;
0x00012744 bl 0x10928 | r0 = readdir64 ();
0x00012748 cmp r0, 0 |
| if (r0 == 0) {
0x0001274c beq 0x127e8 | goto label_4;
| }
0x00012750 add r7, r0, 0x13 | r7 = r0 + 0x13;
0x00012754 mov r0, r7 | r0 = r7;
0x00012758 bl 0x109a0 | r0 = strlen (r0);
0x0001275c cmp r0, 0xfe |
| if (r0 >= 0xfe) {
0x00012760 bls 0x1278c |
0x00012764 ldr r0, [pc, 0x278] |
0x00012768 str r7, [sp] | *(sp) = r7;
0x0001276c ldr r2, [pc, 0x274] | r2 = stderr;
0x00012770 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012774 ldr r1, [pc, 0x270] | r1 = "libubi";
0x00012778 ldr r0, [r0] | r0 = *(0x129e0);
0x0001277c bl 0x108ec | fprintf (r0, "libubi", r2, r3)
| label_2:
0x00012780 mov r0, r8 | r0 = r8;
0x00012784 bl 0x109b8 | closedir ();
0x00012788 b 0x12710 | goto label_0;
| }
0x0001278c sub r3, fp, 0x124 | r3 -= var_124h;
0x00012790 str r3, [sp] | *(sp) = r3;
0x00012794 sub r2, fp, 0x128 | r2 -= var_128h;
0x00012798 sub r3, fp, 0x12c | r3 -= s;
0x0001279c ldr r1, [pc, 0x24c] | r1 = "_s:_error_:_invalid_entry_in__s:___s_";
0x000127a0 mov r0, r7 | r0 = r7;
0x000127a4 bl 0x10934 | r0 = sscanf (r0, "_s:_error_:_invalid_entry_in__s:___s_", r2);
0x000127a8 cmp r0, 2 |
0x000127ac bne 0x12738 |
| } while (r0 != 2);
0x000127b0 ldr r3, [fp, -0x128] | r3 = var_128h;
0x000127b4 cmp r3, r6 |
| if (r3 != r6) {
0x000127b8 bne 0x12738 | goto label_1;
| }
0x000127bc ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x000127c0 ldr r2, [r4, 0x10] | r2 = *((r4 + 0x10));
0x000127c4 add r3, r3, 1 | r3++;
0x000127c8 str r3, [r4, 8] | *((r4 + 8)) = r3;
0x000127cc ldr r3, [fp, -0x12c] | r3 = s;
0x000127d0 cmp r2, r3 |
0x000127d4 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
| if (r2 >= r3) {
0x000127d8 strlt r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
| }
0x000127dc cmp r3, r2 |
| if (r3 >= r2) {
0x000127e0 strlt r3, [r4, 0xc] | *((r4 + 0xc)) = r3;
| }
0x000127e4 b 0x12738 | goto label_1;
| label_4:
0x000127e8 ldr r7, [sb] | r7 = *(sb);
0x000127ec cmp r7, 0 |
| if (r7 != 0) {
0x000127f0 beq 0x12838 |
0x000127f4 ldr r4, [pc, 0x1e8] |
0x000127f8 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000127fc ldr r2, [pc, 0x1e4] | r2 = stderr;
0x00012800 ldr r1, [pc, 0x1ec] | r1 = "ubi_d__d_s";
0x00012804 ldr r0, [r4] | r0 = *(0x129e0);
0x00012808 bl 0x108ec | fprintf (r0, "ubi_d__d_s", r2, r3, r4)
0x0001280c mov r0, r7 | r0 = r7;
0x00012810 ldr r4, [r4] | r4 = *(0x129e0);
0x00012814 bl 0x10868 | strerror (r0);
0x00012818 str r7, [sp] | *(sp) = r7;
0x0001281c ldr r3, [pc, 0x1d4] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x00012820 mov r2, 8 | r2 = 8;
0x00012824 ldr r1, [pc, 0x1d0] | r1 = *(0x129f8);
0x00012828 str r0, [sp, 4] | var_4h = r0;
0x0001282c mov r0, r4 | r0 = r4;
0x00012830 bl 0x108ec | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n")
0x00012834 b 0x12780 | goto label_2;
| }
0x00012838 mov r0, r8 | r0 = r8;
0x0001283c bl 0x109b8 | r0 = closedir ();
0x00012840 cmp r0, 0 |
| if (r0 != 0) {
0x00012844 beq 0x12890 |
0x00012848 ldr r6, [pc, 0x194] | r6 = *(0x129e0);
0x0001284c ldr r4, [sb] | r4 = *(sb);
0x00012850 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x00012854 ldr r2, [pc, 0x18c] | r2 = stderr;
0x00012858 ldr r1, [pc, 0x1a0] | r1 = "%*serror %d (%s)\n";
0x0001285c ldr r0, [r6] | r0 = *(0x129e0);
0x00012860 bl 0x108ec | fprintf (r0, "%*serror %d (%s)\n", r2, r3, r4, r5, r6)
0x00012864 mov r0, r4 | r0 = r4;
0x00012868 ldr r5, [r6] | r5 = *(0x129e0);
0x0001286c bl 0x10868 | strerror (r0);
0x00012870 str r4, [sp] | *(sp) = r4;
0x00012874 ldr r3, [pc, 0x17c] | r3 = "%s: error!: readdir failed on \"%s\"\n";
0x00012878 mov r2, 8 | r2 = 8;
0x0001287c ldr r1, [pc, 0x178] | r1 = *(0x129f8);
0x00012880 str r0, [sp, 4] | var_4h = r0;
0x00012884 mov r0, r5 | r0 = r5;
0x00012888 bl 0x108ec | fprintf (r0, r1, r2, "%s: error!: readdir failed on \"%s\"\n", r4)
0x0001288c b 0x12710 | goto label_0;
| }
0x00012890 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x00012894 add r2, r4, 0x14 | r2 = r4 + 0x14;
0x00012898 cmn r3, 0x80000001 |
| if (r3 != 0x80000001) {
0x0001289c streq r0, [r4, 0xc] | *((r4 + 0xc)) = r0;
| }
0x000128a0 add r3, r4, 0x18 | r3 = r4 + 0x18;
0x000128a4 mov r1, r6 | r1 = r6;
0x000128a8 add r0, r5, 0x18 | r0 = r5 + 0x18;
0x000128ac bl 0x1169c | r0 = fcn_0001169c (r0, r1);
0x000128b0 cmp r0, 0 |
| if (r0 != 0) {
0x000128b4 bne 0x12710 | goto label_0;
| }
0x000128b8 mov r2, sl | r2 = sl;
0x000128bc mov r1, r6 | r1 = r6;
0x000128c0 ldr r0, [r5, 0x3c] | r0 = *((r5 + 0x3c));
0x000128c4 bl 0x111b0 | r0 = fcn_000111b0 (r0, r1);
0x000128c8 cmp r0, 0 |
| if (r0 != 0) {
0x000128cc bne 0x12710 | goto label_0;
| }
0x000128d0 add r2, r4, 0x20 | r2 = r4 + 0x20;
0x000128d4 mov r1, r6 | r1 = r6;
0x000128d8 ldr r0, [r5, 0x1c] | r0 = *((r5 + 0x1c));
0x000128dc bl 0x111b0 | r0 = fcn_000111b0 (r0, r1);
0x000128e0 cmp r0, 0 |
| if (r0 != 0) {
0x000128e4 bne 0x12710 | goto label_0;
| }
0x000128e8 add r2, r4, 0x1c | r2 = r4 + 0x1c;
0x000128ec mov r1, r6 | r1 = r6;
0x000128f0 ldr r0, [r5, 0x20] | r0 = *((r5 + 0x20));
0x000128f4 bl 0x111b0 | r0 = fcn_000111b0 (r0, r1);
0x000128f8 cmp r0, 0 |
| if (r0 != 0) {
0x000128fc bne 0x12710 | goto label_0;
| }
0x00012900 add r2, r4, 0x38 | r2 = r4 + 0x38;
0x00012904 mov r1, r6 | r1 = r6;
0x00012908 ldr r0, [r5, 0x24] | r0 = *((r5 + 0x24));
0x0001290c bl 0x111b0 | r0 = fcn_000111b0 (r0, r1);
0x00012910 cmp r0, 0 |
| if (r0 != 0) {
0x00012914 bne 0x12710 | goto label_0;
| }
0x00012918 add r2, r4, 0x3c | r2 = r4 + 0x3c;
0x0001291c mov r1, r6 | r1 = r6;
0x00012920 ldr r0, [r5, 0x28] | r0 = *((r5 + 0x28));
0x00012924 bl 0x111b0 | r0 = fcn_000111b0 (r0, r1);
0x00012928 cmp r0, 0 |
| if (r0 != 0) {
0x0001292c bne 0x12710 | goto label_0;
| }
0x00012930 add r2, r4, 0x48 | r2 = r4 + 0x48;
0x00012934 mov r1, r6 | r1 = r6;
0x00012938 ldr r0, [r5, 0x30] | r0 = *((r5 + 0x30));
0x0001293c bl 0x111b0 | r0 = fcn_000111b0 (r0, r1);
0x00012940 cmp r0, 0 |
| if (r0 != 0) {
0x00012944 bne 0x12710 | goto label_0;
| }
0x00012948 ldr r8, [r5, 0x2c] | r8 = *((r5 + 0x2c));
0x0001294c mov sb, sp | sb = sp;
0x00012950 mov r0, r8 | r0 = r8;
0x00012954 bl 0x109a0 | strlen (r0);
0x00012958 mov r2, r6 | r2 = r6;
0x0001295c mov r1, r8 | r1 = r8;
0x00012960 add r0, r0, 0x39 | r0 += 0x39;
0x00012964 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012968 sub sp, sp, r0 |
0x0001296c add r7, sp, 8 | r7 += s;
0x00012970 mov r0, r7 | r0 = r7;
0x00012974 bl 0x1097c | sprintf (r0, r1, r2);
0x00012978 add r1, r4, 0x40 | r1 = r4 + 0x40;
0x0001297c mov r0, r7 | r0 = r7;
0x00012980 bl 0x10f8c | fcn_00010f8c (r0, r1);
0x00012984 mov sp, sb |
0x00012988 cmp r0, 0 |
| if (r0 != 0) {
0x0001298c bne 0x12710 | goto label_0;
| }
0x00012990 add r2, r4, 0x4c | r2 = r4 + 0x4c;
0x00012994 mov r1, r6 | r1 = r6;
0x00012998 ldr r0, [r5, 0x34] | r0 = *((r5 + 0x34));
0x0001299c bl 0x111b0 | r0 = fcn_000111b0 (r0, r1);
0x000129a0 cmp r0, 0 |
| if (r0 != 0) {
0x000129a4 bne 0x12710 | goto label_0;
| }
0x000129a8 add r2, r4, 0x50 | r2 = r4 + 0x50;
0x000129ac mov r1, r6 | r1 = r6;
0x000129b0 ldr r0, [r5, 0x38] | r0 = *((r5 + 0x38));
0x000129b4 bl 0x111b0 | r0 = fcn_000111b0 (r0, r1);
0x000129b8 cmp r0, 0 |
| if (r0 != 0) {
0x000129bc bne 0x12710 | goto label_0;
| }
0x000129c0 ldr r3, [r4, 0x3c] | r3 = *((r4 + 0x3c));
0x000129c4 ldr r2, [r4, 0x20] | r2 = *((r4 + 0x20));
0x000129c8 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x000129cc ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x000129d0 strd r6, r7, [r4, 0x30] | __asm ("strd r6, r7, [r4, 0x30]");
0x000129d4 smull r6, r7, r2, r3 | r6:r7 = r2 * r3;
0x000129d8 strd r6, r7, [r4, 0x28] | __asm ("strd r6, r7, [r4, 0x28]");
| label_3:
0x000129dc sub sp, fp, 0x20 |
0x000129e0 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/ubirmvol @ 0x12a04 */
| #include <stdint.h>
|
; (fcn) fcn.00012a04 () | void fcn_00012a04 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_28h;
| int32_t var_38h;
| int32_t var_48h;
| int32_t var_48h_2;
| int32_t var_90h;
| r0 = arg1;
| r1 = arg2;
0x00012a04 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00012a08 sub sp, sp, 0x90 |
0x00012a0c mov r6, r0 | r6 = r0;
0x00012a10 mov r4, r1 | r4 = r1;
0x00012a14 mov r7, r2 | r7 = r2;
0x00012a18 bl 0x12070 | r0 = fcn_00012070 (r0, r1);
0x00012a1c cmp r0, 1 |
| if (r0 == 1) {
0x00012a20 beq 0x12a40 | goto label_2;
| }
0x00012a24 cmp r0, 2 |
| if (r0 != 2) {
0x00012a28 bne 0x12a38 | goto label_0;
| }
0x00012a2c bl 0x10988 | errno_location ();
0x00012a30 mov r3, 0x13 | r3 = 0x13;
0x00012a34 str r3, [r0] | *(r0) = r3;
| do {
| label_0:
0x00012a38 mvn r0, 0 | r0 = ~0;
0x00012a3c b 0x12bcc | goto label_3;
| label_2:
0x00012a40 add r1, sp, 0x28 | r1 += var_28h;
0x00012a44 mov r0, r4 | r0 = r4;
0x00012a48 bl 0x10874 | r0 = stat64 ();
0x00012a4c cmp r0, 0 |
| if (r0 == 0) {
0x00012a50 beq 0x12aa0 | goto label_4;
| }
0x00012a54 bl 0x10988 | errno_location ();
0x00012a58 ldr r6, [pc, 0x174] | r6 = *(0x12bd0);
0x00012a5c mov r3, r4 | r3 = r4;
0x00012a60 ldr r2, [pc, 0x170] | r2 = stderr;
0x00012a64 ldr r1, [pc, 0x170] | r1 = "libubi";
0x00012a68 ldr r5, [r0] | r5 = *(r0);
0x00012a6c ldr r0, [r6] | r0 = *(0x12bd0);
0x00012a70 bl 0x108ec | fprintf (r0, "libubi", r2, r3, r4, r5, r6)
0x00012a74 mov r0, r5 | r0 = r5;
0x00012a78 ldr r4, [r6] | r4 = *(0x12bd0);
0x00012a7c bl 0x10868 | strerror (r0);
0x00012a80 str r5, [sp] | *(sp) = r5;
0x00012a84 ldr r3, [pc, 0x154] | r3 = "_s:_error_:_cannot_get_information_about___s_";
0x00012a88 mov r2, 8 | r2 = 8;
0x00012a8c ldr r1, [pc, 0x150] | r1 = *(0x12be0);
0x00012a90 str r0, [sp, 4] | var_4h = r0;
0x00012a94 mov r0, r4 | r0 = r4;
0x00012a98 bl 0x108ec | fprintf (r0, r1, r2, "_s:_error_:_cannot_get_information_about___s_", r4, r5)
0x00012a9c b 0x12a38 |
| } while (1);
| label_4:
0x00012aa0 ldr r3, [sp, 0x38] | r3 = var_38h;
0x00012aa4 and r3, r3, 0xf000 | r3 &= 0xf000;
0x00012aa8 cmp r3, 0x2000 |
| if (r3 == 0x2000) {
0x00012aac beq 0x12ad8 | goto label_5;
| }
0x00012ab0 bl 0x10988 | errno_location ();
0x00012ab4 ldr r2, [pc, 0x11c] | r2 = stderr;
0x00012ab8 ldr r1, [pc, 0x128] | r1 = "%*serror %d (%s)\n";
0x00012abc mov r3, 0x16 | r3 = 0x16;
0x00012ac0 str r3, [r0] | *(r0) = r3;
0x00012ac4 mov r3, r4 | r3 = r4;
| do {
0x00012ac8 ldr r0, [pc, 0x104] |
0x00012acc ldr r0, [r0] | r0 = *(0x12bd0);
0x00012ad0 bl 0x108ec | fprintf (r0, "%*serror %d (%s)\n", r2, r3)
0x00012ad4 b 0x12a38 | goto label_0;
| label_5:
0x00012ad8 ldrd r8, sb, [sp, 0x48] | __asm ("ldrd r8, sb, [var_48h]");
0x00012adc mov r1, sb | r1 = sb;
0x00012ae0 mov r0, r8 | r0 = r8;
0x00012ae4 bl 0x1088c | gnu_dev_major ();
0x00012ae8 mov r1, sb | r1 = sb;
0x00012aec mov sl, r0 | sl = r0;
0x00012af0 mov r0, r8 | r0 = r8;
0x00012af4 bl 0x108c8 | r0 = gnu_dev_minor ();
0x00012af8 cmp r0, 0 |
| if (r0 == 0) {
0x00012afc beq 0x12b1c | goto label_6;
| }
0x00012b00 bl 0x10988 | errno_location ();
0x00012b04 mov r3, 0x16 | r3 = 0x16;
0x00012b08 ldr r2, [pc, 0xc8] | r2 = stderr;
0x00012b0c ldr r1, [pc, 0xd8] | r1 = "_s:_error_:___s__is_not_a_character_device";
0x00012b10 str r3, [r0] | *(r0) = r3;
0x00012b14 mov r3, r4 | r3 = r4;
0x00012b18 b 0x12ac8 |
| } while (1);
| label_6:
0x00012b1c add r1, sp, 0x10 | r1 += var_10h;
0x00012b20 mov r0, r6 | r0 = r6;
0x00012b24 bl 0x11d40 | r0 = fcn_00011d40 (r0, r1);
0x00012b28 cmp r0, 0 |
| if (r0 != 0) {
0x00012b2c bne 0x12a38 | goto label_0;
| }
0x00012b30 bl 0x10988 | errno_location ();
0x00012b34 ldr r4, [sp, 0x14] | r4 = var_14h;
0x00012b38 add r8, r6, 0x18 | r8 = r6 + 0x18;
0x00012b3c mov r5, r0 | r5 = r0;
| label_1:
0x00012b40 ldr r3, [sp, 0x18] | r3 = var_18h;
0x00012b44 cmp r4, r3 |
| if (r4 <= r3) {
0x00012b48 movgt r3, 0x13 | r3 = 0x13;
| }
| if (r4 > r3) {
0x00012b4c bgt 0x12bb0 | goto label_7;
| }
0x00012b50 add r3, sp, 0xc | r3 += var_ch;
0x00012b54 add r2, sp, 8 | r2 += var_8h;
0x00012b58 mov r1, r4 | r1 = r4;
0x00012b5c mov r0, r8 | r0 = r8;
0x00012b60 bl 0x1169c | r0 = fcn_0001169c (r0, r1);
0x00012b64 cmp r0, 0 |
| if (r0 == 0) {
0x00012b68 beq 0x12b80 | goto label_8;
| }
0x00012b6c ldr r3, [r5] | r3 = *(r5);
0x00012b70 cmp r3, 2 |
| if (r3 != 2) {
0x00012b74 bne 0x12a38 | goto label_0;
| }
| do {
0x00012b78 add r4, r4, 1 | r4++;
0x00012b7c b 0x12b40 | goto label_1;
| label_8:
0x00012b80 ldr r3, [sp, 8] | r3 = var_8h;
0x00012b84 cmp sl, r3 |
0x00012b88 bne 0x12b78 |
| } while (sl != r3);
0x00012b8c ldr r3, [sp, 0xc] | r3 = var_ch;
0x00012b90 cmp r3, 0 |
| if (r3 != 0) {
0x00012b94 beq 0x12bb8 |
0x00012b98 ldr r0, [pc, 0x34] |
0x00012b9c ldr r2, [pc, 0x34] | r2 = stderr;
0x00012ba0 ldr r1, [pc, 0x48] | r1 = "%s: error!: \"%s\" is not an UBI character device\n";
0x00012ba4 ldr r0, [r0] | r0 = *(0x12bd0);
0x00012ba8 bl 0x108ec | fprintf (r0, "%s: error!: \"%s\" is not an UBI character device\n", r2)
0x00012bac mov r3, 0x16 | r3 = 0x16;
| label_7:
0x00012bb0 str r3, [r5] | *(r5) = r3;
0x00012bb4 b 0x12a38 | goto label_0;
| }
0x00012bb8 str r3, [r5] | *(r5) = r3;
0x00012bbc mov r2, r7 | r2 = r7;
0x00012bc0 mov r1, r4 | r1 = r4;
0x00012bc4 mov r0, r6 | r0 = r6;
0x00012bc8 bl 0x126cc | fcn_000126cc (r0, r1);
| label_3:
0x00012bcc add sp, sp, 0x90 |
0x00012bd0 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/ubirmvol @ 0x12bf4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00012bf4 () | void fcn_00012bf4 (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;
0x00012bf4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00012bf8 add sb, r3, 8 | sb = r3 + 8;
0x00012bfc add fp, sp, 0x20 |
0x00012c00 sub sp, sp, 0x3c |
0x00012c04 mov r5, r1 | r5 = r1;
0x00012c08 mov r6, r2 | r6 = r2;
0x00012c0c mov r1, 0 | r1 = 0;
0x00012c10 mov r2, 0xb0 | r2 = 0xb0;
0x00012c14 mov r7, r0 | r7 = r0;
0x00012c18 mov r0, sb | r0 = sb;
0x00012c1c mov r4, r3 | r4 = r3;
0x00012c20 bl 0x1094c | memset (r0, r1, r2);
0x00012c24 ldr sl, [r7, 0x48] | sl = *((r7 + 0x48));
0x00012c28 stm r4, {r5, r6} | *(r4) = r5;
| *((r4 + 4)) = r6;
0x00012c2c mov r0, sl | r0 = sl;
0x00012c30 bl 0x109a0 | strlen (r0);
0x00012c34 mov r8, sp | r8 = sp;
0x00012c38 mov r3, r6 | r3 = r6;
0x00012c3c mov r2, r5 | r2 = r5;
0x00012c40 mov r1, sl | r1 = sl;
0x00012c44 add r0, r0, 0x6b | r0 += 0x6b;
0x00012c48 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012c4c sub sp, sp, r0 |
0x00012c50 mov r0, sp | r0 = sp;
0x00012c54 bl 0x1097c | sprintf (r0, r1, r2);
0x00012c58 mov r0, sp | r0 = sp;
0x00012c5c add r2, r4, 0xc | r2 = r4 + 0xc;
0x00012c60 mov r1, sb | r1 = sb;
0x00012c64 bl 0x115c4 | fcn_000115c4 (r0, r1);
0x00012c68 mov sp, r8 |
0x00012c6c cmp r0, 0 |
0x00012c70 beq 0x12c84 |
| while (r8 < r0) {
| label_0:
0x00012c74 mvn r8, 0 | r8 = ~0;
| label_1:
0x00012c78 mov r0, r8 | r0 = r8;
0x00012c7c sub sp, fp, 0x20 |
0x00012c80 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00012c84 ldr sb, [r7, 0x44] | sb = *((r7 + 0x44));
0x00012c88 mov r0, sb | r0 = sb;
0x00012c8c bl 0x109a0 | strlen (r0);
0x00012c90 mov r3, r6 | r3 = r6;
0x00012c94 mov r2, r5 | r2 = r5;
0x00012c98 mov r1, sb | r1 = sb;
0x00012c9c add r0, r0, 0x6b | r0 += 0x6b;
0x00012ca0 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012ca4 sub sp, sp, r0 |
0x00012ca8 mov r0, sp | r0 = sp;
0x00012cac bl 0x1097c | sprintf (r0, r1, r2);
0x00012cb0 mov r0, sp | r0 = sp;
0x00012cb4 mov r2, 0x32 | r2 = 0x32;
0x00012cb8 sub r1, fp, 0x58 | r1 -= s1;
0x00012cbc bl 0x11248 | fcn_00011248 (r0, r1);
0x00012cc0 mov sp, r8 |
0x00012cc4 subs r8, r0, 0 | r8 = r0 - 0;
0x00012cc8 blt 0x12c74 |
| }
0x00012ccc mov r2, r8 | r2 = r8;
0x00012cd0 ldr r1, [pc, 0x174] | r1 = *(0x12e48);
0x00012cd4 sub r0, fp, 0x58 | r0 -= s1;
0x00012cd8 bl 0x10910 | r0 = strncmp (r0, r1, r2);
0x00012cdc cmp r0, 0 |
| if (r0 != 0) {
0x00012ce0 moveq r3, 4 | r3 = 4;
| }
| if (r0 != 0) {
0x00012ce4 beq 0x12d04 |
0x00012ce8 mov r2, r8 | r2 = r8;
0x00012cec ldr r1, [pc, 0x15c] | r1 = "static";
0x00012cf0 sub r0, fp, 0x58 | r0 -= s1;
0x00012cf4 bl 0x10910 | r0 = strncmp (r0, "static", r2);
0x00012cf8 cmp r0, 0 |
| if (r0 != 0) {
0x00012cfc bne 0x12e24 | goto label_2;
| }
0x00012d00 mov r3, 3 | r3 = 3;
| }
0x00012d04 str r3, [r4, 0x10] | *((r4 + 0x10)) = r3;
0x00012d08 mov r2, r6 | r2 = r6;
0x00012d0c add r3, r4, 0x14 | r3 = r4 + 0x14;
0x00012d10 mov r1, r5 | r1 = r5;
0x00012d14 ldr r0, [r7, 0x4c] | r0 = *((r7 + 0x4c));
0x00012d18 bl 0x111f8 | r0 = fcn_000111f8 (r0, r1);
0x00012d1c cmp r0, 0 |
| if (r0 != 0) {
0x00012d20 bne 0x12c74 | goto label_0;
| }
0x00012d24 ldr r8, [r7, 0x50] | r8 = *((r7 + 0x50));
0x00012d28 mov sb, sp | sb = sp;
0x00012d2c mov r0, r8 | r0 = r8;
0x00012d30 bl 0x109a0 | strlen (r0);
0x00012d34 mov r3, r6 | r3 = r6;
0x00012d38 mov r2, r5 | r2 = r5;
0x00012d3c mov r1, r8 | r1 = r8;
0x00012d40 add r0, r0, 0x6b | r0 += 0x6b;
0x00012d44 bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012d48 sub sp, sp, r0 |
0x00012d4c mov r0, sp | r0 = sp;
0x00012d50 bl 0x1097c | sprintf (r0, r1, r2);
0x00012d54 mov r0, sp | r0 = sp;
0x00012d58 add r1, r4, 0x18 | r1 = r4 + 0x18;
0x00012d5c bl 0x10f8c | fcn_00010f8c (r0, r1);
0x00012d60 mov sp, sb |
0x00012d64 cmp r0, 0 |
| if (r0 != 0) {
0x00012d68 bne 0x12c74 | goto label_0;
| }
0x00012d6c add r3, r4, 0x28 | r3 = r4 + 0x28;
0x00012d70 mov r2, r6 | r2 = r6;
0x00012d74 mov r1, r5 | r1 = r5;
0x00012d78 ldr r0, [r7, 0x54] | r0 = *((r7 + 0x54));
0x00012d7c bl 0x111f8 | r0 = fcn_000111f8 (r0, r1);
0x00012d80 cmp r0, 0 |
| if (r0 != 0) {
0x00012d84 bne 0x12c74 | goto label_0;
| }
0x00012d88 add r3, r4, 0x2c | r3 = r4 + 0x2c;
0x00012d8c mov r2, r6 | r2 = r6;
0x00012d90 mov r1, r5 | r1 = r5;
0x00012d94 ldr r0, [r7, 0x58] | r0 = *((r7 + 0x58));
0x00012d98 bl 0x111f8 | r0 = fcn_000111f8 (r0, r1);
0x00012d9c cmp r0, 0 |
| if (r0 != 0) {
0x00012da0 bne 0x12c74 | goto label_0;
| }
0x00012da4 add r3, r4, 0x30 | r3 = r4 + 0x30;
0x00012da8 mov r2, r6 | r2 = r6;
0x00012dac mov r1, r5 | r1 = r5;
0x00012db0 ldr r0, [r7, 0x5c] | r0 = *((r7 + 0x5c));
0x00012db4 bl 0x111f8 | r0 = fcn_000111f8 (r0, r1);
0x00012db8 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 != r0) {
0x00012dbc bne 0x12c74 | goto label_0;
| }
0x00012dc0 ldr r1, [r4, 0x28] | r1 = *((r4 + 0x28));
0x00012dc4 ldr r0, [r4, 0x2c] | r0 = *((r4 + 0x2c));
0x00012dc8 ldr r7, [r7, 0x60] | r7 = *((r7 + 0x60));
0x00012dcc smull r2, r3, r0, r1 | r2:r3 = r0 * r1;
0x00012dd0 mov r0, r7 | r0 = r7;
0x00012dd4 strd r2, r3, [r4, 0x20] | __asm ("strd r2, r3, [r4, 0x20]");
0x00012dd8 bl 0x109a0 | strlen (r0);
0x00012ddc mov r3, r6 | r3 = r6;
0x00012de0 mov r2, r5 | r2 = r5;
0x00012de4 mov r1, r7 | r1 = r7;
0x00012de8 add r0, r0, 0x6b | r0 += 0x6b;
0x00012dec bic r0, r0, 7 | r0 = BIT_MASK (r0, 7);
0x00012df0 sub sp, sp, r0 |
0x00012df4 mov r0, sp | r0 = sp;
0x00012df8 bl 0x1097c | sprintf (r0, r1, r2);
0x00012dfc mov r0, sp | r0 = sp;
0x00012e00 mov r2, 0x81 | r2 = 0x81;
0x00012e04 add r1, r4, 0x34 | r1 = r4 + 0x34;
0x00012e08 bl 0x11248 | fcn_00011248 (r0, r1);
0x00012e0c mov sp, sb |
0x00012e10 cmp r0, 0 |
| if (r0 < 0) {
0x00012e14 blt 0x12c74 | goto label_0;
| }
0x00012e18 add r4, r4, r0 | r4 += r0;
0x00012e1c strb r8, [r4, 0x33] | *((r4 + 0x33)) = r8;
0x00012e20 b 0x12c78 | goto label_1;
| label_2:
0x00012e24 ldr r0, [pc, 0x28] |
0x00012e28 sub r3, fp, 0x58 | r3 -= s1;
0x00012e2c ldr r2, [pc, 0x24] | r2 = stderr;
0x00012e30 ldr r1, [pc, 0x24] | r1 = "libubi";
0x00012e34 ldr r0, [r0] | r0 = "dynamic";
0x00012e38 bl 0x108ec | r0 = fprintf ("dynamic", "libubi", r2, r3)
0x00012e3c bl 0x10988 | errno_location ();
0x00012e40 mov r3, 0x16 | r3 = 0x16;
0x00012e44 str r3, [r0] | *(r0) = r3;
0x00012e48 b 0x12c74 | 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/ubirmvol @ 0x13104 */
| #include <stdint.h>
|
; (fcn) fcn.00013104 () | void fcn_00013104 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_ch;
| int32_t var_10h;
| int32_t var_5ch;
| r0 = arg1;
| r1 = arg2;
0x00013104 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00013108 mov r6, r0 | r6 = r0;
0x0001310c sub sp, sp, 0x5c |
0x00013110 mov r0, r2 | r0 = r2;
0x00013114 mov r7, r1 | r7 = r1;
0x00013118 mov r8, r2 | r8 = r2;
0x0001311c mov sb, r3 | sb = r3;
0x00013120 bl 0x109a0 | r0 = strlen (r0);
0x00013124 subs fp, r0, 0 |
| if (fp == r0) {
0x00013128 bne 0x13154 |
0x0001312c ldr r3, [pc, 0xc0] | r3 = *(0x131f0);
0x00013130 ldr r2, [pc, 0xc0] | r2 = stderr;
0x00013134 ldr r0, [r3] | r0 = *(0x131f0);
0x00013138 ldr r1, [pc, 0xbc] | r1 = "libubi";
0x0001313c bl 0x108ec | r0 = fprintf (r0, "libubi", r2, r3)
0x00013140 bl 0x10988 | errno_location ();
0x00013144 mov r3, 0x16 | r3 = 0x16;
| label_1:
0x00013148 str r3, [r0] | *(r0) = r3;
0x0001314c mvn r4, 0 | r4 = ~0;
0x00013150 b 0x13174 |
| } else {
0x00013154 mov r2, sp | r2 = sp;
0x00013158 mov r1, r7 | r1 = r7;
0x0001315c mov r0, r6 | r0 = r6;
0x00013160 bl 0x126cc | r0 = fcn_000126cc (r0, r1);
0x00013164 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00013168 ldreq r5, [sp, 0xc] | r5 = var_ch;
| }
| if (r4 != r0) {
0x0001316c addeq sl, sb, 0x34 | sl = sb + 0x34;
| }
| if (r4 == r0) {
0x00013170 beq 0x131b4 | goto label_4;
| }
| }
| do {
| label_3:
0x00013174 mov r0, r4 | r0 = r4;
0x00013178 add sp, sp, 0x5c |
0x0001317c pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_0:
0x00013180 mov r3, sb | r3 = sb;
0x00013184 mov r2, r5 | r2 = r5;
0x00013188 mov r1, r7 | r1 = r7;
0x0001318c mov r0, r6 | r0 = r6;
0x00013190 bl 0x12bf4 | r0 = fcn_00012bf4 (r0, r1);
0x00013194 cmn r0, 1 |
0x00013198 mov r4, r0 | r4 = r0;
| if (r0 != 1) {
0x0001319c bne 0x131cc | goto label_5;
| }
0x000131a0 bl 0x10988 | r0 = errno_location ();
0x000131a4 ldr r3, [r0] | r3 = *(r0);
0x000131a8 cmp r3, 2 |
0x000131ac bne 0x13174 |
| } while (r3 != 2);
| label_2:
0x000131b0 add r5, r5, 1 | r5++;
| label_4:
0x000131b4 ldr r3, [sp, 0x10] | r3 = var_10h;
0x000131b8 cmp r3, r5 |
| if (r3 >= r5) {
0x000131bc bge 0x13180 | goto label_0;
| }
0x000131c0 bl 0x10988 | errno_location ();
0x000131c4 mov r3, 2 | r3 = 2;
0x000131c8 b 0x13148 | goto label_1;
| label_5:
0x000131cc mov r0, sl | r0 = sl;
0x000131d0 bl 0x109a0 | r0 = strlen (r0);
0x000131d4 cmp r0, fp |
| if (r0 != fp) {
0x000131d8 bne 0x131b0 | goto label_2;
| }
0x000131dc mov r1, sl | r1 = sl;
0x000131e0 mov r0, r8 | r0 = r8;
0x000131e4 bl 0x10970 | r0 = strcmp (r0, r1);
0x000131e8 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x000131ec bne 0x131b0 | goto label_2;
| }
0x000131f0 b 0x13174 | goto label_3;
| }
; 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/ubirmvol @ 0x109e8 */
| #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;
| char * * endptr;
| int32_t var_64h;
| int32_t var_118h;
| r0 = argc;
| r1 = argv;
| /* [10] -r-x section size 10376 named .text */
0x000109e8 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x000109ec ldr sl, [pc, 0x400] | sl = "vol_id";
0x000109f0 ldr r7, [pc, 0x400] | r7 = "vol_id";
0x000109f4 sub sp, sp, 0x118 |
0x000109f8 mov r4, r0 | r4 = r0;
0x000109fc mov r8, r1 | r8 = r1;
| label_0:
0x00010a00 mov r6, 0 | r6 = 0;
0x00010a04 str r6, [sp] | *(sp) = r6;
0x00010a08 mov r3, sl | r3 = sl;
0x00010a0c ldr r2, [pc, 0x3e8] | r2 = optarg;
0x00010a10 mov r1, r8 | r1 = r8;
0x00010a14 mov r0, r4 | r0 = r4;
0x00010a18 bl 0x10880 | r0 = getopt_long ();
0x00010a1c cmn r0, 1 |
0x00010a20 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x00010a24 beq 0x10b88 | goto label_8;
| }
0x00010a28 cmp r0, 0x4e |
| if (r0 == 0x4e) {
0x00010a2c beq 0x10b14 | goto label_9;
| }
| if (r0 > 0x4e) {
0x00010a30 bgt 0x10a58 | goto label_10;
| }
0x00010a34 cmp r0, 0x3a |
| if (r0 == 0x3a) {
0x00010a38 beq 0x10b70 | goto label_11;
| }
0x00010a3c cmp r0, 0x3f |
| if (r0 == 0x3f) {
0x00010a40 beq 0x10b4c | goto label_12;
| }
| do {
0x00010a44 ldr r3, [pc, 0x3b4] | r3 = "n:N:h_V";
0x00010a48 ldr r0, [pc, 0x3b4] | r0 = stderr;
0x00010a4c ldr r1, [r3] | r1 = "n:N:h_V";
0x00010a50 bl 0x109ac | fputs (r0, "n:N:h_V");
0x00010a54 b 0x10af4 | goto label_2;
| label_10:
0x00010a58 cmp r0, 0x68 |
| if (r0 == 0x68) {
0x00010a5c beq 0x10b24 | goto label_13;
| }
0x00010a60 cmp r0, 0x6e |
| if (r0 == 0x6e) {
0x00010a64 beq 0x10a84 | goto label_14;
| }
0x00010a68 cmp r0, 0x56 |
0x00010a6c bne 0x10a44 |
| } while (r0 != 0x56);
0x00010a70 ldr r2, [pc, 0x390] | r2 = "Use -h for help\n";
0x00010a74 ldr r1, [pc, 0x390] | r1 = "_.1.0";
0x00010a78 ldr r0, [pc, 0x390] | r0 = "ubirmvol";
0x00010a7c bl 0x1085c | printf ("ubirmvol", "_.1.0", "Use -h for help\n");
0x00010a80 b 0x10b44 | goto label_15;
| label_14:
0x00010a84 ldr sb, [r7] | sb = *(r7);
0x00010a88 mov r2, r6 | r2 = r6;
0x00010a8c add r1, sp, 0x60 | r1 += endptr;
0x00010a90 mov r0, sb | r0 = sb;
0x00010a94 bl 0x108bc | strtoul (r0, r1, r2);
0x00010a98 ldrb r3, [sb] | r3 = *(sb);
0x00010a9c ldr r6, [pc, 0x370] | r6 = "_s__mtd_utils___s";
0x00010aa0 cmp r3, 0 |
0x00010aa4 mov r5, r0 | r5 = r0;
| if (r3 != 0) {
0x00010aa8 beq 0x10abc |
0x00010aac ldr r3, [sp, 0x60] | r3 = endptr;
0x00010ab0 ldrb r3, [r3] | r3 = *(r3);
0x00010ab4 cmp r3, 0 |
| if (r3 == 0) {
0x00010ab8 beq 0x10b04 | goto label_16;
| }
| }
0x00010abc ldr r0, [pc, 0x33c] |
0x00010ac0 str sb, [sp] | *(sp) = sb;
0x00010ac4 ldr r3, [pc, 0x34c] | r3 = *(0x10e14);
0x00010ac8 ldr r2, [pc, 0x33c] | r2 = "_.1.0";
0x00010acc ldr r1, [pc, 0x348] | r1 = "strtoul";
0x00010ad0 ldr r0, [r0] | r0 = "n:N:h_V";
0x00010ad4 bl 0x108ec | fprintf ("n:N:h_V", "strtoul", "_.1.0", r3)
0x00010ad8 str r5, [r6] | *(r6) = r5;
| label_1:
0x00010adc ldr r0, [pc, 0x31c] |
0x00010ae0 ldr r3, [r7] | r3 = *(r7);
0x00010ae4 ldr r2, [pc, 0x320] | r2 = "_.1.0";
0x00010ae8 ldr r1, [pc, 0x330] | r1 = "%s: error!: %s: unable to parse the number '%s'\n";
0x00010aec ldr r0, [r0] | r0 = "n:N:h_V";
0x00010af0 bl 0x108ec | fprintf ("n:N:h_V", "%s: error!: %s: unable to parse the number '%s'\n", "_.1.0", r3, r4, r5)
| label_2:
0x00010af4 mvn r5, 0 | r5 = ~0;
| label_3:
0x00010af8 mov r0, r5 | r0 = r5;
0x00010afc add sp, sp, 0x118 |
0x00010b00 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_16:
0x00010b04 cmp r0, 0 |
0x00010b08 str r0, [r6] | *(r6) = r0;
| if (r0 >= 0) {
0x00010b0c bge 0x10a00 | goto label_0;
| }
0x00010b10 b 0x10adc | goto label_1;
| label_9:
0x00010b14 ldr r2, [r7] | r2 = *(r7);
0x00010b18 ldr r3, [pc, 0x2f4] | r3 = "_s__mtd_utils___s";
0x00010b1c str r2, [r3, 8] | *((r3 + 8)) = r2;
0x00010b20 b 0x10a00 | goto label_0;
| label_13:
0x00010b24 ldr r1, [pc, 0x2f8] | r1 = "_s:_error_:_bad_volume_ID:___s_";
0x00010b28 ldr r0, [pc, 0x2f8] | r0 = "ubirmvol_version_2.1.0___a_tool_to_remove_UBI_volumes.";
0x00010b2c bl 0x1085c | printf ("ubirmvol_version_2.1.0___a_tool_to_remove_UBI_volumes.", "_s:_error_:_bad_volume_ID:___s_");
0x00010b30 ldr r1, [pc, 0x2f4] | r1 = "%s\n\n";
0x00010b34 ldr r0, [pc, 0x2ec] | r0 = "ubirmvol_version_2.1.0___a_tool_to_remove_UBI_volumes.";
0x00010b38 bl 0x1085c | printf ("ubirmvol_version_2.1.0___a_tool_to_remove_UBI_volumes.", "%s\n\n");
0x00010b3c ldr r0, [pc, 0x2ec] | r0 = "Usage: ubirmvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-h] [--help]\n\nExample: ubirmvol /dev/ubi0 -n 1 - remove UBI volume 1 from UBI device corresponding\n to /dev/ubi0\n ubirmvol /dev/ubi0 -N my_vol - remove UBI named \"my_vol\" from UBI device\n corresponding to /dev/ubi0";
0x00010b40 bl 0x108a4 | puts ("Usage: ubirmvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-h] [--help]\n\nExample: ubirmvol /dev/ubi0 -n 1 - remove UBI volume 1 from UBI device corresponding\n to /dev/ubi0\n ubirmvol /dev/ubi0 -N my_vol - remove UBI named \"my_vol\" from UBI device\n corresponding to /dev/ubi0");
| label_15:
0x00010b44 mov r0, r6 | r0 = r6;
0x00010b48 bl 0x10994 | exit (r0);
| label_12:
0x00010b4c ldr r1, [pc, 0x2d0] | r1 = "_s:_error_:_bad_volume_ID:___s_";
0x00010b50 ldr r0, [pc, 0x2d0] | r0 = "ubirmvol_version_2.1.0___a_tool_to_remove_UBI_volumes.";
0x00010b54 bl 0x1085c | printf ("ubirmvol_version_2.1.0___a_tool_to_remove_UBI_volumes.", "_s:_error_:_bad_volume_ID:___s_");
0x00010b58 ldr r1, [pc, 0x2cc] | r1 = "%s\n\n";
0x00010b5c ldr r0, [pc, 0x2c4] | r0 = "ubirmvol_version_2.1.0___a_tool_to_remove_UBI_volumes.";
0x00010b60 bl 0x1085c | printf ("ubirmvol_version_2.1.0___a_tool_to_remove_UBI_volumes.", "%s\n\n");
0x00010b64 ldr r0, [pc, 0x2c4] | r0 = "Usage: ubirmvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-h] [--help]\n\nExample: ubirmvol /dev/ubi0 -n 1 - remove UBI volume 1 from UBI device corresponding\n to /dev/ubi0\n ubirmvol /dev/ubi0 -N my_vol - remove UBI named \"my_vol\" from UBI device\n corresponding to /dev/ubi0";
0x00010b68 bl 0x108a4 | puts ("Usage: ubirmvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-h] [--help]\n\nExample: ubirmvol /dev/ubi0 -n 1 - remove UBI volume 1 from UBI device corresponding\n to /dev/ubi0\n ubirmvol /dev/ubi0 -N my_vol - remove UBI named \"my_vol\" from UBI device\n corresponding to /dev/ubi0");
0x00010b6c b 0x10af4 | goto label_2;
| label_11:
0x00010b70 ldr r3, [pc, 0x288] | r3 = "n:N:h_V";
0x00010b74 ldr r2, [pc, 0x290] | r2 = "_.1.0";
0x00010b78 ldr r1, [pc, 0x2b4] | r1 = "-n, --vol_id=<volume id> volume ID to remove\n-N, --name=<volume name> volume name to remove\n-h, -?, --help print help message\n-V, --version print program version";
0x00010b7c ldr r0, [r3] | r0 = "n:N:h_V";
0x00010b80 bl 0x108ec | fprintf ("n:N:h_V", "-n, --vol_id=<volume id> volume ID to remove\n-N, --name=<volume name> volume name to remove\n-h, -?, --help print help message\n-V, --version print program version", "_.1.0", "n:N:h_V")
0x00010b84 b 0x10af4 | goto label_2;
| label_8:
0x00010b88 ldr r3, [pc, 0x2a8] |
0x00010b8c ldr r3, [r3] | r3 = "%s: error!: parameter is missing\n";
0x00010b90 cmp r4, r3 |
| if (r4 != r3) {
0x00010b94 bne 0x10bb0 | goto label_17;
| }
0x00010b98 ldr r2, [pc, 0x26c] | r2 = "_.1.0";
0x00010b9c ldr r1, [pc, 0x298] | r1 = optind;
| do {
| label_4:
0x00010ba0 ldr r3, [pc, 0x258] | r3 = "n:N:h_V";
0x00010ba4 ldr r0, [r3] | r0 = "n:N:h_V";
| label_5:
0x00010ba8 bl 0x108ec | fprintf ("n:N:h_V", r1, "_.1.0", "n:N:h_V")
0x00010bac b 0x10af8 | goto label_3;
| label_17:
0x00010bb0 sub r4, r4, 1 | r4--;
0x00010bb4 cmp r3, r4 |
| if (r3 == r4) {
0x00010bb8 ldrne r2, [pc, 0x24c] | r2 = "ubirmvol";
| }
| if (r3 == r4) {
0x00010bbc ldrne r1, [pc, 0x27c] | r1 = "%s: error!: more then one UBI device specified (use -h for help)\n";
| }
0x00010bc0 bne 0x10ba0 |
| } while (r3 != r4);
0x00010bc4 ldr r4, [pc, 0x248] | r4 = "_s__mtd_utils___s";
0x00010bc8 ldr r3, [r8, r3, lsl 2] | offset_0 = r3 << 2;
| r3 = *((r8 + offset_0));
0x00010bcc ldr r2, [r4] | r2 = "_s__mtd_utils___s";
0x00010bd0 str r3, [r4, 4] | *((r4 + 4)) = r3;
0x00010bd4 cmn r2, 1 |
0x00010bd8 ldr r3, [r4, 8] | r3 = "strtoul";
| if (r2 == 1) {
0x00010bdc bne 0x10bf4 |
0x00010be0 cmp r3, 0 |
| if (r3 != 0) {
0x00010be4 bne 0x10c04 | goto label_18;
| }
0x00010be8 ldr r2, [pc, 0x21c] | r2 = "_.1.0";
0x00010bec ldr r1, [pc, 0x250] | r1 = "%s: error!: more then one UBI device specified (use -h for help)\n";
0x00010bf0 b 0x10ba0 | goto label_4;
| }
0x00010bf4 cmp r3, 0 |
| if (r3 == 0) {
0x00010bf8 ldrne r2, [pc, 0x20c] | r2 = "ubirmvol";
| }
| if (r3 != 0) {
0x00010bfc ldrne r1, [pc, 0x244] | r1 = "%s: error!: please, specify either volume ID or volume name, not both\n";
| goto label_19;
| }
| if (r3 != 0) {
| label_19:
0x00010c00 bne 0x10ba0 | goto label_4;
| }
| label_18:
0x00010c04 bl 0x11884 | r0 = fcn_00011884 ();
0x00010c08 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 != r0) {
0x00010c0c bne 0x10c64 | goto label_20;
| }
0x00010c10 bl 0x10988 | errno_location ();
0x00010c14 ldr r6, [pc, 0x1e4] | r6 = "n:N:h_V";
0x00010c18 ldr r2, [pc, 0x1ec] | r2 = "_.1.0";
0x00010c1c ldr r4, [r0] | r4 = *(r0);
0x00010c20 ldr r0, [r6] | r0 = "n:N:h_V";
0x00010c24 cmp r4, 0 |
| if (r4 == 0) {
0x00010c28 ldreq r1, [pc, 0x21c] | r1 = "%s: error!: UBI is not present in the system\n";
| goto label_21;
| }
| if (r4 == 0) {
| label_21:
0x00010c2c beq 0x10ba8 | goto label_5;
| }
0x00010c30 ldr r1, [pc, 0x218] | r1 = "%s: error!: UBI is not present in the system\n";
0x00010c34 bl 0x108ec | fprintf (r0, "%s: error!: UBI is not present in the system\n")
0x00010c38 mov r0, r4 | r0 = r4;
0x00010c3c ldr r6, [r6] | r6 = *(r6);
0x00010c40 bl 0x10868 | strerror (r0);
0x00010c44 str r4, [sp] | *(sp) = r4;
0x00010c48 ldr r3, [pc, 0x204] | r3 = "%s: error!: cannot open libubi\n";
0x00010c4c mov r2, 0xa | r2 = 0xa;
0x00010c50 ldr r1, [pc, 0x200] | r1 = *(0x10e54);
0x00010c54 str r0, [sp, 4] | var_4h = r0;
0x00010c58 mov r0, r6 | r0 = r6;
0x00010c5c bl 0x108ec | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n", r4)
0x00010c60 b 0x10af8 | goto label_3;
| label_20:
0x00010c64 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00010c68 bl 0x12070 | r0 = fcn_00012070 (r0, r1);
0x00010c6c cmp r0, 2 |
| if (r0 != 2) {
0x00010c70 bne 0x10c98 | goto label_22;
| }
0x00010c74 ldr r0, [pc, 0x184] |
0x00010c78 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010c7c ldr r2, [pc, 0x188] | r2 = "_.1.0";
0x00010c80 ldr r1, [pc, 0x1d4] | r1 = "%*serror %d (%s)\n";
0x00010c84 ldr r0, [r0] | r0 = "n:N:h_V";
| do {
0x00010c88 bl 0x108ec | fprintf ("n:N:h_V", "%*serror %d (%s)\n", "_.1.0", r3)
| label_6:
0x00010c8c mov r0, r6 | r0 = r6;
0x00010c90 bl 0x117b0 | fcn_000117b0 (r0);
0x00010c94 b 0x10af8 | goto label_3;
| label_22:
0x00010c98 cmp r0, 0 |
0x00010c9c ldr r7, [r4, 4] | r7 = *((r4 + 4));
| if (r0 >= 0) {
0x00010ca0 bge 0x10cf8 | goto label_23;
| }
0x00010ca4 bl 0x10988 | errno_location ();
0x00010ca8 ldr r8, [pc, 0x150] | r8 = "n:N:h_V";
0x00010cac mov r3, r7 | r3 = r7;
0x00010cb0 ldr r2, [pc, 0x154] | r2 = "_.1.0";
0x00010cb4 ldr r4, [r0] | r4 = *(r0);
0x00010cb8 ldr r0, [r8] | r0 = "n:N:h_V";
0x00010cbc cmp r4, 0x13 |
| if (r4 != 0x13) {
0x00010cc0 ldreq r1, [pc, 0x198] | r1 = "%s: error!: \"%s\" is not an UBI device node\n";
| }
0x00010cc4 beq 0x10c88 |
| } while (r4 == 0x13);
0x00010cc8 ldr r1, [pc, 0x194] | r1 = "%s: error!: \"%s\" is not an UBI device node\n";
0x00010ccc bl 0x108ec | fprintf (r0, "%s: error!: \"%s\" is not an UBI device node\n")
0x00010cd0 ldr r7, [r8] | r7 = *(r8);
| label_7:
0x00010cd4 mov r0, r4 | r0 = r4;
0x00010cd8 bl 0x10868 | strerror (r0);
0x00010cdc str r4, [sp] | *(sp) = r4;
0x00010ce0 ldr r3, [pc, 0x16c] | r3 = "%s: error!: cannot open libubi\n";
0x00010ce4 mov r2, 0xa | r2 = 0xa;
0x00010ce8 ldr r1, [pc, 0x168] | r1 = *(0x10e54);
0x00010cec str r0, [sp, 4] | var_4h = r0;
0x00010cf0 mov r0, r7 | r0 = r7;
0x00010cf4 b 0x10d60 | goto label_24;
| label_23:
0x00010cf8 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00010cfc cmp r3, 0 |
| if (r3 == 0) {
0x00010d00 beq 0x10da8 | goto label_25;
| }
0x00010d04 add r2, sp, 8 | r2 += var_8h;
0x00010d08 mov r1, r7 | r1 = r7;
0x00010d0c mov r0, r6 | r0 = r6;
0x00010d10 bl 0x12a04 | r0 = fcn_00012a04 (r0, r1);
0x00010d14 cmp r0, 0 |
| if (r0 == 0) {
0x00010d18 beq 0x10d68 | goto label_26;
| }
0x00010d1c bl 0x10988 | errno_location ();
0x00010d20 ldr r8, [pc, 0xd8] | r8 = "n:N:h_V";
0x00010d24 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010d28 ldr r2, [pc, 0xdc] | r2 = "_.1.0";
0x00010d2c ldr r1, [pc, 0x134] | r1 = "%s: error!: error while probing \"%s\"\n";
0x00010d30 ldr r7, [r0] | r7 = *(r0);
| do {
0x00010d34 ldr r0, [r8] | r0 = *(r8);
0x00010d38 bl 0x108ec | fprintf (r0, "%s: error!: error while probing \"%s\"\n", "_.1.0", r3)
0x00010d3c mov r0, r7 | r0 = r7;
0x00010d40 ldr r4, [r8] | r4 = *(r8);
0x00010d44 bl 0x10868 | strerror (r0);
0x00010d48 ldr r3, [pc, 0x104] | r3 = "%s: error!: cannot open libubi\n";
0x00010d4c ldr r1, [pc, 0x104] | r1 = *(0x10e54);
0x00010d50 mov r2, 0xa | r2 = 0xa;
0x00010d54 str r7, [sp] | *(sp) = r7;
0x00010d58 str r0, [sp, 4] | var_4h = r0;
0x00010d5c mov r0, r4 | r0 = r4;
| label_24:
0x00010d60 bl 0x108ec | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n")
0x00010d64 b 0x10c8c | goto label_6;
| label_26:
0x00010d68 add r3, sp, 0x60 | r3 += endptr;
0x00010d6c ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00010d70 ldr r1, [sp, 8] | r1 = var_8h;
0x00010d74 mov r0, r6 | r0 = r6;
0x00010d78 bl 0x13104 | r0 = fcn_00013104 (r0, r1);
0x00010d7c cmp r0, 0 |
| if (r0 != 0) {
0x00010d80 ldreq r3, [sp, 0x64] | r3 = var_64h;
| }
| if (r0 != 0) {
0x00010d84 streq r3, [r4] | *(r4) = r3;
| }
| if (r0 == 0) {
0x00010d88 beq 0x10da8 | goto label_25;
| }
0x00010d8c bl 0x10988 | errno_location ();
0x00010d90 ldr r8, [pc, 0x68] | r8 = "n:N:h_V";
0x00010d94 ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00010d98 ldr r2, [pc, 0x6c] | r2 = "_.1.0";
0x00010d9c ldr r1, [pc, 0xc8] | r1 = "%s: error!: cannot get information about UBI device \"%s\"\n";
0x00010da0 ldr r7, [r0] | r7 = *(r0);
0x00010da4 b 0x10d34 |
| } while (1);
| label_25:
0x00010da8 ldr r2, [r4] | r2 = *(r4);
0x00010dac ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00010db0 mov r0, r6 | r0 = r6;
0x00010db4 bl 0x123f4 | r0 = fcn_000123f4 (r0);
0x00010db8 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x00010dbc beq 0x10de4 |
0x00010dc0 bl 0x10988 | errno_location ();
0x00010dc4 ldr r7, [pc, 0x34] |
0x00010dc8 ldr r2, [pc, 0x3c] | r2 = "_.1.0";
0x00010dcc ldr r1, [pc, 0x9c] | r1 = "%s: error!: cannot find UBI volume \"%s\"\n";
0x00010dd0 ldr r4, [r0] | r4 = *(r0);
0x00010dd4 ldr r0, [r7] | r0 = "n:N:h_V";
0x00010dd8 bl 0x108ec | fprintf ("n:N:h_V", "%s: error!: cannot find UBI volume \"%s\"\n", "_.1.0", r3, r4)
0x00010ddc ldr r7, [r7] | r7 = "n:N:h_V";
0x00010de0 b 0x10cd4 | goto label_7;
| }
0x00010de4 mov r0, r6 | r0 = r6;
0x00010de8 bl 0x117b0 | fcn_000117b0 (r0);
0x00010dec mov r5, r4 | r5 = r4;
0x00010df0 b 0x10af8 | goto label_3;
| }
[*] Function fprintf used 60 times ubirmvol