[*] Binary protection state of ubirsvol
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf tear down of ubirsvol
; 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/ubirsvol @ 0x10b90 */
| #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_8ch;
| int32_t var_118h;
| r0 = argc;
| r1 = argv;
| /* [10] -r-x section size 12292 named .text */
0x00010b90 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00010b94 ldr sl, [pc, 0x560] | sl = "vol_id";
0x00010b98 ldr r4, [pc, 0x560] | r4 = "vol_id";
0x00010b9c sub sp, sp, 0x118 |
0x00010ba0 mov r6, r0 | r6 = r0;
0x00010ba4 mov r8, r1 | r8 = r1;
| label_0:
0x00010ba8 mov r7, 0 | r7 = 0;
0x00010bac str r7, [sp] | *(sp) = r7;
0x00010bb0 mov r3, sl | r3 = sl;
0x00010bb4 ldr r2, [pc, 0x548] | r2 = optarg;
0x00010bb8 mov r1, r8 | r1 = r8;
0x00010bbc mov r0, r6 | r0 = r6;
0x00010bc0 bl 0x109ec | r0 = getopt_long ();
0x00010bc4 cmn r0, 1 |
0x00010bc8 mov r5, r0 | r5 = r0;
| if (r0 == 1) {
0x00010bcc beq 0x10de8 | goto label_10;
| }
0x00010bd0 cmp r0, 0x53 |
| if (r0 == 0x53) {
0x00010bd4 beq 0x10c88 | goto label_11;
| }
| if (r0 <= 0x53) {
0x00010bd8 bgt 0x10c0c |
0x00010bdc cmp r0, 0x3f |
| if (r0 == 0x3f) {
0x00010be0 beq 0x10db0 | goto label_12;
| }
0x00010be4 cmp r0, 0x4e |
| if (r0 == 0x4e) {
0x00010be8 beq 0x10d78 | goto label_13;
| }
0x00010bec cmp r0, 0x3a |
| if (r0 != 0x3a) {
0x00010bf0 bne 0x10c20 | goto label_14;
| }
0x00010bf4 ldr r2, [pc, 0x50c] | r2 = "s:S:n:N:h_V";
0x00010bf8 ldr r1, [pc, 0x50c] | r1 = "ubirsvol";
| label_6:
0x00010bfc ldr r3, [pc, 0x50c] | r3 = "_s:_error_:_parameter_is_missing";
0x00010c00 ldr r0, [r3] | r0 = "_s:_error_:_parameter_is_missing";
0x00010c04 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "ubirsvol", "s:S:n:N:h_V", "_s:_error_:_parameter_is_missing")
0x00010c08 b 0x10c78 | goto label_3;
| }
0x00010c0c cmp r0, 0x68 |
| if (r0 == 0x68) {
0x00010c10 beq 0x10d88 | goto label_15;
| }
| if (r0 > 0x68) {
0x00010c14 bgt 0x10c34 | goto label_16;
| }
0x00010c18 cmp r0, 0x56 |
| if (r0 == 0x56) {
0x00010c1c beq 0x10dd4 | goto label_17;
| }
| do {
| label_14:
0x00010c20 ldr r3, [pc, 0x4e8] | r3 = "_s:_error_:_parameter_is_missing";
0x00010c24 ldr r0, [pc, 0x4e8] | r0 = stderr;
0x00010c28 ldr r1, [r3] | r1 = "_s:_error_:_parameter_is_missing";
0x00010c2c bl 0x10b48 | fputs (r0, "_s:_error_:_parameter_is_missing");
0x00010c30 b 0x10c78 | goto label_3;
| label_16:
0x00010c34 cmp r0, 0x6e |
| if (r0 == 0x6e) {
0x00010c38 beq 0x10d00 | goto label_18;
| }
0x00010c3c cmp r0, 0x73 |
0x00010c40 bne 0x10c20 |
| } while (r0 != 0x73);
0x00010c44 ldr r0, [r4] | r0 = *(r4);
0x00010c48 bl 0x112a8 | fcn_000112a8 (r0);
0x00010c4c ldr r3, [pc, 0x4c4] | r3 = "Use__h_for_help";
0x00010c50 cmp r0, 1 |
0x00010c54 strd r0, r1, [r3, 0x10] | __asm ("strd r0, r1, [r3, 0x10]");
0x00010c58 sbcs r3, r1, 0 | __asm ("sbcs r3, r1, 0");
| if (r0 >= 1) {
0x00010c5c bge 0x10ba8 | goto label_0;
| }
0x00010c60 ldr r3, [r4] | r3 = *(r4);
0x00010c64 ldr r2, [pc, 0x49c] | r2 = "s:S:n:N:h_V";
0x00010c68 ldr r1, [pc, 0x4ac] | r1 = *(0x11118);
| do {
| label_2:
0x00010c6c ldr r0, [pc, 0x49c] |
0x00010c70 ldr r0, [r0] | r0 = "_s:_error_:_parameter_is_missing";
0x00010c74 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", r1, "s:S:n:N:h_V", r3)
| label_3:
0x00010c78 mvn r5, 0 | r5 = ~0;
| label_4:
0x00010c7c mov r0, r5 | r0 = r5;
0x00010c80 add sp, sp, 0x118 |
0x00010c84 pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_11:
0x00010c88 ldr sb, [r4] | sb = *(r4);
0x00010c8c mov r2, r7 | r2 = r7;
0x00010c90 add r1, sp, 0x60 | r1 += endptr;
0x00010c94 mov r0, sb | r0 = sb;
0x00010c98 bl 0x10ac4 | strtoull (r0, r1, r2);
0x00010c9c ldrb r3, [sb] | r3 = *(sb);
0x00010ca0 ldr r7, [pc, 0x470] | r7 = "Use__h_for_help";
0x00010ca4 cmp r3, 0 |
0x00010ca8 mov r5, r0 | r5 = r0;
| if (r3 != 0) {
0x00010cac beq 0x10cc0 |
0x00010cb0 ldr r3, [sp, 0x60] | r3 = endptr;
0x00010cb4 ldrb r3, [r3] | r3 = *(r3);
0x00010cb8 cmp r3, 0 |
| if (r3 == 0) {
0x00010cbc beq 0x10cf0 | goto label_19;
| }
| }
0x00010cc0 ldr r0, [pc, 0x448] |
0x00010cc4 str sb, [sp] | *(sp) = sb;
0x00010cc8 ldr r3, [pc, 0x450] | r3 = "%s: error!: bad volume size: \"%s\"\n";
0x00010ccc ldr r2, [pc, 0x434] | r2 = "s:S:n:N:h_V";
0x00010cd0 ldr r1, [pc, 0x44c] | r1 = "strtoull";
0x00010cd4 ldr r0, [r0] | r0 = "_s:_error_:_parameter_is_missing";
0x00010cd8 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "strtoull", "s:S:n:N:h_V", "%s: error!: bad volume size: \"%s\"\n")
0x00010cdc str r5, [r7, 0x18] | *((r7 + 0x18)) = r5;
| label_1:
0x00010ce0 ldr r3, [r4] | r3 = *(r4);
0x00010ce4 ldr r2, [pc, 0x41c] | r2 = "s:S:n:N:h_V";
0x00010ce8 ldr r1, [pc, 0x438] | r1 = "%s: error!: %s: unable to parse the number '%s'\n";
0x00010cec b 0x10c6c |
| } while (1);
| label_19:
0x00010cf0 cmp r0, 0 |
0x00010cf4 str r0, [r7, 0x18] | *((r7 + 0x18)) = r0;
| if (r0 > 0) {
0x00010cf8 bgt 0x10ba8 | goto label_0;
| }
0x00010cfc b 0x10ce0 | goto label_1;
| label_18:
0x00010d00 ldr sb, [r4] | sb = *(r4);
0x00010d04 mov r2, r7 | r2 = r7;
0x00010d08 add r1, sp, 0x60 | r1 += endptr;
0x00010d0c mov r0, sb | r0 = sb;
0x00010d10 bl 0x10a34 | strtoul (r0, r1, r2);
0x00010d14 ldrb r3, [sb] | r3 = *(sb);
0x00010d18 ldr r7, [pc, 0x3f8] | r7 = "Use__h_for_help";
0x00010d1c cmp r3, 0 |
0x00010d20 mov r5, r0 | r5 = r0;
| if (r3 == 0) {
0x00010d24 beq 0x10d54 | goto label_20;
| }
0x00010d28 ldr r3, [sp, 0x60] | r3 = endptr;
0x00010d2c ldrb r3, [r3] | r3 = *(r3);
0x00010d30 cmp r3, 0 |
| if (r3 != 0) {
0x00010d34 bne 0x10d54 | goto label_20;
| }
0x00010d38 cmp r0, 0 |
0x00010d3c str r0, [r7] | *(r7) = r0;
| if (r0 >= 0) {
0x00010d40 bge 0x10ba8 | goto label_0;
| }
| do {
0x00010d44 ldr r3, [r4] | r3 = *(r4);
0x00010d48 ldr r2, [pc, 0x3b8] | r2 = "s:S:n:N:h_V";
0x00010d4c ldr r1, [pc, 0x3d8] | r1 = "_s:_error_:_bad_LEB_count:___s_";
0x00010d50 b 0x10c6c | goto label_2;
| label_20:
0x00010d54 ldr r0, [pc, 0x3b4] |
0x00010d58 str sb, [sp] | *(sp) = sb;
0x00010d5c ldr r3, [pc, 0x3cc] | r3 = "%s: error!: bad volume ID: \"%s\"\n";
0x00010d60 ldr r2, [pc, 0x3a0] | r2 = "s:S:n:N:h_V";
0x00010d64 ldr r1, [pc, 0x3b8] | r1 = "strtoull";
0x00010d68 ldr r0, [r0] | r0 = "_s:_error_:_parameter_is_missing";
0x00010d6c bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "strtoull", "s:S:n:N:h_V", "%s: error!: bad volume ID: \"%s\"\n")
0x00010d70 str r5, [r7] | *(r7) = r5;
0x00010d74 b 0x10d44 |
| } while (1);
| label_13:
0x00010d78 ldr r2, [r4] | r2 = *(r4);
0x00010d7c ldr r3, [pc, 0x394] | r3 = "Use__h_for_help";
0x00010d80 str r2, [r3, 8] | *((r3 + 8)) = r2;
0x00010d84 b 0x10ba8 | goto label_0;
| label_15:
0x00010d88 ldr r1, [pc, 0x3a4] | r1 = "strtoul";
0x00010d8c ldr r0, [pc, 0x3a4] | r0 = "ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.";
0x00010d90 bl 0x109c8 | printf ("ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.", "strtoul")
0x00010d94 ldr r1, [pc, 0x3a0] | r1 = "_s";
0x00010d98 ldr r0, [pc, 0x398] | r0 = "ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.";
0x00010d9c bl 0x109c8 | printf ("ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.", "_s")
0x00010da0 ldr r0, [pc, 0x398] | r0 = "Usage: ubirsvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\nExample: ubirsvol /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n UBI device corresponding to /dev/ubi0\n ubirsvol /dev/ubi0 -N my_vol -s 1MiB - resize UBI volume named \"my_vol\" to 1 MiB\n\t on UBI device corresponding to /dev/ubi0";
0x00010da4 bl 0x10a1c | puts ("Usage: ubirsvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\nExample: ubirsvol /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n UBI device corresponding to /dev/ubi0\n ubirsvol /dev/ubi0 -N my_vol -s 1MiB - resize UBI volume named \"my_vol\" to 1 MiB\n\t on UBI device corresponding to /dev/ubi0");
| do {
0x00010da8 mov r0, r7 | r0 = r7;
0x00010dac bl 0x10b30 | exit (r0);
| label_12:
0x00010db0 ldr r1, [pc, 0x37c] | r1 = "strtoul";
0x00010db4 ldr r0, [pc, 0x37c] | r0 = "ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.";
0x00010db8 bl 0x109c8 | printf ("ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.", "strtoul")
0x00010dbc ldr r1, [pc, 0x378] | r1 = "_s";
0x00010dc0 ldr r0, [pc, 0x370] | r0 = "ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.";
0x00010dc4 bl 0x109c8 | printf ("ubirsvol_version_2.1.0___a_tool_to_resize_UBI_volumes.", "_s")
0x00010dc8 ldr r0, [pc, 0x370] | r0 = "Usage: ubirsvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\nExample: ubirsvol /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n UBI device corresponding to /dev/ubi0\n ubirsvol /dev/ubi0 -N my_vol -s 1MiB - resize UBI volume named \"my_vol\" to 1 MiB\n\t on UBI device corresponding to /dev/ubi0";
0x00010dcc bl 0x10a1c | puts ("Usage: ubirsvol <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\nExample: ubirsvol /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n UBI device corresponding to /dev/ubi0\n ubirsvol /dev/ubi0 -N my_vol -s 1MiB - resize UBI volume named \"my_vol\" to 1 MiB\n\t on UBI device corresponding to /dev/ubi0");
0x00010dd0 b 0x10c78 | goto label_3;
| label_17:
0x00010dd4 ldr r2, [pc, 0x368] | r2 = "-n, --vol_id=<volume id> volume ID to resize\n-N, --name=<volume name> volume name to resize\n-s, --size=<bytes> volume size volume size in bytes, kilobytes (KiB)\n or megabytes (MiB)\n-S, --lebs=<LEBs count> alternative way to give volume size in logical\n eraseblocks\n-h, -?, --help print help message\n-V, --version print program version";
0x00010dd8 ldr r1, [pc, 0x328] | r1 = "s:S:n:N:h_V";
0x00010ddc ldr r0, [pc, 0x364] | r0 = "2.1.0";
0x00010de0 bl 0x109c8 | printf ("2.1.0", "s:S:n:N:h_V", "-n, --vol_id=<volume id> volume ID to resize\n-N, --name=<volume name> volume name to resize\n-s, --size=<bytes> volume size volume size in bytes, kilobytes (KiB)\n or megabytes (MiB)\n-S, --lebs=<LEBs count> alternative way to give volume size in logical\n eraseblocks\n-h, -?, --help print help message\n-V, --version print program version")
0x00010de4 b 0x10da8 |
| } while (1);
| label_10:
0x00010de8 ldr r3, [pc, 0x35c] |
0x00010dec ldr r3, [r3] | r3 = "%s (mtd-utils) %s\n";
0x00010df0 cmp r6, r3 |
| if (r6 != r3) {
0x00010df4 bne 0x10e10 | goto label_21;
| }
0x00010df8 ldr r2, [pc, 0x308] | r2 = "s:S:n:N:h_V";
0x00010dfc ldr r1, [pc, 0x34c] | r1 = optind;
| do {
| label_5:
0x00010e00 ldr r3, [pc, 0x308] | r3 = "_s:_error_:_parameter_is_missing";
0x00010e04 ldr r0, [r3] | r0 = "_s:_error_:_parameter_is_missing";
0x00010e08 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", r1, "s:S:n:N:h_V", "_s:_error_:_parameter_is_missing")
0x00010e0c b 0x10c7c | goto label_4;
| label_21:
0x00010e10 sub r6, r6, 1 | r6--;
0x00010e14 cmp r3, r6 |
| if (r3 == r6) {
0x00010e18 ldrne r2, [pc, 0x2e8] | r2 = "ubirsvol";
| }
| if (r3 == r6) {
0x00010e1c ldrne r1, [pc, 0x330] | r1 = "_s:_error_:_more_then_one_UBI_device_specified__use__h_for_help_";
| }
0x00010e20 bne 0x10e00 |
| } while (r3 != r6);
0x00010e24 ldr r4, [pc, 0x2ec] | r4 = "Use__h_for_help";
0x00010e28 ldr r3, [r8, r3, lsl 2] | offset_0 = r3 << 2;
| r3 = *((r8 + offset_0));
0x00010e2c ldr r2, [r4] | r2 = "Use__h_for_help";
0x00010e30 str r3, [r4, 4] | *((r4 + 4)) = r3;
0x00010e34 cmn r2, 1 |
0x00010e38 ldr r3, [r4, 8] | r3 = "%s: error!: bad volume size: \"%s\"\n";
| if (r2 == 1) {
0x00010e3c bne 0x10e54 |
0x00010e40 cmp r3, 0 |
| if (r3 != 0) {
0x00010e44 bne 0x10e64 | goto label_22;
| }
0x00010e48 ldr r2, [pc, 0x2b8] | r2 = "s:S:n:N:h_V";
0x00010e4c ldr r1, [pc, 0x304] | r1 = "_s:_error_:_more_then_one_UBI_device_specified__use__h_for_help_";
0x00010e50 b 0x10e00 | goto label_5;
| }
0x00010e54 cmp r3, 0 |
| if (r3 == 0) {
0x00010e58 ldrne r2, [pc, 0x2a8] | r2 = "ubirsvol";
| }
| if (r3 != 0) {
0x00010e5c ldrne r1, [pc, 0x2f8] | r1 = "%s: error!: please, specify either volume ID or volume name, not both\n";
| goto label_23;
| }
| if (r3 != 0) {
| label_23:
0x00010e60 bne 0x10e00 | goto label_5;
| }
| label_22:
0x00010e64 ldrd r2, r3, [r4, 0x10] | __asm ("ldrd r2, r3, [r4, 0x10]");
0x00010e68 ldr r6, [r4, 0x18] | r6 = *((r4 + 0x18));
0x00010e6c mvn r1, 0 | r1 = ~0;
0x00010e70 mvn r0, 0 | r0 = ~0;
0x00010e74 cmp r3, r1 |
0x00010e78 cmpeq r2, r0 | __asm ("cmpeq r2, r0");
| if (r3 == r1) {
0x00010e7c bne 0x10e94 |
0x00010e80 cmn r6, 1 |
| if (r6 != 1) {
0x00010e84 bne 0x10ea4 | goto label_24;
| }
0x00010e88 ldr r2, [pc, 0x278] | r2 = "s:S:n:N:h_V";
0x00010e8c ldr r1, [pc, 0x2cc] | r1 = "%s: error!: please, specify either volume ID or volume name, not both\n";
0x00010e90 b 0x10bfc | goto label_6;
| }
0x00010e94 cmn r6, 1 |
| if (r6 == 1) {
0x00010e98 ldrne r2, [pc, 0x268] | r2 = "ubirsvol";
| }
| if (r6 != 1) {
0x00010e9c ldrne r1, [pc, 0x2c0] | r1 = "%s: error!: size specified with more then one option\n";
| goto label_25;
| }
| if (r6 != 1) {
| label_25:
0x00010ea0 bne 0x10e00 | goto label_5;
| }
| label_24:
0x00010ea4 bl 0x11e64 | r0 = fcn_00011e64 ();
0x00010ea8 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 == r0) {
0x00010eac bne 0x10ef8 |
0x00010eb0 bl 0x10b24 | errno_location ();
0x00010eb4 ldr r6, [pc, 0x254] |
0x00010eb8 ldr r2, [pc, 0x248] | r2 = "s:S:n:N:h_V";
0x00010ebc ldr r1, [pc, 0x2a4] | r1 = "%s: error!: size specified with more then one option\n";
0x00010ec0 ldr r4, [r0] | r4 = *(r0);
0x00010ec4 ldr r0, [r6] | r0 = "_s:_error_:_parameter_is_missing";
0x00010ec8 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "%s: error!: size specified with more then one option\n", "s:S:n:N:h_V", r3, r4, r5, "_s:_error_:_parameter_is_missing")
0x00010ecc mov r0, r4 | r0 = r4;
0x00010ed0 ldr r6, [r6] | r6 = "_s:_error_:_parameter_is_missing";
0x00010ed4 bl 0x109d4 | strerror (r0);
0x00010ed8 str r4, [sp] | *(sp) = r4;
0x00010edc ldr r3, [pc, 0x288] | r3 = "%s: error!: cannot open libubi\n";
0x00010ee0 mov r2, 0xa | r2 = 0xa;
0x00010ee4 ldr r1, [pc, 0x284] | r1 = *(0x1116c);
0x00010ee8 str r0, [sp, 4] | var_4h = r0;
0x00010eec mov r0, r6 | r0 = r6;
0x00010ef0 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n", r4)
0x00010ef4 b 0x10c7c | goto label_4;
| }
0x00010ef8 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00010efc bl 0x12650 | r0 = fcn_00012650 (r0, r1);
0x00010f00 cmp r0, 2 |
| if (r0 != 2) {
0x00010f04 bne 0x10f2c | goto label_26;
| }
0x00010f08 ldr r0, [pc, 0x200] |
0x00010f0c ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010f10 ldr r2, [pc, 0x1f0] | r2 = "s:S:n:N:h_V";
0x00010f14 ldr r1, [pc, 0x258] | r1 = "%*serror %d (%s)\n";
0x00010f18 ldr r0, [r0] | r0 = "_s:_error_:_parameter_is_missing";
0x00010f1c bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "%*serror %d (%s)\n", "s:S:n:N:h_V", r3)
| do {
0x00010f20 mov r0, r6 | r0 = r6;
0x00010f24 bl 0x11d90 | fcn_00011d90 (r0);
0x00010f28 b 0x10c7c | goto label_4;
| label_26:
0x00010f2c cmp r0, 0 |
| if (r0 < 0) {
0x00010f30 bge 0x10f60 |
0x00010f34 bl 0x10b24 | errno_location ();
0x00010f38 ldr sb, [r4, 4] | sb = *((r4 + 4));
0x00010f3c ldr r8, [pc, 0x1cc] | r8 = "_s:_error_:_parameter_is_missing";
0x00010f40 mov r3, sb | r3 = sb;
0x00010f44 ldr r2, [pc, 0x1bc] | r2 = "s:S:n:N:h_V";
0x00010f48 ldr r7, [r0] | r7 = *(r0);
0x00010f4c ldr r0, [r8] | r0 = "_s:_error_:_parameter_is_missing";
0x00010f50 cmp r7, 0x13 |
| if (r7 != 0x13) {
0x00010f54 bne 0x10fc4 | goto label_27;
| }
0x00010f58 ldr r1, [pc, 0x218] | r1 = "%s: error!: \"%s\" is an UBI volume node, not an UBI device node\n";
0x00010f5c bl 0x10a64 | fprintf (r0, "%s: error!: \"%s\" is an UBI volume node, not an UBI device node\n")
| }
| label_7:
0x00010f60 add r2, sp, 8 | r2 += var_8h;
0x00010f64 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x00010f68 mov r0, r6 | r0 = r6;
0x00010f6c bl 0x12fe4 | r0 = fcn_00012fe4 (r0, r1);
0x00010f70 cmp r0, 0 |
| if (r0 == 0) {
0x00010f74 beq 0x10ff8 | goto label_28;
| }
0x00010f78 bl 0x10b24 | errno_location ();
0x00010f7c ldr r8, [pc, 0x18c] | r8 = "_s:_error_:_parameter_is_missing";
0x00010f80 ldr r3, [r4, 4] | r3 = *((r4 + 4));
0x00010f84 ldr r2, [pc, 0x17c] | r2 = "s:S:n:N:h_V";
0x00010f88 ldr r1, [pc, 0x1ec] | r1 = "%s: error!: \"%s\" is not an UBI device node\n";
0x00010f8c ldr r7, [r0] | r7 = *(r0);
| label_8:
0x00010f90 ldr r0, [r8] | r0 = *(r8);
0x00010f94 bl 0x10a64 | fprintf (r0, "%s: error!: \"%s\" is not an UBI device node\n", "s:S:n:N:h_V", r3)
0x00010f98 mov r0, r7 | r0 = r7;
0x00010f9c ldr r4, [r8] | r4 = *(r8);
0x00010fa0 bl 0x109d4 | strerror (r0);
0x00010fa4 ldr r3, [pc, 0x1c0] | r3 = "%s: error!: cannot open libubi\n";
0x00010fa8 ldr r1, [pc, 0x1c0] | r1 = *(0x1116c);
0x00010fac mov r2, 0xa | r2 = 0xa;
0x00010fb0 str r7, [sp] | *(sp) = r7;
0x00010fb4 str r0, [sp, 4] | var_4h = r0;
0x00010fb8 mov r0, r4 | r0 = r4;
| label_9:
0x00010fbc bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n")
0x00010fc0 b 0x10f20 |
| } while (1);
| label_27:
0x00010fc4 ldr r1, [pc, 0x1b4] | r1 = "%s: error!: cannot get information about UBI device \"%s\"\n";
0x00010fc8 bl 0x10a64 | fprintf (r0, "%s: error!: cannot get information about UBI device \"%s\"\n")
0x00010fcc mov r0, r7 | r0 = r7;
0x00010fd0 ldr r8, [r8] | r8 = *(r8);
0x00010fd4 bl 0x109d4 | strerror (r0);
0x00010fd8 str r7, [sp] | *(sp) = r7;
0x00010fdc ldr r3, [pc, 0x188] | r3 = "%s: error!: cannot open libubi\n";
0x00010fe0 mov r2, 0xa | r2 = 0xa;
0x00010fe4 ldr r1, [pc, 0x184] | r1 = *(0x1116c);
0x00010fe8 str r0, [sp, 4] | var_4h = r0;
0x00010fec mov r0, r8 | r0 = r8;
0x00010ff0 bl 0x10a64 | fprintf (r0, r1, r2, "%s: error!: cannot open libubi\n")
0x00010ff4 b 0x10f60 | goto label_7;
| label_28:
0x00010ff8 ldr r2, [r4, 8] | r2 = *((r4 + 8));
0x00010ffc ldr r1, [sp, 8] | r1 = var_8h;
0x00011000 cmp r2, 0 |
0x00011004 add r3, sp, 0x60 | r3 += endptr;
| if (r2 != 0) {
0x00011008 beq 0x11040 |
0x0001100c mov r0, r6 | r0 = r6;
0x00011010 bl 0x136e4 | r0 = fcn_000136e4 (r0, r1);
0x00011014 cmp r0, 0 |
| if (r0 != 0) {
0x00011018 ldreq r3, [sp, 0x64] | r3 = var_64h;
| }
| if (r0 != 0) {
0x0001101c streq r3, [r4] | *(r4) = r3;
| }
| if (r0 == 0) {
0x00011020 beq 0x11070 | goto label_29;
| }
0x00011024 bl 0x10b24 | errno_location ();
0x00011028 ldr r8, [pc, 0xe0] | r8 = "_s:_error_:_parameter_is_missing";
0x0001102c ldr r3, [r4, 8] | r3 = *((r4 + 8));
0x00011030 ldr r2, [pc, 0xd0] | r2 = "s:S:n:N:h_V";
0x00011034 ldr r1, [pc, 0x148] | r1 = "%s: error!: error while probing \"%s\"\n";
0x00011038 ldr r7, [r0] | r7 = *(r0);
0x0001103c b 0x10f90 | goto label_8;
| }
0x00011040 ldr r2, [r4] | r2 = *(r4);
0x00011044 mov r0, r6 | r0 = r6;
0x00011048 bl 0x131d4 | r0 = fcn_000131d4 (r0, r1);
0x0001104c cmp r0, 0 |
| if (r0 != 0) {
0x00011050 beq 0x11070 |
0x00011054 bl 0x10b24 | errno_location ();
0x00011058 ldr r8, [pc, 0xb0] | r8 = "_s:_error_:_parameter_is_missing";
0x0001105c ldr r3, [r4] | r3 = *(r4);
0x00011060 ldr r2, [pc, 0xa0] | r2 = "s:S:n:N:h_V";
0x00011064 ldr r1, [pc, 0x11c] | r1 = "%s: error!: cannot find UBI volume \"%s\"\n";
0x00011068 ldr r7, [r0] | r7 = *(r0);
0x0001106c b 0x10f90 | goto label_8;
| }
| label_29:
0x00011070 ldr r1, [r4, 0x18] | r1 = *((r4 + 0x18));
0x00011074 cmn r1, 1 |
| if (r1 == 1) {
0x00011078 ldrne r3, [sp, 0x8c] | r3 = var_8ch;
| }
| if (r1 == 1) {
0x0001107c mulne r2, r3, r1 | r2 = r3 * r1;
| }
0x00011080 asrne r3, r2, 0x1f | __asm ("asrne r3, r2, 0x1f");
0x00011084 strdne r2, r3, [r4, 0x10] | __asm ("strdne r2, r3, [r4, 0x10]");
0x00011088 ldrd r2, r3, [r4, 0x10] | __asm ("ldrd r2, r3, [r4, 0x10]");
0x0001108c mov r0, r6 | r0 = r6;
0x00011090 strd r2, r3, [sp] | __asm ("strd r2, r3, [sp]");
0x00011094 ldr r2, [r4] | r2 = *(r4);
0x00011098 ldr r1, [r4, 4] | r1 = *((r4 + 4));
0x0001109c bl 0x12af8 | r0 = fcn_00012af8 (r0, r1, r2);
0x000110a0 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 != r0) {
0x000110a4 beq 0x110ec |
0x000110a8 bl 0x10b24 | errno_location ();
0x000110ac ldr r7, [pc, 0x5c] |
0x000110b0 ldr r2, [pc, 0x50] | r2 = "s:S:n:N:h_V";
0x000110b4 ldr r1, [pc, 0xd0] | r1 = "_s:_error_:_cannot_find_UBI_volume_ID__d";
0x000110b8 ldr r4, [r0] | r4 = *(r0);
0x000110bc ldr r0, [r7] | r0 = "_s:_error_:_parameter_is_missing";
0x000110c0 bl 0x10a64 | fprintf ("_s:_error_:_parameter_is_missing", "_s:_error_:_cannot_find_UBI_volume_ID__d", "s:S:n:N:h_V", r3, r4)
0x000110c4 mov r0, r4 | r0 = r4;
0x000110c8 ldr r7, [r7] | r7 = "_s:_error_:_parameter_is_missing";
0x000110cc bl 0x109d4 | strerror (r0);
0x000110d0 str r4, [sp] | *(sp) = r4;
0x000110d4 ldr r3, [pc, 0x90] | r3 = "%s: error!: cannot open libubi\n";
0x000110d8 mov r2, 0xa | r2 = 0xa;
0x000110dc ldr r1, [pc, 0x8c] | r1 = *(0x1116c);
0x000110e0 str r0, [sp, 4] | var_4h = r0;
0x000110e4 mov r0, r7 | r0 = r7;
0x000110e8 b 0x10fbc | goto label_9;
| }
0x000110ec mov r0, r6 | r0 = r6;
0x000110f0 bl 0x11d90 | fcn_00011d90 (r0);
0x000110f4 mov r5, r4 | r5 = r4;
0x000110f8 b 0x10c7c | goto label_4;
| }
[*] Function printf used 20 times ubirsvol