[*] Binary protection state of ntpq
Partial RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function strcpy tear down of ntpq
; 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/bin/ntpq @ 0x200d4 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.000200d4 () | void fcn_000200d4 (int32_t arg1, int32_t arg2) {
| int32_t var_4h;
| int32_t var_8h;
| int32_t var_ch;
| char * src;
| int32_t var_0h;
| size_t size;
| int32_t var_1h;
| int32_t var_1000h;
| int32_t var_1ch;
| r0 = arg1;
| r1 = arg2;
0x000200d4 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x000200d8 sub sp, sp, 0x1000 |
0x000200dc sub sp, sp, 0x1c |
0x000200e0 mov fp, r0 |
0x000200e4 mov sb, r1 | sb = r1;
0x000200e8 mov r7, 0 | r7 = 0;
| label_1:
0x000200ec cmp fp, 0 |
0x000200f0 bne 0x20108 |
| while (r0 < r7) {
| label_0:
0x000200f4 mov r4, 0 | r4 = 0;
| label_2:
0x000200f8 mov r0, r4 | r0 = r4;
0x000200fc add sp, sp, 0x1000 |
0x00020100 add sp, sp, 0x1c |
0x00020104 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
0x00020108 mov r0, fp | r0 = fp;
0x0002010c bl 0x1261c | r0 = strlen (r0);
0x00020110 cmp r0, r7 |
0x00020114 bls 0x200f4 |
| }
0x00020118 add r7, fp, r7 | r7 = fp + r7;
| label_3:
0x0002011c ldrb r3, [r7] | r3 = *(r7);
0x00020120 add r2, r7, 1 | r2 = r7 + 1;
0x00020124 cmp r3, 0x3a |
| if (r3 == 0x3a) {
0x00020128 beq 0x201f0 | goto label_12;
| }
0x0002012c add r6, sp, 0x18 | r6 += size;
0x00020130 sub r3, r6, 4 | r3 -= src;
0x00020134 mov r8, r3 | r8 = r3;
| label_4:
0x00020138 ldrb r2, [r7], 1 | r2 = *(r7);
| r7++;
0x0002013c mov r1, r3 | r1 = r3;
0x00020140 cmp r2, 0 |
0x00020144 strb r2, [r3], 1 | *(r3) = r2;
| r3++;
| if (r2 != 0) {
0x00020148 beq 0x2015c |
0x0002014c cmp r2, 0x3a |
| if (r2 != 0x3a) {
0x00020150 bne 0x201f8 | goto label_13;
| }
0x00020154 mov r3, 0 | r3 = 0;
0x00020158 strb r3, [r1] | *(r1) = r3;
| }
| label_5:
0x0002015c ldrb r3, [r6, -4] | r3 = src;
0x00020160 sub r7, r7, fp | r7 -= fp;
0x00020164 cmp r3, 0 |
| if (r3 == 0) {
0x00020168 beq 0x200f4 | goto label_0;
| }
0x0002016c mov r0, r8 | r0 = r8;
0x00020170 bl 0x1264c | opendir ();
0x00020174 subs r3, r0, 0 | r3 -= src;
0x00020178 str r3, [sp, 4] | var_4h = r3;
| if (r3 == src) {
0x0002017c beq 0x200ec | goto label_1;
| }
| do {
0x00020180 ldr r0, [sp, 4] | r0 = var_4h;
0x00020184 bl 0x12af0 | r0 = readdir64 ();
0x00020188 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x0002018c beq 0x201dc | goto label_14;
| }
0x00020190 mov r1, sb | r1 = sb;
0x00020194 add r0, r4, 0x13 | r0 = r4 + 0x13;
0x00020198 bl 0x12a24 | r0 = strcmp (r0, r1);
0x0002019c subs r5, r0, 0 | r5 = r0 - 0;
0x000201a0 bne 0x20180 |
| } while (r5 != r0);
0x000201a4 ldrb r3, [sb] | r3 = *(sb);
0x000201a8 mov r0, sb | r0 = sb;
0x000201ac cmp r3, 0x2f |
| if (r3 != 0x2f) {
0x000201b0 bne 0x2020c | goto label_15;
| }
0x000201b4 bl 0x12acc | r0 = strdup (r0);
0x000201b8 mov r6, r0 | r6 = r0;
| label_6:
0x000201bc mov r1, 5 | r1 = 5;
0x000201c0 mov r0, r6 | r0 = r6;
0x000201c4 bl 0x126dc | r0 = access (r0, r1);
0x000201c8 cmp r0, 0 |
| if (r0 >= 0) {
0x000201cc bge 0x202a8 | goto label_16;
| }
| label_8:
0x000201d0 mov r4, 0 | r4 = 0;
| label_9:
0x000201d4 mov r0, r6 | r0 = r6;
0x000201d8 bl 0x12a54 | free (r0);
| label_14:
0x000201dc ldr r0, [sp, 4] | r0 = var_4h;
0x000201e0 bl 0x127cc | closedir ();
0x000201e4 cmp r4, 0 |
| if (r4 == 0) {
0x000201e8 beq 0x200ec | goto label_1;
| }
0x000201ec b 0x200f8 | goto label_2;
| label_12:
0x000201f0 mov r7, r2 | r7 = r2;
0x000201f4 b 0x2011c | goto label_3;
| label_13:
0x000201f8 ldr r1, [pc, 0x204] | r1 = *(0x20400);
0x000201fc sub r2, r3, r8 | r2 = r3 - r8;
0x00020200 cmp r2, r1 |
| if (r2 < r1) {
0x00020204 bls 0x20138 | goto label_4;
| }
0x00020208 b 0x2015c | goto label_5;
| label_15:
0x0002020c bl 0x1261c | strlen (r0);
0x00020210 ldrb r3, [r6, -4] | r3 = src;
0x00020214 cmp r3, 0 |
0x00020218 mov r4, r0 | r4 = r0;
| if (r3 == 0) {
0x0002021c beq 0x20284 | goto label_17;
| }
0x00020220 mov r0, r8 | r0 = r8;
0x00020224 bl 0x1261c | strlen (r0);
0x00020228 add r4, r4, 2 | r4 += 2;
0x0002022c add r0, r4, r0 | r0 = r4 + r0;
0x00020230 bl 0x1258c | malloc (r0);
0x00020234 subs r6, r0, 0 | r6 -= size;
0x00020238 bne 0x20244 |
| while (r6 == r0) {
0x0002023c mov r6, 0 | r6 = 0;
0x00020240 b 0x201bc | goto label_6;
0x00020244 mov r1, r8 | r1 = r8;
0x00020248 bl 0x12b20 | strcpy (r0, r1)
0x0002024c mov r0, r6 | r0 = r6;
0x00020250 bl 0x1261c | r0 = strlen (r0);
0x00020254 add r2, r6, r0 | r2 = r6 + r0;
0x00020258 ldrb r2, [r2, -1] | r2 = *((r2 - 1));
0x0002025c mov r3, r0 | r3 = r0;
0x00020260 cmp r2, 0x2f |
| if (r2 == 0x2f) {
0x00020264 addne r0, r0, 1 | r0 += var_1h;
| }
| if (r2 == 0x2f) {
0x00020268 movne r2, 0x2f | r2 = 0x2f;
| }
| if (r2 == 0x2f) {
0x0002026c strbne r2, [r6, r3] | *((r6 + r3)) = r2;
| }
| if (r2 == 0x2f) {
0x00020270 strbne r5, [r6, r0] | *((r6 + r0)) = r5;
| }
| label_7:
0x00020274 mov r1, sb | r1 = sb;
0x00020278 add r0, r6, r0 | r0 = r6 + r0;
0x0002027c bl 0x12b20 | strcpy (r0, r1)
0x00020280 b 0x201bc | goto label_6;
| label_17:
0x00020284 add r0, r0, 3 | r0 += 3;
0x00020288 bl 0x1258c | r0 = malloc (r0);
0x0002028c subs r6, r0, 0 | r6 = r0 - 0;
0x00020290 beq 0x2023c |
| }
0x00020294 ldr r3, [pc, 0x16c] | r3 = *(0x20404);
0x00020298 strb r5, [r6, 2] | *((r6 + 2)) = r5;
0x0002029c strh r3, [r6] | *(r6) = r3;
0x000202a0 mov r0, 2 | r0 = 2;
0x000202a4 b 0x20274 | goto label_7;
| label_16:
0x000202a8 mov r0, r6 | r0 = r6;
0x000202ac bl 0x12acc | r0 = strdup (r0);
0x000202b0 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x000202b4 beq 0x201d0 | goto label_8;
| }
0x000202b8 ldrb sl, [r6] | sl = *(r6);
0x000202bc cmp sl, 0x2f |
| if (sl == 0x2f) {
0x000202c0 movne sl, 0x2e | sl = 0x2e;
| }
| label_10:
0x000202c4 ldrb r2, [r4, r5] | r2 = *((r4 + r5));
0x000202c8 add r3, r4, r5 | r3 = r4 + r5;
0x000202cc cmp r2, 0 |
| if (r2 != 0) {
0x000202d0 bne 0x202dc | goto label_18;
| }
0x000202d4 b 0x2038c | goto label_19;
| do {
0x000202d8 mov r5, r8 | r5 = r8;
| label_18:
0x000202dc ldrb r1, [r3] | r1 = *(r3);
0x000202e0 mov r2, r3 | r2 = r3;
0x000202e4 cmp r1, 0 |
0x000202e8 cmpne r1, 0x2f | __asm ("cmpne r1, 0x2f");
0x000202ec add r3, r3, 1 | r3++;
0x000202f0 add r8, r5, 1 | r8 = r5 + 1;
0x000202f4 bne 0x202d8 |
| } while (r1 != 0);
0x000202f8 cmp r1, 0 |
| if (r1 == 0) {
0x000202fc beq 0x2038c | goto label_19;
| }
0x00020300 add r3, r4, r8 | r3 = r4 + r8;
0x00020304 mov r0, r3 | r0 = r3;
| do {
0x00020308 mov r1, r0 | r1 = r0;
0x0002030c ldrb lr, [r1] |
0x00020310 sub ip, r0, r4 |
0x00020314 cmp lr, 0x2f |
0x00020318 add r0, r0, 1 | r0++;
0x0002031c beq 0x20308 |
| } while (lr == 0x2f);
0x00020320 cmp ip, r8 |
| if (ip != r8) {
0x00020324 beq 0x20340 |
0x00020328 add r0, r4, r8 | r0 = r4 + r8;
0x0002032c str r2, [sp, 0xc] | var_ch = r2;
0x00020330 str r3, [sp, 8] | var_8h = r3;
0x00020334 bl 0x12b20 | strcpy (r0, r1)
0x00020338 ldr r3, [sp, 8] | r3 = var_8h;
0x0002033c ldr r2, [sp, 0xc] | r2 = var_ch;
| }
0x00020340 cmp r5, 0 |
| if (r5 != 0) {
0x00020344 beq 0x20364 |
0x00020348 add r1, r4, r5 | r1 = r4 + r5;
0x0002034c ldrb r1, [r1, -1] | r1 = *((r1 - 1));
0x00020350 cmp r1, 0x5c |
| if (r1 == 0x5c) {
0x00020354 beq 0x203b4 | goto label_11;
| }
0x00020358 ldrb r1, [r3] | r1 = *(r3);
0x0002035c cmp r1, 0 |
| if (r1 == 0) {
0x00020360 beq 0x20384 | goto label_20;
| }
| }
0x00020364 ldrb r1, [r3] | r1 = *(r3);
0x00020368 cmp r1, 0x2e |
| if (r1 != 0x2e) {
0x0002036c bne 0x203b4 | goto label_11;
| }
0x00020370 add r0, r8, 1 | r0 = r8 + 1;
0x00020374 add r1, r4, r0 | r1 = r4 + r0;
0x00020378 ldrb r0, [r4, r0] | r0 = *((r4 + r0));
0x0002037c cmp r0, 0 |
| if (r0 == 0) {
0x00020380 bne 0x203a0 |
| label_20:
0x00020384 mov r3, 0 | r3 = 0;
0x00020388 strb r3, [r2] | *(r2) = r3;
| label_19:
0x0002038c ldrb r3, [r4] | r3 = *(r4);
0x00020390 cmp r3, 0 |
| if (r3 != 0) {
0x00020394 strbeq sl, [r4] | *(r4) = sl;
| }
| if (r3 != 0) {
0x00020398 strbeq r3, [r4, 1] | *((r4 + 1)) = r3;
| }
0x0002039c b 0x201d4 | goto label_9;
| }
0x000203a0 cmp r0, 0x2f |
| if (r0 != 0x2f) {
0x000203a4 bne 0x203bc | goto label_21;
| }
0x000203a8 mov r0, r3 | r0 = r3;
0x000203ac bl 0x12b20 | strcpy (r0, r1)
0x000203b0 mov r8, r5 | r8 = r5;
| do {
| label_11:
0x000203b4 mov r5, r8 | r5 = r8;
0x000203b8 b 0x202c4 | goto label_10;
| label_21:
0x000203bc cmp r0, 0x2e |
0x000203c0 bne 0x203b4 |
| } while (r0 != 0x2e);
0x000203c4 add r3, r8, 2 | r3 = r8 + 2;
0x000203c8 add r1, r4, r3 | r1 = r4 + r3;
0x000203cc ldrb r3, [r4, r3] | r3 = *((r4 + r3));
0x000203d0 cmp r3, 0 |
0x000203d4 cmpne r3, 0x2f | __asm ("cmpne r3, 0x2f");
| if (r3 != 0) {
0x000203d8 bne 0x203b4 | goto label_11;
| }
| do {
0x000203dc subs r5, r5, 1 | r5--;
| if (r5 <= r5) {
0x000203e0 blo 0x203f0 | goto label_22;
| }
0x000203e4 ldrb r3, [r4, r5] | r3 = *((r4 + r5));
0x000203e8 cmp r3, 0x2f |
0x000203ec bne 0x203dc |
| } while (r3 != 0x2f);
| label_22:
0x000203f0 add r0, r5, 1 | r0 = r5 + 1;
0x000203f4 add r0, r4, r0 | r0 = r4 + r0;
0x000203f8 bl 0x12b20 | strcpy (r0, r1)
0x000203fc bic r8, r5, r5, asr 31 | r8 = BIT_MASK (r5, r5);
0x00020400 b 0x203b4 | goto label_11;
| }
; 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/bin/ntpq @ 0x22be4 */
| #include <stdint.h>
|
; (fcn) fcn.00022be4 () | void fcn_00022be4 (int32_t arg1, int32_t arg2) {
| int32_t var_0h;
| int32_t var_ch;
| r0 = arg1;
| r1 = arg2;
0x00022be4 push {r0, r1, r2, r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00022be8 mov r5, r0 | r5 = r0;
0x00022bec mov r0, r2 | r0 = r2;
0x00022bf0 mov r6, r1 | r6 = r1;
0x00022bf4 mov r4, r2 | r4 = r2;
0x00022bf8 mov r8, r3 | r8 = r3;
0x00022bfc bl 0x1261c | r0 = strlen (r0);
0x00022c00 cmp r0, 0 |
0x00022c04 cmpne r6, r0 | __asm ("cmpne r6, r0");
| if (r0 > 0) {
0x00022c08 movls sb, 1 | sb = 1;
| }
| if (r0 <= 0) {
0x00022c0c movhi sb, 0 | sb = 0;
| }
| if (r0 <= 0) {
0x00022c10 bhi 0x22c24 |
| label_0:
0x00022c14 mov sb, 0 | sb = 0;
| label_1:
0x00022c18 mov r0, sb | r0 = sb;
0x00022c1c add sp, sp, 0xc |
0x00022c20 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| }
0x00022c24 ldrb r3, [r4] | r3 = *(r4);
0x00022c28 cmp r3, 0x24 |
| if (r3 == 0x24) {
0x00022c2c beq 0x22c5c | goto label_3;
| }
0x00022c30 sub r1, r5, 1 | r1 = r5 - 1;
0x00022c34 mov r2, r4 | r2 = r4;
| do {
0x00022c38 ldrb r3, [r2], 1 | r3 = *(r2);
| r2++;
0x00022c3c cmp r3, 0 |
0x00022c40 strb r3, [r1, 1]! | *((r1 += 1)) = r3;
| if (r3 == 0) {
0x00022c44 beq 0x22d54 | goto label_2;
| }
0x00022c48 sub r3, r6, r2 | r3 = r6 - r2;
0x00022c4c add r3, r4, r3 | r3 = r4 + r3;
0x00022c50 cmp r3, 0 |
0x00022c54 bgt 0x22c38 |
| } while (r3 > 0);
0x00022c58 b 0x22c14 | goto label_0;
| label_3:
0x00022c5c ldrb r3, [r4, 1] | r3 = *((r4 + 1));
0x00022c60 cmp r3, 0x24 |
| if (r3 == 0x24) {
0x00022c64 beq 0x22ca0 | goto label_4;
| }
0x00022c68 cmp r3, 0x40 |
| if (r3 == 0x40) {
0x00022c6c beq 0x22d7c | goto label_5;
| }
0x00022c70 cmp r3, 0 |
| if (r3 == 0) {
0x00022c74 movne r2, r5 | r2 = r5;
| }
| if (r3 != 0) {
0x00022c78 ldrne r8, [pc, 0x1b4] | r8 = *(0x00022e34);
| goto label_6;
| }
| if (r3 == 0) {
| label_6:
0x00022c7c beq 0x22c18 | goto label_1;
| }
| do {
0x00022c80 ldrb r7, [r4, 1]! | r7 = *((r4 += 1));
0x00022c84 mov r1, r8 | r1 = r8;
0x00022c88 mov r0, r7 | r0 = r7;
0x00022c8c bl 0x1c9b0 | r0 = fcn_0001c9b0 (r0, r1);
0x00022c90 cmp r0, 0 |
| if (r0 == 0) {
0x00022c94 beq 0x22dbc | goto label_7;
| }
0x00022c98 strb r7, [r2], 1 | *(r2) = r7;
| r2++;
0x00022c9c b 0x22c80 |
| } while (1);
| label_4:
0x00022ca0 ldrb r3, [r4, 2] | r3 = *((r4 + 2));
0x00022ca4 cmp r3, 0 |
| if (r3 == 0) {
0x00022ca8 beq 0x22cbc | goto label_8;
| }
0x00022cac cmp r3, 0x2f |
| if (r3 != 0x2f) {
0x00022cb0 bne 0x22c18 | goto label_1;
| }
0x00022cb4 mov fp, 3 |
0x00022cb8 b 0x22cc0 | goto label_9;
| label_8:
0x00022cbc mov fp, 2 |
| label_9:
0x00022cc0 mov r1, 0x2f | r1 = 0x2f;
0x00022cc4 mov r0, r8 | r0 = r8;
0x00022cc8 bl 0x12a78 | r0 = strchr (r0, r1);
0x00022ccc cmp r0, 0 |
| if (r0 == 0) {
0x00022cd0 movne sl, r8 | sl = r8;
| }
| if (r0 != 0) {
0x00022cd4 bne 0x22cf4 | goto label_10;
| }
0x00022cd8 ldr r0, [pc, 0x158] | r0 = *(0x22e34);
0x00022cdc add r0, pc, r0 | r0 = pc + r0;
0x00022ce0 bl 0x12460 | getenv (r0);
0x00022ce4 mov r1, r8 | r1 = r8;
0x00022ce8 bl 0x200d4 | r0 = fcn_000200d4 (r0, r1);
0x00022cec subs sl, r0, 0 | sl = r0 - 0;
| if (sl == r0) {
0x00022cf0 beq 0x22c14 | goto label_0;
| }
| label_10:
0x00022cf4 mov r1, 0x2f | r1 = 0x2f;
0x00022cf8 mov r0, sl | r0 = sl;
0x00022cfc bl 0x125a4 | r0 = strrchr (r0, r1);
0x00022d00 subs r7, r0, 0 | r7 = r0 - 0;
| if (r7 == r0) {
0x00022d04 beq 0x22c14 | goto label_0;
| }
0x00022d08 add r4, r4, fp | r4 += fp;
0x00022d0c mov r0, r4 | r0 = r4;
0x00022d10 bl 0x1261c | strlen (r0);
0x00022d14 sub r7, r7, sl | r7 -= sl;
0x00022d18 add r7, r7, 1 | r7++;
0x00022d1c add r0, r0, r7 | r0 += r7;
0x00022d20 cmp r6, r0 |
| if (r6 < r0) {
0x00022d24 bls 0x22c14 | goto label_0;
| }
0x00022d28 mov r2, r7 | r2 = r7;
0x00022d2c mov r1, sl | r1 = sl;
0x00022d30 mov r0, r5 | r0 = r5;
0x00022d34 bl 0x124a8 | memcpy (r0, r1, r2);
0x00022d38 mov r1, r4 | r1 = r4;
0x00022d3c add r0, r5, r7 | r0 = r5 + r7;
0x00022d40 bl 0x12b20 | strcpy (r0, r1)
0x00022d44 cmp r8, sl |
| if (r8 != sl) {
0x00022d48 beq 0x22d54 |
0x00022d4c mov r0, sl | r0 = sl;
0x00022d50 bl 0x12a54 | free (r0);
| }
| label_2:
0x00022d54 mov r0, r5 | r0 = r5;
0x00022d58 bl 0x12424 | r0 = canonicalize_file_name ();
0x00022d5c subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 == r0) {
0x00022d60 beq 0x22c14 | goto label_0;
| }
0x00022d64 bl 0x1261c | r0 = strlen (r0);
0x00022d68 cmp r6, r0 |
| if (r6 > r0) {
0x00022d6c bhi 0x22e14 | goto label_11;
| }
0x00022d70 mov r0, r4 | r0 = r4;
0x00022d74 bl 0x12a54 | free (r0);
0x00022d78 b 0x22c18 | goto label_1;
| label_5:
0x00022d7c ldr r3, [pc, 0xb8] |
0x00022d80 add r3, pc, r3 | r3 = pc + r3;
0x00022d84 ldr r3, [r3] | r3 = *(0x22e38);
0x00022d88 ldrb r2, [r3] | r2 = *(r3);
0x00022d8c cmp r2, 0 |
| if (r2 == 0) {
0x00022d90 beq 0x22c14 | goto label_0;
| }
0x00022d94 ldr r2, [pc, 0xa4] | r2 = *(0x22e3c);
0x00022d98 add r4, r4, 2 | r4 += 2;
0x00022d9c str r4, [sp] | *(sp) = r4;
0x00022da0 add r2, pc, r2 | r2 = pc + r2;
0x00022da4 mov r1, r6 | r1 = r6;
0x00022da8 mov r0, r5 | r0 = r5;
0x00022dac bl 0x2e74c | r0 = fcn_0002e74c ();
0x00022db0 cmp r0, r6 |
| if (r0 < r6) {
0x00022db4 blt 0x22d54 | goto label_2;
| }
0x00022db8 b 0x22c14 | goto label_0;
| label_7:
0x00022dbc cmp r5, r2 |
| if (r5 == r2) {
0x00022dc0 beq 0x22c14 | goto label_0;
| }
0x00022dc4 strb r0, [r2] | *(r2) = r0;
0x00022dc8 mov r0, r5 | r0 = r5;
0x00022dcc bl 0x12460 | r0 = getenv (r0);
0x00022dd0 subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 == r0) {
0x00022dd4 beq 0x22c14 | goto label_0;
| }
0x00022dd8 bl 0x1261c | r0 = strlen (r0);
0x00022ddc mov r7, r0 | r7 = r0;
0x00022de0 mov r0, r4 | r0 = r4;
0x00022de4 bl 0x1261c | r0 = strlen (r0);
0x00022de8 add r0, r7, r0 | r0 = r7 + r0;
0x00022dec add r0, r0, 1 | r0++;
0x00022df0 cmp r6, r0 |
| if (r6 < r0) {
0x00022df4 bls 0x22c14 | goto label_0;
| }
0x00022df8 ldr r1, [pc, 0x44] | r1 = *(0x22e40);
0x00022dfc mov r3, r4 | r3 = r4;
0x00022e00 mov r2, r8 | r2 = r8;
0x00022e04 add r1, pc, r1 | r1 = pc + r1;
0x00022e08 mov r0, r5 | r0 = r5;
0x00022e0c bl 0x12970 | sprintf (r0, r1, r2);
0x00022e10 b 0x22d54 | goto label_2;
| label_11:
0x00022e14 add r2, r0, 1 | r2 = r0 + 1;
0x00022e18 mov r1, r4 | r1 = r4;
0x00022e1c mov r0, r5 | r0 = r5;
0x00022e20 bl 0x124a8 | memcpy (r0, r1, r2);
0x00022e24 mov r0, r4 | r0 = r4;
0x00022e28 bl 0x12a54 | free (r0);
0x00022e2c mov sb, 1 | sb = 1;
0x00022e30 b 0x22c18 | goto label_1;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/bin/ntpq @ 0x270ec */
| #include <stdint.h>
|
; (fcn) fcn.000270ec () | void fcn_000270ec (int32_t arg1, uint32_t arg2) {
| char * s;
| int32_t var_1h;
| int32_t var_2h;
| int32_t var_18h;
| r0 = arg1;
| r1 = arg2;
0x000270ec push {r4, r5, r6, r7, r8, sb, sl, lr} |
0x000270f0 ldr r7, [pc, 0x5cc] | r7 = *(0x276c0);
0x000270f4 ldr r3, [pc, 0x5cc] | r3 = "P";
0x000270f8 cmp r1, r7 |
0x000270fc mov sb, 0 | sb = 0;
| if (r1 == r7) {
0x00027100 movne r7, r1 | r7 = r1;
| }
0x00027104 add r3, pc, r3 | r3 = pc + r3;
0x00027108 mov r4, r0 | r4 = r0;
0x0002710c sub sp, sp, 0x18 |
0x00027110 mov r8, r1 | r8 = r1;
0x00027114 ldr r6, [pc, 0x5b0] | r6 = *(0x276c8);
0x00027118 mov r1, sb | r1 = sb;
0x0002711c add r0, r0, 0xc | r0 += 0xc;
| if (r1 != r7) {
0x00027120 moveq r7, sb | r7 = sb;
| }
0x00027124 strb sb, [r3, 0x10c] | *((r3 + 0x10c)) = sb;
0x00027128 bl 0x25058 | fcn_00025058 (r0, r1);
0x0002712c ldr r1, [pc, 0x59c] | r1 = *(0x276cc);
0x00027130 add r6, pc, r6 | r6 = pc + r6;
0x00027134 cmp r7, sb |
0x00027138 ldr r3, [pc, 0x594] | r3 = *(0x276d0);
0x0002713c ldr r2, [r4] | r2 = *(r4);
0x00027140 ldr r5, [r6, r1] | r5 = *(0x276c8);
| if (r7 != sb) {
0x00027144 bne 0x27190 | goto label_8;
| }
0x00027148 cmp r2, r3 |
0x0002714c ldr r3, [r5] | r3 = *(r5);
| if (r2 <= r3) {
0x00027150 ldrgt r0, [r4, 0x6c] | r0 = *((r4 + 0x6c));
| }
| if (r2 > r3) {
0x00027154 movle r0, r7 | r0 = r7;
| }
0x00027158 cmp r3, 0 |
| if (r3 != 0) {
0x0002715c bne 0x271a8 | goto label_9;
| }
0x00027160 ldr r3, [pc, 0x570] | r3 = *(0x276d4);
0x00027164 add r3, pc, r3 | r3 = pc + r3;
0x00027168 ldrb r3, [r3, 4] | r3 = *((r3 + 4));
0x0002716c cmp r3, 0 |
0x00027170 beq 0x2717c |
| while (r3 == 0) {
0x00027174 ldr r3, [pc, 0x560] | r3 = *(0x276d8);
0x00027178 b 0x27180 | goto label_10;
0x0002717c ldr r3, [pc, 0x55c] | r3 = *(0x276dc);
| label_10:
0x00027180 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00027184 ldr r3, [r3] | r3 = *(r3);
0x00027188 str r3, [r5] | *(r5) = r3;
0x0002718c b 0x271a8 | goto label_9;
| label_8:
0x00027190 cmp r2, r3 |
0x00027194 ldr r3, [r5] | r3 = *(r5);
| if (r2 <= r3) {
0x00027198 ldrgt r0, [r4, 0x70] | r0 = *((r4 + 0x70));
| }
| if (r2 > r3) {
0x0002719c movle r0, sb | r0 = sb;
| }
0x000271a0 cmp r3, 0 |
0x000271a4 beq 0x27174 |
| }
| label_9:
0x000271a8 ldr r2, [r4, 0xc] | r2 = *((r4 + 0xc));
0x000271ac ldr ip, [r5] | ip = *(r5);
0x000271b0 lsr r3, r2, 0x14 | r3 = r2 >> 0x14;
0x000271b4 eor r3, r3, 1 | r3 ^= 1;
0x000271b8 cmp r0, 0 |
| if (r0 != 0) {
0x000271bc moveq r3, 0 | r3 = 0;
| }
| if (r0 == 0) {
0x000271c0 andne r3, r3, 1 | r3 &= 1;
| }
0x000271c4 cmp r3, 0 |
| if (r3 == 0) {
0x000271c8 beq 0x27234 | goto label_11;
| }
0x000271cc tst r2, 0x2000 |
| if ((r2 & 0x2000) == 0) {
0x000271d0 beq 0x27228 | goto label_12;
| }
0x000271d4 mov r2, ip | r2 = ip;
0x000271d8 mov r1, 1 | r1 = 1;
0x000271dc bl 0x26f9c | fcn_00026f9c (r0, r1, r2);
| do {
| label_0:
0x000271e0 ldr r0, [r5] | r0 = *(r5);
0x000271e4 bl 0x128a4 | fflush (r0);
0x000271e8 ldr r0, [r5] | r0 = *(r5);
0x000271ec bl 0x1282c | r0 = ferror (r0);
0x000271f0 cmp r0, 0 |
| if (r0 == 0) {
0x000271f4 beq 0x276bc | goto label_13;
| }
0x000271f8 ldr r2, [pc, 0x4e0] |
0x000271fc ldr r3, [pc, 0x4e0] | r3 = *(0x276e0);
0x00027200 ldr r2, [r6, r2] | r2 = *((r6 + r2));
0x00027204 ldr ip, [r5] | ip = *(r5);
0x00027208 ldr r2, [r2] | r2 = *(0x276dc);
0x0002720c ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00027210 cmp ip, r2 |
0x00027214 ldr r0, [r4, 0x1c] | r0 = *((r4 + 0x1c));
0x00027218 ldr r1, [r3, 0xe4] | r1 = *(0x277c4);
| if (ip != r2) {
0x0002721c bne 0x274e0 | goto label_14;
| }
| label_1:
0x00027220 ldr r2, [r3, 0xdc] | r2 = *((r3 + 0xdc));
| label_2:
0x00027224 bl 0x1dddc | fcn_0001dddc (r0, r1);
| label_12:
0x00027228 mov r1, ip | r1 = ip;
0x0002722c bl 0x12874 | fputs (r0, r1);
0x00027230 b 0x271e0 |
| } while (1);
| label_11:
0x00027234 ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x00027238 ldr r1, [r4, 0x38] | r1 = *((r4 + 0x38));
0x0002723c mov r0, ip | r0 = ip;
0x00027240 bl 0x12910 | fprintf (r0, r1, r2);
0x00027244 cmp r7, 0 |
0x00027248 ldr r0, [r4, 0xc] | r0 = *((r4 + 0xc));
| if (r7 != 0) {
0x0002724c beq 0x27258 |
0x00027250 tst r0, 0x4000 |
| if ((r0 & 0x4000) != 0) {
0x00027254 bne 0x275b0 | goto label_15;
| }
| }
0x00027258 mov r3, 0 | r3 = 0;
0x0002725c add r1, sp, 0x18 | r1 += var_18h;
0x00027260 str r3, [r1, -0x18]! | *((r1 -= 0x18)) = r3;
0x00027264 ldr r3, [pc, 0x47c] | r3 = *(0x276e4);
0x00027268 tst r0, 0x1000 |
0x0002726c ldr sl, [r6, r3] | sl = *((r6 + r3));
| if ((r0 & 0x1000) == 0) {
0x00027270 beq 0x27500 | goto label_16;
| }
0x00027274 bl 0x1de48 | fcn_0001de48 (r0, r1);
0x00027278 add r1, sl, 0x21 | r1 = sl + 0x21;
0x0002727c mov r2, r0 | r2 = r0;
0x00027280 mov sb, r0 | sb = r0;
0x00027284 ldr r0, [pc, 0x460] |
0x00027288 add r0, pc, r0 | r0 = pc + r0;
0x0002728c add r0, r0, 0x10c | r0 = 0x277f4;
0x00027290 add r0, r0, 1 | r0++;
0x00027294 bl 0x12970 | sprintf (r0, r1, r2);
0x00027298 ldr r1, [r5] | r1 = *(r5);
0x0002729c ldr r3, [r1, 0x34] | r3 = *((r1 + 0x34));
0x000272a0 cmp r3, 0 |
| if (r3 == 0) {
0x000272a4 beq 0x274f4 | goto label_17;
| }
0x000272a8 ldr r3, [r1, 0x10] | r3 = *((r1 + 0x10));
0x000272ac ldr r2, [r1, 0x1c] | r2 = *((r1 + 0x1c));
0x000272b0 cmp r3, r2 |
| if (r3 >= r2) {
0x000272b4 bhs 0x274e8 | goto label_18;
| }
0x000272b8 add r2, r3, 1 | r2 = r3 + 1;
0x000272bc str r2, [r1, 0x10] | *((r1 + 0x10)) = r2;
0x000272c0 mov r2, 0xa | r2 = 0xa;
0x000272c4 strb r2, [r3] | *(r3) = r2;
| label_3:
0x000272c8 adds r0, sb, 0xf | r0 = sb + 0xf;
| if (r0 >= sb) {
0x000272cc addmi r0, sb, 0x16 | r0 = sb + 0x16;
| }
0x000272d0 asr r0, r0, 3 | r0 >>= 3;
0x000272d4 rsb r0, r0, 4 | r0 = 4 - r0;
0x000272d8 cmp r0, 0 |
| if (r0 <= 0) {
0x000272dc ldrgt r3, [pc, 0x40c] | r3 = *((pc + 0x40c));
| }
| if (r0 <= 0) {
0x000272e0 addgt r3, pc, r3 | r3 = pc + r3;
| }
| if (r0 <= 0) {
0x000272e4 strgt r0, [r3, 0x108] | *((r3 + 0x108)) = r0;
| }
0x000272e8 ldr r2, [sp] | r2 = *(sp);
0x000272ec mov r1, r8 | r1 = r8;
0x000272f0 mov r0, r4 | r0 = r4;
0x000272f4 bl 0x1f8cc | fcn_0001f8cc (r0, r1, r2);
0x000272f8 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x000272fc and r3, r3, 3 | r3 &= 3;
0x00027300 cmp r3, 1 |
| if (r3 == 1) {
0x00027304 beq 0x2754c | goto label_19;
| }
| if (r3 <= 1) {
0x00027308 blo 0x27560 | goto label_20;
| }
0x0002730c cmp r3, 3 |
| if (r3 == 3) {
0x00027310 bne 0x27328 |
0x00027314 ldr r3, [pc, 0x3c8] | r3 = *(0x276e0);
0x00027318 ldr r1, [r5] | r1 = *(r5);
0x0002731c ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00027320 ldr r0, [r3, 0x120] | r0 = *(0x27800);
| label_4:
0x00027324 bl 0x12874 | fputs (r0, r1);
| }
0x00027328 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x0002732c tst r3, 0x20 |
| if ((r3 & 0x20) != 0) {
0x00027330 beq 0x27348 |
0x00027334 ldr r3, [pc, 0x3a8] | r3 = *(0x276e0);
0x00027338 ldr r1, [r5] | r1 = *(r5);
0x0002733c ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00027340 ldr r0, [r3, 0x14c] | r0 = *(0x2782c);
0x00027344 bl 0x12874 | fputs (r0, r1);
| }
0x00027348 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x0002734c tst r3, 0x800 |
| if ((r3 & 0x800) != 0) {
0x00027350 beq 0x27368 |
0x00027354 ldr r3, [pc, 0x388] | r3 = *(0x276e0);
0x00027358 ldr r1, [r5] | r1 = *(r5);
0x0002735c ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00027360 ldr r0, [r3, 0x18c] | r0 = *(0x2786c);
0x00027364 bl 0x12874 | fputs (r0, r1);
| }
0x00027368 ldr r0, [r4, 0x3c] | r0 = *((r4 + 0x3c));
0x0002736c cmp r0, 0 |
| if (r0 != 0) {
0x00027370 beq 0x2737c |
0x00027374 ldr r1, [r5] | r1 = *(r5);
0x00027378 bl 0x12874 | fputs (r0, r1);
| }
0x0002737c cmp r8, 0 |
| if (r8 != 0) {
0x00027380 bne 0x2747c | goto label_21;
| }
0x00027384 ldr r8, [r4, 0x34] | r8 = *((r4 + 0x34));
0x00027388 cmp r8, 0 |
| if (r8 != 0) {
0x0002738c beq 0x273a0 |
0x00027390 ldr r2, [r4, 0x18] | r2 = *((r4 + 0x18));
0x00027394 ldr r1, [r4, 0x24] | r1 = *((r4 + 0x24));
0x00027398 mov r0, r8 | r0 = r8;
0x0002739c bl 0x22e48 | fcn_00022e48 (r0, r1);
| }
0x000273a0 ldr r3, [r4, 0xc] | r3 = *((r4 + 0xc));
0x000273a4 tst r3, 0x100 |
| if ((r3 & 0x100) != 0) {
0x000273a8 beq 0x273d8 |
0x000273ac ldr r3, [pc, 0x330] | r3 = *(0x276e0);
0x000273b0 cmp r8, 0 |
0x000273b4 ldr r8, [r6, r3] | r8 = *((r6 + r3));
| if (r8 == 0) {
0x000273b8 bne 0x273c8 |
0x000273bc ldr r1, [r5] | r1 = *(r5);
0x000273c0 ldr r0, [r8, 0x160] | r0 = *((r8 + 0x160));
0x000273c4 bl 0x12874 | fputs (r0, r1);
| }
0x000273c8 ldr r2, [r4, 0x20] | r2 = *((r4 + 0x20));
0x000273cc ldr r1, [r8, 0x114] | r1 = *((r8 + 0x114));
0x000273d0 ldr r0, [r5] | r0 = *(r5);
0x000273d4 bl 0x12910 | fprintf (r0, r1, r2);
| }
0x000273d8 ldr r3, [pc, 0x314] | r3 = *(0x276f0);
0x000273dc add r3, pc, r3 | r3 = pc + r3;
0x000273e0 ldrb r3, [r3, 0x10c] | r3 = *((r3 + 0x10c));
0x000273e4 cmp r3, 0 |
| if (r3 == 0) {
0x000273e8 beq 0x27468 | goto label_22;
| }
0x000273ec ldr r1, [r5] | r1 = *(r5);
0x000273f0 ldr r8, [r4, 0x64] | r8 = *((r4 + 0x64));
0x000273f4 ldr r3, [r1, 0x34] | r3 = *((r1 + 0x34));
0x000273f8 ldr sb, [r4, 0x44] | sb = *((r4 + 0x44));
0x000273fc cmp r3, 0 |
| if (r3 == 0) {
0x00027400 beq 0x27580 | goto label_23;
| }
0x00027404 ldr r3, [r1, 0x10] | r3 = *((r1 + 0x10));
0x00027408 ldr r2, [r1, 0x1c] | r2 = *((r1 + 0x1c));
0x0002740c cmp r3, r2 |
| if (r3 >= r2) {
0x00027410 bhs 0x27574 | goto label_24;
| }
0x00027414 add r2, r3, 1 | r2 = r3 + 1;
0x00027418 str r2, [r1, 0x10] | *((r1 + 0x10)) = r2;
0x0002741c mov r2, 0xa | r2 = 0xa;
0x00027420 strb r2, [r3] | *(r3) = r2;
| label_5:
0x00027424 ldr r0, [r5] | r0 = *(r5);
0x00027428 bl 0x128a4 | fflush (r0);
| do {
0x0002742c ldr r3, [sb, 0x10] | r3 = *((sb + 0x10));
0x00027430 lsr r3, r3, 0xc | r3 >>= 0xc;
0x00027434 and r3, r3, 0xf | r3 &= 0xf;
0x00027438 cmp r3, 2 |
| if (r3 != 2) {
0x0002743c beq 0x27448 |
0x00027440 cmp r3, 4 |
| if (r3 != 4) {
0x00027444 bne 0x27458 | goto label_25;
| }
| }
0x00027448 ldr r3, [sb, 0x28] | r3 = *((sb + 0x28));
0x0002744c mov r1, sb | r1 = sb;
0x00027450 mov r0, 1 | r0 = 1;
0x00027454 blx r3 | uint32_t (*r3)(uint32_t, uint32_t, uint32_t) (r0, r1, r3);
| label_25:
0x00027458 sub r8, r8, 1 | r8--;
0x0002745c cmp r8, 0 |
0x00027460 add sb, sb, 0x40 | sb += 0x40;
0x00027464 bgt 0x2742c |
| } while (r8 > 0);
| label_22:
0x00027468 ldr r0, [r4, 0x40] | r0 = *((r4 + 0x40));
0x0002746c cmp r0, 0 |
| if (r0 != 0) {
0x00027470 beq 0x2747c |
0x00027474 ldr r1, [r5] | r1 = *(r5);
0x00027478 bl 0x12874 | fputs (r0, r1);
| }
| label_21:
0x0002747c ldr r2, [r4] | r2 = *(r4);
0x00027480 ldr r3, [r5] | r3 = *(r5);
0x00027484 cmp r2, 0x22000 |
| if (r2 < 0x22000) {
0x00027488 blt 0x2758c | goto label_26;
| }
0x0002748c ldr r0, [r4, 0x80] | r0 = *((r4 + 0x80));
0x00027490 cmp r0, 0 |
| if (r0 == 0) {
0x00027494 beq 0x2758c | goto label_26;
| }
0x00027498 mov r1, r3 | r1 = r3;
0x0002749c bl 0x12874 | fputs (r0, r1);
| label_6:
0x000274a0 ldr r0, [r5] | r0 = *(r5);
0x000274a4 bl 0x128a4 | fflush (r0);
0x000274a8 ldr r0, [r5] | r0 = *(r5);
0x000274ac bl 0x1282c | r0 = ferror (r0);
0x000274b0 cmp r0, 0 |
| if (r0 == 0) {
0x000274b4 beq 0x271e0 | goto label_0;
| }
0x000274b8 ldr r2, [pc, 0x21c] |
0x000274bc ldr r3, [pc, 0x220] | r3 = *(0x276e0);
0x000274c0 ldr r2, [r6, r2] | r2 = *((r6 + r2));
0x000274c4 ldr ip, [r5] | ip = *(r5);
0x000274c8 ldr r2, [r2] | r2 = *(0x276d8);
0x000274cc ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x000274d0 cmp ip, r2 |
0x000274d4 ldr r0, [r4, 0x1c] | r0 = *((r4 + 0x1c));
0x000274d8 ldr r1, [r3, 0xe4] | r1 = *(0x277c4);
| if (ip != r2) {
0x000274dc bne 0x27220 | goto label_1;
| }
| label_14:
0x000274e0 ldr r2, [r3, 0xe0] | r2 = *((r3 + 0xe0));
0x000274e4 b 0x27224 | goto label_2;
| label_18:
0x000274e8 mov r0, 0xa | r0 = 0xa;
0x000274ec bl 0x126d0 | fputc_unlocked ();
0x000274f0 b 0x272c8 | goto label_3;
| label_17:
0x000274f4 mov r0, 0xa | r0 = 0xa;
0x000274f8 bl 0x127fc | fputc (r0, r1);
0x000274fc b 0x272c8 | goto label_3;
| label_16:
0x00027500 bl 0x1df78 | fcn_0001df78 (r0, r1);
0x00027504 add r1, sl, 0x21 | r1 = sl + 0x21;
0x00027508 mov r2, r0 | r2 = r0;
0x0002750c mov sb, r0 | sb = r0;
0x00027510 ldr r0, [pc, 0x1e0] |
0x00027514 add r0, pc, r0 | r0 = pc + r0;
0x00027518 add r0, r0, 0x10c | r0 = 0x27800;
0x0002751c add r0, r0, 1 | r0++;
0x00027520 bl 0x12970 | sprintf (r0, r1, r2);
0x00027524 cmp r8, 0 |
| if (r8 != 0) {
0x00027528 bne 0x2753c | goto label_27;
| }
0x0002752c ldr r3, [r4, 0x44] | r3 = *((r4 + 0x44));
0x00027530 ldr r3, [r3, 0x10] | r3 = *((r3 + 0x10));
0x00027534 tst r3, 0x200000 |
| if ((r3 & 0x200000) != 0) {
0x00027538 bne 0x272c8 | goto label_3;
| }
| label_27:
0x0002753c ldr r1, [r5] | r1 = *(r5);
0x00027540 ldr r0, [sp] | r0 = *(sp);
0x00027544 bl 0x12874 | fputs (r0, r1);
0x00027548 b 0x272c8 | goto label_3;
| label_19:
0x0002754c ldr r3, [pc, 0x190] | r3 = *(0x276e0);
0x00027550 ldr r1, [r5] | r1 = *(r5);
0x00027554 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x00027558 ldr r0, [r3, 0x134] | r0 = *(0x27814);
0x0002755c b 0x27324 | goto label_4;
| label_20:
0x00027560 ldr r3, [pc, 0x17c] | r3 = *(0x276e0);
0x00027564 ldr r1, [r5] | r1 = *(r5);
0x00027568 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0002756c ldr r0, [r3, 0x150] | r0 = *(0x27830);
0x00027570 b 0x27324 | goto label_4;
| label_24:
0x00027574 mov r0, 0xa | r0 = 0xa;
0x00027578 bl 0x126d0 | fputc_unlocked ();
0x0002757c b 0x27424 | goto label_5;
| label_23:
0x00027580 mov r0, 0xa | r0 = 0xa;
0x00027584 bl 0x127fc | fputc (r0, r1);
0x00027588 b 0x27424 | goto label_5;
| label_26:
0x0002758c ldr r2, [r4, 0x48] | r2 = *((r4 + 0x48));
0x00027590 cmp r2, 0 |
| if (r2 == 0) {
0x00027594 beq 0x274a0 | goto label_6;
| }
0x00027598 ldr r1, [pc, 0x144] |
0x0002759c mov r0, r3 | r0 = r3;
0x000275a0 ldr r1, [r6, r1] | r1 = *((r6 + r1));
0x000275a4 ldr r1, [r1, 0x158] | r1 = *(0x27838);
0x000275a8 bl 0x12910 | fprintf (r0, r1);
0x000275ac b 0x274a0 | goto label_6;
| label_15:
0x000275b0 ldr r3, [r4] | r3 = *(r4);
0x000275b4 cmp r3, 0x26000 |
| if (r3 < 0x26000) {
0x000275b8 ldrge r2, [r4, 0x68] | r2 = *((r4 + 0x68));
| }
| if (r3 < 0x26000) {
0x000275bc ldrge r3, [r4, 0x44] | r3 = *((r4 + 0x44));
| }
| if (r3 < 0x26000) {
0x000275c0 addge r3, r3, r2, lsl 6 | r3 += (r2 << 6);
| }
| if (r3 >= 0x26000) {
0x000275c4 bge 0x27618 | goto label_28;
| }
0x000275c8 and r3, r0, 3 | r3 = r0 & 3;
0x000275cc cmp r3, 2 |
0x000275d0 mov r0, sp | r0 = sp;
| if (r3 == 2) {
0x000275d4 beq 0x276a0 | goto label_29;
| }
0x000275d8 cmp r3, 3 |
| if (r3 != 3) {
0x000275dc beq 0x275e8 |
0x000275e0 cmp r3, 1 |
| if (r3 != 1) {
0x000275e4 bne 0x276b0 | goto label_30;
| }
| }
0x000275e8 ldr r1, [pc, 0x10c] | r1 = *(0x276f8);
0x000275ec add r1, pc, r1 | r1 = pc + r1;
0x000275f0 b 0x276a8 | goto label_7;
| do {
0x000275f4 ldr r1, [r4, 0x64] | r1 = *((r4 + 0x64));
0x000275f8 add r2, r2, 1 | r2++;
0x000275fc cmp r2, r1 |
| if (r2 >= r1) {
0x00027600 blt 0x27614 |
0x00027604 ldr r3, [pc, 0xd8] | r3 = *(0x276e0);
0x00027608 ldr r3, [r6, r3] | r3 = *((r6 + r3));
0x0002760c ldr r0, [r3, 0x38] | r0 = *(0x27718);
0x00027610 bl 0x1da34 | fcn_0001da34 (r0);
| }
0x00027614 add r3, r3, 0x40 | r3 += 0x40;
| label_28:
0x00027618 ldr r1, [r3, 0x14] | r1 = *((r3 + 0x14));
0x0002761c cmp r1, 3 |
0x00027620 bne 0x275f4 |
| } while (r1 != 3);
0x00027624 and r0, r0, 3 | r0 &= 3;
0x00027628 cmp r0, 2 |
| if (r0 != 2) {
0x0002762c beq 0x27668 |
0x00027630 cmp r0, 3 |
| if (r0 != 3) {
0x00027634 beq 0x2764c |
0x00027638 cmp r0, 1 |
| if (r0 == 1) {
0x0002763c movne r2, 0x14 | r2 = 0x14;
| }
| if (r0 == 1) {
0x00027640 ldrne r1, [r3, 0x34] | r1 = *((r3 + 0x34));
| }
| if (r0 == 1) {
0x00027644 movne r0, sp | r0 = sp;
| }
| if (r0 != 1) {
0x00027648 bne 0x27660 | goto label_31;
| }
| }
0x0002764c ldr r2, [pc, 0xac] | r2 = *(0x276fc);
0x00027650 add r0, sp, 2 | r0 += var_2h;
0x00027654 strh r2, [sp] | *(sp) = r2;
0x00027658 ldr r1, [r3, 0x34] | r1 = *((r3 + 0x34));
0x0002765c mov r2, 0x14 | r2 = 0x14;
| label_31:
0x00027660 bl 0x12850 | strncpy (r0, r1, r2);
0x00027664 b 0x27680 |
| } else {
0x00027668 mov r2, 0x2d | r2 = 0x2d;
0x0002766c strb r2, [sp] | *(sp) = r2;
0x00027670 ldrh r3, [r3, 2] | r3 = *((r3 + 2));
0x00027674 strb r3, [sp, 1] | var_1h = r3;
0x00027678 mov r3, 0 | r3 = 0;
0x0002767c strb r3, [sp, 2] | var_2h = r3;
| }
| do {
0x00027680 ldr r3, [pc, 0x5c] | r3 = *(0x276e0);
0x00027684 ldr r2, [r4, 0x1c] | r2 = *((r4 + 0x1c));
0x00027688 ldr r1, [r6, r3] | r1 = *((r6 + r3));
0x0002768c ldr r0, [r5] | r0 = *(r5);
0x00027690 mov r3, sp | r3 = sp;
0x00027694 ldr r1, [r1, 0xd4] | r1 = *((r1 + 0xd4));
0x00027698 bl 0x12910 | fprintf (r0, r1, r2, r3);
0x0002769c b 0x271e0 | goto label_0;
| label_29:
0x000276a0 ldr r1, [pc, 0x5c] | r1 = *(0x27700);
0x000276a4 add r1, pc, r1 | r1 = pc + r1;
| label_7:
0x000276a8 bl 0x12b20 | strcpy (r0, r1)
0x000276ac b 0x27680 |
| } while (1);
| label_30:
0x000276b0 ldr r1, [pc, 0x50] | r1 = "atch:";
0x000276b4 add r1, pc, r1 | r1 = pc + r1;
0x000276b8 b 0x276a8 | goto label_7;
| label_13:
0x000276bc mov r0, r7 | r0 = r7;
0x000276c0 bl 0x1d9f8 | r0 = fcn_0001d9f8 (r0);
| if (r0 != 1) {
0x000276c4 andeq r2, r0, r0, asr r7 | r2 = r0 & (r0 >> r7);
| }
0x000276c8 strheq pc, [r2], -r4 | __asm ("strheq pc, [r2], -r4");
| if (r0 != 1) {
0x000276cc andeq fp, r2, r8, asr 29 |
| }
| if (r0 != 1) {
0x000276d0 andeq r0, r0, r4, asr 5 | r0 &= (r4 >> 5);
| }
0x000276d4 strdeq sp, lr, [r1], -pc | __asm ("strdeq sp, lr, [r1], -pc");
| if (r0 != 1) {
0x000276d8 andeq pc, r2, r4, asr r8 | pc = r2 & (r4 >> r8);
| }
| if (r0 != 1) {
0x000276dc andeq r0, r0, r4, lsr 5 | r0 &= (r4 >> 5);
| }
| if (r0 != 1) {
0x000276e0 muleq r0, ip, r2 | r0 = ip * r2;
| }
| if (r0 != 1) {
0x000276e4 andeq r0, r0, ip, asr 5 | r0 &= (ip >> 5);
| }
| if (r0 != 1) {
0x000276e8 andeq r0, r0, ip, lsr 5 | r0 &= (ip >> 5);
| }
| if (r0 != 1) {
0x000276ec andeq pc, r2, r0, lsr r7 | pc = r2 & (r0 >> r7);
| }
0x000276f0 invalid |
| }
; 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/bin/ntpq @ 0x12b70 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main (int32_t argc, char ** argv) {
| int32_t var_4h;
| void * var_ch;
| void * ptr;
| int32_t var_14h;
| int32_t var_1ch;
| r0 = argc;
| r1 = argv;
0x00012b70 b 0x16e28 |
0x00016e28 ldr r2, [pc, 0x674] | r2 = *(0x174a0);
0x00016e2c ldr r3, [pc, 0x674] | r3 = *(0x174a4);
0x00016e30 push {r4, r5, r6, r7, r8, sb, sl, fp, lr} |
0x00016e34 mov r4, 0 | r4 = 0;
0x00016e38 sub sp, sp, 0x1c |
0x00016e3c str r2, [r3, 4] | *((r3 + 4)) = r2;
0x00016e40 mov r7, r0 | r7 = r0;
0x00016e44 mov sl, r1 | sl = r1;
0x00016e48 str r4, [r3] | *(r3) = r4;
0x00016e4c bl 0x2acf0 | fcn_0002acf0 ();
0x00016e50 bl 0x29af8 | fcn_00029af8 ();
0x00016e54 ldr r3, [pc, 0x650] |
0x00016e58 mov r1, 4 | r1 = 4;
0x00016e5c ldr r3, [r3] | r3 = *(0x174a8);
0x00016e60 str r4, [sp, 0xc] | var_ch = r4;
0x00016e64 cmp r3, r4 |
| if (r3 != r4) {
0x00016e68 ldreq r3, [pc, 0x640] | r3 = *(0x000174b0);
| }
| if (r3 != r4) {
0x00016e6c moveq r2, 2 | r2 = 2;
| }
0x00016e70 str r4, [sp, 0x10] | ptr = r4;
| if (r3 != r4) {
0x00016e74 streq r2, [r3] | *(r3) = r2;
| }
0x00016e78 mov r3, 9 | r3 = 9;
0x00016e7c mov r2, 0 | r2 = 0;
0x00016e80 str r3, [sp, 0x14] | var_14h = r3;
0x00016e84 mov r0, r2 | r0 = r2;
0x00016e88 mov r3, 1 | r3 = 1;
0x00016e8c bl 0x2aa08 | fcn_0002aa08 (r0, r1);
0x00016e90 ldr r3, [pc, 0x61c] |
0x00016e94 ldr r3, [r3] | r3 = *(0x174b0);
0x00016e98 cmp r3, 0 |
0x00016e9c str r0, [sp, 0x10] | ptr = r0;
| if (r3 == 0) {
0x00016ea0 bne 0x16ea8 |
0x00016ea4 bl 0x2ed0c | fcn_0002ed0c ();
| }
0x00016ea8 add r1, sp, 0xc | r1 += var_ch;
0x00016eac ldr r0, [pc, 0x604] | r0 = *(0x174b4);
0x00016eb0 bl 0x1243c | EVP_MD_do_all_sorted ();
0x00016eb4 ldr r4, [sp, 0xc] | r4 = var_ch;
0x00016eb8 ldr r0, [sp, 0x10] | r0 = ptr;
0x00016ebc bl 0x12a54 | free (r0);
0x00016ec0 cmp r4, 0 |
| if (r4 == 0) {
0x00016ec4 beq 0x16f38 | goto label_12;
| }
0x00016ec8 ldrb r3, [r4] | r3 = *(r4);
0x00016ecc cmp r3, 0 |
| if (r3 == 0) {
0x00016ed0 beq 0x16f38 | goto label_12;
| }
0x00016ed4 ldr r0, [pc, 0x5e0] | r0 = *(0x174b8);
0x00016ed8 bl 0x12a48 | r0 = OBJ_nid2sn ();
0x00016edc subs r8, r0, 0 | r8 = r0 - 0;
| if (r8 != r0) {
0x00016ee0 bne 0x16f64 | goto label_13;
| }
| label_0:
0x00016ee4 ldr r5, [pc, 0x5d4] | r5 = *(0x174bc);
0x00016ee8 ldr r3, [pc, 0x5d4] | r3 = *(0x174c0);
0x00016eec mov r8, 0 | r8 = 0;
0x00016ef0 add fp, r5, 0x1c |
0x00016ef4 mov r6, r5 | r6 = r5;
| do {
0x00016ef8 ldr r1, [fp, r8, lsl 5] | offset_0 = r8 << 5;
| r1 = *((fp + offset_0));
0x00016efc mov r0, r3 | r0 = r3;
0x00016f00 str r3, [sp, 4] | var_4h = r3;
0x00016f04 bl 0x12a24 | strcmp (r0, r1);
0x00016f08 lsl sb, r8, 5 | sb = r8 << 5;
0x00016f0c cmp r0, 0 |
| if (r0 == 0) {
0x00016f10 beq 0x1734c | goto label_14;
| }
0x00016f14 add r8, r8, 1 | r8++;
0x00016f18 cmp r8, 0x14 |
0x00016f1c ldr r3, [sp, 4] | r3 = var_4h;
0x00016f20 bne 0x16ef8 |
| } while (r8 != 0x14);
0x00016f24 ldr r3, [pc, 0x59c] | r3 = "keytype";
0x00016f28 mov r2, 2 | r2 = 2;
0x00016f2c ldr r1, [pc, 0x598] | r1 = "icmd___sizeof_builtins__sizeof_builtins_";
0x00016f30 ldr r0, [pc, 0x598] | r0 = *(0x174cc);
0x00016f34 bl 0x2f7d0 | fcn_0002f7d0 ();
| label_12:
0x00016f38 mov r3, 0 | r3 = 0;
0x00016f3c mov r2, r3 | r2 = r3;
0x00016f40 mov r1, 0x10 | r1 = 0x10;
0x00016f44 mov r0, r4 | r0 = r4;
0x00016f48 bl 0x2aa08 | fcn_0002aa08 (r0, r1);
0x00016f4c ldr r3, [pc, 0x580] | r3 = "ntpq.c";
0x00016f50 ldr r2, [pc, 0x580] | r2 = "AES128CMAC";
0x00016f54 ldr r1, [pc, 0x580] | r1 = "\n ";
0x00016f58 mov r4, r0 | r4 = r0;
0x00016f5c bl 0x12970 | sprintf (r0, "\n ", "AES128CMAC");
0x00016f60 b 0x16ee4 | goto label_0;
| label_13:
0x00016f64 ldrb r3, [r8] | r3 = *(r8);
0x00016f68 cmp r3, 0 |
| if (r3 == 0) {
0x00016f6c beq 0x16ee4 | goto label_0;
| }
0x00016f70 mov r3, r4 | r3 = r4;
0x00016f74 b 0x16f94 | goto label_15;
| label_1:
0x00016f78 mov r0, r8 | r0 = r8;
0x00016f7c bl 0x1261c | strlen (r0);
0x00016f80 ldrb r2, [r6, r0] | r2 = *((r6 + r0));
0x00016f84 add r3, r6, r0 | r3 = r6 + r0;
0x00016f88 cmp r2, 0 |
0x00016f8c cmpne r2, 0x2c | __asm ("cmpne r2, 0x2c");
| if (r2 == 0) {
0x00016f90 beq 0x16ee4 | goto label_0;
| }
| label_15:
0x00016f94 mov r1, r8 | r1 = r8;
0x00016f98 mov r0, r3 | r0 = r3;
0x00016f9c bl 0x12a0c | r0 = strstr (r0, r1);
0x00016fa0 subs r6, r0, 0 | r6 = r0 - 0;
| if (r6 != r0) {
0x00016fa4 bne 0x16f78 | goto label_1;
| }
0x00016fa8 mov r0, r4 | r0 = r4;
0x00016fac bl 0x1261c | strlen (r0);
0x00016fb0 mov r8, r4 | r8 = r4;
0x00016fb4 ldr fp, [pc, 0x51c] | fp = "\n ";
0x00016fb8 str r0, [sp, 4] | var_4h = r0;
0x00016fbc add sb, r4, r0 | sb = r4 + r0;
0x00016fc0 b 0x16fdc |
| while (r0 == 0) {
0x00016fc4 add r5, r8, 5 | r5 = r8 + 5;
| label_3:
0x00016fc8 cmp r5, sb |
| if (r5 < sb) {
0x00016fcc bhs 0x16fdc |
0x00016fd0 ldrb r2, [r5] | r2 = *(r5);
0x00016fd4 cmp r2, 0 |
| if (r2 != 0) {
0x00016fd8 bne 0x17070 | goto label_16;
| }
| }
| label_2:
0x00016fdc cmp r8, sb |
| if (r8 >= sb) {
0x00016fe0 bhs 0x17008 | goto label_17;
| }
0x00016fe4 ldrb r2, [r8] | r2 = *(r8);
0x00016fe8 cmp r2, 0 |
| if (r2 == 0) {
0x00016fec beq 0x17008 | goto label_17;
| }
0x00016ff0 mov r2, 5 | r2 = 5;
0x00016ff4 mov r1, r8 | r1 = r8;
0x00016ff8 mov r0, fp | r0 = fp;
0x00016ffc bl 0x125b0 | r0 = strncmp (r0, r1, r2);
0x00017000 cmp r0, 0 |
0x00017004 beq 0x16fc4 |
| }
| label_17:
0x00017008 ldr r3, [sp, 4] | r3 = var_4h;
0x0001700c cmp r6, 0 |
0x00017010 add r1, r3, 0xd | r1 = r3 + 0xd;
| if (r6 == 0) {
0x00017014 beq 0x17110 | goto label_18;
| }
0x00017018 mov r3, 0 | r3 = 0;
0x0001701c mov r2, r3 | r2 = r3;
0x00017020 mov r0, r4 | r0 = r4;
0x00017024 bl 0x2aa08 | fcn_0002aa08 (r0, r1);
0x00017028 sub r5, r5, r4 | r5 -= r4;
0x0001702c add r5, r0, r5 | r5 = r0 + r5;
0x00017030 mov r4, r0 | r4 = r0;
0x00017034 mov r0, r5 | r0 = r5;
0x00017038 bl 0x1261c | strlen (r0);
0x0001703c mov r1, r5 | r1 = r5;
0x00017040 add r2, r0, 1 | r2 = r0 + 1;
0x00017044 add r0, r5, 0xc | r0 = r5 + 0xc;
0x00017048 bl 0x12760 | memmove (r0, r1, r2);
0x0001704c mov r2, 0xa | r2 = 0xa;
0x00017050 ldr r1, [pc, 0x47c] | r1 = "ntpq.c";
0x00017054 mov r0, r5 | r0 = r5;
0x00017058 bl 0x124a8 | memcpy (r0, "ntpq.c", r2);
0x0001705c mov r2, 2 | r2 = 2;
0x00017060 ldr r1, [pc, 0x478] | r1 = *(0x174dc);
0x00017064 add r0, r5, 0xa | r0 = r5 + 0xa;
0x00017068 bl 0x124a8 | memcpy (r0, r1, r2);
0x0001706c b 0x16ee4 | goto label_0;
| label_16:
0x00017070 ldr r1, [pc, 0x468] | r1 = *(0x174dc);
0x00017074 mov r0, r5 | r0 = r5;
0x00017078 bl 0x12a0c | strstr (r0, r1);
0x0001707c mov r1, fp | r1 = fp;
0x00017080 mov r8, r0 | r8 = r0;
0x00017084 mov r0, r5 | r0 = r5;
0x00017088 bl 0x12a0c | strstr (r0, r1);
0x0001708c clz r2, r8 | r2 &= r8;
0x00017090 lsr r2, r2, 5 | r2 >>= 5;
0x00017094 cmp r0, 0 |
0x00017098 cmpeq r8, 0 | __asm ("cmpeq r8, 0");
| if (r0 != 0) {
0x0001709c moveq r8, sb | r8 = sb;
| }
| if (r0 != 0) {
0x000170a0 beq 0x170bc |
0x000170a4 cmp r0, 0 |
| if (r0 == 0) {
0x000170a8 beq 0x170bc | goto label_19;
| }
0x000170ac cmp r8, r0 |
| if (r8 <= r0) {
0x000170b0 orrhi r2, r2, 1 | r2 |= 1;
| }
0x000170b4 cmp r2, 0 |
| if (r2 != 0) {
0x000170b8 movne r8, r0 | r8 = r0;
| goto label_19;
| }
| }
| label_19:
0x000170bc sub r2, r8, r5 | r2 = r8 - r5;
0x000170c0 mov r1, r5 | r1 = r5;
0x000170c4 ldr r0, [pc, 0x408] | r0 = "ntpq.c";
0x000170c8 bl 0x125b0 | r0 = strncmp ("ntpq.c", r1, r2);
0x000170cc cmp r0, 0 |
| if (r0 < 0) {
0x000170d0 blt 0x17108 | goto label_20;
| }
0x000170d4 cmp r8, sb |
| if (r8 >= sb) {
0x000170d8 bhs 0x16fdc | goto label_2;
| }
0x000170dc ldrb r2, [r8] | r2 = *(r8);
0x000170e0 cmp r2, 0 |
| if (r2 == 0) {
0x000170e4 beq 0x16fdc | goto label_2;
| }
0x000170e8 mov r2, 2 | r2 = 2;
0x000170ec mov r1, r8 | r1 = r8;
0x000170f0 ldr r0, [pc, 0x3e8] | r0 = *(0x174dc);
0x000170f4 bl 0x125b0 | r0 = strncmp (r0, r1, r2);
0x000170f8 cmp r0, 0 |
| if (r0 != 0) {
0x000170fc bne 0x16fdc | goto label_2;
| }
0x00017100 add r5, r5, 2 | r5 += 2;
0x00017104 b 0x16fc8 | goto label_3;
| label_20:
0x00017108 mov r6, 1 | r6 = 1;
0x0001710c b 0x16fdc | goto label_2;
| label_18:
0x00017110 mov r3, r6 | r3 = r6;
0x00017114 mov r2, r6 | r2 = r6;
0x00017118 mov r0, r4 | r0 = r4;
0x0001711c bl 0x2aa08 | r0 = fcn_0002aa08 (r0, r1);
0x00017120 mov r4, r0 | r4 = r0;
0x00017124 bl 0x1261c | strlen (r0);
0x00017128 ldr r1, [pc, 0x3b0] | r1 = *(0x174dc);
0x0001712c add r0, r4, r0 | r0 = r4 + r0;
0x00017130 bl 0x12b20 | strcpy (r0, r1)
0x00017134 mov r0, r4 | r0 = r4;
0x00017138 bl 0x1261c | strlen (r0);
0x0001713c ldr r1, [pc, 0x390] | r1 = "ntpq.c";
0x00017140 add r0, r4, r0 | r0 = r4 + r0;
0x00017144 bl 0x12b20 | strcpy (r0, "ntpq.c")
0x00017148 b 0x16ee4 | goto label_0;
| label_9:
0x0001714c ldr r0, [pc, 0x390] | r0 = *(0x174e0);
0x00017150 ldr r3, [r0] | r3 = *(0x174e0);
0x00017154 cmp r3, 0xc7 |
| if (r3 <= 0xc7) {
0x00017158 bhi 0x1717c |
0x0001715c ldr r1, [pc, 0x384] | r1 = *(0x174e4);
0x00017160 ldr ip, [pc, 0x384] | ip = "localhost";
0x00017164 ldr r2, [r2] | r2 = *(r2);
0x00017168 str ip, [r1, r3, lsl 3] | offset_1 = r3 << 3;
| *((r1 + offset_1)) = ip;
0x0001716c add r1, r1, r3, lsl 3 | r1 += (r3 << 3);
0x00017170 add r3, r3, 1 | r3++;
0x00017174 str r2, [r1, 4] | *((r1 + 4)) = r2;
0x00017178 str r3, [r0] | *(r0) = r3;
| }
| label_10:
0x0001717c ldr r4, [pc, 0x36c] | r4 = "localhost";
0x00017180 ldr r3, [r4, 0xc50] | r3 = *(0x1813c);
0x00017184 cmp r3, 0 |
| if (r3 == 0) {
0x00017188 bne 0x171cc |
0x0001718c ldr r3, [r4, 0x344] | r3 = *((r4 + 0x344));
0x00017190 cmp r3, 0 |
| if (r3 != 0) {
0x00017194 bne 0x171cc | goto label_21;
| }
0x00017198 ldr r3, [pc, 0x354] | r3 = *(0x174f0);
0x0001719c ldr r0, [r3] | r0 = *(0x174f0);
0x000171a0 bl 0x127b4 | r0 = fileno (r0);
0x000171a4 bl 0x127c0 | r0 = isatty (r0);
0x000171a8 cmp r0, 0 |
| if (r0 == 0) {
0x000171ac beq 0x171cc | goto label_21;
| }
0x000171b0 ldr r3, [pc, 0x340] | r3 = stdin;
0x000171b4 ldr r0, [r3] | r0 = stdin;
0x000171b8 bl 0x127b4 | r0 = fileno (r0);
0x000171bc bl 0x127c0 | r0 = isatty (r0);
0x000171c0 cmp r0, 0 |
| if (r0 == 0) {
0x000171c4 movne r3, 1 | r3 = 1;
| }
| if (r0 != 0) {
0x000171c8 strne r3, [r4, 0x344] | *((r4 + 0x344)) = r3;
| goto label_21;
| }
| }
| label_21:
0x000171cc ldr r0, [pc, 0x328] | r0 = stderr;
0x000171d0 bl 0x2f638 | fcn_0002f638 (r0);
0x000171d4 ldr r3, [r4, 0x344] | r3 = *((r4 + 0x344));
0x000171d8 cmp r3, 0 |
| if (r3 != 0) {
0x000171dc beq 0x171e8 |
0x000171e0 ldr r0, [pc, 0x318] | r0 = *(0x174fc);
0x000171e4 bl 0x16de8 | fcn_00016de8 (r0);
| }
0x000171e8 ldr r3, [r4, 0xc50] | r3 = *((r4 + 0xc50));
0x000171ec cmp r3, 0 |
| if (r3 != 0) {
0x000171f0 bne 0x1733c | goto label_22;
| }
0x000171f4 ldr r3, [pc, 0x2ec] | r3 = *(0x174e4);
0x000171f8 ldm r3, {r0, r1} | r0 = *(r3);
| r1 = *((r3 + 4));
0x000171fc bl 0x1319c | fcn_0001319c (r0, r1);
0x00017200 ldr r0, [r4, 0x344] | r0 = *((r4 + 0x344));
0x00017204 cmp r0, 0 |
| if (r0 == 0) {
0x00017208 ldrne r0, [r6, 0x2a8] | r0 = *((r6 + 0x2a8));
| }
0x0001720c bl 0x2c9cc | fcn_0002c9cc (r0);
| do {
0x00017210 add r0, sp, 0xc | r0 += var_ch;
0x00017214 bl 0x2ca38 | fcn_0002ca38 (r0);
0x00017218 subs r4, r0, 0 | r4 -= var_ch;
| if (r4 == var_ch) {
0x0001721c beq 0x17230 | goto label_23;
| }
0x00017220 bl 0x15614 | fcn_00015614 (r0);
0x00017224 mov r0, r4 | r0 = r4;
0x00017228 bl 0x12a54 | free (r0);
0x0001722c b 0x17210 |
| } while (1);
| label_23:
0x00017230 bl 0x2ca08 | fcn_0002ca08 ();
| label_4:
0x00017234 mov r0, 0 | r0 = 0;
0x00017238 add sp, sp, 0x1c |
0x0001723c pop {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| do {
0x00017240 ldr r3, [pc, 0x2a0] | r3 = *(0x174e4);
0x00017244 add r2, r3, r5, lsl 3 | r2 = r3 + (r5 << 3);
0x00017248 ldr r1, [r2, 4] | r1 = *((r2 + 4));
0x0001724c ldr r0, [r3, r5, lsl 3] | r0 = *(0x174e4);
0x00017250 bl 0x1319c | r0 = fcn_0001319c (r0, r1);
0x00017254 cmp r0, 0 |
| if (r0 != 0) {
0x00017258 bne 0x17270 | goto label_24;
| }
| label_5:
0x0001725c add r5, r5, 1 | r5++;
| label_8:
0x00017260 ldr r3, [r7] | r3 = *(r7);
0x00017264 cmp r3, r5 |
0x00017268 bhi 0x17240 |
| } while (r3 > r5);
0x0001726c b 0x17234 | goto label_4;
| label_24:
0x00017270 cmp r5, 0 |
| if (r5 != 0) {
0x00017274 beq 0x172b0 |
0x00017278 ldr r1, [r4, 0x28] | r1 = *((r4 + 0x28));
0x0001727c cmp r1, 0 |
| if (r1 == 0) {
0x00017280 beq 0x172b0 | goto label_7;
| }
0x00017284 ldr r3, [r1, 0x34] | r3 = *((r1 + 0x34));
0x00017288 cmp r3, 0 |
| if (r3 == 0) {
0x0001728c beq 0x17324 | goto label_25;
| }
0x00017290 ldr r3, [r1, 0x10] | r3 = *((r1 + 0x10));
0x00017294 ldr r2, [r1, 0x1c] | r2 = *((r1 + 0x1c));
0x00017298 cmp r3, r2 |
| if (r3 >= r2) {
0x0001729c bhs 0x17318 | goto label_26;
| }
0x000172a0 add r2, r3, 1 | r2 = r3 + 1;
0x000172a4 str r2, [r1, 0x10] | *((r1 + 0x10)) = r2;
0x000172a8 mov r2, 0xa | r2 = 0xa;
0x000172ac strb r2, [r3] | *(r3) = r2;
| }
| label_7:
0x000172b0 mov r6, 0 | r6 = 0;
0x000172b4 mov sb, 0xa | sb = 0xa;
| label_6:
0x000172b8 ldr r3, [r4, 0xc50] | r3 = *((r4 + 0xc50));
0x000172bc cmp r3, r6 |
| if (r3 < r6) {
0x000172c0 bls 0x1725c | goto label_5;
| }
0x000172c4 cmp r6, 0 |
| if (r6 == 0) {
0x000172c8 beq 0x17308 | goto label_27;
| }
0x000172cc ldr r1, [r4, 0x28] | r1 = *((r4 + 0x28));
0x000172d0 cmp r1, 0 |
| if (r1 == 0) {
0x000172d4 beq 0x17308 | goto label_27;
| }
0x000172d8 ldr r3, [r1, 0x34] | r3 = *((r1 + 0x34));
0x000172dc cmp r3, 0 |
| if (r3 == 0) {
0x000172e0 beq 0x17330 | goto label_28;
| }
0x000172e4 ldr r3, [r1, 0x10] | r3 = *((r1 + 0x10));
0x000172e8 ldr r2, [r1, 0x1c] | r2 = *((r1 + 0x1c));
0x000172ec cmp r3, r2 |
| if (r3 >= r2) {
0x000172f0 addlo r2, r3, 1 | r2 = r3 + 1;
| }
| if (r3 >= r2) {
0x000172f4 strlo r2, [r1, 0x10] | *((r1 + 0x10)) = r2;
| }
| if (r3 >= r2) {
0x000172f8 strblo sb, [r3] | *(r3) = sb;
| }
| if (r3 <= r2) {
0x000172fc blo 0x17308 | goto label_27;
| }
0x00017300 mov r0, 0xa | r0 = 0xa;
0x00017304 bl 0x126d0 | fputc_unlocked ();
| do {
| label_27:
0x00017308 ldr r0, [r8, r6, lsl 2] | offset_2 = r6 << 2;
| r0 = *((r8 + offset_2));
0x0001730c bl 0x15614 | fcn_00015614 (r0);
0x00017310 add r6, r6, 1 | r6++;
0x00017314 b 0x172b8 | goto label_6;
| label_26:
0x00017318 mov r0, 0xa | r0 = 0xa;
0x0001731c bl 0x126d0 | fputc_unlocked ();
0x00017320 b 0x172b0 | goto label_7;
| label_25:
0x00017324 mov r0, 0xa | r0 = 0xa;
0x00017328 bl 0x127fc | fputc (r0, r1);
0x0001732c b 0x172b0 | goto label_7;
| label_28:
0x00017330 mov r0, 0xa | r0 = 0xa;
0x00017334 bl 0x127fc | fputc (r0, r1);
0x00017338 b 0x17308 |
| } while (1);
| label_22:
0x0001733c mov r5, 0 | r5 = 0;
0x00017340 ldr r7, [pc, 0x19c] | r7 = *(0x174e0);
0x00017344 ldr r8, [pc, 0x1b8] | r8 = *(0x17500);
0x00017348 b 0x17260 | goto label_8;
| label_14:
0x0001734c ldr r3, [pc, 0x1b4] | r3 = *(0x17504);
0x00017350 add r5, r5, sb | r5 += sb;
0x00017354 mov r2, r4 | r2 = r4;
0x00017358 ldr r1, [pc, 0x1ac] | r1 = "digest_name";
0x0001735c str r3, [r5, 0x28] | *((r5 + 0x28)) = r3;
0x00017360 add r0, sp, 0xc | r0 += var_ch;
0x00017364 bl 0x14918 | fcn_00014918 (r0);
0x00017368 ldr r3, [sp, 0xc] | r3 = var_ch;
0x0001736c mov r0, r4 | r0 = r4;
0x00017370 str r3, [r5, 0x38] | *((r5 + 0x38)) = r3;
0x00017374 bl 0x12a54 | free (r0);
0x00017378 ldr r4, [pc, 0x190] | r4 = "set_key_type_to_use_for_authenticated_requests__one_of:_s";
0x0001737c ldr r2, [sl] | r2 = *(sl);
0x00017380 ldr r3, [pc, 0x18c] | r3 = *(0x17510);
0x00017384 mov r1, r7 | r1 = r7;
0x00017388 str r2, [r3] | *(r3) = r2;
0x0001738c mov r0, r4 | r0 = r4;
0x00017390 mov r2, sl | r2 = sl;
0x00017394 bl 0x2c99c | fcn_0002c99c (r0, r1);
0x00017398 ldr r3, [r4, 0x44] | r3 = *(0x17550);
0x0001739c ldr r2, [pc, 0x174] | r2 = *(0x17514);
0x000173a0 ldr r1, [r3, 0x118] | r1 = *(0x17668);
0x000173a4 str r1, [r2] | *(r2) = r1;
0x000173a8 ldr r2, [r3, 0x10] | r2 = *(0x17560);
0x000173ac tst r2, 0xf |
| if ((r2 & 0xf) == 0) {
0x000173b0 movne r1, 2 | r1 = 2;
| }
0x000173b4 ldr r2, [pc, 0x160] | r2 = *(0x17518);
0x000173b8 sub r7, r7, r0 | r7 -= r0;
| if ((r2 & 0xf) == 0) {
0x000173bc bne 0x173d4 |
0x000173c0 ldr r1, [r3, 0x50] | r1 = *((r3 + 0x50));
0x000173c4 tst r1, 0xf |
| if ((r1 & 0xf) != 0) {
0x000173c8 ldreq r1, [pc, 0xe0] | r1 = *(0x000174b0);
| }
| if ((r1 & 0xf) == 0) {
0x000173cc movne r1, 0xa | r1 = 0xa;
| }
| if ((r1 & 0xf) == 0) {
0x000173d0 ldreq r1, [r1] | r1 = *(r1);
| goto label_29;
| }
| }
| label_29:
0x000173d4 str r1, [r2] | *(r2) = r1;
0x000173d8 ldr r1, [r3, 0x150] | r1 = *((r3 + 0x150));
0x000173dc tst r1, 0xf |
| if ((r1 & 0xf) == 0) {
0x000173e0 ldrne r1, [pc, 0x108] | r1 = *(0x000174f0);
| }
| if ((r1 & 0xf) == 0) {
0x000173e4 movne ip, 1 |
| }
| if ((r1 & 0xf) == 0) {
0x000173e8 strne ip, [r1, 0x344] | *((r1 + 0x344)) = ip;
| }
0x000173ec ldr r1, [r3, 0x190] | r1 = *((r3 + 0x190));
0x000173f0 tst r1, 0xf |
| if ((r1 & 0xf) == 0) {
0x000173f4 movne r1, 0 | r1 = 0;
| }
| if ((r1 & 0xf) == 0) {
0x000173f8 strne r1, [r6, 0x2a0] | *((r6 + 0x2a0)) = r1;
| }
0x000173fc ldr r1, [r3, 0x290] | r1 = *((r3 + 0x290));
0x00017400 tst r1, 0xf |
| if ((r1 & 0xf) == 0) {
0x00017404 ldrne r1, [pc, 0xe4] | r1 = *(0x000174f0);
| }
| if ((r1 & 0xf) == 0) {
0x00017408 movne ip, 1 |
| }
| if ((r1 & 0xf) == 0) {
0x0001740c strne ip, [r1, 0xc54] | *((r1 + 0xc54)) = ip;
| }
0x00017410 ldr r1, [r3, 0x1d0] | r1 = *((r3 + 0x1d0));
0x00017414 ldr r3, [r3, 0x258] | r3 = *((r3 + 0x258));
0x00017418 ands r1, r1, 0xf | r1 &= 0xf;
| if (r1 == r1) {
0x0001741c movne r1, 1 | r1 = 1;
| }
0x00017420 cmp r7, 0 |
0x00017424 str r1, [r6, 0x2a4] | *((r6 + 0x2a4)) = r1;
0x00017428 str r3, [r6, 0x29c] | *((r6 + 0x29c)) = r3;
| if (r7 == 0) {
0x0001742c beq 0x1714c | goto label_9;
| }
0x00017430 ldr lr, [pc, 0xac] |
0x00017434 ldr r4, [pc, 0xac] | r4 = *(0x174e4);
0x00017438 add r0, sl, r0, lsl 2 | r0 = sl + (r0 << 2);
0x0001743c mov r1, 0 | r1 = 0;
0x00017440 mov r5, 0xa | r5 = 0xa;
0x00017444 mov r8, 2 | r8 = 2;
| label_11:
0x00017448 cmp r1, r7 |
| if (r1 == r7) {
0x0001744c beq 0x1717c | goto label_10;
| }
0x00017450 ldr ip, [r0, r1, lsl 2] | offset_3 = r1 << 2;
| ip = *((r0 + offset_3));
0x00017454 ldrb r3, [ip] | r3 = *(ip);
0x00017458 cmp r3, 0x2d |
| if (r3 == 0x2d) {
0x0001745c bne 0x1747c |
0x00017460 ldrb r3, [ip, 1] | r3 = *((ip + 1));
0x00017464 cmp r3, 0x34 |
| if (r3 != 0x34) {
0x00017468 streq r8, [r2] | *(r2) = r8;
| }
| if (r3 == 0x34) {
0x0001746c beq 0x1749c | goto label_30;
| }
0x00017470 cmp r3, 0x36 |
| if (r3 != 0x36) {
0x00017474 streq r5, [r2] | *(r2) = r5;
| }
| if (r3 == 0x36) {
0x00017478 beq 0x1749c | goto label_30;
| }
| }
0x0001747c ldr r3, [lr] | r3 = *(lr);
0x00017480 cmp r3, 0xc7 |
| if (r3 > 0xc7) {
0x00017484 ldrls sb, [r2] | sb = *(r2);
| }
| if (r3 > 0xc7) {
0x00017488 strls ip, [r4, r3, lsl 3] | offset_4 = r3 << 3;
| *((r4 + offset_4)) = ip;
| }
| if (r3 > 0xc7) {
0x0001748c addls ip, r4, r3, lsl 3 |
| }
| if (r3 > 0xc7) {
0x00017490 addls r3, r3, 1 | r3++;
| }
| if (r3 > 0xc7) {
0x00017494 strls sb, [ip, 4] | *((ip + 4)) = sb;
| }
| if (r3 > 0xc7) {
0x00017498 strls r3, [lr] | *(lr) = r3;
| }
| label_30:
0x0001749c add r1, r1, 1 | r1++;
0x000174a0 b 0x17448 | goto label_11;
| }
[*] Function strcpy used 10 times ntpq