Function at 0x401580
Capabilities:
Create thread
Read file on windows
Terminate process

Disassembly:
xor eax, eax
sub esp, 0x220
mov dword [0x40ad18], eax
push ebx
mov dword [0x40ad1c], eax
push ebp
push esi
mov dword [0x40ad20], eax
push edi
xor ebx, ebx
mov dword [0x40ad24], eax
mov edi, 0x47851632
push ebx
mov dword [0x40ad28], eax
mov dword [0x40ad18], edi
call dword [sym.imp.ole32.dll_CoInitialize]
lea ecx, [esp + 0x28]
push ecx
call fcn.00401280
mov edx, dword [esp + 0x238]
add esp, 4
lea eax, [esp + 0x28]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x28]
push 0x8410
push ecx
call fcn.0040558b
mov ebp, eax
add esp, 8
cmp ebp, 0xffffffff
jne 0x4015ff
pop edi
pop esi
pop ebp
or eax, eax
pop ebx
add esp, 0x220
ret
push ebx
push ebx
push ebp
call fcn.00405275
push 2
push ebx
push ebp
call fcn.00405275
push ebx
mov esi, eax
push ebx
push ebp
mov dword [esp + 0x48], esi
call fcn.00405275
add esp, 0x24
cmp esi, ebx
jne 0x40163c
push ebp
call fcn.00405195
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x220
ret
push 0x14
push 0x40ad18
push ebp
mov dword [esp + 0x1c], 0x14
call fcn.0040534d
mov ecx, dword [esp + 0x1c]
add esp, 0xc
cmp ecx, eax
mov dword [esp + 0x1c], eax
jne 0x401bac
cmp dword [0x40ad18], edi
jne 0x401bac
mov edx, dword [0x40ad1c]
shr edx, 0x10
cmp dx, 1
jne 0x40178d
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea eax, [esp + 0x20]
push eax
push ebx
push esi
push 0x401c30
push ebx
push ebx
mov dword [esp + 0x2c], esi
call fcn.00405a44
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
add esp, 0x18
mov dword [esp + 0x10], eax
push 0xffffffffffffffff
push esi
call edi
mov ecx, dword [0x40ad30]
push ecx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4016ee
mov edx, dword [0x40ad28]
mov eax, dword [0x40ad30]
add edx, 0x14
and edx, 0xffff
shl edx, 0x10
push edx
push ebx
push 0x401
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov esi, dword [esp + 0x23c]
mov dword [esp + 0x10], ebx
cmp esi, ebx
je 0x401761
cmp esi, 0xffffffff
je 0x401761
mov dword [esp + 0x10], 1
mov ecx, dword [0x40ad30]
push ecx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x401732
mov edx, dword [esp + 0x10]
mov eax, dword [0x40ad30]
push ebx
push edx
push 0x402
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
push 0x5dc
push esi
call edi
cmp eax, ebx
mov dword [esp + 0x20], eax
je 0x40174a
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
xor esi, esi
inc eax
cmp eax, 0x14
mov dword [esp + 0x10], eax
jl 0x40170a
mov ecx, dword [0x40ad30]
push ecx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x401787
mov edx, dword [0x40ad30]
push ebx
push 0x14
push 0x402
push edx
call dword [sym.imp.USER32.dll_SendMessageA]
mov ebx, dword [esp + 0x14]
jmp 0x401794
mov ebx, dword [esp + 0x23c]
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
mov eax, dword [0x40ad28]
test eax, eax
lea ecx, [eax - 1]
mov dword [esp + 0x14], ecx
je 0x401937
lea edx, [esp + 0x10]
push 4
or esi, 0xffffffff
push edx
push ebp
mov dword [esp + 0x1c], esi
call fcn.0040534d
lea eax, [esp + 0x24]
push 4
push eax
push ebp
mov dword [esp + 0x30], esi
call fcn.0040534d
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x3c]
add esp, 0x18
cmp ecx, eax
jle 0x401b3c
test eax, eax
jle 0x401b3c
mov ecx, dword [esp + 0x18]
test ecx, ecx
jle 0x401b3c
add ecx, 0x1000
cmp ecx, eax
jl 0x401b3c
push eax
call fcn.004059b8
mov ecx, dword [esp + 0x14]
mov edi, eax
push ecx
push edi
push ebp
call fcn.0040534d
mov ecx, dword [esp + 0x20]
add esp, 0x10
cmp ecx, eax
mov dword [esp + 0x1c], eax
jg 0x401aaa
test edi, edi
je 0x401ab7
mov edx, dword [esp + 0x18]
push edx
call fcn.004059b8
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x20]
push ecx
mov esi, eax
mov eax, dword [esp + 0x20]
push edi
push edx
push esi
mov dword [esp + 0x30], eax
call fcn.00402630
push edi
mov dword [esp + 0x38], eax
call fcn.00405970
mov eax, dword [esp + 0x38]
add esp, 0x18
test eax, eax
jne 0x401a1c
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
cmp eax, ecx
jne 0x401a1c
mov eax, dword [esi]
dec eax
je 0x4018a7
dec eax
jne 0x4018e7
mov ecx, dword [esp + 0x238]
push ecx
push esi
call fcn.004024e0
add esp, 8
jmp 0x4018e7
mov edx, dword [esp + 0x238]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [esp + 0x12c]
push edx
push eax
call edi
lea ecx, [esp + 0x12c]
push ecx
push esi
call fcn.00401e10
add esp, 8
mov dword [esp + 0x20], eax
test al, 1
je 0x4018e7
lea edx, [esp + 0x12c]
lea eax, [esp + 0x28]
push edx
push eax
call edi
push esi
call fcn.00405970
mov ecx, dword [0x40ad30]
add esp, 4
push ecx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x401924
mov edx, dword [0x40ad28]
mov eax, dword [esp + 0x14]
sub edx, eax
mov eax, dword [0x40ad30]
add edx, 0x14
push 0
push edx
push 0x402
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov eax, dword [esp + 0x14]
mov ecx, eax
dec eax
test ecx, ecx
mov dword [esp + 0x14], eax
jne 0x4017b5
push ebp
call fcn.00405195
mov edx, dword [esp + 0x23c]
mov ecx, 0x41
xor eax, eax
mov edi, edx
add esp, 4
rep stosd dword es:[edi], eax
lea eax, [esp + 0x28]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, dword [0x40ad30]
mov esi, dword [sym.imp.USER32.dll_IsWindow]
push ecx
call esi
test eax, eax
je 0x401994
mov edx, dword [0x40ad28]
mov eax, dword [esp + 0x14]
sub edx, eax
mov eax, dword [0x40ad30]
add edx, 0x14
push 0
push edx
push 0x402
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [0x40ad1c]
mov edx, dword [0x40ad30]
shr ecx, 0x10
push edx
mov dword [esp + 0x14], ecx
call esi
test eax, eax
je 0x4019e2
mov eax, dword [0x40ad30]
push 0
push 0
push 0x10
push eax
mov dword [0x40ad30], 0
call dword [sym.imp.USER32.dll_SendMessageA]
push 0xffffffffffffffff
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov dword [0x40ad18], eax
mov dword [0x40ad18], 0x47851632
mov dword [0x40ad1c], eax
mov dword [0x40ad20], eax
mov dword [0x40ad24], eax
mov dword [0x40ad28], eax
call dword [sym.imp.ole32.dll_CoUninitialize]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x220
ret
test esi, esi
je 0x401a29
push esi
call fcn.00405970
add esp, 4
push ebp
call fcn.00405195
mov edx, dword [0x40ad30]
add esp, 4
push edx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x401a6f
mov eax, dword [0x40ad30]
push 0
push 0
push 0x10
push eax
mov dword [0x40ad30], 0
call dword [sym.imp.USER32.dll_SendMessageA]
push 0xffffffffffffffff
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov dword [0x40ad18], eax
mov dword [0x40ad18], 0x47851632
mov dword [0x40ad1c], eax
mov dword [0x40ad20], eax
mov dword [0x40ad24], eax
mov dword [0x40ad28], eax
call dword [sym.imp.ole32.dll_CoUninitialize]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffc
pop ebx
add esp, 0x220
ret
test edi, edi
je 0x401ab7
push edi
call fcn.00405970
add esp, 4
push ebp
call fcn.00405195
mov ecx, dword [0x40ad30]
add esp, 4
push ecx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x401afc
mov eax, dword [0x40ad30]
push 0
push 0
push 0x10
push eax
mov dword [0x40ad30], 0
call dword [sym.imp.USER32.dll_SendMessageA]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edx, edx
mov dword [0x40ad18], edx
mov dword [0x40ad18], 0x47851632
mov dword [0x40ad1c], edx
mov dword [0x40ad20], edx
mov dword [0x40ad24], edx
mov dword [0x40ad28], edx
call dword [sym.imp.ole32.dll_CoUninitialize]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffd
pop ebx
add esp, 0x220
ret
push ebp
call fcn.00405195
mov eax, dword [0x40ad30]
add esp, 4
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x401b80
mov eax, dword [0x40ad30]
push 0
push 0
push 0x10
push eax
mov dword [0x40ad30], 0
call dword [sym.imp.USER32.dll_SendMessageA]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
mov dword [0x40ad18], ecx
mov dword [0x40ad18], 0x47851632
mov dword [0x40ad1c], ecx
mov dword [0x40ad20], ecx
mov dword [0x40ad24], ecx
mov dword [0x40ad28], ecx
jmp 0x401c19
push ebp
call fcn.00405195
mov ecx, dword [0x40ad30]
add esp, 4
push ecx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x401bf3
mov eax, dword [0x40ad30]
push ebx
push ebx
push 0x10
push eax
mov dword [0x40ad30], ebx
call dword [sym.imp.USER32.dll_SendMessageA]
mov esi, dword [esp + 0x23c]
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edx, edx
mov dword [0x40ad18], edx
mov dword [0x40ad18], edi
mov dword [0x40ad1c], edx
mov dword [0x40ad20], edx
mov dword [0x40ad24], edx
mov dword [0x40ad28], edx
call dword [sym.imp.ole32.dll_CoUninitialize]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
pop ebx
add esp, 0x220
ret