Function at 0x406310
Capabilities:
Check mutex on windows

Disassembly:
push 0xffffffffffffffff
push 0x4535a4
mov eax, dword fs:[0]
push eax
sub esp, 0x69c
mov eax, dword [0x46b114]
xor eax, esp
mov dword [esp + 0x698], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x46b114]
xor eax, esp
push eax
lea eax, [esp + 0x6b0]
mov dword fs:[0], eax
mov eax, dword [esp + 0x6c0]
mov edi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov ebp, dword [esp + 0x6c4]
mov esi, ecx
mov dword [esp + 0x18], eax
call edi
lea ecx, [esp + 0x38]
push ecx
lea edx, [esp + 0x2c]
push edx
lea ecx, [esp + 0x38]
push ecx
lea edx, [esi + 0x3c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessTimes]
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentThread]
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadPriority]
push 2
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GetPriorityClass]
push 0x80
call edi
push eax
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x9e]
push ecx
mov word [esp + 0xa0], ax
call sub.MSVCR90.dll_memset
add esp, 0xc
push 0x104
lea edx, [esp + 0x98]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x94]
push eax
call edi
lea ecx, [esp + 0x94]
push ecx
call edi
lea edx, [esp + 0x94]
push edx
mov eax, 0x4ad318
call fcn.00403760
push str.ThunerNewTask_Instance
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x406484
push str.ThunderNewTask_AgentDataWnd
push str.CAgentDataWindow
call dword [sym.imp.USER32.dll_FindWindowW]
test eax, eax
je 0x4065f7
mov ecx, ebp
mov dword [esp + 0x1c], 0
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x406454
lea edx, [esp + 0x1c]
push edx
sub ecx, esi
push 0
sar ecx, 1
push 0x4a
lea ecx, [ecx + ecx + 2]
push eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], ebp
call dword [sym.imp.USER32.dll_SendMessageW]
jmp 0x40669c
call fcn.00407d30
push 0x407db0
call dword [sym.imp.XLLuaRuntime.dll_XLLRT_ErrorHandle]
mov ebx, dword [sym.imp.XLLuaRuntime.dll_XLLRT_GetEnv]
push 0
call ebx
mov edi, eax
push edi
call fcn.00439f12
add esp, 4
push edi
call dword [sym.imp.XLLuaRuntime.dll_XLLRT_ReleaseEnv]
mov eax, dword [esi]
mov edx, dword [eax + 8]
mov ecx, esi
call edx
lea edi, [esp + 0x78]
call fcn.00407bc0
push str.thunder_stat.xml
push 0x4adb38
lea eax, [esp + 0x4ac]
mov dword [esp + 0x6c0], 0
mov edi, dword [sym.imp.SHLWAPI.dll_PathCombineW]
push eax
call edi
push str.ThunderNewTaskStat.xml
push 0x4adb38
lea ecx, [esp + 0x2a4]
push ecx
call edi
mov edx, dword [sym.imp.MSVCR90.dll___wargv]
mov eax, dword [edx]
mov ecx, dword [eax]
push 0x2e
push ecx
lea edx, [esp + 0x64]
push edx
call fcn.0042fd71
add esp, 0xc
lea ecx, [esp + 0x40]
mov byte [esp + 0x6b8], 1
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
mov byte [esp + 0x6b8], 2
cmp dword [esp + 0x74], 8
mov eax, dword [esp + 0x60]
jae 0x40653e
lea eax, [esp + 0x60]
mov edx, dword [esp + 0x70]
lea ecx, [esp + 0x40]
push ecx
push edx
push eax
call fcn.0043eff0
mov ecx, dword [esp + 0x88]
mov eax, 0x10
add esp, 0xc
cmp dword [esp + 0x90], eax
jae 0x40656a
lea ecx, [esp + 0x7c]
cmp dword [esp + 0x58], eax
mov eax, dword [esp + 0x44]
jae 0x406578
lea eax, [esp + 0x44]
lea edx, [esi + 0x38]
push edx
push 5
push str.http:__down.verify.stat.xunlei.com_stat
lea edx, [esp + 0x2a8]
push edx
lea edx, [esp + 0x4b4]
push edx
push str.http:__xl7xml.client.xunlei.com_7.9_thunder_stat2.xml
push 0x12c
push 0x3e8
push ecx
push eax
push 0x45a754
push 0x3fa
call dword [sym.imp.xlstat.dll_XLSTAT_Init3]
push 0
call ebx
mov edi, eax
test edi, edi
jne 0x4065fe
lea ecx, [esp + 0x40]
mov byte [esp + 0x6b8], 1
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x5c]
mov byte [esp + 0x6b8], 0
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x78]
mov dword [esp + 0x6b8], 0xffffffff
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
xor al, al
jmp 0x40669e
push edi
call dword [sym.imp.xlstat.dll_XLSTAT_RegisterClass]
mov ecx, edi
call fcn.0040ad90
push edi
call fcn.0040b880
add esp, 4
push edi
call fcn.0040be90
add esp, 4
push edi
call dword [sym.imp.XLLuaRuntime.dll_XLLRT_ReleaseEnv]
mov eax, dword [esi]
mov edx, dword [eax + 0xc]
mov ecx, esi
call edx
call fcn.00410380
mov ecx, eax
call fcn.004103f0
call fcn.004161c0
push eax
mov eax, ebp
call fcn.00416230
test eax, eax
je 0x4065be
call fcn.004161c0
push eax
call fcn.00416300
mov edi, dword [esp + 0x18]
call fcn.0040ab40
lea ecx, [esp + 0x40]
mov byte [esp + 0x6b8], 1
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x5c]
mov byte [esp + 0x6b8], 0
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x78]
mov dword [esp + 0x6b8], 0xffffffff
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov al, 1
mov ecx, dword [esp + 0x6b0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x698]
xor ecx, esp
call fcn.004390e8
add esp, 0x6a8
ret 8