Function at 0x1004d320
Capabilities:
Create thread
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1004f2e1
mov eax, dword fs:[0]
push eax
push ecx
sub esp, 0x78
push ebx
push esi
push edi
mov eax, dword [0x100664a0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 0xffffffff
cmp dword [ebp + 8], 0
je 0x1004d5a4
cmp dword [ebp + 0xc], 0
je 0x1004d5a4
mov dword [ebp - 0x38], 1
mov dword [ebp - 0x18], 1
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x3c], eax
xor ecx, ecx
mov eax, dword [ebp - 0x3c]
mov edx, 0x1c
mul edx
seto cl
neg ecx
or ecx, eax
xor eax, eax
add ecx, 4
setb al
neg eax
or eax, ecx
push eax
call fcn.100163ab
add esp, 4
mov dword [ebp - 0x68], eax
mov ecx, dword [ebp - 0x68]
mov dword [ebp - 0x44], ecx
mov byte [ebp - 4], 1
cmp dword [ebp - 0x44], 0
je 0x1004d3ec
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x3c]
mov dword [edx], eax
push fcn.100012e0
push fcn.10001230
mov ecx, dword [ebp - 0x3c]
push ecx
push 0x1c
mov edx, dword [ebp - 0x44]
add edx, 4
push edx
call fcn.100378d6
mov eax, dword [ebp - 0x44]
add eax, 4
mov dword [ebp - 0x6c], eax
jmp 0x1004d3f3
mov dword [ebp - 0x6c], 0
mov ecx, dword [ebp - 0x6c]
mov dword [ebp - 0x40], ecx
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x40]
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x48], eax
xor ecx, ecx
mov eax, dword [ebp - 0x48]
mov edx, 0x1c
mul edx
seto cl
neg ecx
or ecx, eax
xor eax, eax
add ecx, 4
setb al
neg eax
or eax, ecx
push eax
call fcn.100163ab
add esp, 4
mov dword [ebp - 0x70], eax
mov ecx, dword [ebp - 0x70]
mov dword [ebp - 0x50], ecx
mov byte [ebp - 4], 2
cmp dword [ebp - 0x50], 0
je 0x1004d473
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp - 0x48]
mov dword [edx], eax
push fcn.100012e0
push fcn.10001230
mov ecx, dword [ebp - 0x48]
push ecx
push 0x1c
mov edx, dword [ebp - 0x50]
add edx, 4
push edx
call fcn.100378d6
mov eax, dword [ebp - 0x50]
add eax, 4
mov dword [ebp - 0x74], eax
jmp 0x1004d47a
mov dword [ebp - 0x74], 0
mov ecx, dword [ebp - 0x74]
mov dword [ebp - 0x4c], ecx
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x4c]
mov dword [ebp - 0x30], edx
cmp dword [ebp + 0x10], 0x3a98
jle 0x1004d4a0
mov eax, dword [ebp + 0x10]
sub eax, 0x3a98
mov dword [ebp - 0x78], eax
jmp 0x1004d4a6
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x78], ecx
mov edx, dword [ebp - 0x78]
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0x24], ecx
mov edx, dword [ebp + 8]
push edx
mov ecx, dword [ebp - 0x34]
call fcn.10001320
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp - 0x30]
call fcn.10001320
push 0
push 0
lea ecx, [ebp - 0x34]
push ecx
push 0x1004d1e0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [ebp - 0x20], eax
mov edx, dword [ebp + 0x10]
imul edx, dword [ebp - 0x38]
push edx
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
test eax, eax
je 0x1004d51f
cmp dword [ebp - 0x1c], 0x103
je 0x1004d51f
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x14], eax
jmp 0x1004d532
mov dword [ebp - 0x14], 0xfffffffe
push 0
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x58], eax
mov ecx, dword [ebp - 0x58]
mov dword [ebp - 0x54], ecx
cmp dword [ebp - 0x54], 0
je 0x1004d563
push 3
mov ecx, dword [ebp - 0x54]
call fcn.10013930
mov dword [ebp - 0x7c], eax
mov edx, dword [ebp - 0x7c]
mov dword [ebp - 0x80], edx
jmp 0x1004d56a
mov dword [ebp - 0x80], 0
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x60], eax
mov ecx, dword [ebp - 0x60]
mov dword [ebp - 0x5c], ecx
cmp dword [ebp - 0x5c], 0
je 0x1004d59a
push 3
mov ecx, dword [ebp - 0x5c]
call fcn.10013930
mov dword [ebp - 0x84], eax
mov edx, dword [ebp - 0x84]
mov dword [ebp - 0x88], edx
jmp 0x1004d5a4
mov dword [ebp - 0x88], 0
mov eax, dword [ebp - 0x14]
jmp 0x1004d5cf
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10