Function at 0x404080
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x460dab
mov eax, dword fs:[0]
push eax
sub esp, 0x148
mov eax, dword [0x478424]
xor eax, esp
mov dword [esp + 0x140], eax
push ebx
push esi
push edi
mov eax, dword [0x478424]
xor eax, esp
push eax
lea eax, [esp + 0x158]
mov dword fs:[0], eax
mov esi, ecx
lea ebx, [esi + 0x1f8]
push ebx
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], ebx
call fcn.004048c0
test al, al
jne 0x404109
push str._Control_InitCtrlFile_Error_n
push 2
call fcn.00411a20
mov ecx, eax
call fcn.00411cc0
mov eax, dword [esi]
mov edx, dword [eax + 0x1c]
add esp, 8
push 3
mov ecx, esi
call edx
mov eax, dword [esi]
mov edx, dword [eax + 0x20]
mov ecx, esi
call edx
jmp 0x404372
call fcn.00404b20
mov eax, dword [esi + 0x288]
cmp eax, 5
jne 0x404120
push str._Control_PreviousDealCtrlFile_Error_n
jmp 0x4040df
cmp eax, 3
jne 0x40417e
push str._Control_PreviousDealCtrlFile_Ready_n
push 2
call fcn.00411a20
mov ecx, eax
call fcn.00411cc0
add esp, 8
cmp dword [esi + 0x1e0], 0x10
jb 0x40414c
mov edi, dword [esi + 0x1cc]
jmp 0x404152
lea edi, [esi + 0x1cc]
lea eax, [esi + 0x1e4]
push eax
lea ecx, [esi + 0x2e0]
push esi
call fcn.004064f0
mov edx, dword [esi]
mov eax, dword [edx + 0x1c]
push 6
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0x20]
mov ecx, esi
call eax
jmp 0x404372
lea edi, [esi + 0x48]
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
mov eax, ebx
call fcn.00406420
mov edx, dword [edi]
mov byte [esp + 0x17], al
mov eax, dword [edx + 0x10]
mov ecx, edi
call eax
mov eax, dword [edi + 0xa0]
cmp eax, 0xffffffff
je 0x4041f2
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [edi + 0xa8]
xor esi, esi
cmp eax, esi
mov dword [edi + 0xa0], 0xffffffff
mov byte [edi + 0x9c], 1
je 0x4041db
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov dword [edi + 0xa8], esi
mov eax, dword [edi + 0xa4]
cmp eax, esi
je 0x4041f2
push eax
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
mov dword [edi + 0xa4], esi
cmp byte [esp + 0x17], 0
mov byte [edi + 0xb0], 8
mov byte [edi + 0xb8], 0
mov byte [edi + 0x10], 0
je 0x404261
mov ebx, dword [esp + 0x1c]
call fcn.00404b20
mov ebx, dword [esp + 0x18]
cmp dword [ebx + 0x288], 3
je 0x4042ba
push str._CTRL_Check_CtrlFile_failed_n
push 2
call fcn.00411a20
mov ecx, eax
call fcn.00411cc0
mov esi, dword [esp + 0x24]
mov edx, dword [esi]
mov eax, dword [edx]
add esp, 8
mov ecx, esi
call eax
test edx, edx
ja 0x404253
test eax, eax
jbe 0x4042fc
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
mov ecx, esi
call eax
jmp 0x404181
cmp dword [ebx + 0x274], 0x10
mov ecx, dword [ebx + 0x1fc]
jb 0x404278
mov eax, dword [ebx + 0x260]
jmp 0x40427e
lea eax, [ebx + 0x260]
push ecx
push eax
push str._s_download_failed__d_
lea ecx, [esp + 0x58]
push pe_nt_image_headers32
push ecx
call fcn.00445b8d
add esp, 0x14
push ebx
lea esi, [esp + 0x50]
call fcn.00406600
mov edx, dword [ebx]
mov eax, dword [edx + 0x1c]
push 4
mov ecx, ebx
call eax
mov edx, dword [ebx]
mov eax, dword [edx + 0x20]
mov ecx, ebx
call eax
jmp 0x404372
cmp dword [ebx + 0x1e0], 0x10
jb 0x4042cb
mov edi, dword [ebx + 0x1cc]
jmp 0x4042d1
lea edi, [ebx + 0x1cc]
lea ecx, [ebx + 0x1e4]
push ecx
lea ecx, [ebx + 0x2e0]
push ebx
call fcn.004064f0
mov esi, ebx
mov edx, dword [esi]
mov eax, dword [edx + 0x1c]
push 6
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0x20]
mov ecx, esi
call eax
jmp 0x404372
push 0x10
lea ecx, [ebx + 0x2e0]
push ecx
lea edx, [esp + 0x44]
push 0x10
push edx
call fcn.00445a61
add esp, 0x10
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x24]
call fcn.00411810
lea ecx, [esp + 0x20]
push ecx
mov edx, str._check_error
mov dword [esp + 0x164], 0
call fcn.00404430
cmp dword [esp + 0x38], 0x10
mov esi, dword [esp + 0x24]
jae 0x40434b
lea esi, [esp + 0x24]
push ebx
call fcn.00406600
mov edx, dword [ebx]
mov eax, dword [edx + 0x1c]
push 5
mov ecx, ebx
call eax
mov edx, dword [ebx]
mov eax, dword [edx + 0x20]
mov ecx, ebx
call eax
lea ecx, [esp + 0x20]
mov esi, eax
call fcn.00401b20
mov eax, esi
mov ecx, dword [esp + 0x158]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x140]
xor ecx, esp
call fcn.00445276
mov esp, ebp
pop ebp
ret