Function at 0x4012a4
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
add esp, 0xfffffff8
mov eax, dword [ebp + 8]
push eax
push 0
call sub.KERNEL32.dll_GlobalAlloc
add esp, 8
mov eax, eax
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], 0
lea esi, [esi]
mov eax, dword [ebp + 8]
cdq
mov ecx, edx
shr ecx, 0x1f
lea edx, [ecx + eax]
mov eax, edx
sar eax, 1
cmp dword [ebp - 0x58], eax
jl 0x4012e8
jmp 0x401300
mov eax, dword [ebp - 0x5c]
mov byte [eax], 0x28
inc dword [ebp - 0x5c]
mov eax, dword [ebp - 0x5c]
mov byte [eax], 0xd8
inc dword [ebp - 0x5c]
inc dword [ebp - 0x58]
jmp 0x4012d0
mov word [ebp - 0x30], 1
mov word [ebp - 0x2e], 1
mov eax, dword [ebp + 8]
mov edx, eax
lea eax, [edx + edx]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 8]
mov edx, eax
lea eax, [edx + edx]
mov dword [ebp - 0x28], eax
mov word [ebp - 0x24], 4
mov word [ebp - 0x22], 8
mov word [ebp - 0x20], 0
mov eax, dword [ebp + 8]
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
push 0
push 0
push 1
push 0
call sub.KERNEL32.dll_CreateEventA
mov eax, eax
mov dword [0x4040d0], eax
add esp, 0xfffffff8
add esp, 0xfffffff8
push 0x401244
mov eax, dword [0x404170]
push eax
call sub.KERNEL32.dll_GetProcAddress
add esp, 8
mov eax, eax
push 0x30000
push 0
push 0x401210
lea edx, [ebp - 0x30]
push edx
push 0xffffffffffffffff
lea edx, [ebp - 4]
push edx
call eax
add esp, 8
mov eax, eax
test eax, eax
jne 0x4014b1
add esp, 0xfffffffc
add esp, 0xfffffff8
push 0x401250
mov eax, dword [0x404170]
push eax
call sub.KERNEL32.dll_GetProcAddress
add esp, 8
mov eax, eax
push 0x20
lea edx, [ebp - 0x50]
push edx
mov edx, dword [ebp - 4]
push edx
call eax
add esp, 4
mov eax, eax
test eax, eax
jne 0x4014b1
add esp, 0xfffffffc
add esp, 0xfffffff8
push 0x401265
mov eax, dword [0x404170]
push eax
call sub.KERNEL32.dll_GetProcAddress
add esp, 8
mov eax, eax
push 0x20
lea edx, [ebp - 0x50]
push edx
mov edx, dword [ebp - 4]
push edx
call eax
add esp, 4
mov eax, eax
test eax, eax
jne 0x4014b1
add esp, 0xfffffff8
push 0xffffffffffffffff
mov eax, dword [0x4040d0]
push eax
call sub.KERNEL32.dll_WaitForSingleObject
add esp, 8
add esp, 0xfffffff4
add esp, 0xfffffff8
push 0x401272
mov eax, dword [0x404170]
push eax
call sub.KERNEL32.dll_GetProcAddress
add esp, 8
mov eax, eax
mov edx, dword [ebp - 4]
push edx
call eax
add esp, 0xc
add esp, 0xfffffffc
add esp, 0xfffffff8
push 0x40127f
mov eax, dword [0x404170]
push eax
call sub.KERNEL32.dll_GetProcAddress
add esp, 8
mov eax, eax
push 0x20
lea edx, [ebp - 0x50]
push edx
mov edx, dword [ebp - 4]
push edx
call eax
add esp, 4
mov eax, eax
test eax, eax
jne 0x4014b1
add esp, 0xfffffff4
add esp, 0xfffffff8
push 0x401296
mov eax, dword [0x404170]
push eax
call sub.KERNEL32.dll_GetProcAddress
add esp, 8
mov eax, eax
mov edx, dword [ebp - 4]
push edx
call eax
add esp, 0xc
add esp, 0xfffffff4
mov eax, dword [0x4040d0]
push eax
call sub.KERNEL32.dll_CloseHandle
add esp, 0xc
add esp, 0xfffffff4
mov eax, dword [ebp - 0x54]
push eax
call sub.KERNEL32.dll_GlobalFree
add esp, 0xc
leave
ret