Function at 0x4a6480
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x549b0d
mov eax, dword fs:[0]
push eax
sub esp, 0x78
mov eax, dword [0x5ac020]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x4c], esi
lea eax, [ebp - 0x2c]
xor ebx, ebx
mov dword [ebp - 0x48], eax
xor eax, eax
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x14], 7
mov dword [ebp - 0x18], ebx
mov word [ebp - 0x28], ax
mov dword [ebp - 4], eax
mov dword [ebp - 0x2c], vtable.cafx::tstring_ex_wchar_t__class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___.0
mov dword [ebp - 4], 2
mov ecx, dword [0x5be230]
test ecx, ecx
je 0x4a64f4
mov eax, dword [ecx]
call dword [eax + 0x78]
mov ecx, dword [0x5be230]
cmp dword [esi + 4], 0
jne 0x4a6504
mov ebx, 0x15
jmp 0x4a6665
mov edi, dword [ebp + 0x10]
test edi, edi
je 0x4a651e
push ecx
push dword [ebp + 8]
mov ecx, esi
call fcn.004a75f0
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp + 8]
push 0
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 0xc]
push 0
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x44]
push eax
push 0x4a5ed0
push 0
push 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x34], edi
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [ebp - 0x40], eax
test eax, eax
je 0x4a6585
mov esi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, dword [sym.imp.USER32.dll_PeekMessageW]
push 0x32
push eax
call esi
cmp eax, 0x102
jne 0x4a6582
push 2
push 0
push 0
push 0
lea eax, [ebp - 0x80]
push eax
call edi
mov eax, dword [ebp - 0x40]
test eax, eax
jne 0x4a6561
mov esi, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x30]
test eax, eax
jne 0x4a665d
lea eax, [esi + 0x20]
push eax
mov dword [ebp - 0x4c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [ebp - 0x3c]
lea edi, [esi + 0xc]
push 0x4a6460
sub esp, 0xc
mov ecx, edi
push esp
call fcn.00412030
mov byte [ebp - 4], 3
sub esp, 0xc
mov ecx, edi
push esp
call fcn.00412010
mov byte [ebp - 4], 4
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x58]
call fcn.004a7fa0
add esp, 0x20
lea eax, [ebp - 0x64]
mov ecx, edi
push eax
call fcn.00412030
mov esi, dword [ebp - 0x50]
cmp esi, dword [eax + 8]
setne al
test al, al
je 0x4a6652
mov eax, dword [ebp - 0x58]
test eax, eax
jne 0x4a65f8
xor edx, edx
jmp 0x4a65fa
mov edx, dword [eax]
mov ecx, dword [edx + 8]
mov eax, esi
shr eax, 2
dec ecx
and ecx, eax
and esi, 3
mov eax, dword [edx + 4]
mov eax, dword [eax + ecx*4]
push dword [eax + esi*4]
call fcn.0051d3d0
sub esp, 8
mov edx, esp
mov dword [edx], 0
mov dword [edx + 4], 0
mov eax, dword [ebp - 0x58]
test eax, eax
je 0x4a6639
mov eax, dword [eax]
test eax, eax
je 0x4a6639
mov eax, dword [eax]
mov dword [edx], eax
mov eax, dword [ebp - 0x50]
mov dword [edx + 8], eax
mov byte [ebp - 4], 5
lea eax, [ebp - 0x64]
push eax
mov byte [ebp - 4], 2
mov ecx, edi
call fcn.004a7c50
push dword [ebp - 0x4c]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x4a665f
mov ebx, eax
mov ecx, dword [0x5be230]
test ecx, ecx
je 0x4a666e
mov eax, dword [ecx]
call dword [eax + 0x7c]
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [ebp - 4], 0xffffffff
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x2c], vtable.cafx::tstring_ex_wchar_t__class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___.0
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x14], 8
jb 0x4a66a1
push dword [ebp - 0x28]
call fcn.0051d3d0
add esp, 4
xor eax, eax
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
mov eax, ebx
mov dword [ebp - 0x18], 0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004ffcef
mov esp, ebp
pop ebp
ret 0xc