[*] Binary protection state of ubiattach
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf tear down of ubiattach
; 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/ubiattach @ 0x113c4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000113c4 () | void fcn_000113c4 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_0h_2;
| int32_t var_ch;
| r0 = arg1;
| r1 = arg2;
0x000113c4 ldr r3, [pc, 0x144] | r3 = *(0x1150c);
0x000113c8 cmp r2, 0 |
0x000113cc push {r0, r1, r2, r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000113d0 ldr r6, [pc, 0x13c] | r6 = "__";
0x000113d4 mov r4, r0 | r4 = r0;
| if (r2 != 0) {
0x000113d8 moveq r6, r3 | r6 = r3;
| }
0x000113dc mov r8, r2 | r8 = r2;
0x000113e0 mov r3, r1 | r3 = r1;
0x000113e4 mov r2, r0 | r2 = r0;
0x000113e8 ldr r0, [pc, 0x128] | r0 = "_";
0x000113ec mov r5, r1 | r5 = r1;
0x000113f0 bl 0x109c8 | printf (r0, r1, r2, r3, r4, r5, "__")
0x000113f4 cmp r4, 0x40000001 |
0x000113f8 sbcs r3, r5, 0 | __asm ("sbcs r3, r5, 0");
| if (r4 < 0x40000001) {
0x000113fc blt 0x11450 | goto label_1;
| }
0x00011400 add r3, pc, 0xf8 | r3 = pc + 0xf8;
0x00011404 ldrd r2, r3, [r3] | __asm ("ldrd r2, r3, [r3]");
0x00011408 bic r0, r4, 0xc0000000 | r0 = BIT_MASK (r4, 0xc0000000);
0x0001140c mov r1, 0 | r1 = 0;
0x00011410 bl 0x13928 | fcn_00013928 (r0);
0x00011414 lsr r7, r4, 0x1e | r7 = r4 >> 0x1e;
0x00011418 orr r7, r7, r5, lsl 2 | r7 |= (r5 << 2);
0x0001141c asr sb, r5, 0x1e | sb = r5 >> 0x1e;
0x00011420 mov r2, r7 | r2 = r7;
0x00011424 mov r3, sb | r3 = sb;
0x00011428 strd r0, r1, [sp] | __asm ("strd r0, r1, [sp]");
0x0001142c ldr r0, [pc, 0xe8] | r0 = "%lld bytes";
0x00011430 mov r1, r6 | r1 = r6;
| do {
| label_0:
0x00011434 bl 0x109c8 | printf (r0, r1, r2, r3)
0x00011438 cmp r8, 0 |
| if (r8 == 0) {
0x0001143c beq 0x114f8 | goto label_2;
| }
0x00011440 mov r0, 0x29 | r0 = 0x29;
0x00011444 add sp, sp, 0xc |
0x00011448 pop {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x0001144c b 0x109b0 | void (*0x109b0)() ();
| label_1:
0x00011450 mov r2, 0x100000 | r2 = 0x100000;
0x00011454 mov r3, 0 | r3 = 0;
0x00011458 cmp r2, r4 |
0x0001145c sbcs r3, r3, r5 | __asm ("sbcs r3, r3, r5");
| if (r2 >= r4) {
0x00011460 bge 0x114a4 | goto label_3;
| }
0x00011464 ldr sl, [pc, 0xb4] | sl = *(0x00011520);
0x00011468 mov fp, 0 |
0x0001146c add r3, pc, 0x94 | r3 = pc + 0x94;
0x00011470 ldrd r2, r3, [r3] | __asm ("ldrd r2, r3, [r3]");
0x00011474 and r0, sl, r4 | r0 = sl & r4;
0x00011478 and r1, fp, r5 | r1 = fp & r5;
0x0001147c bl 0x13928 | fcn_00013928 (r0);
0x00011480 lsr r7, r4, 0x14 | r7 = r4 >> 0x14;
0x00011484 orr r7, r7, r5, lsl 12 | r7 |= (r5 << 12);
0x00011488 asr sb, r5, 0x14 | sb = r5 >> 0x14;
0x0001148c mov r2, r7 | r2 = r7;
0x00011490 mov r3, sb | r3 = sb;
0x00011494 strd r0, r1, [sp] | __asm ("strd r0, r1, [sp]");
0x00011498 ldr r0, [pc, 0x84] | r0 = *(0x11520);
0x0001149c mov r1, r6 | r1 = r6;
0x000114a0 b 0x11434 |
| } while (1);
| label_3:
0x000114a4 mov r2, 0x400 | r2 = 0x400;
0x000114a8 mov r3, 0 | r3 = 0;
0x000114ac cmp r2, r4 |
0x000114b0 sbcs r3, r3, r5 | __asm ("sbcs r3, r3, r5");
| if (r2 < r4) {
0x000114b4 bge 0x114f8 |
0x000114b8 ldr sl, [pc, 0x68] | sl = *(0x00011528);
0x000114bc mov fp, 0 |
0x000114c0 mov r2, 0x66 | r2 = 0x66;
0x000114c4 mov r3, 0 | r3 = 0;
0x000114c8 and r0, sl, r4 | r0 = sl & r4;
0x000114cc and r1, fp, r5 | r1 = fp & r5;
0x000114d0 bl 0x13928 | fcn_00013928 (r0);
0x000114d4 lsr r7, r4, 0xa | r7 = r4 >> 0xa;
0x000114d8 orr r7, r7, r5, lsl 22 | r7 |= (r5 << 22);
0x000114dc asr sb, r5, 0xa | sb = r5 >> 0xa;
0x000114e0 mov r2, r7 | r2 = r7;
0x000114e4 mov r3, sb | r3 = sb;
0x000114e8 strd r0, r1, [sp] | __asm ("strd r0, r1, [sp]");
0x000114ec ldr r0, [pc, 0x38] | r0 = *(0x11528);
0x000114f0 mov r1, r6 | r1 = r6;
0x000114f4 b 0x11434 | goto label_0;
| }
| label_2:
0x000114f8 add sp, sp, 0xc |
0x000114fc 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/ubiattach @ 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_ch;
| int32_t var_10h;
| int32_t var_14h;
| int32_t var_18h;
| int32_t var_1ch;
| int32_t var_20h;
| int32_t var_30h;
| int32_t var_38h;
| int32_t var_54h;
| int32_t var_58h;
| int32_t var_60h;
| int32_t var_60h_2;
| int32_t var_68h;
| int32_t var_68h_2;
| int32_t var_74h;
| int32_t var_90h;
| r0 = argc;
| r1 = argv;
| /* [10] -r-x section size 12308 named .text */
0x00010b90 push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x00010b94 ldr r8, [pc, 0x4f0] | r8 = *(0x11088);
0x00010b98 ldr sb, [pc, 0x4f0] | sb = "p:m:d:O:b:hV";
0x00010b9c ldr r5, [pc, 0x4f0] | r5 = "p:m:d:O:b:hV";
0x00010ba0 sub sp, sp, 0x90 |
0x00010ba4 mov r6, r0 | r6 = r0;
0x00010ba8 mov r7, r1 | r7 = r1;
| label_0:
0x00010bac mov sl, 0 | sl = 0;
0x00010bb0 str sl, [sp] | *(sp) = sl;
0x00010bb4 mov r3, r8 | r3 = r8;
0x00010bb8 mov r2, sb | r2 = sb;
0x00010bbc mov r1, r7 | r1 = r7;
0x00010bc0 mov r0, r6 | r0 = r6;
0x00010bc4 str sl, [sp, 0x38] | var_38h = sl;
0x00010bc8 bl 0x109ec | r0 = getopt_long ();
0x00010bcc cmn r0, 1 |
0x00010bd0 mov r4, r0 | r4 = r0;
| if (r0 == 1) {
0x00010bd4 beq 0x10dbc | goto label_7;
| }
0x00010bd8 cmp r0, 0x62 |
| if (r0 == 0x62) {
0x00010bdc beq 0x10d30 | goto label_8;
| }
| if (r0 <= 0x62) {
0x00010be0 bgt 0x10c14 |
0x00010be4 cmp r0, 0x4f |
| if (r0 == 0x4f) {
0x00010be8 beq 0x10cec | goto label_9;
| }
0x00010bec cmp r0, 0x56 |
| if (r0 == 0x56) {
0x00010bf0 beq 0x10da8 | goto label_10;
| }
0x00010bf4 cmp r0, 0x3a |
| if (r0 != 0x3a) {
0x00010bf8 bne 0x10c28 | goto label_11;
| }
0x00010bfc ldr r2, [pc, 0x494] | r2 = optarg;
0x00010c00 ldr r1, [pc, 0x494] | r1 = "ubiattach";
| label_2:
0x00010c04 ldr r3, [pc, 0x494] | r3 = "%s: error!: parameter is missing\n";
0x00010c08 ldr r0, [r3] | r0 = "%s: error!: parameter is missing\n";
0x00010c0c bl 0x10a64 | fprintf ("%s: error!: parameter is missing\n", "ubiattach", r2, "%s: error!: parameter is missing\n")
0x00010c10 b 0x10ca0 | goto label_12;
| }
0x00010c14 cmp r0, 0x68 |
| if (r0 == 0x68) {
0x00010c18 beq 0x10d80 | goto label_13;
| }
| if (r0 > 0x68) {
0x00010c1c bgt 0x10c3c | goto label_14;
| }
0x00010c20 cmp r0, 0x64 |
| if (r0 == 0x64) {
0x00010c24 beq 0x10c5c | goto label_15;
| }
| do {
| label_11:
0x00010c28 ldr r3, [pc, 0x470] | r3 = "%s: error!: parameter is missing\n";
0x00010c2c ldr r0, [pc, 0x470] | r0 = stderr;
0x00010c30 ldr r1, [r3] | r1 = "%s: error!: parameter is missing\n";
0x00010c34 bl 0x10b48 | fputs (r0, "%s: error!: parameter is missing\n");
0x00010c38 b 0x10ca0 | goto label_12;
| label_14:
0x00010c3c cmp r0, 0x6d |
| if (r0 == 0x6d) {
0x00010c40 beq 0x10cb0 | goto label_16;
| }
0x00010c44 cmp r0, 0x70 |
0x00010c48 bne 0x10c28 |
| } while (r0 != 0x70);
0x00010c4c ldr r2, [r5] | r2 = *(r5);
0x00010c50 ldr r3, [pc, 0x450] | r3 = "Use -h for help\n";
0x00010c54 str r2, [r3, 0x10] | *((r3 + 0x10)) = r2;
0x00010c58 b 0x10bac | goto label_0;
| label_15:
0x00010c5c add r1, sp, 0x38 | r1 += var_38h;
0x00010c60 ldr r0, [r5] | r0 = *(r5);
0x00010c64 bl 0x1123c | fcn_0001123c (r0, r1);
0x00010c68 ldr r3, [pc, 0x438] | r3 = "Use -h for help\n";
0x00010c6c str r0, [r3] | *(r3) = r0;
0x00010c70 ldr r3, [sp, 0x38] | r3 = var_38h;
0x00010c74 cmp r3, 0 |
| if (r3 != 0) {
0x00010c78 lsreq r0, r0, 0x1f | r0 >>= 0x1f;
| }
| if (r3 == 0) {
0x00010c7c movne r0, 1 | r0 = 1;
| }
0x00010c80 cmp r0, 0 |
| if (r0 == 0) {
0x00010c84 beq 0x10bac | goto label_0;
| }
0x00010c88 ldr r3, [r5] | r3 = *(r5);
0x00010c8c ldr r2, [pc, 0x404] | r2 = optarg;
0x00010c90 ldr r1, [pc, 0x414] | r1 = *(0x110a8);
| label_1:
0x00010c94 ldr r0, [pc, 0x404] |
0x00010c98 ldr r0, [r0] | r0 = "%s: error!: parameter is missing\n";
0x00010c9c bl 0x10a64 | fprintf ("%s: error!: parameter is missing\n", r1, r2, r3)
| label_12:
0x00010ca0 mvn r4, 0 | r4 = ~0;
| label_3:
0x00010ca4 mov r0, r4 | r0 = r4;
0x00010ca8 add sp, sp, 0x90 |
0x00010cac pop {r4, r5, r6, r7, r8, sb, sl, pc} |
| label_16:
0x00010cb0 add r1, sp, 0x38 | r1 += var_38h;
0x00010cb4 ldr r0, [r5] | r0 = *(r5);
0x00010cb8 bl 0x1123c | fcn_0001123c (r0, r1);
0x00010cbc ldr r3, [pc, 0x3e4] | r3 = "Use -h for help\n";
0x00010cc0 str r0, [r3, 4] | *((r3 + 4)) = r0;
0x00010cc4 ldr r3, [sp, 0x38] | r3 = var_38h;
0x00010cc8 cmp r3, 0 |
| if (r3 != 0) {
0x00010ccc lsreq r0, r0, 0x1f | r0 >>= 0x1f;
| }
| if (r3 == 0) {
0x00010cd0 movne r0, 1 | r0 = 1;
| }
0x00010cd4 cmp r0, 0 |
| if (r0 == 0) {
0x00010cd8 beq 0x10bac | goto label_0;
| }
0x00010cdc ldr r3, [r5] | r3 = *(r5);
0x00010ce0 ldr r2, [pc, 0x3b0] | r2 = optarg;
0x00010ce4 ldr r1, [pc, 0x3c4] | r1 = "%s: error!: bad UBI device number: \"%s\"\n";
0x00010ce8 b 0x10c94 | goto label_1;
| label_9:
0x00010cec add r1, sp, 0x38 | r1 += var_38h;
0x00010cf0 ldr r0, [r5] | r0 = *(r5);
0x00010cf4 bl 0x1123c | fcn_0001123c (r0, r1);
0x00010cf8 ldr r3, [pc, 0x3a8] | r3 = "Use -h for help\n";
0x00010cfc str r0, [r3, 8] | *((r3 + 8)) = r0;
0x00010d00 ldr r3, [sp, 0x38] | r3 = var_38h;
0x00010d04 cmp r0, 0 |
| if (r0 <= 0) {
0x00010d08 movgt r0, 0 | r0 = 0;
| }
| if (r0 > 0) {
0x00010d0c movle r0, 1 | r0 = 1;
| }
0x00010d10 cmp r3, 0 |
| if (r3 == 0) {
0x00010d14 movne r0, 1 | r0 = 1;
| }
0x00010d18 cmp r0, 0 |
| if (r0 == 0) {
0x00010d1c beq 0x10bac | goto label_0;
| }
0x00010d20 ldr r3, [r5] | r3 = *(r5);
0x00010d24 ldr r2, [pc, 0x36c] | r2 = optarg;
0x00010d28 ldr r1, [pc, 0x384] | r1 = "_s:_error_:_bad_MTD_device_number:___s_";
0x00010d2c b 0x10c94 | goto label_1;
| label_8:
0x00010d30 add r1, sp, 0x38 | r1 += var_38h;
0x00010d34 ldr r0, [r5] | r0 = *(r5);
0x00010d38 bl 0x1123c | fcn_0001123c (r0, r1);
0x00010d3c ldr r3, [pc, 0x364] | r3 = "Use -h for help\n";
0x00010d40 str r0, [r3, 0x14] | *((r3 + 0x14)) = r0;
0x00010d44 ldr r3, [sp, 0x38] | r3 = var_38h;
0x00010d48 cmp r0, 0x300 |
0x00010d4c cmpls r3, 0 | __asm ("cmpls r3, 0");
| if (r0 == 0x300) {
0x00010d50 ldrne r3, [r5] | r3 = *(r5);
| }
| if (r0 == 0x300) {
0x00010d54 ldrne r2, [pc, 0x33c] | r2 = "ubiattach";
| }
| if (r0 != 0x300) {
0x00010d58 ldrne r1, [pc, 0x358] | r1 = "%s: error!: bad maximum of expected bad blocks (0-768): \"%s\"\n";
| goto label_17;
| }
| if (r0 != 0x300) {
| label_17:
0x00010d5c bne 0x10c94 | goto label_1;
| }
0x00010d60 cmp r0, 0 |
| if (r0 != 0) {
0x00010d64 bne 0x10bac | goto label_0;
| }
0x00010d68 ldr r3, [pc, 0x330] | r3 = "%s: error!: parameter is missing\n";
0x00010d6c ldr r2, [pc, 0x324] | r2 = optarg;
0x00010d70 ldr r1, [pc, 0x344] | r1 = "%s: error!: bad maximum of expected bad blocks (0-768): \"%s\"\n";
0x00010d74 ldr r0, [r3] | r0 = "%s: error!: parameter is missing\n";
0x00010d78 bl 0x10a64 | fprintf ("%s: error!: parameter is missing\n", "%s: error!: bad maximum of expected bad blocks (0-768): \"%s\"\n", r2, "%s: error!: parameter is missing\n")
0x00010d7c b 0x10bac | goto label_0;
| label_13:
0x00010d80 ldr r1, [pc, 0x338] | r1 = "_s:_warning_:_the_default_kernel_value_will_be_used_for_maximum_expected_bad_blocks";
0x00010d84 ldr r0, [pc, 0x338] | r0 = "ubiattach_version_2.1.0___a_tool_to_attach_MTD_device_to_UBI.";
0x00010d88 bl 0x109c8 | printf ("ubiattach_version_2.1.0___a_tool_to_attach_MTD_device_to_UBI.", "_s:_warning_:_the_default_kernel_value_will_be_used_for_maximum_expected_bad_blocks")
0x00010d8c ldr r1, [pc, 0x334] | r1 = "%s\n\n";
0x00010d90 ldr r0, [pc, 0x32c] | r0 = "ubiattach_version_2.1.0___a_tool_to_attach_MTD_device_to_UBI.";
0x00010d94 bl 0x109c8 | printf ("ubiattach_version_2.1.0___a_tool_to_attach_MTD_device_to_UBI.", "%s\n\n")
0x00010d98 ldr r0, [pc, 0x32c] | r0 = "Usage:_ubiattach___UBI_control_device_node_file_name____m__MTD_device_number_____d__UBI_device_number_____p__path_to_device_____mtdn_MTD_device_number______devn_UBI_device_number_____dev_path_path_to_device_____max_beb_per1024_maximum_bad_bloc";
0x00010d9c bl 0x10a1c | puts ("Usage:_ubiattach___UBI_control_device_node_file_name____m__MTD_device_number_____d__UBI_device_number_____p__path_to_device_____mtdn_MTD_device_number______devn_UBI_device_number_____dev_path_path_to_device_____max_beb_per1024_maximum_bad_bloc");
| do {
0x00010da0 mov r0, sl | r0 = sl;
0x00010da4 bl 0x10b30 | exit (r0);
| label_10:
0x00010da8 ldr r2, [pc, 0x320] | r2 = "-d, --devn=<number> the number to assign to the newly created UBI device\n (assigned automatically if this is not specified)\n-p, --dev-path=<path> path to MTD device node to attach\n-m, --mtdn=<number> MTD device number to attach (alternative method, e.g\n if the character device node does not exist)\n-O, --vid-hdr-offset VID header offset (do not specify this unless you really\n know what you are doing, the default should be optimal)\n-b, --max-beb-per1024 maximum expected bad block number per 1024 eraseblock.\n The default value is correct for most NAND devices.\n Allowed range is 0-768, 0 means the default kernel value.\n-h, --help print help message\n-V, --version print program version";
0x00010dac ldr r1, [pc, 0x2e4] | r1 = optarg;
0x00010db0 ldr r0, [pc, 0x31c] | r0 = "_.1.0";
0x00010db4 bl 0x109c8 | printf ("_.1.0", r1, "-d, --devn=<number> the number to assign to the newly created UBI device\n (assigned automatically if this is not specified)\n-p, --dev-path=<path> path to MTD device node to attach\n-m, --mtdn=<number> MTD device number to attach (alternative method, e.g\n if the character device node does not exist)\n-O, --vid-hdr-offset VID header offset (do not specify this unless you really\n know what you are doing, the default should be optimal)\n-b, --max-beb-per1024 maximum expected bad block number per 1024 eraseblock.\n The default value is correct for most NAND devices.\n Allowed range is 0-768, 0 means the default kernel value.\n-h, --help print help message\n-V, --version print program version")
0x00010db8 b 0x10da0 |
| } while (1);
| label_7:
0x00010dbc ldr r3, [pc, 0x314] |
0x00010dc0 ldr r3, [r3] | r3 = "_s__mtd_utils___s";
0x00010dc4 cmp r6, r3 |
| if (r6 != r3) {
0x00010dc8 bne 0x10e04 | goto label_18;
| }
0x00010dcc ldr r3, [pc, 0x2d4] | r3 = "Use -h for help\n";
0x00010dd0 ldr r2, [pc, 0x304] | r2 = optind;
| do {
0x00010dd4 str r2, [r3, 0xc] | *((r3 + 0xc)) = r2;
0x00010dd8 ldr r3, [pc, 0x2c8] | r3 = "Use -h for help\n";
0x00010ddc ldr r6, [r3, 4] | r6 = *(0x110a8);
0x00010de0 mov r5, r3 | r5 = r3;
0x00010de4 cmn r6, 1 |
| if (r6 != 1) {
0x00010de8 bne 0x10e30 | goto label_19;
| }
0x00010dec ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x00010df0 cmp r3, 0 |
| if (r3 != 0) {
0x00010df4 bne 0x10e30 | goto label_19;
| }
0x00010df8 ldr r2, [pc, 0x298] | r2 = optarg;
0x00010dfc ldr r1, [pc, 0x2dc] | r1 = "_dev_ubi_ctrl";
0x00010e00 b 0x10c04 | goto label_2;
| label_18:
0x00010e04 sub r6, r6, 1 | r6--;
0x00010e08 cmp r3, r6 |
| if (r3 != r6) {
0x00010e0c ldreq r2, [r7, r3, lsl 2] | offset_0 = r3 << 2;
| r2 = *((r7 + offset_0));
| }
| if (r3 != r6) {
0x00010e10 ldreq r3, [pc, 0x290] | r3 = *(0x000110a8);
| }
0x00010e14 beq 0x10dd4 |
| } while (r3 == r6);
0x00010e18 ldr r3, [pc, 0x280] | r3 = "%s: error!: parameter is missing\n";
0x00010e1c ldr r2, [pc, 0x274] | r2 = optarg;
0x00010e20 ldr r1, [pc, 0x2bc] | r1 = "_s:_error_:_MTD_device_to_attach_was_not_specified__use__h_for_help_";
0x00010e24 ldr r0, [r3] | r0 = "%s: error!: parameter is missing\n";
| do {
0x00010e28 bl 0x10a64 | fprintf ("%s: error!: parameter is missing\n", "_s:_error_:_MTD_device_to_attach_was_not_specified__use__h_for_help_", r2, "%s: error!: parameter is missing\n")
0x00010e2c b 0x10ca4 | goto label_3;
| label_19:
0x00010e30 bl 0x11e74 | r0 = fcn_00011e74 ();
0x00010e34 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 != r0) {
0x00010e38 bne 0x10e90 | goto label_20;
| }
0x00010e3c bl 0x10b24 | errno_location ();
0x00010e40 ldr r6, [pc, 0x258] | r6 = "%s: error!: parameter is missing\n";
0x00010e44 ldr r2, [pc, 0x24c] | r2 = optarg;
0x00010e48 ldr r5, [r0] | r5 = *(r0);
0x00010e4c ldr r0, [r6] | r0 = "%s: error!: parameter is missing\n";
0x00010e50 cmp r5, 0 |
| if (r5 != 0) {
0x00010e54 ldreq r1, [pc, 0x28c] | r1 = "%s: error!: UBI is not present in the system\n";
| }
0x00010e58 beq 0x10e28 |
| } while (r5 == 0);
0x00010e5c ldr r1, [pc, 0x288] | r1 = "%s: error!: UBI is not present in the system\n";
0x00010e60 bl 0x10a64 | fprintf (r0, "%s: error!: UBI is not present in the system\n")
0x00010e64 mov r0, r5 | r0 = r5;
0x00010e68 ldr r6, [r6] | r6 = *(r6);
0x00010e6c bl 0x109d4 | strerror (r0);
0x00010e70 str r5, [sp] | *(sp) = r5;
0x00010e74 ldr r3, [pc, 0x274] | r3 = "_s:_error_:_cannot_open_libubi";
0x00010e78 mov r2, 0xb | r2 = 0xb;
0x00010e7c ldr r1, [pc, 0x270] | r1 = *(0x110f0);
0x00010e80 str r0, [sp, 4] | var_4h = r0;
0x00010e84 mov r0, r6 | r0 = r6;
0x00010e88 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open_libubi", r4, r5)
0x00010e8c b 0x10ca4 | goto label_3;
| label_20:
0x00010e90 add r1, sp, 0x20 | r1 += var_20h;
0x00010e94 bl 0x12330 | r0 = fcn_00012330 (r0, r1);
0x00010e98 cmp r0, 0 |
| if (r0 != 0) {
0x00010e9c beq 0x10ee4 |
0x00010ea0 bl 0x10b24 | errno_location ();
0x00010ea4 ldr r7, [pc, 0x1f4] | r7 = "%s: error!: parameter is missing\n";
0x00010ea8 ldr r2, [pc, 0x1e8] | r2 = optarg;
0x00010eac ldr r1, [pc, 0x244] | r1 = "_serror__d___s_";
0x00010eb0 ldr r5, [r0] | r5 = *(r0);
| label_6:
0x00010eb4 ldr r0, [r7] | r0 = *(r7);
0x00010eb8 bl 0x10a64 | fprintf (r0, "_serror__d___s_", r2, r3, r4, r5)
0x00010ebc mov r0, r5 | r0 = r5;
0x00010ec0 ldr r7, [r7] | r7 = *(r7);
0x00010ec4 bl 0x109d4 | strerror (r0);
0x00010ec8 str r5, [sp] | *(sp) = r5;
0x00010ecc ldr r3, [pc, 0x21c] | r3 = "_s:_error_:_cannot_open_libubi";
0x00010ed0 mov r2, 0xb | r2 = 0xb;
0x00010ed4 ldr r1, [pc, 0x218] | r1 = *(0x110f0);
0x00010ed8 str r0, [sp, 4] | var_4h = r0;
0x00010edc mov r0, r7 | r0 = r7;
0x00010ee0 b 0x10fa4 | goto label_21;
| }
0x00010ee4 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00010ee8 cmn r3, 1 |
| if (r3 != 1) {
0x00010eec bne 0x10f10 | goto label_22;
| }
0x00010ef0 ldr r3, [pc, 0x1a8] | r3 = "%s: error!: parameter is missing\n";
0x00010ef4 ldr r2, [pc, 0x19c] | r2 = optarg;
0x00010ef8 ldr r1, [pc, 0x1fc] | r1 = "_s:_error_:_cannot_get_UBI_information";
0x00010efc ldr r0, [r3] | r0 = "%s: error!: parameter is missing\n";
0x00010f00 bl 0x10a64 | fprintf ("%s: error!: parameter is missing\n", "_s:_error_:_cannot_get_UBI_information", r2, "%s: error!: parameter is missing\n")
| do {
| label_5:
0x00010f04 mov r0, r6 | r0 = r6;
0x00010f08 bl 0x11da0 | fcn_00011da0 (r0);
0x00010f0c b 0x10ca4 | goto label_3;
| label_22:
0x00010f10 ldr r3, [r5] | r3 = *(r5);
0x00010f14 add r2, sp, 0xc | r2 += var_ch;
0x00010f18 str r3, [sp, 0xc] | var_ch = r3;
0x00010f1c ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x00010f20 ldr r1, [r5, 0xc] | r1 = *((r5 + 0xc));
0x00010f24 str r3, [sp, 0x10] | var_10h = r3;
0x00010f28 ldr r3, [r5, 8] | r3 = *((r5 + 8));
0x00010f2c mov r0, r6 | r0 = r6;
0x00010f30 str r3, [sp, 0x18] | var_18h = r3;
0x00010f34 ldr r3, [r5, 0x10] | r3 = *((r5 + 0x10));
0x00010f38 str r3, [sp, 0x14] | var_14h = r3;
0x00010f3c ldr r3, [r5, 0x14] | r3 = *((r5 + 0x14));
0x00010f40 str r3, [sp, 0x1c] | var_1ch = r3;
0x00010f44 bl 0x12204 | r0 = fcn_00012204 (r0);
0x00010f48 cmp r0, 0 |
| if (r0 >= 0) {
0x00010f4c bge 0x10fbc | goto label_23;
| }
0x00010f50 bl 0x10b24 | errno_location ();
0x00010f54 ldr sl, [r5, 0x10] | sl = *((r5 + 0x10));
0x00010f58 ldr r8, [pc, 0x140] | r8 = "%s: error!: parameter is missing\n";
0x00010f5c cmp sl, 0 |
0x00010f60 ldr sb, [r8] | sb = "%s: error!: parameter is missing\n";
0x00010f64 ldr r7, [r0] | r7 = *(r0);
| if (sl == 0) {
0x00010f68 beq 0x10fac | goto label_24;
| }
0x00010f6c ldr r2, [pc, 0x124] | r2 = optarg;
0x00010f70 ldr r1, [pc, 0x188] | r1 = "_s:_error_:_MTD_attach_detach_feature_is_not_supported_by_your_kernel";
0x00010f74 mov r3, sl | r3 = sl;
| label_4:
0x00010f78 mov r0, sb | r0 = sb;
0x00010f7c bl 0x10a64 | fprintf (r0, "_s:_error_:_MTD_attach_detach_feature_is_not_supported_by_your_kernel", r2, r3)
0x00010f80 mov r0, r7 | r0 = r7;
0x00010f84 ldr r5, [r8] | r5 = *(r8);
0x00010f88 bl 0x109d4 | strerror (r0);
0x00010f8c ldr r3, [pc, 0x15c] | r3 = "_s:_error_:_cannot_open_libubi";
0x00010f90 ldr r1, [pc, 0x15c] | r1 = *(0x110f0);
0x00010f94 mov r2, 0xb | r2 = 0xb;
0x00010f98 str r7, [sp] | *(sp) = r7;
0x00010f9c str r0, [sp, 4] | var_4h = r0;
0x00010fa0 mov r0, r5 | r0 = r5;
| label_21:
0x00010fa4 bl 0x10a64 | fprintf (r0, r1, r2, "_s:_error_:_cannot_open_libubi")
0x00010fa8 b 0x10f04 |
| } while (1);
| label_24:
0x00010fac ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x00010fb0 ldr r2, [pc, 0xe0] | r2 = optarg;
0x00010fb4 ldr r1, [pc, 0x148] | r1 = "%s: error!: cannot attach \"%s\"\n";
0x00010fb8 b 0x10f78 | goto label_4;
| label_23:
0x00010fbc cmp r0, 1 |
| if (r0 == 1) {
0x00010fc0 bne 0x10ff8 |
0x00010fc4 ldr r0, [pc, 0xd4] |
0x00010fc8 ldr r3, [r5, 0x14] | r3 = *((r5 + 0x14));
0x00010fcc ldr r2, [pc, 0xc4] | r2 = optarg;
0x00010fd0 ldr r1, [pc, 0x130] | r1 = "%s: error!: cannot attach mtd%d\n";
0x00010fd4 ldr r0, [r0] | r0 = "%s: error!: parameter is missing\n";
0x00010fd8 bl 0x10a64 | fprintf ("%s: error!: parameter is missing\n", "%s: error!: cannot attach mtd%d\n", r2, r3)
0x00010fdc ldr r1, [pc, 0xb4] | r1 = optarg;
0x00010fe0 ldr r0, [pc, 0x124] | r0 = "_s:_warning_:_the___max_beb_per1024_d_parameter_was_ignored";
0x00010fe4 bl 0x109c8 | printf ("_s:_warning_:_the___max_beb_per1024_d_parameter_was_ignored", r1)
0x00010fe8 ldr r1, [pc, 0xa8] | r1 = optarg;
0x00010fec ldr r0, [pc, 0x11c] | r0 = "_s:_the_UBI_kernel_driver_does_not_support_does_not_allow_changing_the_reserved_PEBs_count";
0x00010ff0 bl 0x109c8 | printf ("_s:_the_UBI_kernel_driver_does_not_support_does_not_allow_changing_the_reserved_PEBs_count", r1)
0x00010ff4 b 0x10f04 | goto label_5;
| }
0x00010ff8 add r2, sp, 0x38 | r2 += var_38h;
0x00010ffc ldr r1, [sp, 0xc] | r1 = var_ch;
0x00011000 mov r0, r6 | r0 = r6;
0x00011004 bl 0x12cbc | r0 = fcn_00012cbc (r0, r1);
0x00011008 subs r5, r0, 0 | r5 = r0 - 0;
| if (r5 != r0) {
0x0001100c beq 0x11028 |
0x00011010 bl 0x10b24 | errno_location ();
0x00011014 ldr r7, [pc, 0x84] | r7 = "%s: error!: parameter is missing\n";
0x00011018 ldr r2, [pc, 0x78] | r2 = optarg;
0x0001101c ldr r1, [pc, 0xf0] | r1 = "_s:_the_support_was_added_in_kernel_version_3.7__probably_you_are_running_older_kernel_";
0x00011020 ldr r5, [r0] | r5 = *(r0);
0x00011024 b 0x10eb4 | goto label_6;
| }
0x00011028 ldr r2, [sp, 0x54] | r2 = var_54h;
0x0001102c ldr r1, [sp, 0x38] | r1 = var_38h;
0x00011030 ldr r0, [pc, 0xe0] | r0 = "%s: error!: cannot get information about newly created UBI device\n";
0x00011034 bl 0x109c8 | printf ("%s: error!: cannot get information about newly created UBI device\n", r1, r2)
0x00011038 mov r2, r5 | r2 = r5;
0x0001103c ldrd r0, r1, [sp, 0x60] | __asm ("ldrd r0, r1, [var_60h]");
0x00011040 bl 0x113c4 | fcn_000113c4 (r0, r1);
0x00011044 ldr r1, [sp, 0x58] | r1 = var_58h;
0x00011048 ldr r0, [pc, 0xcc] | r0 = "UBI_device_number__d__total__d_LEBs__";
0x0001104c bl 0x109c8 | printf ("UBI_device_number__d__total__d_LEBs__", r1)
0x00011050 ldrd r0, r1, [sp, 0x68] | __asm ("ldrd r0, r1, [var_68h]");
0x00011054 mov r2, r5 | r2 = r5;
0x00011058 bl 0x113c4 | fcn_000113c4 (r0, r1);
0x0001105c ldr r0, [pc, 0xbc] | r0 = "___available__d_LEBs__";
0x00011060 bl 0x109c8 | printf ("___available__d_LEBs__")
0x00011064 ldr r0, [sp, 0x74] | r0 = var_74h;
0x00011068 mov r2, 1 | r2 = 1;
0x0001106c asr r1, r0, 0x1f | r1 = r0 >> 0x1f;
0x00011070 bl 0x113c4 | fcn_000113c4 (r0, r1);
0x00011074 mov r0, 0xa | r0 = 0xa;
0x00011078 bl 0x109b0 | putchar (r0);
0x0001107c mov r0, r6 | r0 = r6;
0x00011080 bl 0x11da0 | fcn_00011da0 (r0);
0x00011084 mov r4, r5 | r4 = r5;
0x00011088 b 0x10ca4 | goto label_3;
| }
[*] Function printf used 22 times ubiattach