[*] Binary protection state of ntpd
Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function mmap tear down of ntpd
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/ntpd @ 0x23a4 */
| #include <stdint.h>
|
; (fcn) fcn.000023a4 () | void fcn_000023a4 (int16_t arg_8h, int16_t arg_ch, int16_t arg_10h, int16_t arg_14h, int16_t arg_18h, int16_t arg_1ch, int16_t arg_d0h, int16_t arg_d4h, int16_t arg_d9h, int16_t arg_dah, int16_t arg_f0h, int16_t arg_f5h, int16_t arg_f6h, int16_t arg_f8h, int16_t arg_104h, uint32_t arg4) {
| int16_t var_0h;
| int16_t var_4h;
| r3 = arg4;
| label_0:
0x00001d4c mov r2, r8 | r2 = r8;
0x00001d4e mov r1, r7 | r1 = r7;
0x00001d50 mov r0, r4 | r0 = r4;
0x00001d52 blx 0x1a64 | r0 = sqrt (r0);
0x00001d56 adds r3, r0, 1 | r3 = r0 + 1;
| if (r3 == r0) {
0x00001d58 beq 0x1dc8 | goto label_12;
| }
| do {
0x00001d5a subs r0, 0x50 | r0 -= 0x50;
0x00001d5c cmp r0, 0x26 |
| if (r0 > 0x26) {
0x00001d5e bhi.w 0x21f6 | goto label_13;
| }
| /* switch table (40 cases) at 0x1d66 */
0x00001d62 tbh [pc, r0, lsl 1] | __asm ("tbh [pc, r0, lsl 1]");
0x00001db4 ldr r3, [sp, 0xd4] | r3 = *(arg_d4h);
0x00001db6 mov r2, r8 | r2 = r8;
0x00001db8 mov r1, r7 | r1 = r7;
0x00001dba mov r0, r4 | r0 = r4;
0x00001dbc adds r3, 1 | r3++;
0x00001dbe str r3, [sp, 0xd4] | *(arg_d4h) = r3;
0x00001dc0 blx 0x1a64 | r0 = sqrt (r0);
0x00001dc4 adds r3, r0, 1 | r3 = r0 + 1;
0x00001dc6 bne 0x1d5a |
| } while (r3 != r0);
| label_12:
0x00001dc8 ldr r0, [sp, 0xd0] | r0 = *(arg_d0h);
0x00001dca movs r1, 0x18 | r1 = 0x18;
0x00001dcc cmp r0, 0 |
0x00001dce it eq |
| if (r0 != 0) {
0x00001dd0 moveq r0, 1 | r0 = 1;
| }
0x00001dd2 bl 0x3cc8 | fcn_00003cc8 (r0, r1);
0x00001dd6 ldr r0, [sp, 0xd4] | r0 = *(arg_d4h);
0x00001dd8 bl 0x3d20 | fcn_00003d20 (r0);
0x00001ddc ldr.w r3, [pc, 0x4e4] |
0x00001de0 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00001de2 ldr r3, [r3] | r3 = *(0x22c4);
0x00001de4 cmp r4, r3 |
| if (r4 > r3) {
0x00001de6 bgt.w 0x21f6 | goto label_13;
| }
0x00001dea ldr r1, [sp, 8] | r1 = *(arg_8h);
0x00001dec mov r0, sl | r0 = sl;
0x00001dee bl 0x7dc4 | r0 = fcn_00007dc4 (r0);
0x00001df2 mov r4, r0 | r4 = r0;
0x00001df4 cmp r0, 0 |
| if (r0 != 0) {
0x00001df6 bne.w 0x2242 | goto label_14;
| }
0x00001dfa ldrb.w r3, [sp, 0xda] | r3 = *(arg_dah);
0x00001dfe cmp r3, 0 |
| if (r3 != 0) {
0x00001e00 bne.w 0x1f3a | goto label_15;
| }
0x00001e04 blx 0x18d0 | r0 = fcn_000018d0 ();
0x00001e08 mov r7, r0 | r7 = r0;
0x00001e0a cmp r0, 0 |
| if (r0 != 0) {
0x00001e0c bne.w 0x2260 | goto label_16;
| }
0x00001e10 ldr.w r8, [pc, 0x4b4] |
0x00001e14 add r8, pc | r8 = 0x40e0;
0x00001e16 mov r0, r8 | r0 = r8;
0x00001e18 blx 0x16f4 | r0 = fcn_000016f4 ();
0x00001e1c mov r4, r0 | r4 = r0;
0x00001e1e cmp r0, 0 |
| if (r0 == 0) {
0x00001e20 beq.w 0x226a | goto label_17;
| }
0x00001e24 cmp r5, 0 |
| if (r5 == 0) {
0x00001e26 beq.w 0x1f60 | goto label_18;
| }
0x00001e2a add r1, sp, 0x14 | r1 += arg_14h;
0x00001e2c add r0, sp, 0x10 | r0 += arg_10h;
0x00001e2e bl 0x877c | fcn_0000877c (r0, r1);
0x00001e32 adds r0, 1 | r0++;
| if (r0 == 1) {
0x00001e34 beq.w 0x2276 | goto label_19;
| }
0x00001e38 ldr.w r0, [pc, 0x490] |
0x00001e3c mov r1, r5 | r1 = r5;
0x00001e3e add r0, pc | r0 = 0x410e;
0x00001e40 blx 0x171c | r0 = cxa_finalize ();
0x00001e44 cmp r0, 0 |
| if (r0 == 0) {
0x00001e46 beq.w 0x2286 | goto label_20;
| }
0x00001e4a ldr.w r0, [pc, 0x484] |
0x00001e4e mov r1, r5 | r1 = r5;
0x00001e50 add r0, pc | r0 = 0x4126;
0x00001e52 blx 0x171c | r0 = cxa_finalize ();
0x00001e56 cmp r0, 0 |
| if (r0 == 0) {
0x00001e58 beq.w 0x2294 | goto label_21;
| }
0x00001e5c ldr.w r0, [pc, 0x474] |
0x00001e60 mov r1, r5 | r1 = r5;
0x00001e62 add r0, pc | r0 = 0x413a;
0x00001e64 blx 0x171c | r0 = cxa_finalize ();
0x00001e68 cmp r0, 0 |
| if (r0 != 0) {
0x00001e6a bne 0x1f52 | goto label_22;
| }
0x00001e6c ldrd r1, r2, [r4, 8] | __asm ("ldrd r1, r2, [r4, 8]");
0x00001e70 ldr r0, [r4, 0x14] | r0 = *((r4 + 0x14));
0x00001e72 bl 0x3254 | fcn_00003254 ();
| label_10:
0x00001e76 ldr.w r1, [pc, 0x460] |
0x00001e7a mov r2, r5 | r2 = r5;
0x00001e7c ldr.w r0, [pc, 0x45c] |
0x00001e80 add r1, pc | r1 = 0x415e;
0x00001e82 add r0, pc | r0 = 0x4162;
0x00001e84 bl 0x40f0 | fcn_000040f0 (r0);
0x00001e88 ldr.w r3, [pc, 0x454] | r3 = *(0x22e0);
0x00001e8c movs r2, 0xa | r2 = 0xa;
0x00001e8e movs r1, 0 | r1 = 0;
0x00001e90 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00001e92 ldr r0, [r3] | r0 = *(0x22e0);
0x00001e94 blx 0x1734 | r0 = setsockopt ();
0x00001e98 cmp.w r0, 0xe10 |
0x00001e9c str r0, [sp, 0xf8] | *(arg_f8h) = r0;
| if (r0 < 0xe10) {
0x00001e9e bls.w 0x1d4c | goto label_0;
| }
0x00001ea2 ldr.w r0, [pc, 0x440] |
0x00001ea6 movs r1, 1 | r1 = 1;
0x00001ea8 ldr.w r2, [pc, 0x43c] |
0x00001eac ldrb.w r3, [sp, 0xf6] | r3 = *(arg_f6h);
0x00001eb0 ldr r0, [r6, r0] | r0 = *((r6 + r0));
0x00001eb2 add r2, pc | r2 = 0x419e;
0x00001eb4 ldr r0, [r0] | r0 = *(0x22e6);
0x00001eb6 blx 0x1b00 | munmap (r0, r1);
0x00001eba movs r0, 1 | r0 = 1;
0x00001ebc blx 0x1a28 | mmap (r0, r1, r2, r3, r4, r5)
0x00001ec0 movs r3, 1 | r3 = 1;
0x00001ec2 strb.w r3, [sp, 0xd9] | *(arg_d9h) = r3;
0x00001ec6 b 0x1d4c | goto label_0;
0x00001ec8 movs r3, 1 | r3 = 1;
0x00001eca strb.w r3, [sp, 0xf5] | *(arg_f5h) = r3;
0x00001ece b 0x1d4c | goto label_0;
0x00001ed0 ldr.w r3, [pc, 0x40c] | r3 = *(0x22e0);
0x00001ed4 movs r2, 0xa | r2 = 0xa;
0x00001ed6 movs r1, 0 | r1 = 0;
0x00001ed8 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00001eda ldr r0, [r3] | r0 = *(0x22e0);
0x00001edc blx 0x1734 | r0 = setsockopt ();
0x00001ee0 uxtb r0, r0 | r0 = (int8_t) r0;
0x00001ee2 subs r3, r0, 1 | r3 = r0 - 1;
0x00001ee4 strb.w r0, [sp, 0xf6] | *(arg_f6h) = r0;
| label_11:
0x00001ee8 cmp r3, 0xe |
| if (r3 < 0xe) {
0x00001eea bls.w 0x1d4c | goto label_0;
| }
0x00001eee ldr r4, [pc, 0x3f4] | r4 = *(0x22e6);
0x00001ef0 mov r3, r0 | r3 = r0;
0x00001ef2 ldr r2, [pc, 0x3f8] |
0x00001ef4 movs r1, 1 | r1 = 1;
0x00001ef6 ldr r0, [r6, r4] | r0 = *((r6 + r4));
0x00001ef8 add r2, pc | r2 = 0x41ea;
0x00001efa ldr r0, [r0] | r0 = *(r0);
0x00001efc blx 0x1b00 | munmap (r0, r1);
0x00001f00 movs r0, 1 | r0 = 1;
0x00001f02 blx 0x1a28 | mmap (r0, r1, r2, r3, r4, r5)
0x00001f06 ldr r3, [pc, 0x3d8] |
0x00001f08 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00001f0a ldr r3, [r3] | r3 = *(0x22e2);
0x00001f0c str r3, [sp, 0xf0] | *(arg_f0h) = r3;
0x00001f0e b 0x1d4c | goto label_0;
0x00001f10 movs r2, 2 | r2 = 2;
0x00001f12 movs r3, 1 | r3 = 1;
0x00001f14 str r2, [sp, 0xd0] | *(arg_d0h) = r2;
0x00001f16 strb.w r3, [sp, 0xda] | *(arg_dah) = r3;
0x00001f1a b 0x1d4c | goto label_0;
0x00001f1c ldr r3, [pc, 0x3c0] | r3 = *(0x22e0);
0x00001f1e ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00001f20 ldr.w sl, [r3] | sl = *(0x22e0);
0x00001f24 b 0x1d4c | goto label_0;
0x00001f26 movs r3, 2 | r3 = 2;
0x00001f28 str r3, [sp, 0xd0] | *(arg_d0h) = r3;
0x00001f2a b 0x1d4c | goto label_0;
0x00001f2c strb.w fp, [sp, 0xd9] | *(arg_d9h) = fp;
0x00001f30 b 0x1d4c | goto label_0;
0x00001f32 ldr r3, [pc, 0x3ac] | r3 = *(0x22e2);
0x00001f34 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00001f36 ldr r5, [r3] | r5 = *(0x22e2);
0x00001f38 b 0x1d4c | goto label_0;
| label_15:
0x00001f3a ldr r3, [pc, 0x3a8] |
0x00001f3c movs r2, 0x11 | r2 = 0x11;
0x00001f3e ldr r0, [pc, 0x3b0] |
0x00001f40 movs r1, 1 | r1 = 1;
0x00001f42 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00001f44 add r0, pc | r0 = 0x423a;
0x00001f46 ldr r3, [r3] | r3 = *(0x22e6);
0x00001f48 blx 0x1910 | fcn_00001910 ();
0x00001f4c mov r0, r4 | r0 = r4;
0x00001f4e blx 0x1a28 | mmap (r0, r1, r2, r3, r4, r5)
| label_22:
0x00001f52 ldr r1, [pc, 0x3a0] |
0x00001f54 mov r2, r5 | r2 = r5;
0x00001f56 ldr r0, [pc, 0x3a0] |
0x00001f58 add r1, pc | r1 = 0x4252;
0x00001f5a add r0, pc | r0 = 0x4258;
0x00001f5c bl 0x40f0 | fcn_000040f0 (r0);
| label_18:
0x00001f60 mvn r2, 0x13 | r2 = ~0x13;
0x00001f64 mov r1, r5 | r1 = r5;
0x00001f66 mov r0, r5 | r0 = r5;
0x00001f68 blx 0x1970 | fcn_00001970 ();
0x00001f6c adds r0, 1 | r0++;
| if (r0 == 1) {
0x00001f6e beq.w 0x2220 | goto label_23;
| }
| label_9:
0x00001f72 bl 0x5ae0 | fcn_00005ae0 ();
0x00001f76 ldrb.w r3, [sp, 0xd9] | r3 = *(arg_d9h);
0x00001f7a cmp r3, 0 |
| if (r3 == 0) {
0x00001f7c beq.w 0x21fa | goto label_24;
| }
0x00001f80 ldr r3, [pc, 0x378] |
0x00001f82 movw r2, 0x3a98 | r2 = 0x3a98;
0x00001f86 add r3, pc | r3 = 0x4286;
0x00001f88 str r2, [r3, 8] | *((r3 + 8)) = r2;
| label_8:
0x00001f8a movs r1, 1 | r1 = 1;
0x00001f8c add r3, sp, 0x18 | r3 += arg_18h;
0x00001f8e movt r1, 8 | r1 = (r1 & 0xFFFF) | 0x80000;
0x00001f92 movs r2, 0 | r2 = 0;
0x00001f94 movs r0, 1 | r0 = 1;
0x00001f96 blx 0x18a0 | fcn_000018a0 ();
0x00001f9a adds r0, 1 | r0++;
| if (r0 == 1) {
0x00001f9c beq.w 0x223a | goto label_25;
| }
0x00001fa0 ldr r4, [pc, 0x35c] |
0x00001fa2 movs r0, 0x11 | r0 = 0x11;
0x00001fa4 ldr.w r8, [pc, 0x35c] | r8 = *(0x00002304);
0x00001fa8 add r4, pc | r4 = 0x42ac;
0x00001faa mov r1, r4 | r1 = r4;
0x00001fac add r8, pc | r8 += pc;
0x00001fae blx 0x1814 | fcn_00001814 ();
0x00001fb2 ldr r0, [pc, 0x354] |
0x00001fb4 ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [arg_10h]");
0x00001fb8 ldr r1, [sp, 0x1c] | r1 = *(arg_1ch);
0x00001fba add r0, pc | r0 = 0x42c8;
0x00001fbc bl 0x869c | fcn_0000869c (r0, r1, r2, r3);
0x00001fc0 ldr r0, [pc, 0x348] |
0x00001fc2 add r0, pc |
0x00001fc4 bl 0x3d10 | r0 = fcn_00003d10 (r0);
0x00001fc8 bl 0x6290 | fcn_00006290 ();
0x00001fcc mov r1, r4 | r1 = r4;
0x00001fce movs r0, 0xf | r0 = 0xf;
0x00001fd0 blx 0x1814 | fcn_00001814 ();
0x00001fd4 mov r1, r4 | r1 = r4;
0x00001fd6 movs r0, 2 | r0 = 2;
0x00001fd8 blx 0x1814 | fcn_00001814 ();
0x00001fdc mov r1, r4 | r1 = r4;
0x00001fde movs r0, 1 | r0 = 1;
0x00001fe0 blx 0x1814 | fcn_00001814 ();
0x00001fe4 bl 0x3264 | fcn_00003264 ();
0x00001fe8 movs r0, 0x28 |
0x00001fea movt r0, 1 | r0 = 0x142d2;
0x00001fee blx 0x198c | strftime (r0, r1, r2, r3);
0x00001ff2 str.w r0, [r8, 0xc] | __asm ("str.w r0, [r8, 0xc]");
0x00001ff6 cmp r0, 0 |
| if (r0 == 0) {
0x00001ff8 beq.w 0x2236 | goto label_26;
| }
0x00001ffc ldr r1, [sp, 0x18] | r1 = *(arg_18h);
0x00001ffe bl 0x89b0 | fcn_000089b0 (r0, r1);
0x00002002 ldr r2, [pc, 0x30c] | r2 = *(0x2312);
0x00002004 ldr.w r3, [r8] | r3 = *(r8);
0x00002008 ldr r2, [r6, r2] | r2 = *((r6 + r2));
0x0000200a mov r1, r2 | r1 = r2;
0x0000200c str r2, [sp] | *(sp) = r2;
0x0000200e movs r2, 0 | r2 = 0;
0x00002010 str r2, [r1] | *(r1) = r2;
0x00002012 cmp r3, 0 |
| if (r3 != 0) {
0x00002014 bne 0x2104 | goto label_27;
| }
0x00002016 ldr r3, [pc, 0x2fc] |
0x00002018 ldr.w r8, [pc, 0x2fc] | r8 = *(0x00002318);
0x0000201c add r3, pc | r3 = 0x4336;
0x0000201e str r3, [sp, 4] | var_4h = r3;
0x00002020 add r8, pc | r8 += pc;
0x00002022 ldr r3, [pc, 0x2f8] |
0x00002024 add r3, pc | r3 = 0x4346;
0x00002026 str r3, [sp, 0xc] | *(arg_ch) = r3;
| label_1:
0x00002028 ldr r3, [sp] | r3 = *(sp);
0x0000202a ldr r4, [r3] | r4 = *(r3);
0x0000202c adds r4, 1 | r4++;
0x0000202e cmp r4, r7 |
| if (r4 >= r7) {
0x00002030 bls 0x2046 |
0x00002032 mov r0, r5 | r0 = r5;
0x00002034 movs r2, 8 | r2 = 8;
0x00002036 mov r1, r4 | r1 = r4;
0x00002038 blx 0x1794 | free (r0);
0x0000203a sub.w r6, ip, r5, lsl 16 | r6 = ip - (r5 << 16);
0x0000203e cmp r0, 0 |
| if (r0 == 0) {
0x00002040 beq.w 0x224c | goto label_28;
| }
0x00002044 mov r7, r4 | r7 = r4;
| }
0x00002046 lsls r2, r7, 3 | r2 = r7 << 3;
0x00002048 movs r1, 0 | r1 = 0;
0x0000204a mov r0, r5 | r0 = r5;
0x0000204c blx 0x1adc | fprintf_chk ();
0x00002050 ldr.w r3, [r8, 0xc] | r3 = *((r8 + 0xc));
0x00002054 movs r4, 1 | r4 = 1;
0x00002056 add.w r3, r3, 0x10000 | r3 += 0x10000;
0x0000205a ldr r3, [r3, 0x20] | r3 = *((r3 + 0x20));
0x0000205c strh r4, [r5, 4] | *((r5 + 4)) = r4;
0x0000205e str r3, [r5] | *(r5) = r3;
0x00002060 ldr.w r3, [r8, 0xc] | r3 = *((r8 + 0xc));
0x00002064 add.w r3, r3, 0x10000 | r3 += 0x10000;
0x00002068 ldr r3, [r3, 0x18] | r3 = *((r3 + 0x18));
0x0000206a cmp r3, 0 |
0x0000206c ite ne |
| if (r3 == 0) {
0x0000206e movne r3, 5 | r3 = 5;
| }
| if (r3 != 0) {
0x00002070 moveq r3, r4 | r3 = r4;
| }
0x00002072 strh r3, [r5, 4] | *((r5 + 4)) = r3;
0x00002074 ldr r3, [pc, 0x2a8] |
0x00002076 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00002078 ldr r3, [r3] |
0x0000207a ldr r3, [r3, 0x20] | r3 = *(0x2340);
| if (r3 == 0) {
0x0000207c cbz r3, 0x2094 | goto label_29;
| }
0x0000207e adds r0, r5, 4 | r0 = r5 + 4;
0x00002080 mov r1, r4 | r1 = r4;
| do {
0x00002082 ldr r2, [r3, 0x28] | r2 = *((r3 + 0x28));
0x00002084 str.w r2, [r5, r4, lsl 3] | __asm ("str.w r2, [r5, r4, lsl 3]");
0x00002088 strh.w r1, [r0, r4, lsl 3] | offset_0 = r4 << 3;
| *((r0 + offset_0)) = r1;
0x0000208c adds r4, 1 | r4++;
0x0000208e ldr r3, [r3] | r3 = *(r3);
0x00002090 cmp r3, 0 |
0x00002092 bne 0x2082 |
| } while (r3 != 0);
| label_29:
0x00002094 ldr r3, [sp, 4] | r3 = var_4h;
0x00002096 mov r1, r4 | r1 = r4;
0x00002098 mov r0, r5 | r0 = r5;
0x0000209a ldr r2, [r3, 8] | r2 = *((r3 + 8));
0x0000209c blx 0x18ec | r0 = fcn_000018ec ();
0x000020a0 cmp.w r0, -1 |
0x000020a4 mov fp, r0 |
| if (r0 == -1) {
0x000020a6 beq 0x217c | goto label_30;
| }
0x000020a8 cmp r0, 0 |
| if (r0 <= 0) {
0x000020aa ble 0x20f0 | goto label_3;
| }
0x000020ac ldrh r2, [r5, 6] | r2 = *((r5 + 6));
0x000020ae lsls r1, r2, 0x1d | r1 = r2 << 0x1d;
| if (r1 < r2) {
0x000020b0 bmi.w 0x21bc | goto label_31;
| }
| label_6:
0x000020b4 lsls r3, r2, 0x1f | r3 = r2 << 0x1f;
| if (r3 < r2) {
0x000020b6 bmi 0x21a2 | goto label_32;
| }
| label_5:
0x000020b8 cmp.w fp, 0 |
0x000020bc it gt |
| if (fp > 0) {
0x000020be cmpgt r4, 1 | __asm ("cmpgt r4, 1");
| }
| if (fp <= 0) {
0x000020c0 ble 0x20f0 | goto label_3;
| }
0x000020c2 add.w sb, r5, 8 | sb = r5 + 8;
0x000020c6 mov.w sl, 1 | sl = 1;
| do {
0x000020ca mov r0, sb | r0 = sb;
0x000020cc add.w sl, sl, 1 | sl++;
0x000020d0 bl 0x3278 | r0 = fcn_00003278 ();
0x000020d4 sub.w fp, fp, r0 |
0x000020d8 add.w sb, sb, 8 | sb += 8;
0x000020dc cmp.w fp, 0 |
0x000020e0 ite le |
| if (fp > 0) {
0x000020e2 movle r3, 0 | r3 = 0;
| }
| if (fp <= 0) {
0x000020e4 movgt r3, 1 | r3 = 1;
| }
0x000020e6 cmp sl, r4 |
0x000020e8 it ge |
| if (sl < r4) {
0x000020ea movge r3, 0 | r3 = 0;
| }
0x000020ec cmp r3, 0 |
0x000020ee bne 0x20ca |
| } while (r3 != 0);
| label_3:
0x000020f0 ldr r4, [pc, 0x230] |
0x000020f2 add r4, pc | r4 = 0x441a;
0x000020f4 ldr r3, [r4, 4] | r3 = *(0x441e);
0x000020f6 cmp r3, 0 |
| if (r3 != 0) {
0x000020f8 bne 0x2198 | goto label_33;
| }
| label_4:
0x000020fa ldr r3, [pc, 0x22c] |
0x000020fc add r3, pc |
0x000020fe ldr r3, [r3] | r3 = *(0x442a);
0x00002100 cmp r3, 0 |
| if (r3 == 0) {
0x00002102 beq 0x2028 | goto label_1;
| }
| label_27:
0x00002104 movs r1, 0 | r1 = 0;
0x00002106 movs r0, 0x11 | r0 = 0x11;
0x00002108 blx 0x1814 | fcn_00001814 ();
0x0000210c ldr r3, [pc, 0x21c] |
0x0000210e add r3, pc |
0x00002110 ldr r3, [r3, 0xc] |
0x00002112 add.w r3, r3, 0x10000 | r3 = 0x1444a;
0x00002116 ldr r0, [r3, 0x20] | r0 = *(0x1446a);
0x00002118 blx 0x1c44 | getgrnam ();
0x0000211c blx 0x1a94 | r0 = bind (r0, r1, r2);
0x00002120 mov r4, r0 | r4 = r0;
| do {
| label_2:
0x00002122 movs r0, 0 | r0 = 0;
0x00002124 blx 0x18ac | fcn_000018ac ();
0x00002128 adds r0, 1 | r0++;
0x0000212a bne 0x2122 |
| } while (r0 != 1);
0x0000212c ldr r3, [r4] | r3 = *(r4);
0x0000212e cmp r3, 0xa |
0x00002130 it ne |
| if (r3 != 0xa) {
0x00002132 cmpne r3, 4 | __asm ("cmpne r3, 4");
| }
| if (r3 != 0xa) {
0x00002134 bne 0x2232 | goto label_34;
| }
0x00002136 cmp r3, 4 |
| if (r3 == 4) {
0x00002138 beq 0x2122 | goto label_2;
| }
0x0000213a ldr r4, [pc, 0x1f4] |
0x0000213c add r4, pc | r4 = 0x4472;
0x0000213e ldr r0, [r4, 0xc] |
0x00002140 add.w r0, r0, 0x10000 | r0 = 0x1447e;
0x00002144 adds r0, 0x10 | r0 += 0x10;
0x00002146 bl 0x920c | fcn_0000920c (r0);
0x0000214a ldr r0, [r4, 0xc] | r0 = *(0x447e);
0x0000214c blx 0x17a4 | fcn_000017a4 ();
0x00002150 ldr r0, [pc, 0x1e0] |
0x00002152 add r0, pc | r0 = 0x448a;
0x00002154 bl 0x3ffc | fcn_00003ffc (r0, r1);
0x00002158 ldr r0, [sp, 0xf0] | r0 = *(arg_f0h);
| if (r0 != 0) {
0x0000215a cbz r0, 0x2160 |
0x0000215c blx 0x1888 | fcn_00001888 ();
| }
0x00002160 ldr r2, [pc, 0x1d4] |
0x00002162 ldr r3, [pc, 0x140] | r3 = *(0x22a6);
0x00002164 add r2, pc | r2 = 0x44a0;
0x00002166 ldr r3, [r2, r3] | r3 = *(0x44a0);
0x00002168 ldr r2, [r3] | r2 = *(0x44a0);
0x0000216a ldr r3, [sp, 0x104] | r3 = *(arg_104h);
0x0000216c eors r2, r3 | r2 ^= r3;
0x0000216e mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x00002172 bne 0x2248 | goto label_35;
| }
0x00002174 movs r0, 0 | r0 = 0;
0x00002176 add sp, 0x10c |
0x00002178 pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_30:
0x0000217c blx 0x1a94 | r0 = bind (r0, r1, r2);
0x00002180 ldr r3, [r0] | r3 = *(r0);
0x00002182 cmp r3, 4 |
| if (r3 == 4) {
0x00002184 beq 0x20f0 | goto label_3;
| }
0x00002186 ldr r0, [pc, 0x1b4] |
0x00002188 add r0, pc | r0 = 0x44ca;
0x0000218a bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x0000218e ldr r3, [pc, 0x1b0] |
0x00002190 movs r2, 1 | r2 = 1;
0x00002192 add r3, pc | r3 = 0x44d8;
0x00002194 str r2, [r3] | *(r3) = r2;
0x00002196 b 0x20f0 | goto label_3;
| label_33:
0x00002198 bl 0x5a7c | fcn_00005a7c ();
0x0000219c movs r3, 0 | r3 = 0;
0x0000219e str r3, [r4, 4] | *((r4 + 4)) = r3;
0x000021a0 b 0x20fa | goto label_4;
| label_32:
0x000021a2 ldrd r1, r2, [sp, 0x10] | __asm ("ldrd r1, r2, [arg_10h]");
0x000021a6 add.w fp, fp, -1 |
0x000021aa ldr r0, [sp, 8] | r0 = *(arg_8h);
0x000021ac bl 0x60b4 | fcn_000060b4 (r0, r1, r2, r3, r4);
0x000021b0 adds r0, 1 | r0++;
0x000021b2 ittt eq |
| if (r0 != 1) {
0x000021b4 ldreq r3, [sp, 0xc] | r3 = *(arg_ch);
| }
| if (r0 != 1) {
0x000021b6 moveq r2, 1 | r2 = 1;
| }
| if (r0 != 1) {
0x000021b8 streq r2, [r3] | *(r3) = r2;
| }
0x000021ba b 0x20b8 | goto label_5;
| label_31:
0x000021bc ldr.w sb, [pc, 0x184] | sb = *(0x00002344);
0x000021c0 add sb, pc | sb += pc;
0x000021c2 ldr.w r0, [sb, 0xc] | r0 = *((sb + 0xc));
0x000021c6 add.w r0, r0, 0x10000 | r0 += 0x10000;
0x000021ca adds r0, 0x10 | r0 += 0x10;
0x000021cc bl 0x90b8 | r0 = fcn_000090b8 (r0, r1);
0x000021d0 cmp r0, 0 |
0x000021d2 ble 0x21d8 |
| while (r1 == 0xb) {
| label_7:
0x000021d4 ldrh r2, [r5, 6] | r2 = *((r5 + 6));
0x000021d6 b 0x20b4 | goto label_6;
0x000021d8 blx 0x1a94 | r0 = bind (r0, r1, r2);
0x000021dc ldr r1, [r0] | r1 = *(r0);
0x000021de cmp r1, 0xb |
0x000021e0 beq 0x21d4 |
| }
0x000021e2 ldr r0, [pc, 0x164] |
0x000021e4 add r0, pc | r0 = 0x4532;
0x000021e6 bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x000021ea movs r1, 1 | r1 = 1;
0x000021ec str.w r1, [sb] | __asm ("str.w r1, [sb]");
0x000021f0 b 0x21d4 | goto label_7;
| label_13:
0x000021f6 bl 0x5a20 | fcn_00005a20 ();
| label_24:
0x000021fa movs r1, 0x18 | r1 = 0x18;
0x000021fc ldr r0, [sp, 0xd0] | r0 = *(arg_d0h);
0x000021fe bl 0x3cc8 | fcn_00003cc8 (r0, r1);
0x00002202 ldr r0, [sp, 0xd4] | r0 = *(arg_d4h);
0x00002204 bl 0x3d20 | fcn_00003d20 (r0);
0x00002208 ldr r1, [sp, 0xd0] | r1 = *(arg_d0h);
0x0000220a cmp r1, 0 |
| if (r1 != 0) {
0x0000220c bne.w 0x1f8a | goto label_8;
| }
0x00002210 movs r0, 1 | r0 = 1;
0x00002212 blx 0x1958 | r0 = fcn_00001958 ();
| if (r0 == 0) {
0x00002216 cbnz r0, 0x222a |
0x00002218 ldr r0, [sp, 8] | r0 = *(arg_8h);
0x0000221a bl 0x59d8 | fcn_000059d8 (r0);
0x0000221e b 0x1f8a | goto label_8;
| label_23:
0x00002220 ldr r0, [pc, 0x128] |
0x00002222 add r0, pc | r0 = 0x4572;
0x00002224 blx 0x1b8c | fcn_00001b8c ();
0x00002228 b 0x1f72 | goto label_9;
| }
0x0000222a ldr r0, [pc, 0x124] |
0x0000222c add r0, pc | r0 = 0x4582;
0x0000222e bl 0x40b4 | fcn_000040b4 ();
| label_34:
0x00002232 ldr r0, [pc, 0x120] |
0x00002234 add r0, pc | r0 = 0x458e;
| label_26:
0x00002236 bl 0x40b4 | fcn_000040b4 ();
| label_25:
0x0000223a ldr r0, [pc, 0x11c] |
0x0000223c add r0, pc | r0 = 0x459a;
0x0000223e bl 0x40b4 | fcn_000040b4 ();
| label_14:
0x00002242 movs r0, 1 | r0 = 1;
0x00002244 blx 0x1a28 | r0 = mmap (r0, r1, r2, r3, r4, r5)
| label_35:
0x00002248 blx 0x1860 | register_atfork ();
| label_28:
0x0000224c ldr r0, [pc, 0x10c] |
0x0000224e mov r2, r4 | r2 = r4;
0x00002250 mov r1, r7 | r1 = r7;
0x00002252 add r0, pc | r0 = 0x45b2;
0x00002254 bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00002258 ldr r0, [pc, 0x104] |
0x0000225a add r0, pc | r0 = 0x45be;
0x0000225c bl 0x40f0 | fcn_000040f0 (r0);
| label_16:
0x00002260 ldr r1, [pc, 0x100] |
0x00002262 movs r0, 1 | r0 = 1;
0x00002264 add r1, pc | r1 = 0x45cc;
0x00002266 blx 0x1b4c | fcn_00001b4c ();
| label_17:
0x0000226a ldr r1, [pc, 0xfc] |
0x0000226c mov r2, r8 | r2 = r8;
0x0000226e movs r0, 1 | r0 = 1;
0x00002270 add r1, pc | r1 = 0x45de;
0x00002272 blx 0x1b4c | fcn_00001b4c ();
0x00002274 invalid |
| label_19:
0x00002276 ldr r0, [pc, 0xf4] |
0x00002278 add r0, pc | r0 = 0x45ea;
0x0000227a bl 0x40f0 | fcn_000040f0 (r0);
0x0000227e mov r1, sl | r1 = sl;
0x00002280 mov r0, r4 | r0 = r4;
0x00002282 bl 0x6800 | fcn_00006800 (r0, r1);
| label_20:
0x00002286 ldrd r2, r3, [sp, 0x10] | __asm ("ldrd r2, r3, [arg_10h]");
0x0000228a mov r1, r4 | r1 = r4;
0x0000228c ldr r0, [sp, 8] | r0 = *(arg_8h);
0x0000228e bl 0x45dc | fcn_000045dc (r0, r1, r2, r3, r4, r5, r6);
0x00002292 b 0x1e76 | goto label_10;
| label_21:
0x00002294 ldr r0, [sp, 8] | r0 = *(arg_8h);
0x00002296 mov r1, r4 | r1 = r4;
0x00002298 bl 0x5694 | fcn_00005694 (r0, r1);
0x0000229c b 0x1e76 | goto label_10;
0x000023a4 adds r0, 0x14 | r0 += 0x14;
0x000023a6 b 0x1ee8 | goto label_11;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/ntpd @ 0x40b4 */
| #include <stdint.h>
|
; (fcn) fcn.000040b4 () | void fcn_000040b4 () {
| int16_t var_0h_3;
| int16_t var_4h_4;
| int16_t var_10h_4;
| int16_t var_38h;
0x000040b4 push {r0, r1, r2, r3} |
0x000040b6 ldr r2, [pc, 0x30] |
0x000040b8 ldr r3, [pc, 0x30] | r3 = *(0x40ec);
0x000040ba push {lr} |
0x000040bc sub sp, 0xc |
0x000040be add r2, pc | r2 = 0x81ac;
0x000040c0 add r4, sp, 0x10 | r4 += var_10h_4;
0x000040c2 ldr r3, [r2, r3] |
0x000040c4 ldr r5, [r4], 4 | r5 = *(r4);
| r4 += 4;
0x000040c8 ldr r3, [r3] | r3 = *(0x81ac);
0x000040ca str r3, [sp, 4] | var_4h_4 = r3;
0x000040cc mov.w r3, 0 | r3 = 0;
0x000040d0 str r4, [sp] | *(sp) = r4;
0x000040d2 blx 0x1a94 | bind (r0, r1, r2);
0x000040d6 mov r2, r4 | r2 = r4;
0x000040d8 ldr r0, [r0] | r0 = *(r0);
0x000040da mov r1, r5 | r1 = r5;
0x000040dc bl 0x3e54 | fcn_00003e54 (r0, r1, r2);
0x000040e0 movs r0, 1 | r0 = 1;
0x000040e2 blx 0x1a28 | mmap (r0, r1, r2, r3, r4, r5)
0x000040e6 nop |
0x000040e8 ldr r5, [sp, 0x38] | r5 = var_38h;
0x000040ea movs r1, r0 | r1 = r0;
0x000040ec lsls r0, r7, 7 | r0 = r7 << 7;
0x000040ee movs r0, r0 |
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/ntpd @ 0x40f0 */
| #include <stdint.h>
|
; (fcn) fcn.000040f0 () | void fcn_000040f0 (int16_t arg_348h) {
| int16_t var_0h_4;
| int16_t var_4h_5;
| int16_t var_10h_5;
0x000040f0 invalid |
0x000040f4 push {r0, r1, r2, r3} |
0x000040f6 movs r0, 0 | r0 = 0;
0x000040f8 ldr r3, [pc, 0x28] |
0x000040fa add ip, pc |
0x000040fc push {lr} |
0x000040fe sub sp, 0xc |
0x00004100 add r2, sp, 0x10 | r2 += var_10h_5;
0x00004102 ldr.w r3, [ip, r3] | r3 = *((ip + r3));
0x00004106 ldr r1, [r2], 4 | r1 = *(r2);
| r2 += 4;
0x0000410a ldr r3, [r3] | r3 = *(0x4124);
0x0000410c str r3, [sp, 4] | var_4h_5 = r3;
0x0000410e mov.w r3, 0 | r3 = 0;
0x00004112 str r2, [sp] | *(sp) = r2;
0x00004114 bl 0x3e54 | fcn_00003e54 (r0, r1, r2);
0x00004116 cdp2 p0, 9, c2, c14, c1, 0 | __asm ("cdp2 p0, 9, c2, c14, c1, 0");
0x0000411a blx 0x1a28 | mmap (r0, r1, r2, r3, r4, r5)
0x0000411e nop |
0x00004120 ldr r4, [sp, 0x348] | r4 = *(arg_348h);
0x00004122 movs r1, r0 | r1 = r0;
0x00004124 lsls r0, r7, 7 | r0 = r7 << 7;
0x00004126 movs r0, r0 |
0x00004128 cmp r0, 0xe |
| if (r0 != 0xe) {
0x0000412a beq 0x4136 |
0x0000412c cmp r0, 0xf |
| if (r0 == 0xf) {
0x0000412e beq 0x4140 | goto label_0;
| }
0x00004130 cmp r0, 2 |
| if (r0 == 2) {
0x00004132 beq 0x4140 | goto label_0;
| }
0x00004134 bx lr | return;
| }
0x00004136 ldr r3, [pc, 0x14] |
0x00004138 movs r2, 1 | r2 = 1;
0x0000413a add r3, pc | r3 = 0x828c;
0x0000413c str r2, [r3, 8] | *((r3 + 8)) = r2;
0x0000413e bx lr | return;
| label_0:
0x00004140 ldr r3, [pc, 0xc] |
0x00004142 movs r2, 1 | r2 = 1;
0x00004144 add r3, pc | r3 = 0x8298;
0x00004146 str r2, [r3] | *(r3) = r2;
0x00004148 str r2, [r3, 4] | *((r3 + 4)) = r2;
0x0000414a bx lr | return;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/ntpd @ 0x45dc */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000045dc () | void fcn_000045dc (int16_t arg_0h, int16_t arg_4h, int16_t arg_6h, int16_t arg_8h, int16_t arg_ch, int16_t arg_eh, int16_t arg_10h, int16_t arg_14h, int16_t arg_16h, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4) {
| int16_t var_4h;
| void * ptr;
| int16_t var_ch;
| int16_t var_10h;
| int16_t var_14h;
| int16_t var_18h;
| int16_t var_1ch;
| int16_t var_20h;
| int16_t var_24h;
| int16_t var_28h;
| int16_t var_2ch;
| int16_t var_30h;
| int16_t var_34h;
| int16_t var_38h;
| int16_t var_3ch;
| int16_t var_40h;
| int16_t var_50h;
| int16_t var_58h;
| int16_t var_9ch;
| int16_t var_a0h;
| int16_t var_a4h;
| r0 = arg1;
| r1 = arg2;
| r2 = arg3;
| r3 = arg4;
0x000045dc push.w {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000045e0 mov r7, r2 | r7 = r2;
0x000045e2 ldr.w r2, [pc, 0x97c] | r2 = *(0x00004f60);
0x000045e6 mov r4, r3 | r4 = r3;
0x000045e8 sub sp, 0xac |
0x000045ea mov r6, r1 | r6 = r1;
0x000045ec ldr.w r3, [pc, 0x974] |
0x000045f0 movs r1, 1 | r1 = 1;
0x000045f2 add r2, pc | r2 += pc;
0x000045f4 ldr.w r8, [pc, 0x970] | r8 = *(0x00004f68);
0x000045f8 mov r5, r0 | r5 = r0;
0x000045fa movt r1, 8 | r1 = (r1 & 0xFFFF) | 0x80000;
0x000045fe ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x00004600 movs r0, 1 | r0 = 1;
0x00004602 movs r2, 0 | r2 = 0;
0x00004604 add r8, pc | r8 += pc;
0x00004606 ldr r3, [r3] | r3 = *(0x4f64);
0x00004608 str r3, [sp, 0xa4] | var_a4h = r3;
0x0000460a mov.w r3, 0 | r3 = 0;
0x0000460e add r3, sp, 0x9c | r3 += var_9ch;
0x00004610 blx 0x18a0 | fcn_000018a0 ();
0x00004614 adds r0, 1 | r0++;
| if (r0 == 1) {
0x00004616 beq 0x46a6 | goto label_26;
| }
0x00004618 ldr.w r0, [pc, 0x950] |
0x0000461c mov r3, r4 | r3 = r4;
0x0000461e ldr r1, [sp, 0xa0] | r1 = var_a0h;
0x00004620 mov r2, r7 | r2 = r7;
0x00004622 add r0, pc | r0 = 0x9592;
0x00004624 bl 0x869c | fcn_0000869c (r0, r1, r2, r3);
0x00004628 ldrb.w r3, [r5, 0xb9] | r3 = *((r5 + 0xb9));
| if (r3 == 0) {
0x0000462c cbz r3, 0x4636 | goto label_27;
| }
0x0000462e ldr.w r0, [r5, 0xb0] | r0 = *((r5 + 0xb0));
0x00004632 cmp r0, 0 |
0x00004634 beq 0x46ba |
| while (r0 != 1) {
| label_27:
0x00004636 ldr.w r4, [pc, 0x938] |
0x0000463a add r4, pc | r4 = 0x95b0;
0x0000463c mov r0, r4 | r0 = r4;
0x0000463e bl 0x3d10 | fcn_00003d10 (r0);
0x00004642 ldr.w r1, [pc, 0x930] |
0x00004646 mov r0, r4 | r0 = r4;
0x00004648 add r1, pc | r1 = 0x95c2;
0x0000464a blx 0x1aa0 | r0 = fcntl ();
0x0000464e mov r7, r0 | r7 = r0;
| if (r0 != 0) {
0x00004650 cbz r0, 0x46b0 |
0x00004652 ldr.w r0, [pc, 0x924] |
0x00004656 add r0, pc | r0 = 0x95d4;
0x00004658 bl 0x3380 | r0 = fcn_00003380 (r0, r1, r2);
0x0000465c adds r3, r0, 1 | r3 = r0 + 1;
0x0000465e mov r4, r0 | r4 = r0;
| if (r3 == r0) {
0x00004660 beq 0x46dc | goto label_28;
| }
0x00004662 bl 0x3288 | fcn_00003288 (r0);
0x00004666 adds r0, 1 | r0++;
| if (r0 == 1) {
0x00004668 beq 0x46d2 | goto label_29;
| }
0x0000466a ldr.w r0, [pc, 0x910] |
0x0000466e movs r2, 0 | r2 = 0;
0x00004670 movs r1, 2 | r1 = 2;
0x00004672 add r0, pc | r0 = 0x95f4;
0x00004674 blx 0x19f8 | r0 = getpid ();
0x00004678 cmp.w r0, -1 |
0x0000467c mov sb, r0 | sb = r0;
| if (r0 == -1) {
0x0000467e beq 0x46e6 | goto label_1;
| }
0x00004680 ldr r0, [r6, 0x14] | r0 = *((r6 + 0x14));
0x00004682 add r1, sp, 0x40 | r1 += var_40h;
0x00004684 blx 0x19ec | ctype_b_loc ();
0x00004688 adds r0, 1 | r0++;
| if (r0 == 1) {
0x0000468a beq 0x46ec | goto label_30;
| }
0x0000468c ldr r2, [sp, 0x50] | r2 = var_50h;
0x0000468e ldr r3, [sp, 0x58] | r3 = var_58h;
0x00004690 ldr r1, [r6, 0x14] | r1 = *((r6 + 0x14));
0x00004692 and r0, r2, 0x12 | r0 = r2 & 0x12;
0x00004696 orrs r3, r0 | r3 |= r0;
0x00004698 str r3, [sp, 4] | var_4h = r3;
| if (r3 == r0) {
0x0000469a beq 0x46f8 | goto label_31;
| }
0x0000469c ldr.w r0, [pc, 0x8e0] |
0x000046a0 add r0, pc | r0 = 0x9624;
0x000046a2 bl 0x40f0 | fcn_000040f0 (r0);
| label_26:
0x000046a6 ldr.w r0, [pc, 0x8dc] |
0x000046aa add r0, pc | r0 = 0x9634;
0x000046ac bl 0x40b4 | fcn_000040b4 ();
| }
0x000046b0 ldr.w r0, [pc, 0x8d4] |
0x000046b4 add r0, pc | r0 = 0x9640;
0x000046b6 bl 0x40b4 | fcn_000040b4 ();
0x000046ba movs r1, 0x18 | r1 = 0x18;
0x000046bc bl 0x3cc8 | r0 = fcn_00003cc8 (r0, r1);
0x000046c0 blx 0x1a40 | getopt (r0, r1, r2);
0x000046c4 adds r0, 1 | r0++;
0x000046c6 bne 0x4636 |
| }
0x000046c8 ldr.w r0, [pc, 0x8c0] |
0x000046cc add r0, pc | r0 = 0x965c;
0x000046ce bl 0x40b4 | fcn_000040b4 ();
| label_29:
0x000046d2 ldr.w r0, [pc, 0x8bc] |
0x000046d6 add r0, pc | r0 = 0x966c;
0x000046d8 bl 0x40f0 | fcn_000040f0 (r0);
| label_28:
0x000046dc ldr.w r0, [pc, 0x8b4] |
0x000046e0 add r0, pc | r0 = 0x9678;
0x000046e2 bl 0x40f0 | fcn_000040f0 (r0);
| label_1:
0x000046e6 movs r0, 0 | r0 = 0;
0x000046e8 bl 0x40b4 | fcn_000040b4 ();
| label_30:
0x000046ec ldr.w r0, [pc, 0x8a8] |
0x000046f0 ldr r1, [r6, 0x14] | r1 = *((r6 + 0x14));
0x000046f2 add r0, pc | r0 = 0x968e;
0x000046f4 bl 0x40b4 | fcn_000040b4 ();
| label_31:
0x000046f8 mov r0, r1 | r0 = r1;
0x000046fa blx 0x1940 | fcn_00001940 ();
0x000046fe adds r0, 1 | r0++;
| if (r0 == 1) {
0x00004700 beq 0x475c | goto label_32;
| }
0x00004702 ldr.w r0, [pc, 0x898] |
0x00004706 add r0, pc | r0 = 0x96a8;
0x00004708 blx 0x18b8 | fcn_000018b8 ();
0x0000470c adds r0, 1 | r0++;
| if (r0 == 1) {
0x0000470e beq 0x4780 | goto label_33;
| }
0x00004710 ldr.w r3, [r5, 0xb0] | r3 = *((r5 + 0xb0));
0x00004714 cbz r3, 0x4766 |
| while (1) {
0x00004716 mov r0, sb | r0 = sb;
0x00004718 ldr.w sb, [pc, 0x884] | sb = *(0x00004fa0);
0x0000471c blx 0x1c44 | getgrnam ();
0x00004720 ldr.w r0, [pc, 0x880] |
0x00004724 add sb, pc | sb += pc;
0x00004726 add r0, pc | r0 = 0x96ce;
0x00004728 bl 0x9d1c | fcn_00009d1c (r0, r1, r2);
0x0000472c mov r1, r5 | r1 = r5;
0x0000472e mov r0, r7 | r0 = r7;
0x00004730 add r2, sp, 0x30 | r2 += var_30h;
0x00004732 str.w r5, [sb, 0x10] | __asm ("str.w r5, [sb, 0x10]");
0x00004736 bl 0x7e40 | fcn_00007e40 (r0, r1, r2);
0x0000473a add.w r1, r6, 0xc | r1 = r6 + 0xc;
0x0000473c lsls r4, r1, 4 | r4 = r1 << 4;
0x0000473e movs r0, 1 | r0 = 1;
0x00004740 blx 0x1904 | r0 = fcn_00001904 ();
| if (r0 == 0) {
0x00004744 cbnz r0, 0x4752 |
0x00004746 ldr r2, [r6, 0xc] | r2 = *((r6 + 0xc));
0x00004748 mov r1, r2 | r1 = r2;
0x0000474a mov r0, r2 | r0 = r2;
0x0000474c blx 0x1c50 | r0 = snprintf_chk ();
| if (r0 == 0) {
0x00004750 cbz r0, 0x478a | goto label_34;
| }
| }
| label_0:
0x00004752 ldr.w r0, [pc, 0x854] |
0x00004756 add r0, pc | r0 = 0x9704;
0x00004758 bl 0x40b4 | fcn_000040b4 ();
| label_32:
0x0000475c ldr.w r0, [pc, 0x84c] |
0x00004760 add r0, pc | r0 = 0x9710;
0x00004762 bl 0x40b4 | fcn_000040b4 ();
0x00004766 ldr r1, [sp, 4] | r1 = var_4h;
0x00004768 mov r0, sb | r0 = sb;
0x0000476a blx 0x1894 | fcn_00001894 ();
0x0000476e movs r1, 1 | r1 = 1;
0x00004770 mov r0, sb | r0 = sb;
0x00004772 blx 0x1894 | fcn_00001894 ();
0x00004776 movs r1, 2 | r1 = 2;
0x00004778 mov r0, sb | r0 = sb;
0x0000477a blx 0x1894 | fcn_00001894 ();
0x0000477e b 0x4716 |
| }
| label_33:
0x00004780 ldr.w r0, [pc, 0x82c] |
0x00004784 add r0, pc | r0 = 0x9738;
0x00004786 bl 0x40b4 | fcn_000040b4 ();
| label_34:
0x0000478a ldr r2, [r6, 8] | r2 = *((r6 + 8));
0x0000478c mov r1, r2 | r1 = r2;
0x0000478e mov r0, r2 | r0 = r2;
0x00004790 blx 0x1ba4 | fcn_00001ba4 ();
0x00004794 str r0, [sp, 0x14] | var_14h = r0;
0x00004796 cmp r0, 0 |
| if (r0 != 0) {
0x00004798 bne 0x4752 | goto label_0;
| }
0x0000479a ldr.w r5, [pc, 0x818] | r5 = *(0x00004fb4);
0x0000479e blx 0x1c5c | fcn_00001c5c ();
0x000047a2 movs r0, 0xf | r0 = 0xf;
0x000047a4 add r5, pc | r5 += pc;
0x000047a6 mov r1, r5 | r1 = r5;
0x000047a8 blx 0x1814 | fcn_00001814 ();
0x000047ac mov r1, r5 | r1 = r5;
0x000047ae movs r0, 2 | r0 = 2;
0x000047b0 blx 0x1814 | fcn_00001814 ();
0x000047b4 movs r1, 1 | r1 = 1;
0x000047b6 movs r0, 0xd | r0 = 0xd;
0x000047b8 blx 0x1814 | fcn_00001814 ();
0x000047bc movs r1, 1 | r1 = 1;
0x000047be mov r0, r1 | r0 = r1;
0x000047c0 blx 0x1814 | fcn_00001814 ();
0x000047c4 ldr r1, [sp, 0x14] | r1 = var_14h;
0x000047c6 movs r0, 0x11 | r0 = 0x11;
0x000047c8 blx 0x1814 | fcn_00001814 ();
0x000047cc ldr.w r2, [sb, 0x10] | r2 = *((sb + 0x10));
0x000047d0 ldrb.w r3, [r2, 0xd5] | r3 = *((r2 + 0xd5));
0x000047d4 cmp r3, 1 |
| if (r3 == 1) {
0x000047d6 beq.w 0x4f18 | goto label_35;
| }
| label_24:
0x000047da ldr.w r5, [pc, 0x7dc] | r5 = *(0x00004fb8);
0x000047de movs r0, 0x28 |
0x000047e0 movt r0, 1 | r0 = 0x10028;
0x000047e4 blx 0x198c | strftime (r0, r1, r2, r3);
0x000047e8 add r5, pc | r5 += pc;
0x000047ea str r0, [r5, 0xc] | *((r5 + 0xc)) = r0;
0x000047ec cmp r0, 0 |
| if (r0 == 0) {
0x000047ee beq.w 0x46e6 | goto label_1;
| }
0x000047f2 movs r1, 3 | r1 = 3;
0x000047f4 bl 0x89b0 | fcn_000089b0 (r0, r1);
0x000047f8 movs r0, 0x28 |
0x000047fa movt r0, 1 | r0 = 0x10028;
0x000047fe blx 0x198c | strftime (r0, r1, r2, r3);
0x00004802 str r0, [r5, 0x14] | *((r5 + 0x14)) = r0;
0x00004804 cmp r0, 0 |
| if (r0 == 0) {
0x00004806 beq.w 0x46e6 | goto label_1;
| }
0x0000480a ldr r1, [sp, 0x9c] | r1 = var_9ch;
0x0000480c bl 0x89b0 | fcn_000089b0 (r0, r1);
0x00004810 ldr.w r3, [pc, 0x7a8] | r3 = *(0x4fbc);
0x00004814 ldr r6, [r5, 0x10] | r6 = *((r5 + 0x10));
0x00004816 ldr.w r8, [r8, r3] | r8 = *((r8 + r3));
0x0000481a movs r3, 0 | r3 = 0;
0x0000481c str.w r3, [r6, 0xc0] | __asm ("str.w r3, [r6, 0xc0]");
0x00004820 str.w r3, [r8] | __asm ("str.w r3, [r8]");
0x00004824 bl 0x8480 | fcn_00008480 ();
0x00004828 ldr r3, [r5, 0x10] | r3 = *((r5 + 0x10));
0x0000482a str.w r0, [r6, 0xbc] | __asm ("str.w r0, [r6, 0xbc]");
0x0000482e ldr r5, [r3, 0x20] | r5 = *(0x4fdc);
| if (r5 == 0) {
| do {
0x00004830 cbz r5, 0x4846 | goto label_36;
| }
0x00004832 mov r0, r5 | r0 = r5;
0x00004834 bl 0x3248 | fcn_00003248 ();
0x00004838 ldr.w r3, [r8] | r3 = *(r8);
0x0000483c add r3, r0 | r3 += r0;
0x0000483e str.w r3, [r8] | __asm ("str.w r3, [r8]");
0x00004842 ldr r5, [r5] | r5 = *(r5);
0x00004844 b 0x4830 |
| } while (1);
| label_36:
0x00004846 ldr.w r3, [pc, 0x778] | r3 = *(0x00004fc0);
0x0000484a add r3, pc | r3 += pc;
0x0000484c ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x0000484e ldr r5, [r3, 8] | r5 = *((r3 + 8));
| if (r5 == 0) {
| do {
0x00004850 cbz r5, 0x485c | goto label_37;
| }
0x00004852 mov r0, r5 | r0 = r5;
0x00004854 bl 0x24ec | fcn_000024ec (r0);
0x00004858 ldr r5, [r5] | r5 = *(r5);
0x0000485a b 0x4850 |
| } while (1);
| label_37:
0x0000485c ldr.w r3, [pc, 0x764] | r3 = *(0x00004fc4);
0x00004860 movs r2, 0x28 | r2 = 0x28;
0x00004862 mov r1, r5 | r1 = r5;
0x00004864 add r3, pc | r3 += pc;
0x00004866 ldr r6, [r3, 0x10] | r6 = *((r3 + 0x10));
0x00004868 adds r0, r6, r2 | r0 = r6 + r2;
0x0000486a blx 0x1adc | fprintf_chk ();
0x0000486e movs r3, 0 | r3 = 0;
0x00004870 movs r2, 0 | r2 = 0;
0x00004872 strd r2, r3, [r6, 0x58] | __asm ("strd r2, r3, [r6, 0x58]");
0x00004876 add r1, sp, 0x38 | r1 += var_38h;
0x00004878 strd r2, r3, [r6, 0x68] | __asm ("strd r2, r3, [r6, 0x68]");
0x0000487c mov r0, r5 | r0 = r5;
0x0000487e strd r2, r3, [r6, 0x70] | __asm ("strd r2, r3, [r6, 0x70]");
0x00004882 strd r2, r3, [r6, 0x60] | __asm ("strd r2, r3, [r6, 0x60]");
0x00004886 strd r2, r3, [r6, 0x50] | __asm ("strd r2, r3, [r6, 0x50]");
0x0000488a strd r5, r5, [r6, 0x78] | __asm ("strd r5, r5, [r6, 0x78]");
0x0000488e blx 0x1ad0 | printf_chk ();
0x00004892 mov.w r0, 0xca00 | r0 = 0xca00;
0x00004896 ldr r1, [sp, 0x3c] | r1 = var_3ch;
0x00004898 movt r0, 0x3b9a | r0 = (r0 & 0xFFFF) | 0x3b9a0000;
0x0000489c bl 0xac60 | r0 = fcn_0000ac60 (r0, r1);
0x000048a0 mov r3, r0 | r3 = r0;
0x000048a2 b 0x48a8 |
| while (r3 > 1) {
0x000048a4 asrs r3, r3, 1 | r3 >>= 1;
0x000048a6 subs r5, 1 | r5--;
0x000048a8 cmp r3, 1 |
0x000048aa bgt 0x48a4 |
| }
0x000048ac ldr.w r6, [pc, 0x718] | r6 = *(0x00004fc8);
0x000048b0 movs r2, 1 | r2 = 1;
0x000048b2 movs r7, 0 | r7 = 0;
0x000048b4 add r6, pc | r6 += pc;
0x000048b6 ldr r3, [r6, 0x10] | r3 = *((r6 + 0x10));
0x000048b8 str.w r2, [r3, 0xac] | __asm ("str.w r2, [r3, 0xac]");
0x000048bc strb.w r5, [r3, 0x4a] | *((r3 + 0x4a)) = r5;
0x000048c0 mov r3, r6 | r3 = r6;
0x000048c2 str r7, [r3, 0x1c]! | *((r3 += 0x1c)) = r7;
0x000048c6 str r3, [r6, 0x20] | *((r6 + 0x20)) = r3;
0x000048c8 bl 0x7e28 | fcn_00007e28 ();
0x000048cc ldr.w r0, [pc, 0x6fc] |
0x000048d0 add r0, pc | r0 = 0x98a0;
0x000048d2 bl 0x3ffc | fcn_00003ffc (r0, r1);
0x000048d6 ldr r3, [r6, 0x10] | r3 = *((r6 + 0x10));
0x000048d8 ldr.w r2, [pc, 0x6f4] | r2 = *(0x00004fd0);
0x000048dc str r7, [sp, 0x34] | var_34h = r7;
0x000048de ldr r3, [r3, 8] | r3 = *((r3 + 8));
0x000048e0 add r2, pc | r2 += pc;
0x000048e2 str r7, [r6, 0x18] | *((r6 + 0x18)) = r7;
0x000048e4 mov r1, r3 | r1 = r3;
| do {
| if (r1 == 0) {
0x000048e6 cbz r1, 0x48f2 | goto label_38;
| }
0x000048e8 ldr r3, [r2, 0x18] | r3 = *((r2 + 0x18));
0x000048ea adds r3, 1 | r3++;
0x000048ec str r3, [r2, 0x18] | *((r2 + 0x18)) = r3;
0x000048ee ldr r1, [r1] | r1 = *(r1);
0x000048f0 b 0x48e6 |
| } while (1);
| label_38:
0x000048f2 ldr.w r3, [pc, 0x6e0] | r3 = *(0x00004fd4);
0x000048f6 mov fp, r1 |
0x000048f8 str r1, [sp, 8] | ptr = r1;
0x000048fa str r1, [sp, 0xc] | var_ch = r1;
0x000048fc add r3, pc | r3 += pc;
0x000048fe str r4, [sp, 0x18] | var_18h = r4;
0x00004900 str r3, [sp, 0x10] | var_10h = r3;
0x00004902 ldr.w r3, [pc, 0x6d4] |
0x00004906 add r3, pc | r3 = 0x98e4;
0x00004908 str r3, [sp, 0x2c] | var_2ch = r3;
0x0000490a ldr.w r3, [pc, 0x6d0] |
0x0000490e add r3, pc | r3 = 0x98f0;
0x00004910 str r3, [sp, 0x1c] | var_1ch = r3;
0x00004912 ldr.w r3, [pc, 0x6cc] |
0x00004916 add r3, pc | r3 = 0x98fc;
0x00004918 str r3, [sp, 0x28] | var_28h = r3;
| label_7:
0x0000491a ldr r3, [sp, 0x10] | r3 = var_10h;
0x0000491c ldr r3, [r3] | r3 = *(r3);
0x0000491e cmp r3, 0 |
| if (r3 != 0) {
0x00004920 bne.w 0x4eb4 | goto label_39;
| }
0x00004924 ldr r2, [sp, 0x10] | r2 = var_10h;
0x00004926 ldr r3, [r2, 8] | r3 = *((r2 + 8));
| if (r3 != 0) {
0x00004928 cbz r3, 0x493c |
0x0000492a ldr r3, [r2, 0x10] | r3 = *((r2 + 0x10));
0x0000492c ldrb.w r4, [r3, 0xd4] | r4 = *((r3 + 0xd4));
| if (r4 != 0) {
0x00004930 cbnz r4, 0x493c | goto label_21;
| }
0x00004932 ldrb.w r3, [r3, 0xd5] | r3 = *((r3 + 0xd5));
0x00004936 cmp r3, 0 |
| if (r3 != 0) {
0x00004938 bne.w 0x4e6a | goto label_40;
| }
| }
| label_21:
0x0000493c ldr.w r5, [pc, 0x6a4] | r5 = *(0x00004fe4);
0x00004940 ldr r3, [sp, 4] | r3 = var_4h;
0x00004942 add r5, pc | r5 += pc;
0x00004944 ldr r1, [r5, 0x18] | r1 = *((r5 + 0x18));
0x00004946 cmp r1, r3 |
| if (r1 > r3) {
0x00004948 bhi.w 0x4d9c | goto label_41;
| }
| label_14:
0x0000494c ldr.w r3, [pc, 0x698] | r3 = *(0x00004fe8);
0x00004950 add r3, pc | r3 += pc;
0x00004952 ldr r5, [r3, 0x18] | r5 = *((r3 + 0x18));
0x00004954 ldr r3, [sp, 0x30] | r3 = var_30h;
0x00004956 add r5, r3 | r5 += r3;
0x00004958 ldr r3, [sp, 0x34] | r3 = var_34h;
0x0000495a adds r5, 3 | r5 += 3;
0x0000495c add r5, r3 | r5 += r3;
0x0000495e ldr r3, [sp, 0xc] | r3 = var_ch;
0x00004960 cmp r3, r5 |
| if (r3 < r5) {
0x00004962 bhs 0x4978 |
0x00004964 mov r0, fp | r0 = fp;
0x00004966 movs r2, 8 | r2 = 8;
0x00004968 mov r1, r5 | r1 = r5;
0x0000496a blx 0x1794 | r0 = free (r0);
0x0000496e mov fp, r0 |
0x00004970 cmp r0, 0 |
| if (r0 == 0) {
0x00004972 beq.w 0x4f04 | goto label_42;
| }
0x00004976 str r5, [sp, 0xc] | var_ch = r5;
| }
0x00004978 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0000497a movs r1, 0 | r1 = 0;
0x0000497c mov r0, fp | r0 = fp;
0x0000497e movs r5, 3 | r5 = 3;
0x00004980 lsls r2, r3, 3 | r2 = r3 << 3;
0x00004982 blx 0x1adc | fprintf_chk ();
0x00004986 ldr r3, [sp, 4] | r3 = var_4h;
0x00004988 movs r1, 0 | r1 = 0;
0x0000498a ldr r0, [sp, 8] | r0 = ptr;
0x0000498c lsls r2, r3, 2 | r2 = r3 << 2;
0x0000498e blx 0x1adc | fprintf_chk ();
0x00004992 bl 0x8480 | fcn_00008480 ();
0x00004996 ldr.w r2, [pc, 0x654] | r2 = *(0x00004fec);
0x0000499a movs r1, 1 | r1 = 1;
0x0000499c add.w r4, r0, 0xe10 | r4 = r0 + 0xe10;
0x000049a0 add.w r0, fp, 4 | r0 += arg_4h;
0x000049a4 add r2, pc | r2 += pc;
0x000049a6 ldr r3, [r2, 0xc] | r3 = *((r2 + 0xc));
0x000049a8 add.w r3, r3, 0x10000 | r3 += 0x10000;
0x000049ac ldr r3, [r3, 0x20] | r3 = *((r3 + 0x20));
0x000049ae strh.w r1, [fp, 4] | *(arg_4h) = r1;
0x000049b2 str.w r3, [fp] | __asm ("str.w r3, [fp]");
0x000049b6 ldrd r2, r3, [r2, 0x10] | __asm ("ldrd r2, r3, [r2, 0x10]");
0x000049ba add.w r3, r3, 0x10000 | r3 += 0x10000;
0x000049be ldr r3, [r3, 0x20] | r3 = *((r3 + 0x20));
0x000049c0 strh.w r1, [fp, 0xc] | *(arg_ch) = r1;
0x000049c4 strh.w r1, [fp, 0x14] | *(arg_14h) = r1;
0x000049c8 str.w r3, [fp, 8] | __asm ("str.w r3, [arg_8h]");
0x000049cc ldr r3, [sp, 0x18] | r3 = var_18h;
0x000049ce str.w r3, [fp, 0x10] | __asm ("str.w r3, [arg_10h]");
0x000049d2 ldr r3, [r2] | r3 = *(r2);
| do {
| if (r3 == 0) {
0x000049d4 cbz r3, 0x49e8 | goto label_43;
| }
0x000049d6 ldr.w r2, [r3, 0x88] | r2 = *((r3 + 0x88));
0x000049da str.w r2, [fp, r5, lsl 3] | __asm ("str.w r2, [fp, r5, lsl 3]");
0x000049de strh.w r1, [r0, r5, lsl 3] | offset_0 = r5 << 3;
| *((r0 + offset_0)) = r1;
0x000049e2 adds r5, 1 | r5++;
0x000049e4 ldr r3, [r3] | r3 = *(r3);
0x000049e6 b 0x49d4 |
| } while (1);
| label_43:
0x000049e8 ldr.w r3, [pc, 0x604] | r3 = *(0x00004ff0);
0x000049ec mov r7, r5 | r7 = r5;
0x000049ee ldr.w sb, [pc, 0x604] |
0x000049f2 ldr.w sl, [sp, 0x1c] | sl = var_1ch;
0x000049f6 add r3, pc | r3 += pc;
0x000049f8 ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x000049fa add sb, pc | sb = 0x99f4;
0x000049fc str.w sb, [sp, 0x20] | __asm ("str.w sb, [var_20h]");
0x00004a00 ldr r6, [r3, 8] | r6 = *((r3 + 8));
| do {
0x00004a02 cmp r6, 0 |
| if (r6 == 0) {
0x00004a04 beq 0x4af8 | goto label_44;
| }
0x00004a06 ldr.w r3, [r8] | r3 = *(r8);
| if (r3 != 0) {
0x00004a0a cbz r3, 0x4a1a |
0x00004a0c ldr.w r3, [pc, 0x5e8] | r3 = *(0x00004ff8);
0x00004a10 add r3, pc | r3 += pc;
0x00004a12 ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x00004a14 ldr.w r3, [r3, 0xc0] | r3 = *((r3 + 0xc0));
0x00004a16 adds r0, 0xc0 | r0 += 0xc0;
| if (r3 == 0) {
0x00004a18 cbz r3, 0x4a5a | goto label_4;
| }
| }
0x00004a1a ldr.w sb, [r6, 0x2d8] | sb = *((r6 + 0x2d8));
0x00004a1e cmp.w sb, 0 |
| if (sb > 0) {
0x00004a22 bgt 0x4aa0 | goto label_45;
| }
| label_3:
0x00004a24 ldr.w sb, [r6, 0x2dc] | sb = *((r6 + 0x2dc));
0x00004a28 cmp.w sb, 0 |
| if (sb > 0) {
0x00004a2c bgt 0x4a5e | goto label_46;
| }
| label_2:
0x00004a2e ldr.w r3, [r6, 0x2f0] | r3 = *((r6 + 0x2f0));
0x00004a32 cmp r3, 3 |
| if (r3 > 3) {
0x00004a34 bgt 0x4ad0 | goto label_47;
| }
| label_5:
0x00004a36 ldr.w r3, [r6, 0x2d8] | r3 = *((r6 + 0x2d8));
0x00004a3a cmp r3, 0 |
| if (r3 > 0) {
0x00004a3c ble 0x4a44 |
0x00004a3e cmp r4, r3 |
0x00004a40 it ge |
| if (r4 >= r3) {
0x00004a42 movge r4, r3 | r4 = r3;
| goto label_48;
| }
| }
| label_48:
0x00004a44 ldr.w r3, [r6, 0x2dc] | r3 = *((r6 + 0x2dc));
0x00004a48 cmp r3, 0 |
| if (r3 > 0) {
0x00004a4a ble 0x4a52 |
0x00004a4c cmp r4, r3 |
0x00004a4e it ge |
| if (r4 >= r3) {
0x00004a50 movge r4, r3 | r4 = r3;
| goto label_49;
| }
| }
| label_49:
0x00004a52 ldr.w r3, [r6, 0x2d4] | r3 = *((r6 + 0x2d4));
0x00004a56 cmp r3, 4 |
| if (r3 == 4) {
0x00004a58 beq 0x4ab0 | goto label_50;
| }
| label_4:
0x00004a5a ldr r6, [r6] | r6 = *(r6);
0x00004a5c b 0x4a02 |
| } while (1);
| label_46:
0x00004a5e bl 0x8480 | r0 = fcn_00008480 ();
0x00004a62 cmp sb, r0 |
| if (sb > r0) {
0x00004a64 bgt 0x4a2e | goto label_2;
| }
0x00004a66 ldr r0, [r6, 0x18] | r0 = *((r6 + 0x18));
0x00004a68 adds r0, 4 | r0 += 4;
0x00004a6a bl 0x865c | fcn_0000865c (r0);
0x00004a6e mov.w r2, 0x12c | r2 = 0x12c;
0x00004a72 mov r1, r0 | r1 = r0;
0x00004a74 ldr r0, [sp, 0x28] | r0 = var_28h;
0x00004a76 bl 0x4054 | fcn_00004054 (r0, r1);
0x00004a7a ldrb.w r3, [r6, 0x2e9] | r3 = *((r6 + 0x2e9));
0x00004a7e cmp r3, 5 |
| if (r3 >= 5) {
0x00004a80 bls 0x4a8e |
0x00004a82 lsrs r3, r3, 1 | r3 >>= 1;
0x00004a84 cmp r3, 5 |
0x00004a86 strb.w r3, [r6, 0x2e9] | *((r6 + 0x2e9)) = r3;
| if (r3 < 5) {
0x00004a8a bls.w 0x4e58 | goto label_51;
| }
| }
| label_20:
0x00004a8e mov r0, r6 | r0 = r6;
0x00004a90 bl 0x2550 | fcn_00002550 (r0);
0x00004a94 mov.w r1, 0x12c | r1 = 0x12c;
0x00004a98 mov r0, r6 | r0 = r6;
0x00004a9a bl 0x2470 | fcn_00002470 (r0, r1);
0x00004a9e b 0x4a2e | goto label_2;
| label_45:
0x00004aa0 bl 0x8480 | r0 = fcn_00008480 ();
0x00004aa4 cmp sb, r0 |
| if (sb > r0) {
0x00004aa6 bgt 0x4a24 | goto label_3;
| }
0x00004aa8 mov r0, r6 | r0 = r6;
0x00004aaa bl 0x25e0 | fcn_000025e0 (r0);
0x00004aae b 0x4a24 | goto label_3;
| label_50:
0x00004ab0 ldr r3, [r6, 0x1c] | r3 = *((r6 + 0x1c));
0x00004ab2 ldr r3, [r3] | r3 = *(r3);
0x00004ab4 adds r0, r3, 1 | r0 = r3 + 1;
| if (r0 == r3) {
0x00004ab6 beq 0x4a5a | goto label_4;
| }
0x00004ab8 add.w r2, fp, r7, lsl 3 | r2 = fp + (r7 << 3);
0x00004abc movs r1, 1 | r1 = 1;
0x00004abe str.w r3, [fp, r7, lsl 3] | __asm ("str.w r3, [fp, r7, lsl 3]");
0x00004ac2 subs r3, r7, r5 | r3 = r7 - r5;
0x00004ac4 strh r1, [r2, 4] | *((r2 + 4)) = r1;
0x00004ac6 add r7, r1 | r7 += r1;
0x00004ac8 ldr r2, [sp, 8] | r2 = ptr;
0x00004aca str.w r6, [r2, r3, lsl 2] | __asm ("str.w r6, [r2, r3, lsl 2]");
0x00004ace b 0x4a5a | goto label_4;
| label_47:
0x00004ad0 ldr r0, [r6, 0x18] | r0 = *((r6 + 0x18));
0x00004ad2 adds r0, 4 | r0 += 4;
0x00004ad4 bl 0x865c | fcn_0000865c (r0);
0x00004ad8 movs r2, 0x3c | r2 = 0x3c;
0x00004ada mov r1, r0 | r1 = r0;
0x00004adc mov r0, sl | r0 = sl;
0x00004ade bl 0x4054 | fcn_00004054 (r0, r1);
0x00004ae0 invalid |
0x00004ae4 mov r0, r6 | r0 = r6;
0x00004ae6 str.w r3, [r6, 0x2f0] | __asm ("str.w r3, [r6, 0x2f0]");
0x00004aea bl 0x2550 | fcn_00002550 (r0);
0x00004aee movs r1, 0x3c | r1 = 0x3c;
0x00004af0 mov r0, r6 | r0 = r6;
0x00004af2 bl 0x2470 | fcn_00002470 (r0, r1);
0x00004af6 b 0x4a36 | goto label_5;
| label_44:
0x00004af8 ldr.w r3, [pc, 0x500] | r3 = *(0x00004ffc);
0x00004afc add r3, pc | r3 += pc;
0x00004afe ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x00004b00 ldr r3, [r3, 0x18] | r3 = *((r3 + 0x18));
0x00004b02 cmp r3, 0 |
| if (r3 != 0) {
0x00004b04 bne.w 0x4cf4 | goto label_52;
| }
| label_11:
0x00004b08 ldr.w r3, [pc, 0x4f4] | r3 = *(0x00005000);
0x00004b0c add r3, pc | r3 += pc;
0x00004b0e ldr r3, [r3, 0xc] | r3 = *((r3 + 0xc));
0x00004b10 add.w r3, r3, 0x10000 | r3 += 0x10000;
0x00004b14 ldr r3, [r3, 0x18] | r3 = *((r3 + 0x18));
| if (r3 != 0) {
0x00004b16 cbz r3, 0x4b24 |
0x00004b18 ldrh.w r3, [fp, 4] | r3 = *(arg_4h);
0x00004b1c orr r3, r3, 4 | r3 |= 4;
0x00004b20 strh.w r3, [fp, 4] | *(arg_4h) = r3;
| }
0x00004b24 ldr.w r3, [pc, 0x4dc] | r3 = *(0x00005004);
0x00004b28 add r3, pc | r3 += pc;
0x00004b2a ldr r3, [r3, 0x14] | r3 = *((r3 + 0x14));
0x00004b2c add.w r3, r3, 0x10000 | r3 += 0x10000;
0x00004b30 ldr r3, [r3, 0x18] | r3 = *((r3 + 0x18));
| if (r3 != 0) {
0x00004b32 cbz r3, 0x4b40 |
0x00004b34 ldrh.w r3, [fp, 0xc] | r3 = *(arg_ch);
0x00004b38 orr r3, r3, 4 | r3 |= 4;
0x00004b3c strh.w r3, [fp, 0xc] | *(arg_ch) = r3;
| }
0x00004b40 ldr.w r3, [pc, 0x4c4] | r3 = *(0x00005008);
0x00004b44 add.w r2, fp, r7, lsl 3 | r2 = fp + (r7 << 3);
0x00004b48 mov r6, r7 | r6 = r7;
0x00004b4a mov.w ip, 1 |
0x00004b4e add r3, pc | r3 += pc;
0x00004b50 ldr r3, [r3, 0x1c] | r3 = *((r3 + 0x1c));
| do {
| if (r3 == 0) {
0x00004b52 cbz r3, 0x4b78 | goto label_53;
| }
0x00004b54 add.w r1, r3, 0x10000 | r1 = r3 + 0x10000;
0x00004b58 adds r2, 8 | r2 += 8;
0x00004b5a ldr r0, [r1, 0x28] | r0 = *((r1 + 0x28));
0x00004b5c str.w r0, [fp, r6, lsl 3] | __asm ("str.w r0, [fp, r6, lsl 3]");
0x00004b60 adds r6, 1 | r6++;
0x00004b62 strh ip, [r2, -0x4] | *((r2 - 0x4)) = ip;
0x00004b66 ldr r1, [r1, 0x20] | r1 = *((r1 + 0x20));
0x00004b68 cmp r1, 0 |
0x00004b6a ite ne |
| if (r1 == 0) {
0x00004b6c movne r1, 5 | r1 = 5;
| }
| if (r1 != 0) {
0x00004b6e moveq r1, 1 | r1 = 1;
| }
0x00004b70 strh r1, [r2, -0x4] | *((r2 - 0x4)) = r1;
0x00004b74 ldr r3, [r3] | r3 = *(r3);
0x00004b76 b 0x4b52 |
| } while (1);
| label_53:
0x00004b78 ldr.w r3, [pc, 0x490] | r3 = *(0x0000500c);
0x00004b7c add r3, pc | r3 += pc;
0x00004b7e ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x00004b80 ldr.w sb, [r3, 0x20] | sb = *((r3 + 0x20));
0x00004b84 mov r3, r4 | r3 = r4;
0x00004b86 mov r4, sb | r4 = sb;
0x00004b88 mov sb, r3 | sb = r3;
| do {
| if (r4 == 0) {
0x00004b8a cbz r4, 0x4b96 | goto label_54;
| }
0x00004b8c mov r0, r4 | r0 = r4;
0x00004b8e bl 0x324c | fcn_0000324c ();
0x00004b92 ldr r4, [r4] | r4 = *(r4);
0x00004b94 b 0x4b8a |
| } while (1);
| label_54:
0x00004b96 bl 0x8480 | fcn_00008480 ();
0x00004b9a ldr.w r3, [r8] | r3 = *(r8);
0x00004b9e mov r4, sb | r4 = sb;
| if (r3 != 0) {
0x00004ba0 cbz r3, 0x4ba4 |
0x00004ba2 adds r4, r0, 1 | r4 = r0 + 1;
| }
0x00004ba4 subs r4, r4, r0 | r4 -= r0;
0x00004ba6 mov.w r2, 0x3e8 | r2 = 0x3e8;
0x00004baa bic.w r4, r4, r4, asr 31 | r4 = BIT_MASK (r4, r4);
0x00004bae mov r1, r6 | r1 = r6;
0x00004bb0 mov r0, fp | r0 = fp;
0x00004bb2 mul r2, r4, r2 | r2 = r4 * r2;
0x00004bb6 blx 0x18ec | r0 = fcn_000018ec ();
0x00004bba cmp.w r0, -1 |
0x00004bbe mov sb, r0 | sb = r0;
| if (r0 == -1) {
0x00004bc0 beq.w 0x4d7e | goto label_55;
| }
0x00004bc4 cmp r0, 0 |
| if (r0 <= 0) {
0x00004bc6 ble 0x4c72 | goto label_13;
| }
0x00004bc8 ldrh.w r2, [fp, 6] | r2 = *(arg_6h);
0x00004bcc lsls r1, r2, 0x1d | r1 = r2 << 0x1d;
| if (r1 < r2) {
0x00004bce bmi.w 0x4db2 | goto label_56;
| }
| label_15:
0x00004bd2 and r2, r2, 9 | r2 &= 9;
0x00004bd6 cmp r2, 0 |
| if (r2 != 0) {
0x00004bd8 bne.w 0x4df8 | goto label_57;
| }
| label_18:
0x00004bdc ldrh.w r2, [fp, 0xe] | r2 = *(arg_eh);
0x00004be0 lsls r3, r2, 0x1d | r3 = r2 << 0x1d;
| if (r3 < r2) {
0x00004be2 bmi.w 0x4dde | goto label_58;
| }
| label_17:
0x00004be6 and r2, r2, 9 | r2 &= 9;
0x00004bea cmp r2, 0 |
| if (r2 != 0) {
0x00004bec bne.w 0x4e28 | goto label_59;
| }
| label_19:
0x00004bf0 ldrh.w r2, [fp, 0x16] | r2 = *(arg_16h);
0x00004bf4 and r2, r2, 9 | r2 &= 9;
0x00004bf8 cmp r2, 0 |
| if (r2 != 0) {
0x00004bfa bne.w 0x4dcc | goto label_60;
| }
| label_16:
0x00004bfe ldr.w r3, [pc, 0x410] | r3 = *(0x00005010);
0x00004c02 mov sl, fp | sl = fp;
0x00004c04 ldr.w r2, [pc, 0x40c] |
0x00004c08 movs r4, 3 | r4 = 3;
0x00004c0a str r6, [sp, 0x20] | var_20h = r6;
0x00004c0c mov r6, r5 | r6 = r5;
0x00004c0e add r3, pc | r3 += pc;
0x00004c10 add r2, pc | r2 = 0x9c28;
0x00004c12 mov r5, r3 | r5 = r3;
0x00004c14 str r2, [sp, 0x24] | var_24h = r2;
0x00004c16 b 0x4c1e |
| while (r2 == 0) {
| label_6:
0x00004c18 adds r4, 1 | r4++;
0x00004c1a add.w sl, sl, 8 | sl += 8;
0x00004c1e cmp.w sb, 0 |
| if (sb <= 0) {
0x00004c22 ble 0x4c9c | goto label_61;
| }
0x00004c24 cmp r6, r4 |
| if (r6 <= r4) {
0x00004c26 ble 0x4c9c | goto label_61;
| }
0x00004c28 ldrh.w r2, [sl, 0x1e] | r2 = *((sl + 0x1e));
0x00004c2c and r2, r2, 9 | r2 &= 9;
0x00004c30 cmp r2, 0 |
0x00004c32 beq 0x4c18 |
| }
0x00004c34 ldr r1, [r5, 0x10] | r1 = *((r5 + 0x10));
0x00004c36 add.w sb, sb, -1 | sb += -1;
0x00004c3a ldr.w r0, [sl, 0x18] | r0 = *((sl + 0x18));
0x00004c3e bl 0x80d4 | fcn_000080d4 (r0, r1);
0x00004c42 adds r0, 1 | r0++;
| if (r0 != 1) {
0x00004c44 bne 0x4c18 | goto label_6;
| }
0x00004c46 ldr r0, [sp, 0x24] | r0 = var_24h;
0x00004c48 bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00004c4c movs r3, 1 | r3 = 1;
0x00004c4e str r3, [r5] | *(r5) = r3;
0x00004c50 b 0x4c18 | goto label_6;
| label_9:
0x00004c52 ldr r6, [sp, 0x20] | r6 = var_20h;
0x00004c54 add r5, sp, 0x34 | r5 += var_34h;
0x00004c56 b 0x4c6c |
| while (sb > 0) {
0x00004c58 cmp r6, r4 |
| if (r6 <= r4) {
0x00004c5a ble 0x4c72 | goto label_13;
| }
0x00004c5c add.w r0, fp, r4, lsl 3 | r0 = fp + (r4 << 3);
0x00004c60 mov r1, r5 | r1 = r5;
0x00004c62 adds r4, 1 | r4++;
0x00004c64 bl 0x39c8 | r0 = fcn_000039c8 (r0, r1, r2);
0x00004c68 sub.w sb, sb, r0 | sb -= r0;
0x00004c6c cmp.w sb, 0 |
0x00004c70 bgt 0x4c58 |
| }
| label_13:
0x00004c72 ldr r3, [pc, 0x3a4] |
0x00004c74 add r3, pc |
0x00004c76 ldr r3, [r3, 0x10] | r3 = *(0x9ca2);
0x00004c78 ldr r5, [r3, 0x10] | r5 = *(0x9cb2);
| label_8:
0x00004c7a cmp r5, 0 |
| if (r5 == 0) {
0x00004c7c beq.w 0x491a | goto label_7;
| }
0x00004c80 ldr.w r6, [r5, 0x200] | r6 = *((r5 + 0x200));
0x00004c84 ldr r4, [r5] | r4 = *(r5);
0x00004c86 bl 0x8480 | r0 = fcn_00008480 ();
0x00004c8a cmp r6, r0 |
| if (r6 > r0) {
0x00004c8c ble 0x4c92 |
0x00004c8e mov r5, r4 | r5 = r4;
0x00004c90 b 0x4c7a | goto label_8;
| }
0x00004c92 mov r0, r5 | r0 = r5;
0x00004c94 mov r5, r4 | r5 = r4;
0x00004c96 bl 0x7e30 | fcn_00007e30 ();
0x00004c9a b 0x4c7a | goto label_8;
| label_61:
0x00004c9c ldr r3, [sp, 8] | r3 = ptr;
0x00004c9e mvn r2, 3 | r2 = ~3;
0x00004ca2 ldr r5, [pc, 0x378] |
0x00004ca4 add.w sl, fp, 6 | sl += arg_6h;
0x00004ca8 mla r3, r2, r6, r3 | __asm ("mla r3, r2, r6, r3");
0x00004cac ldr r2, [pc, 0x370] |
0x00004cae add r5, pc | r5 = 0x9cd0;
0x00004cb0 add r2, pc | r2 = 0x9cd4;
0x00004cb2 mov r6, r5 | r6 = r5;
0x00004cb4 str r2, [sp, 0x24] | var_24h = r2;
0x00004cb6 mov r5, r3 | r5 = r3;
0x00004cb8 b 0x4cbc | goto label_62;
| label_10:
0x00004cba adds r4, 1 | r4++;
| label_62:
0x00004cbc cmp.w sb, 0 |
| if (sb <= 0) {
0x00004cc0 ble 0x4c52 | goto label_9;
| }
0x00004cc2 cmp r7, r4 |
| if (r7 <= r4) {
0x00004cc4 ble 0x4c52 | goto label_9;
| }
0x00004cc6 ldrh.w r1, [sl, r4, lsl 3] | offset_1 = r4 << 3;
| r1 = *((sl + offset_1));
0x00004cca and r1, r1, 9 | r1 &= 9;
0x00004cce cmp r1, 0 |
| if (r1 == 0) {
0x00004cd0 beq 0x4cba | goto label_10;
| }
0x00004cd2 ldr r1, [r6, 0x10] | r1 = *((r6 + 0x10));
0x00004cd4 add.w sb, sb, -1 | sb += -1;
0x00004cd8 ldr.w r0, [r5, r4, lsl 2] | offset_2 = r4 << 2;
| r0 = *((r5 + offset_2));
0x00004cdc ldrb.w r1, [r1, 0xb9] | r1 = *((r1 + 0xb9));
0x00004ce0 bl 0x29a0 | fcn_000029a0 (r0, r1);
0x00004ce4 adds r0, 1 | r0++;
| if (r0 != 1) {
0x00004ce6 bne 0x4cba | goto label_10;
| }
0x00004ce8 ldr r0, [sp, 0x24] | r0 = var_24h;
0x00004cea bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00004cee movs r1, 1 | r1 = 1;
0x00004cf0 str r1, [r6] | *(r6) = r1;
0x00004cf2 b 0x4cba | goto label_10;
| label_52:
0x00004cf4 ldr r3, [sp, 0x14] | r3 = var_14h;
| if (r3 != 0) {
0x00004cf6 cbz r3, 0x4d04 |
0x00004cf8 bl 0x8480 | fcn_00008480 ();
0x00004cfc ldr r3, [sp, 0x14] | r3 = var_14h;
0x00004cfe adds r3, 0x3b | r3 += 0x3b;
0x00004d00 cmp r3, r0 |
| if (r3 >= r0) {
0x00004d02 bge 0x4d14 | goto label_63;
| }
| }
0x00004d04 bl 0x7e2c | fcn_00007e2c ();
0x00004d08 ldr r3, [pc, 0x318] |
0x00004d0a add r3, pc | r3 = 0x9d32;
0x00004d0c str r0, [r3, 0x24] | *((r3 + 0x24)) = r0;
0x00004d0e bl 0x8480 | fcn_00008480 ();
0x00004d12 str r0, [sp, 0x14] | var_14h = r0;
| label_63:
0x00004d14 ldr r3, [pc, 0x310] |
0x00004d16 add r3, pc |
0x00004d18 ldr r3, [r3, 0x24] | r3 = *(0x9d66);
| if (r3 == 0) {
0x00004d1a cbnz r3, 0x4d26 |
0x00004d1c ldr r3, [sp, 0x14] | r3 = var_14h;
0x00004d1e adds r3, 0x3c | r3 += 0x3c;
0x00004d20 cmp r4, r3 |
0x00004d22 it ge |
| if (r4 >= r3) {
0x00004d24 movge r4, r3 | r4 = r3;
| goto label_64;
| }
| }
| label_64:
0x00004d26 ldr r3, [pc, 0x304] |
0x00004d28 movs r2, 0 | r2 = 0;
0x00004d2a ldr.w sl, [pc, 0x304] | sl = *(0x00005030);
0x00004d2e ldr.w sb, [pc, 0x304] | sb = *(0x00005034);
0x00004d30 str r3, [sp, 0x10] | *((sp + 0x10)) = r3;
0x00004d32 add r3, pc |
0x00004d34 str r2, [r3, 0x24] | *((r3 + 0x24)) = r2;
0x00004d36 add sl, pc | sl += pc;
0x00004d38 ldr r3, [r3, 0x10] | r3 = *(0x9d74);
0x00004d3a add sb, pc | sb += pc;
0x00004d3c ldr r6, [r3, 0x10] | r6 = *(0x9d84);
| label_12:
0x00004d3e cmp r6, 0 |
| if (r6 == 0) {
0x00004d40 beq.w 0x4b08 | goto label_11;
| }
0x00004d44 ldr.w r3, [sl, 0x10] | r3 = *((sl + 0x10));
0x00004d48 ldrb.w r3, [r3, 0xb9] | r3 = *((r3 + 0xb9));
| if (r3 == 0) {
0x00004d4c cbz r3, 0x4d5c | goto label_65;
| }
0x00004d4e vldr d0, [r6, 0x30] | __asm ("vldr d0, [r6, 0x30]");
0x00004d52 vcmp.f64 d0, 0 | __asm ("vcmp.f64 d0, 0");
0x00004d56 vmrs apsr_nzcv, fpscr | __asm ("vmrs apsr_nzcv, fpscr");
0x00004d5a bne 0x4d78 |
| while (1) {
| label_65:
0x00004d5c ldr.w r3, [sb, 0x24] | r3 = *((sb + 0x24));
0x00004d60 adds r3, 1 | r3++;
0x00004d62 str.w r3, [sb, 0x24] | __asm ("str.w r3, [sb, 0x24]");
0x00004d66 ldr.w r3, [r6, 0x200] | r3 = *((r6 + 0x200));
0x00004d6a cmp r3, 0 |
| if (r3 > 0) {
0x00004d6c ble 0x4d74 |
0x00004d6e cmp r4, r3 |
0x00004d70 it ge |
| if (r4 >= r3) {
0x00004d72 movge r4, r3 | r4 = r3;
| goto label_66;
| }
| }
| label_66:
0x00004d74 ldr r6, [r6] | r6 = *(r6);
0x00004d76 b 0x4d3e | goto label_12;
0x00004d78 bl 0x45a4 | fcn_000045a4 ();
0x00004d7c b 0x4d5c |
| }
| label_55:
0x00004d7e blx 0x1a94 | r0 = bind (r0, r1, r2);
0x00004d82 ldr r3, [r0] | r3 = *(r0);
0x00004d84 cmp r3, 4 |
| if (r3 == 4) {
0x00004d86 beq.w 0x4c72 | goto label_13;
| }
0x00004d8a ldr r0, [pc, 0x2ac] |
0x00004d8c add r0, pc | r0 = 0x9dca;
0x00004d8e bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00004d92 ldr r3, [pc, 0x2a8] |
0x00004d94 movs r2, 1 | r2 = 1;
0x00004d96 add r3, pc | r3 = 0x9dd8;
0x00004d98 str r2, [r3] | *(r3) = r2;
0x00004d9a b 0x4c72 | goto label_13;
| label_41:
0x00004d9c ldr r0, [sp, 8] | r0 = ptr;
0x00004d9e movs r2, 4 | r2 = 4;
0x00004da0 blx 0x1794 | free (r0);
0x00004da2 ldcl p0, c9, [r8], 8 | __asm ("ldcl p0, c9, [r8], 8");
0x00004da6 cmp r0, 0 |
| if (r0 == 0) {
0x00004da8 beq.w 0x4f36 | goto label_67;
| }
0x00004dac ldr r3, [r5, 0x18] | r3 = *((r5 + 0x18));
0x00004dae str r3, [sp, 4] | var_4h = r3;
0x00004db0 b 0x494c | goto label_14;
| label_56:
0x00004db2 ldr r4, [pc, 0x28c] |
0x00004db4 add r4, pc | r4 = 0x9dfa;
0x00004db6 ldr r0, [r4, 0xc] |
0x00004db8 add.w r0, r0, 0x10000 | r0 = 0x19e06;
0x00004dbc adds r0, 0x10 | r0 += 0x10;
0x00004dbe bl 0x90b8 | r0 = fcn_000090b8 (r0, r1);
0x00004dc2 cmp r0, 0 |
| if (r0 <= 0) {
0x00004dc4 ble 0x4e9c | goto label_68;
| }
| label_23:
0x00004dc6 ldrh.w r2, [fp, 6] | r2 = *(arg_6h);
0x00004dca b 0x4bd2 | goto label_15;
| label_60:
0x00004dcc ldr r0, [sp, 0x18] | r0 = var_18h;
0x00004dce add.w sb, sb, -1 | sb += -1;
0x00004dd2 bl 0x3500 | fcn_00003500 ();
0x00004dd6 ldr r2, [sp, 0x34] | r2 = var_34h;
0x00004dd8 add r2, r0 | r2 += r0;
0x00004dda str r2, [sp, 0x34] | var_34h = r2;
0x00004ddc b 0x4bfe | goto label_16;
| label_58:
0x00004dde ldr r4, [pc, 0x264] |
0x00004de0 add r4, pc | r4 = 0x9e2a;
0x00004de2 ldr r0, [r4, 0x14] |
0x00004de4 add.w r0, r0, 0x10000 | r0 = 0x19e3e;
0x00004de8 adds r0, 0x10 | r0 += 0x10;
0x00004dea bl 0x90b8 | r0 = fcn_000090b8 (r0, r1);
0x00004dee cmp r0, 0 |
| if (r0 <= 0) {
0x00004df0 ble 0x4e84 | goto label_69;
| }
| label_22:
0x00004df2 ldrh.w r2, [fp, 0xe] | r2 = *(arg_eh);
0x00004df6 b 0x4be6 | goto label_17;
| label_57:
0x00004df8 bl 0x4178 | fcn_00004178 (r0, r1);
0x00004dfc adds r0, 1 | r0++;
0x00004dfe add.w sb, sb, -1 | sb += -1;
| if (r0 == 1) {
0x00004e02 beq 0x4e0e | goto label_70;
| }
0x00004e04 cmp.w sb, 0 |
| if (sb != 0) {
0x00004e08 bne.w 0x4bdc | goto label_18;
| }
0x00004e0c b 0x4c72 | goto label_13;
| label_70:
0x00004e0e ldr r0, [pc, 0x238] |
0x00004e10 add r0, pc | r0 = 0x9e5e;
0x00004e12 bl 0x3ffc | fcn_00003ffc (r0, r1);
0x00004e16 ldr r2, [pc, 0x234] |
0x00004e18 movs r1, 1 | r1 = 1;
0x00004e1a add r2, pc | r2 = 0x9e6c;
0x00004e1c str r1, [r2] | *(r2) = r1;
0x00004e1e cmp.w sb, 0 |
| if (sb != 0) {
0x00004e22 bne.w 0x4bdc | goto label_18;
| }
0x00004e26 b 0x4c72 | goto label_13;
| label_59:
0x00004e28 bl 0x4278 | fcn_00004278 (r0, r1);
0x00004e2c adds r0, 1 | r0++;
0x00004e2e add.w sb, sb, -1 | sb += -1;
| if (r0 == 1) {
0x00004e32 beq 0x4e3e | goto label_71;
| }
0x00004e34 cmp.w sb, 0 |
| if (sb != 0) {
0x00004e38 bne.w 0x4bf0 | goto label_19;
| }
0x00004e3c b 0x4c72 | goto label_13;
| label_71:
0x00004e3e ldr r0, [pc, 0x210] |
0x00004e40 add r0, pc | r0 = 0x9e96;
0x00004e42 bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00004e46 ldr r2, [pc, 0x20c] |
0x00004e48 movs r1, 1 | r1 = 1;
0x00004e4a add r2, pc | r2 = 0x9ea4;
0x00004e4c str r1, [r2] | *(r2) = r1;
0x00004e4e cmp.w sb, 0 |
| if (sb != 0) {
0x00004e52 bne.w 0x4bf0 | goto label_19;
| }
0x00004e56 b 0x4c72 | goto label_13;
| label_51:
0x00004e58 ldr r0, [r6, 0x18] | r0 = *((r6 + 0x18));
0x00004e5a adds r0, 4 | r0 += 4;
0x00004e5c bl 0x865c | r0 = fcn_0000865c (r0);
0x00004e60 mov r1, r0 | r1 = r0;
0x00004e62 ldr r0, [sp, 0x20] | r0 = var_20h;
0x00004e64 bl 0x3ffc | fcn_00003ffc (r0, r1);
0x00004e68 b 0x4a8e | goto label_20;
| label_40:
0x00004e6a ldr r0, [sp, 0x2c] | r0 = var_2ch;
0x00004e6c bl 0x3ffc | fcn_00003ffc (r0, r1);
0x00004e70 ldr r3, [sp, 0x10] | r3 = var_10h;
0x00004e72 mov r1, r4 | r1 = r4;
0x00004e74 movs r0, 0xe | r0 = 0xe;
0x00004e76 ldr r2, [r3, 8] | r2 = *((r3 + 8));
0x00004e78 ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x00004e7a strb.w r2, [r3, 0xd4] | *((r3 + 0xd4)) = r2;
0x00004e7e blx 0x1814 | fcn_00001814 ();
0x00004e82 b 0x493c | goto label_21;
| label_69:
0x00004e84 blx 0x1a94 | r0 = bind (r0, r1, r2);
0x00004e88 ldr r2, [r0] | r2 = *(r0);
0x00004e8a cmp r2, 0xb |
| if (r2 == 0xb) {
0x00004e8c beq 0x4df2 | goto label_22;
| }
0x00004e8e ldr r0, [pc, 0x1c8] |
0x00004e90 add r0, pc | r0 = 0x9eee;
0x00004e92 bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00004e96 movs r2, 1 | r2 = 1;
0x00004e98 str r2, [r4] | *(r4) = r2;
0x00004e9a b 0x4df2 | goto label_22;
| label_68:
0x00004e9c blx 0x1a94 | r0 = bind (r0, r1, r2);
0x00004ea0 ldr r2, [r0] | r2 = *(r0);
0x00004ea2 cmp r2, 0xb |
| if (r2 == 0xb) {
0x00004ea4 beq 0x4dc6 | goto label_23;
| }
0x00004ea6 ldr r0, [pc, 0x1b4] |
0x00004ea8 add r0, pc | r0 = 0x9f0a;
0x00004eaa bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00004eae movs r2, 1 | r2 = 1;
0x00004eb0 str r2, [r4] | *(r4) = r2;
0x00004eb2 b 0x4dc6 | goto label_23;
| label_39:
0x00004eb4 ldr r4, [sp, 0x10] | r4 = var_10h;
0x00004eb6 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00004eb8 add.w r0, r0, 0x10000 | r0 += 0x10000;
0x00004ebc adds r0, 0x10 | r0 += 0x10;
0x00004ebe bl 0x90b8 | fcn_000090b8 (r0, r1);
0x00004ec2 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00004ec4 add.w r0, r0, 0x10000 | r0 += 0x10000;
0x00004ec8 adds r0, 0x10 | r0 += 0x10;
0x00004eca bl 0x920c | fcn_0000920c (r0);
0x00004ece ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
0x00004ed0 blx 0x17a4 | fcn_000017a4 ();
0x00004ed4 ldr r0, [r4, 0x14] | r0 = *((r4 + 0x14));
0x00004ed6 add.w r0, r0, 0x10000 | r0 += 0x10000;
0x00004eda adds r0, 0x10 | r0 += 0x10;
0x00004edc bl 0x90b8 | fcn_000090b8 (r0, r1);
0x00004ee0 ldr r0, [r4, 0x14] | r0 = *((r4 + 0x14));
0x00004ee2 add.w r0, r0, 0x10000 | r0 += 0x10000;
0x00004ee6 adds r0, 0x10 | r0 += 0x10;
0x00004ee8 bl 0x920c | fcn_0000920c (r0);
0x00004eec ldr r0, [r4, 0x14] | r0 = *((r4 + 0x14));
0x00004eee blx 0x17a4 | fcn_000017a4 ();
0x00004ef2 ldr r3, [r4, 4] | r3 = *((r4 + 4));
| if (r3 != 0) {
0x00004ef4 cbnz r3, 0x4f2c | goto label_72;
| }
| label_25:
0x00004ef6 ldr r0, [pc, 0x168] |
0x00004ef8 add r0, pc | r0 = 0x9f5e;
0x00004efa bl 0x3ffc | fcn_00003ffc (r0, r1);
0x00004efe movs r0, 0 | r0 = 0;
0x00004f00 blx 0x1a28 | mmap (r0, r1, r2, r3, r4, r5)
| label_42:
0x00004f04 ldr r0, [pc, 0x15c] |
0x00004f06 mov r2, r5 | r2 = r5;
0x00004f08 ldr r1, [sp, 0xc] | r1 = var_ch;
0x00004f0a add r0, pc | r0 = 0x9f72;
0x00004f0c bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00004f10 ldr r0, [pc, 0x154] |
0x00004f12 add r0, pc | r0 = 0x9f7e;
0x00004f14 bl 0x40f0 | fcn_000040f0 (r0);
0x00004f16 invalid |
| label_35:
0x00004f18 ldr r1, [sp, 0x30] | r1 = var_30h;
0x00004f1a cmp r1, 0 |
| if (r1 == 0) {
0x00004f1c beq.w 0x47da | goto label_24;
| }
0x00004f20 ldr.w r2, [r2, 0xd8] | r2 = *((r2 + 0xd8));
| if (r2 == 0) {
0x00004f24 cbnz r2, 0x4f4a |
0x00004f26 str.w r3, [sb, 8] | __asm ("str.w r3, [sb, 8]");
0x00004f2a b 0x47da | goto label_24;
| label_72:
0x00004f2c ldr r0, [pc, 0x13c] |
0x00004f2e add r0, pc | r0 = 0x9f9e;
0x00004f30 bl 0x3ffc | fcn_00003ffc (r0, r1);
0x00004f34 b 0x4ef6 | goto label_25;
| label_67:
0x00004f36 ldr r0, [pc, 0x138] |
0x00004f38 ldr r2, [r5, 0x18] | r2 = *((r5 + 0x18));
0x00004f3a ldr r1, [sp, 4] | r1 = var_4h;
0x00004f3c add r0, pc | r0 = 0x9fb2;
0x00004f3e bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x00004f42 ldr r0, [pc, 0x130] |
0x00004f44 add r0, pc | r0 = 0x9fbe;
0x00004f46 bl 0x40f0 | fcn_000040f0 (r0);
| }
0x00004f4a mov r1, r5 | r1 = r5;
0x00004f4c movs r0, 0xe | r0 = 0xe;
0x00004f4e blx 0x1814 | fcn_00001814 ();
0x00004f52 ldr.w r3, [sb, 0x10] | r3 = *((sb + 0x10));
0x00004f56 ldr.w r0, [r3, 0xd8] | r0 = *((r3 + 0xd8));
0x00004f5a blx 0x186c | unlink (r0);
0x00004f5e b 0x47da | goto label_24;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/ntpd @ 0x5694 */
| #include <stdint.h>
|
; (fcn) fcn.00005694 () | void fcn_00005694 (int16_t arg1, int16_t arg2) {
| int16_t var_4h;
| int16_t var_1h;
| int16_t var_8h;
| int16_t var_ah;
| int16_t var_ch;
| r0 = arg1;
| r1 = arg2;
0x00005694 push {r4, r5, r6, r7, lr} |
0x00005696 movs r2, 0 | r2 = 0;
0x00005698 ldr r5, [pc, 0x1bc] |
0x0000569a sub sp, 0x14 |
0x0000569c mov r4, r0 | r4 = r0;
0x0000569e mov r6, r1 | r6 = r1;
0x000056a0 ldr r3, [pc, 0x1b8] | r3 = *(0x585c);
0x000056a2 mov r0, r2 | r0 = r2;
0x000056a4 add r5, pc | r5 = 0xaf00;
0x000056a6 ldr r7, [pc, 0x1b8] |
0x000056a8 mov r1, r2 | r1 = r2;
0x000056aa ldr r3, [r5, r3] |
0x000056ac add r7, pc | r7 = 0xaf12;
0x000056ae ldr r3, [r3] | r3 = *(0xaf00);
0x000056b0 str r3, [sp, 0xc] | var_ch = r3;
0x000056b2 mov.w r3, 0 | r3 = 0;
0x000056b6 blx 0x1970 | fcn_00001970 ();
0x000056ba adds r0, 1 | r0++;
| if (r0 == 1) {
0x000056bc beq.w 0x57ea | goto label_7;
| }
| label_4:
0x000056c0 ldrb.w r3, [r4, 0xb9] | r3 = *((r4 + 0xb9));
| if (r3 != 0) {
0x000056c4 cbz r3, 0x56ce |
0x000056c6 ldr.w r0, [r4, 0xb0] | r0 = *((r4 + 0xb0));
0x000056ca cmp r0, 0 |
| if (r0 == 0) {
0x000056cc beq 0x57be | goto label_8;
| }
| }
| label_2:
0x000056ce ldr r0, [pc, 0x194] |
0x000056d0 add r0, pc | r0 = 0xaf3a;
0x000056d2 bl 0x3d10 | fcn_00003d10 (r0);
0x000056d6 ldr r0, [pc, 0x190] |
0x000056d8 movs r2, 0 | r2 = 0;
0x000056da movs r1, 2 | r1 = 2;
0x000056dc add r0, pc | r0 = 0xaf4a;
0x000056de blx 0x19f8 | r0 = getpid ();
0x000056e2 adds r3, r0, 1 | r3 = r0 + 1;
0x000056e4 mov r5, r0 | r5 = r0;
| if (r3 == r0) {
0x000056e6 beq.w 0x57f4 | goto label_9;
| }
0x000056ea ldr.w r1, [r4, 0xb0] | r1 = *((r4 + 0xb0));
0x000056ee cmp r1, 0 |
| if (r1 == 0) {
0x000056f0 beq 0x57d4 | goto label_10;
| }
| label_3:
0x000056f2 mov r0, r5 | r0 = r5;
0x000056f4 blx 0x1c44 | getgrnam ();
0x000056f8 ldr r0, [pc, 0x170] |
0x000056fa add r0, pc | r0 = 0xaf6a;
0x000056fc bl 0x9d1c | fcn_00009d1c (r0, r1, r2);
0x00005700 add.w r1, r6, 0xc | r1 = r6 + 0xc;
0x00005704 movs r0, 1 | r0 = 1;
0x00005706 blx 0x1904 | r0 = fcn_00001904 ();
0x0000570a cbz r0, 0x5714 |
| while (r0 != 0) {
| label_0:
0x0000570c ldr r0, [pc, 0x160] |
0x0000570e add r0, pc | r0 = 0xaf82;
0x00005710 bl 0x40b4 | fcn_000040b4 ();
0x00005714 ldr r2, [r6, 0xc] | r2 = *((r6 + 0xc));
0x00005716 mov r1, r2 | r1 = r2;
0x00005718 mov r0, r2 | r0 = r2;
0x0000571a blx 0x1c50 | r0 = snprintf_chk ();
0x0000571e cmp r0, 0 |
0x00005720 bne 0x570c |
| }
0x00005722 ldr r2, [r6, 8] | r2 = *((r6 + 8));
0x00005724 mov r1, r2 | r1 = r2;
0x00005726 mov r0, r2 | r0 = r2;
0x00005728 blx 0x1ba4 | r0 = fcn_00001ba4 ();
0x0000572c cmp r0, 0 |
| if (r0 != 0) {
0x0000572e bne 0x570c | goto label_0;
| }
0x00005730 ldr r4, [pc, 0x140] |
0x00005732 movs r0, 0xf | r0 = 0xf;
0x00005734 add r4, pc | r4 = 0xafac;
0x00005736 mov r1, r4 | r1 = r4;
0x00005738 blx 0x1814 | fcn_00001814 ();
0x0000573c mov r1, r4 | r1 = r4;
0x0000573e movs r0, 2 | r0 = 2;
0x00005740 blx 0x1814 | fcn_00001814 ();
0x00005744 movs r1, 1 | r1 = 1;
0x00005746 mov r0, r1 | r0 = r1;
0x00005748 blx 0x1814 | fcn_00001814 ();
0x0000574c movs r0, 0x28 |
0x0000574e movt r0, 1 | r0 = 0x10028;
0x00005752 blx 0x198c | strftime (r0, r1, r2, r3);
0x00005756 ldr r2, [pc, 0x120] | r2 = *(0x587a);
0x00005758 ldr r4, [r7, r2] | r4 = *((r7 + r2));
0x0000575a str r0, [r4] | *(r4) = r0;
0x0000575c cmp r0, 0 |
| if (r0 == 0) {
0x0000575e beq 0x57f4 | goto label_9;
| }
0x00005760 ldr r5, [pc, 0x118] |
0x00005762 movs r1, 3 | r1 = 3;
0x00005764 ldr r6, [pc, 0x118] |
0x00005766 ldr r7, [pc, 0x11c] |
0x00005768 add r5, pc | r5 = 0xafe8;
0x0000576a add r6, pc | r6 = 0xafee;
0x0000576c add r7, pc | r7 = 0xaff6;
0x0000576e bl 0x89b0 | fcn_000089b0 (r0, r1);
| do {
| label_1:
0x00005772 ldr r3, [r5] | r3 = *(r5);
0x00005774 ldr r0, [r4] | r0 = *(r4);
0x00005776 add.w r0, r0, 0x10000 | r0 += 0x10000;
0x0000577a cmp r3, 0 |
| if (r3 != 0) {
0x0000577c bne 0x582c | goto label_11;
| }
0x0000577e ldr r3, [r0, 0x18] | r3 = *((r0 + 0x18));
0x00005780 movs r1, 1 | r1 = 1;
0x00005782 mov.w r2, -1 | r2 = -1;
0x00005786 cmp r3, 0 |
0x00005788 ldr r3, [r0, 0x20] | r3 = *((r0 + 0x20));
0x0000578a add r0, sp, 4 | r0 += var_4h;
0x0000578c str r3, [sp, 4] | var_4h = r3;
0x0000578e ite ne |
| if (r3 == 0) {
0x00005790 movne r3, 5 | r3 = 5;
| }
| if (r3 != 0) {
0x00005792 moveq r3, 1 | r3 = 1;
| }
0x00005794 strh.w r3, [sp, 8] | var_8h = r3;
0x00005798 blx 0x18ec | fcn_000018ec ();
0x0000579c adds r1, r0, 1 | r1 += var_1h;
| if (r1 == var_1h) {
0x0000579e beq 0x57fa | goto label_12;
| }
0x000057a0 cmp r0, 0 |
0x000057a2 ble 0x5772 |
| } while (r0 <= 0);
0x000057a4 ldrh.w r3, [sp, 0xa] | r3 = var_ah;
0x000057a8 lsls r2, r3, 0x1d | r2 = r3 << 0x1d;
| if (r2 < r3) {
0x000057aa bmi 0x5816 | goto label_13;
| }
| label_5:
0x000057ac lsls r3, r3, 0x1f | r3 <<= 0x1f;
| if (r3 >= r3) {
0x000057ae bpl 0x5772 | goto label_1;
| }
0x000057b0 bl 0x5514 | fcn_00005514 ();
0x000057b4 adds r0, 1 | r0++;
0x000057b6 itt eq |
| if (r0 != 1) {
0x000057b8 moveq r3, 1 | r3 = 1;
| }
| if (r0 != 1) {
0x000057ba streq r3, [r6] | *(r6) = r3;
| }
0x000057bc b 0x5772 | goto label_1;
| label_8:
0x000057be movs r1, 0x18 | r1 = 0x18;
0x000057c0 bl 0x3cc8 | r0 = fcn_00003cc8 (r0, r1);
0x000057c4 blx 0x1a40 | getopt (r0, r1, r2);
0x000057c8 adds r0, 1 | r0++;
| if (r0 != 1) {
0x000057ca bne 0x56ce | goto label_2;
| }
0x000057cc ldr r0, [pc, 0xb8] |
0x000057ce add r0, pc | r0 = 0xb05a;
0x000057d0 bl 0x40b4 | fcn_000040b4 ();
| label_10:
0x000057d4 blx 0x1894 | fcn_00001894 ();
0x000057d8 movs r1, 1 | r1 = 1;
0x000057da mov r0, r5 | r0 = r5;
0x000057dc blx 0x1894 | fcn_00001894 ();
0x000057e0 movs r1, 2 | r1 = 2;
0x000057e2 mov r0, r5 | r0 = r5;
0x000057e4 blx 0x1894 | fcn_00001894 ();
0x000057e8 b 0x56f2 | goto label_3;
| label_7:
0x000057ea ldr r0, [pc, 0xa0] |
0x000057ec add r0, pc | r0 = 0xb07e;
0x000057ee bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x000057f2 b 0x56c0 | goto label_4;
| label_9:
0x000057f4 movs r0, 0 | r0 = 0;
0x000057f6 bl 0x40b4 | fcn_000040b4 ();
| label_12:
0x000057fa blx 0x1a94 | r0 = bind (r0, r1, r2);
0x000057fe ldr r3, [r0] | r3 = *(r0);
0x00005800 cmp r3, 4 |
| if (r3 == 4) {
0x00005802 beq 0x5772 | goto label_1;
| }
0x00005804 ldr r0, [pc, 0x88] |
0x00005806 add r0, pc | r0 = 0xb09a;
0x00005808 bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x0000580c ldr r3, [pc, 0x84] |
0x0000580e movs r2, 1 | r2 = 1;
0x00005810 add r3, pc | r3 = 0xb0a8;
0x00005812 str r2, [r3] | *(r3) = r2;
0x00005814 b 0x5772 | goto label_1;
| label_13:
0x00005816 ldr r0, [r4] | r0 = *(r4);
0x00005818 add.w r0, r0, 0x10000 | r0 += 0x10000;
0x0000581c adds r0, 0x10 | r0 += 0x10;
0x0000581e bl 0x90b8 | r0 = fcn_000090b8 (r0, r1);
0x00005822 cmp r0, 0 |
0x00005824 ble 0x583e |
| while (r3 == 0xb) {
| label_6:
0x00005826 ldrh.w r3, [sp, 0xa] | r3 = var_ah;
0x0000582a b 0x57ac | goto label_5;
| label_11:
0x0000582c adds r0, 0x10 | r0 += 0x10;
0x0000582e bl 0x920c | fcn_0000920c (r0);
0x00005832 ldr r0, [r4] | r0 = *(r4);
0x00005834 blx 0x17a4 | fcn_000017a4 ();
0x00005838 movs r0, 0 | r0 = 0;
0x0000583a blx 0x1a28 | r0 = mmap (r0, r1, r2, r3, r4, r5)
0x0000583e blx 0x1a94 | r0 = bind (r0, r1, r2);
0x00005842 ldr r3, [r0] | r3 = *(r0);
0x00005844 cmp r3, 0xb |
0x00005846 beq 0x5826 |
| }
0x00005848 mov r0, r7 | r0 = r7;
0x0000584a bl 0x3ee4 | fcn_00003ee4 (r0, r1);
0x0000584e ldr r3, [pc, 0x48] |
0x00005850 movs r2, 1 | r2 = 1;
0x00005852 add r3, pc | r3 = 0xb0f0;
0x00005854 str r2, [r3] | *(r3) = r2;
0x00005856 b 0x5826 | goto label_6;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/ntpd @ 0x5a20 */
| #include <stdint.h>
|
; (fcn) fcn.00005a20 () | void fcn_00005a20 () {
0x00005a20 ldr r4, [pc, 0x40] |
0x00005a22 push {r3, lr} |
0x00005a24 ldr r3, [pc, 0x40] | r3 = *(0x5a68);
0x00005a26 add r4, pc | r4 = 0xb48e;
0x00005a28 ldr r1, [pc, 0x40] |
0x00005a2a ldr r3, [r4, r3] | r3 = *(0xb48e);
0x00005a2c add r1, pc | r1 = "%s %s";
0x00005a2e ldr r5, [r3] | r5 = *(0xb48e);
0x00005a30 mov r0, r5 | r0 = r5;
0x00005a32 blx 0x171c | cxa_finalize ();
0x00005a36 ldr r3, [pc, 0x38] | r3 = *(0x5a72);
0x00005a38 ldr r3, [r4, r3] | r3 = *(0xb48e);
0x00005a3a ldr r4, [r3] | r4 = *(0xb48e);
| if (r0 != 0) {
0x00005a3c cbnz r0, 0x5a52 | goto label_0;
| }
0x00005a3e ldr r0, [pc, 0x34] |
0x00005a40 mov r3, r4 | r3 = r4;
0x00005a42 movs r2, 0x30 | r2 = 0x30;
0x00005a44 movs r1, 1 | r1 = 1;
0x00005a46 add r0, pc | r0 = 0xb4c0;
0x00005a48 blx 0x1910 | fcn_00001910 ();
| do {
0x00005a4c movs r0, 1 | r0 = 1;
0x00005a4e blx 0x1a28 | mmap (r0, r1, r2, r3, r4, r5)
| label_0:
0x00005a52 ldr r2, [pc, 0x24] |
0x00005a54 mov r3, r5 | r3 = r5;
0x00005a56 movs r1, 1 | r1 = 1;
0x00005a58 mov r0, r4 | r0 = r4;
0x00005a5a add r2, pc | r2 = 0xb4d8;
0x00005a5c blx 0x1b00 | munmap (r0, r1);
0x00005a60 b 0x5a4c |
| } while (1);
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-50593792.squashfs_v4_le_extract/usr/sbin/ntpd @ 0x6800 */
| #include <stdint.h>
|
; (fcn) fcn.00006800 () | void fcn_00006800 (uint32_t arg1, int16_t arg2) {
| int16_t var_0h;
| int16_t var_14h_4;
| int16_t var_2ch;
| int16_t var_2eh;
| int16_t var_9ch;
| int16_t var_10h;
| int16_t var_2b0h;
| r0 = arg1;
| r1 = arg2;
0x00006800 ldr r2, [pc, 0x260] |
0x00006802 cmp r0, 1 |
0x00006804 ldr r3, [pc, 0x260] | r3 = *(0x6a68);
0x00006806 push.w {r4, r5, r6, r7, r8, sb, sl, lr} |
0x0000680a sub sp, 0xa0 |
0x0000680c add r2, pc | r2 = 0xd274;
0x0000680e ldr r6, [pc, 0x25c] |
0x00006810 ldr r3, [r2, r3] |
0x00006812 add r6, pc | r6 = 0xd284;
0x00006814 ldr r3, [r3] | r3 = *(0xd274);
0x00006816 str r3, [sp, 0x9c] | var_9ch = r3;
0x00006818 mov.w r3, 0 | r3 = 0;
| if (r0 <= 1) {
0x0000681c ble 0x68c4 | goto label_6;
| }
0x0000681e ldr r7, [pc, 0x250] |
0x00006820 mov r4, r0 | r4 = r0;
0x00006822 ldr.w sb, [pc, 0x250] | sb = *(0x00006a74);
0x00006826 mov r5, r1 | r5 = r1;
0x00006828 ldr.w r8, [pc, 0x24c] | r8 = *(0x00006a78);
0x0000682c add r7, pc | r7 = 0xd2a2;
0x0000682e add sb, pc | sb += pc;
0x00006830 add r8, pc | r8 += pc;
0x00006832 b 0x684e |
| while (r3 != r0) {
0x00006834 cmp r0, 0x73 |
| if (r0 != 0x73) {
0x00006836 bne 0x68c4 | goto label_6;
| }
0x00006838 ldr r3, [pc, 0x240] | r3 = *(0x6a7c);
0x0000683a mov r1, sb | r1 = sb;
0x0000683c ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0000683e ldr.w sl, [r3] | sl = *(0x6a7c);
0x00006842 mov r0, sl | r0 = sl;
0x00006844 bl 0x638c | fcn_0000638c (r0, r1);
0x00006848 str.w r0, [r8, 0x10] | __asm ("str.w r0, [r8, 0x10]");
| if (r0 == 0) {
0x0000684c cbz r0, 0x68ba | goto label_7;
| }
0x0000684e mov r2, r7 | r2 = r7;
0x00006850 mov r1, r5 | r1 = r5;
0x00006852 mov r0, r4 | r0 = r4;
0x00006854 blx 0x1a64 | r0 = sqrt (r0);
0x00006858 adds r3, r0, 1 | r3 = r0 + 1;
0x0000685a bne 0x6834 |
| }
0x0000685c ldr r3, [pc, 0x220] |
0x0000685e add r3, pc |
0x00006860 ldr r3, [r3, 0x10] | r3 = *(0xd2f2);
| if (r3 == 0) {
0x00006862 cbz r3, 0x68c4 | goto label_6;
| }
0x00006864 ldrb r3, [r3] | r3 = *(r3);
0x00006866 cmp r3, 0x70 |
| if (r3 == 0x70) {
0x00006868 beq 0x6958 | goto label_8;
| }
| if (r3 > 0x70) {
0x0000686a bhi 0x68c8 | goto label_9;
| }
0x0000686c cmp r3, 0x53 |
| if (r3 == 0x53) {
0x0000686e beq 0x68d0 | goto label_10;
| }
0x00006870 cmp r3, 0x61 |
0x00006872 it eq |
| if (r3 != 0x61) {
0x00006874 moveq r4, 3 | r4 = 3;
| }
| if (r3 != 0x61) {
0x00006876 bne 0x68c4 | goto label_6;
| }
| label_0:
0x00006878 movs r1, 1 | r1 = 1;
0x0000687a movs r2, 0 | r2 = 0;
0x0000687c mov r0, r1 | r0 = r1;
0x0000687e blx 0x1bf8 | r0 = fcn_00001bf8 ();
0x00006882 cmp.w r0, -1 |
0x00006886 mov r8, r0 | r8 = r0;
| if (r0 == -1) {
0x00006888 beq 0x68d4 | goto label_11;
| }
0x0000688a ldr r7, [pc, 0x1f8] |
0x0000688c add r6, sp, 0x2c | r6 += var_2ch;
0x0000688e movs r2, 0x6e | r2 = 0x6e;
0x00006890 movs r1, 0 | r1 = 0;
0x00006892 mov r0, r6 | r0 = r6;
0x00006894 movs r5, 1 | r5 = 1;
0x00006896 add r7, pc | r7 = 0xd320;
0x00006898 blx 0x1adc | fprintf_chk ();
0x0000689c movs r2, 0x6c | r2 = 0x6c;
0x0000689e mov r1, r7 | r1 = r7;
0x000068a0 add.w r0, sp, 0x2e | r0 += var_2eh;
0x000068a4 strh.w r5, [sp, 0x2c] | var_2ch = r5;
0x000068a8 bl 0x9e68 | r0 = fcn_00009e68 (r0, r1, r2);
0x000068ac cmp r0, 0x6b |
| if (r0 < 0x6b) {
0x000068ae bls 0x68de | goto label_12;
| }
0x000068b0 ldr r1, [pc, 0x1d4] |
0x000068b2 mov r0, r5 | r0 = r5;
0x000068b4 add r1, pc | r1 = 0xd340;
0x000068b6 blx 0x1b4c | fcn_00001b4c ();
| label_7:
0x000068ba ldr r0, [pc, 0x1d0] |
0x000068bc mov r1, sl | r1 = sl;
0x000068be add r0, pc | r0 = 0xd350;
0x000068c0 blx 0x1a58 | chown ();
| do {
| label_6:
0x000068c4 bl 0x5a20 | fcn_00005a20 ();
| label_9:
0x000068c8 cmp r3, 0x73 |
0x000068ca bne 0x68c4 |
| } while (r3 != 0x73);
0x000068cc movs r4, 0 | r4 = 0;
0x000068ce b 0x6878 | goto label_0;
| label_10:
0x000068d0 movs r4, 2 | r4 = 2;
0x000068d2 b 0x6878 | goto label_0;
| label_11:
0x000068d4 ldr r1, [pc, 0x1b8] |
0x000068d6 movs r0, 1 | r0 = 1;
0x000068d8 add r1, pc | r1 = 0xd36c;
0x000068da blx 0x18c4 | fcn_000018c4 ();
| label_12:
0x000068de mov r1, r6 | r1 = r6;
0x000068e0 movs r2, 0x6e | r2 = 0x6e;
0x000068e2 mov r0, r8 | r0 = r8;
0x000068e4 blx 0x1c68 | fcn_00001c68 ();
0x000068e8 adds r0, 1 | r0++;
| if (r0 == 1) {
0x000068ea beq 0x695c | goto label_13;
| }
0x000068ec movs r0, 0x28 |
0x000068ee movt r0, 1 | r0 = 0x10028;
0x000068f2 blx 0x198c | r0 = strftime (r0, r1, r2, r3);
0x000068f6 mov r7, r0 | r7 = r0;
0x000068f8 cmp r0, 0 |
| if (r0 == 0) {
0x000068fa beq.w 0x6a5a | goto label_14;
| }
0x000068fe mov r1, r8 | r1 = r8;
0x00006900 bl 0x89b0 | fcn_000089b0 (r0, r1);
0x00006904 cmp r4, 2 |
0x00006906 mov.w r3, 0 | r3 = 0;
0x0000690a mov.w r2, -1 | r2 = -1;
0x0000690e strd r3, r3, [sp, 4] | __asm ("strd r3, r3, [sp, 4]");
0x00006912 str r2, [sp] | *(sp) = r2;
0x00006914 mov r2, r3 | r2 = r3;
| if (r4 == 2) {
0x00006916 beq.w 0x6a46 | goto label_15;
| }
0x0000691a cmp r4, 3 |
| if (r4 == 3) {
0x0000691c beq.w 0x6a3c | goto label_16;
| }
0x00006920 cmp r4, 1 |
0x00006922 mov r0, r7 | r0 = r7;
0x00006924 ite ne |
| if (r4 == 1) {
0x00006926 movne r1, 0xb | r1 = 0xb;
| }
| if (r4 != 1) {
0x00006928 moveq r1, 0xc | r1 = 0xc;
| }
0x0000692a bl 0x8c20 | fcn_00008c20 (r0, r1, r2, r3);
| label_5:
0x0000692e add.w r5, r7, 0x10000 | r5 = r7 + 0x10000;
0x00006932 add.w r6, r5, 0x10 | r6 = r5 + 0x10;
| do {
| label_1:
0x00006936 ldr r3, [r5, 0x18] | r3 = *((r5 + 0x18));
| if (r3 == 0) {
0x00006938 cbz r3, 0x6968 | goto label_17;
| }
0x0000693a mov r0, r6 | r0 = r6;
0x0000693c bl 0x90b8 | r0 = fcn_000090b8 (r0, r1);
0x00006940 cmp r0, 0 |
0x00006942 bgt 0x6936 |
| } while (r0 > 0);
0x00006944 blx 0x1a94 | r0 = bind (r0, r1, r2);
0x00006948 ldr r3, [r0] | r3 = *(r0);
0x0000694a cmp r3, 0xb |
| if (r3 == 0xb) {
0x0000694c beq 0x6936 | goto label_1;
| }
0x0000694e ldr r1, [pc, 0x144] |
0x00006950 movs r0, 1 | r0 = 1;
0x00006952 add r1, pc | r1 = 0xd3ec;
0x00006954 blx 0x18c4 | fcn_000018c4 ();
| label_8:
0x00006958 movs r4, 1 | r4 = 1;
0x0000695a b 0x6878 | goto label_0;
| label_13:
0x0000695c ldr r1, [pc, 0x138] |
0x0000695e mov r2, r7 | r2 = r7;
0x00006960 mov r0, r5 | r0 = r5;
0x00006962 add r1, pc | r1 = 0xd3fe;
0x00006964 blx 0x18c4 | fcn_000018c4 ();
| label_17:
0x00006968 add r5, sp, 0x14 | r5 += var_14h_4;
| do {
0x0000696a mov r0, r7 | r0 = r7;
0x0000696c bl 0x89e4 | r0 = fcn_000089e4 (r0);
0x00006970 adds r3, r0, 1 | r3 = r0 + 1;
| if (r3 == r0) {
0x00006972 beq 0x6a1e | goto label_18;
| }
0x00006974 cmp r0, 0 |
| if (r0 == 0) {
0x00006976 beq 0x6a50 | goto label_19;
| }
| label_2:
0x00006978 mov r1, r5 | r1 = r5;
0x0000697a mov r0, r7 | r0 = r7;
0x0000697c bl 0x8d24 | r0 = fcn_00008d24 (r0, r1);
0x00006980 adds r6, r0, 1 | r6 = r0 + 1;
| if (r6 == r0) {
0x00006982 beq 0x6a32 | goto label_20;
| }
0x00006984 cmp r0, 0 |
0x00006986 beq 0x696a |
| } while (r0 == 0);
0x00006988 cmp r4, 2 |
| if (r4 != 2) {
0x0000698a beq 0x69b2 |
0x0000698c cmp r4, 3 |
| if (r4 == 3) {
0x0000698e beq 0x69e4 | goto label_21;
| }
0x00006990 cmp r4, 1 |
| if (r4 == 1) {
0x00006992 beq 0x69d0 | goto label_22;
| }
0x00006994 mov r0, r5 | r0 = r5;
0x00006996 bl 0x63e0 | fcn_000063e0 (r0);
0x0000699a mov r0, r5 | r0 = r5;
0x0000699c bl 0x8cec | fcn_00008cec (r0);
| label_3:
0x000069a0 mov r0, r8 | r0 = r8;
0x000069a2 blx 0x1c44 | getgrnam ();
0x000069a6 mov r0, r7 | r0 = r7;
0x000069a8 blx 0x17a4 | fcn_000017a4 ();
0x000069ac movs r0, 0 | r0 = 0;
0x000069ae blx 0x1a28 | mmap (r0, r1, r2, r3, r4, r5)
| }
0x000069b2 movs r1, 0 | r1 = 0;
0x000069b4 mov r0, r5 | r0 = r5;
0x000069b6 bl 0x66f4 | fcn_000066f4 (r0, r1);
0x000069ba ldr r6, [sp, 0x14] | r6 = var_14h_4;
0x000069bc sub.w r2, r6, 0xf | r2 = r6 - 0xf;
0x000069c0 rsbs r6, r2, 0 | r6 = r2 - ;
0x000069c2 adcs r6, r2 | __asm ("adcs r6, r2");
| label_4:
0x000069c4 mov r0, r5 | r0 = r5;
0x000069c6 bl 0x8cec | fcn_00008cec (r0);
0x000069ca cmp r6, 0 |
| if (r6 == 0) {
0x000069cc beq 0x6978 | goto label_2;
| }
0x000069ce b 0x69a0 | goto label_3;
| label_22:
0x000069d0 movs r1, 0 | r1 = 0;
0x000069d2 mov r0, r5 | r0 = r5;
0x000069d4 bl 0x655c | fcn_0000655c (r0, r1);
0x000069d8 ldr r6, [sp, 0x14] | r6 = var_14h_4;
0x000069da sub.w r1, r6, 0xd | r1 = r6 - 0xd;
0x000069de rsbs r6, r1, 0 | r6 = r1 - ;
0x000069e0 adcs r6, r1 | __asm ("adcs r6, r1");
0x000069e2 b 0x69c4 | goto label_4;
| label_21:
0x000069e4 ldr r3, [sp, 0x14] | r3 = var_14h_4;
0x000069e6 subs r3, 0xb | r3 -= 0xb;
0x000069e8 cmp r3, 6 |
| if (r3 > 6) {
0x000069ea bhi 0x69fe | goto label_23;
| }
| /* switch table (7 cases) at 0x69f0 */
0x000069ec tbb [pc, r3] | __asm ("tbb [0x000069f4]");
0x000069f8 mov r0, r5 | r0 = r5;
0x000069fa bl 0x63e0 | fcn_000063e0 (r0);
| do {
| label_23:
0x000069fe mov r0, r5 | r0 = r5;
0x00006a00 bl 0x8cec | fcn_00008cec (r0);
0x00006a04 b 0x6978 | goto label_2;
0x00006a06 movs r1, 1 | r1 = 1;
0x00006a08 mov r0, r5 | r0 = r5;
0x00006a0a bl 0x66f4 | fcn_000066f4 (r0, r1);
0x00006a0e b 0x69fe |
| } while (1);
0x00006a10 movs r1, 1 | r1 = 1;
0x00006a12 mov r0, r5 | r0 = r5;
0x00006a14 bl 0x655c | fcn_0000655c (r0, r1);
0x00006a16 stc2 p7, c14, [r2, 0x3c4]! | __asm ("stc2 p7, c14, [r2, 0x3c4]!");
0x00006a1a movs r6, 1 | r6 = 1;
0x00006a1c b 0x69c4 | goto label_4;
| label_18:
0x00006a1e blx 0x1a94 | r0 = bind (r0, r1, r2);
0x00006a22 ldr r3, [r0] | r3 = *(r0);
0x00006a24 cmp r3, 0xb |
| if (r3 == 0xb) {
0x00006a26 beq 0x6978 | goto label_2;
| }
0x00006a28 ldr r1, [pc, 0x70] |
0x00006a2a movs r0, 1 | r0 = 1;
0x00006a2c add r1, pc | r1 = 0xd4cc;
0x00006a2e blx 0x18c4 | fcn_000018c4 ();
| label_20:
0x00006a32 ldr r1, [pc, 0x6c] |
0x00006a34 movs r0, 1 | r0 = 1;
0x00006a36 add r1, pc | r1 = 0xd4dc;
0x00006a38 blx 0x18c4 | fcn_000018c4 ();
| label_16:
0x00006a3c movs r1, 0x10 | r1 = 0x10;
0x00006a3e mov r0, r7 | r0 = r7;
0x00006a40 bl 0x8c20 | fcn_00008c20 (r0, r1, r2, r3);
0x00006a44 b 0x692e | goto label_5;
| label_15:
0x00006a46 movs r1, 0xe | r1 = 0xe;
0x00006a48 mov r0, r7 | r0 = r7;
0x00006a4a bl 0x8c20 | fcn_00008c20 (r0, r1, r2, r3);
0x00006a4e b 0x692e | goto label_5;
| label_19:
0x00006a50 ldr r1, [pc, 0x50] |
0x00006a52 movs r0, 1 | r0 = 1;
0x00006a54 add r1, pc | r1 = 0xd4fc;
0x00006a56 blx 0x1b4c | r0 = fcn_00001b4c ();
| label_14:
0x00006a5a mov r1, r0 | r1 = r0;
0x00006a5c mov r0, r5 | r0 = r5;
0x00006a5e blx 0x18c4 | fcn_000018c4 ();
0x00006a62 nop |
0x00006a64 strb r0, [r0, 0x17] | *((r0 + 0x17)) = r0;
0x00006a66 movs r1, r0 | r1 = r0;
0x00006a68 lsls r0, r7, 7 | r0 = r7 << 7;
0x00006a6a movs r0, r0 |
0x00006a6c strb r2, [r7, 0x16] | *((r7 + 0x16)) = r2;
0x00006a6e movs r1, r0 | r1 = r0;
0x00006a70 ldrb r4, [r4, r1] | r4 = *((r4 + r1));
0x00006a72 movs r0, r0 |
0x00006a74 strb r2, [r5, 0x1f] | *((r5 + 0x1f)) = r2;
0x00006a76 movs r1, r0 | r1 = r0;
0x00006a78 ldr r0, [sp, 0x2b0] | r0 = var_2b0h;
0x00006a7a movs r1, r0 | r1 = r0;
0x00006a7c lsls r4, r5, 8 | r4 = r5 << 8;
0x00006a7e movs r0, r0 |
0x00006a80 ldr r0, [sp, 0x1f8] | r0 = var_10h;
0x00006a82 movs r1, r0 | r1 = r0;
0x00006a84 str r6, [r7, r3] | *((r7 + r3)) = r6;
0x00006a86 movs r0, r0 |
0x00006a88 ldr r6, [pc, 0x170] | r6 = *(0x6bfc);
0x00006a8a movs r0, r0 |
0x00006a8c ldrh r6, [r6, r6] | r6 = *((r6 + r6));
0x00006a8e movs r0, r0 |
0x00006a90 ldrh r4, [r7, r6] | r4 = *((r7 + r6));
0x00006a92 movs r0, r0 |
0x00006a94 ldrh r6, [r3, r5] | r6 = *((r3 + r5));
0x00006a96 movs r0, r0 |
0x00006a98 ldrh r2, [r0, r5] | r2 = *((r0 + r5));
0x00006a9a movs r0, r0 |
0x00006a9c ldrh r4, [r4, r2] | r4 = *((r4 + r2));
0x00006a9e movs r0, r0 |
0x00006aa0 ldrh r2, [r1, r3] | r2 = *((r1 + r3));
0x00006aa2 movs r0, r0 |
0x00006aa4 ldrh r0, [r3, r2] | r0 = *((r3 + r2));
0x00006aa6 movs r0, r0 |
0x00006aa8 ldr r3, [pc, 0x10] |
0x00006aaa movs r2, 0 | r2 = 0;
0x00006aac movs r0, 1 | r0 = 1;
0x00006aae add r3, pc | r3 = 0xd56e;
0x00006ab0 strd r0, r2, [r3] | __asm ("strd r0, r2, [r3]");
0x00006ab4 strd r0, r2, [r3, 8] | __asm ("strd r0, r2, [r3, 8]");
0x00006ab8 str r2, [r3, 0x10] | *((r3 + 0x10)) = r2;
0x00006aba bx lr | return;
| }
[*] Function mmap used 11 times ntpd