Function at 0x1004c590
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx + 0x10]
sub eax, dword [ecx + 0x14]
add eax, eax
add eax, eax
add eax, eax
sub eax, dword [ecx + 0x1c]
add eax, dword [ecx + 0xc]
mov ecx, dword [esi + 0x250]
mov dword [ebp - 0x34], eax
xor eax, eax
mov dword [ebp - 4], eax
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 0x240]
mov dword [ebp - 0x24], ecx
mov edx, eax
cmp eax, ecx
jl 0x1004c5cd
mov edx, ecx
cmp edx, 1
jge 0x1004c5db
mov dword [ebp - 8], 1
jmp 0x1004c5e5
mov dword [ebp - 8], eax
cmp eax, ecx
jl 0x1004c5e5
mov dword [ebp - 8], ecx
shl eax, 0xa
cdq
push ebx
push edi
mov edi, dword [ebp - 8]
idiv edi
mov ebx, dword [esi + 0xa0]
add ebx, 0x38
mov dword [ebp - 0x18], eax
mov eax, ecx
shl eax, 0xa
cdq
idiv edi
mov ecx, dword [esi + 0x14]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0xa4]
cmp dword [eax + 0x144], 0
lea edi, [eax + 0x38]
mov dword [ebp - 0x30], edi
jne 0x1004c64f
mov edx, dword [esi + 4]
mov eax, dword [esi]
mov ecx, dword [esi + 0xc]
push 0x45
push edx
mov edx, dword [esi + 8]
push eax
push ecx
push edx
push edi
call fcn.10047170
mov eax, dword [esi + 0xa4]
add esp, 0x18
mov dword [eax + 0x144], 1
mov ecx, dword [esi + 0xa4]
cmp dword [ecx + 0x148], 0
je 0x1004c69f
mov edx, dword [esi + 0x6c]
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 8]
push 0
and edx, 4
push edx
mov edx, dword [esi + 0x140]
push eax
mov eax, dword [esi + 0x134]
push ecx
mov ecx, dword [esi + 0x128]
push edx
mov edx, dword [edi]
push eax
push ecx
push edx
call fcn.100475d0
mov eax, dword [esi + 0xa4]
add esp, 0x20
mov dword [eax + 0x148], 0
mov ecx, dword [esi + 0xa0]
cmp dword [ecx + 0x144], 0
jne 0x1004c6d8
mov edx, dword [esi + 4]
mov eax, dword [esi]
mov ecx, dword [esi + 0xc]
push 0x45
push edx
mov edx, dword [esi + 8]
push eax
push ecx
push edx
push ebx
call fcn.10047170
mov eax, dword [esi + 0xa0]
add esp, 0x18
mov dword [eax + 0x144], 1
mov ecx, dword [esi + 0xa0]
cmp dword [ecx + 0x148], 0
je 0x1004c728
mov edx, dword [esi + 0x6c]
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 8]
push 0
and edx, 4
push edx
mov edx, dword [esi + 0xe4]
push eax
mov eax, dword [esi + 0xcc]
push ecx
mov ecx, dword [esi + 0xc0]
push edx
mov edx, dword [ebx]
push eax
push ecx
push edx
call fcn.100475d0
mov eax, dword [esi + 0xa0]
add esp, 0x20
mov dword [eax + 0x148], 0
mov edi, dword [ebp + 8]
mov eax, dword [edi + 0xc]
mov dword [edi + 0x14], 2
test eax, 0x4000
je 0x1004c762
test eax, 0x2000
je 0x1004c762
movzx ecx, word [esi + 0x14]
movzx edx, word [esi + 0x10]
mov eax, dword [edi + 0x44]
push ecx
movzx ecx, word [esi + 8]
push edx
push eax
push ecx
lea edx, [edi + 0x38]
push edx
call fcn.100486d0
add esp, 0x14
push 0
push 0x10
push 0
push edi
push esi
xor edx, edx
xor ecx, ecx
call fcn.10049e50
mov eax, dword [esi + 0xa0]
mov eax, dword [eax + 0x20]
mov dword [edi + 0x24], eax
mov dword [edi + 0x20], eax
mov eax, dword [esi + 0x240]
add esp, 0x14
test eax, eax
jle 0x1004c9fd
mov edx, dword [ebp - 0x14]
imul edx, dword [ebp - 0x10]
mov edi, dword [ebp - 0x24]
lea eax, [edx + edi - 1]
cdq
idiv edi
mov ecx, dword [ebp - 0xc]
add ecx, 0x200
sar ecx, 0xa
mov ebx, dword [ebp - 0x18]
add ebx, 0x200
sar ebx, 0xa
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
add eax, ecx
mov dword [ebp - 0x30], eax
imul eax, dword [ebp - 0x14]
lea eax, [eax + edi - 1]
cdq
idiv edi
shl ecx, 0xa
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x2c], eax
sub eax, dword [ebp - 0x20]
lea eax, [eax + ebx - 1]
cdq
idiv ebx
mov edx, dword [ebp - 0x1c]
sub edx, ecx
add dword [ebp - 0xc], edx
mov ecx, ebx
shl ecx, 0xa
mov edi, eax
mov eax, dword [esi + 0x240]
shl eax, 0xa
cdq
idiv dword [ebp - 8]
sub eax, ecx
add dword [ebp - 0x18], eax
test ebx, ebx
jle 0x1004c8cc
lea edx, [edi*4]
mov edi, dword [ebp - 4]
lea edi, [edi + edi*8]
add edi, edi
add edi, edi
mov dword [ebp - 0x28], edx
add edi, edi
jmp 0x1004c830
mov eax, dword [ebp - 0x28]
mov ecx, dword [esi + 0x244]
mov edx, dword [ecx + edi + 0x1c]
push eax
push 0
push edx
call fcn.1000e230
mov eax, dword [esi + 0x244]
mov edx, dword [ebp + 8]
mov dword [eax + edi + 0x44], esi
mov ecx, dword [esi + 0x244]
mov dword [ecx + edi + 4], edx
mov eax, dword [esi + 0x244]
mov ecx, dword [ebp - 0x10]
mov dword [eax + edi + 0xc], ecx
mov edx, dword [esi + 0x244]
mov dword [edx + edi + 0x10], ebx
mov eax, dword [esi + 0x244]
mov edx, dword [ebp - 0x2c]
mov dword [eax + edi + 0x18], edx
mov eax, dword [esi + 0x244]
mov edx, dword [ebp - 0x20]
mov dword [eax + edi + 0x14], edx
mov eax, dword [ebp - 4]
add eax, ecx
add esp, 0xc
test al, 1
je 0x1004c8a2
mov edx, dword [esi + 0xd0]
jmp 0x1004c8a8
mov edx, dword [esi + 0xd4]
sar eax, 1
imul eax, dword [esi + 8]
shl eax, 4
add eax, edx
mov edx, dword [esi + 0x244]
inc ecx
mov dword [edx + edi + 8], eax
add edi, 0x48
mov dword [ebp - 0x10], ecx
cmp ecx, ebx
jl 0x1004c830
mov ecx, dword [ebp - 4]
mov edx, dword [esi + 0x244]
mov edi, dword [ebp + 8]
lea eax, [ebx + ecx]
lea ebx, [eax + eax*8]
mov ebx, dword [edx + ebx*8 - 0x2c]
sub ebx, 4
lea ecx, [ecx + ecx*8]
mov dword [edx + ecx*8 + 0x20], ebx
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x10], edx
mov dword [ebp - 4], eax
cmp eax, dword [esi + 0x240]
jl 0x1004c793
mov eax, 1
mov dword [ebp - 4], eax
cmp dword [esi + 0x240], eax
jle 0x1004c94d
mov ebx, 0x48
mov eax, dword [esi + 0x244]
push 0
push 0
add eax, ebx
push eax
push fcn.10061190
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [esi + 0x244]
mov dword [ebx + ecx], eax
mov eax, dword [ebp - 4]
inc eax
add ebx, 0x48
mov dword [ebp - 4], eax
cmp eax, dword [esi + 0x240]
jl 0x1004c916
mov edx, dword [esi + 0x244]
push edx
call fcn.10061190
mov eax, 1
add esp, 4
mov dword [ebp - 4], eax
cmp dword [esi + 0x240], eax
jle 0x1004c9a5
mov ebx, 0x48
mov eax, dword [esi + 0x244]
mov ecx, dword [eax + ebx]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [esi + 0x244]
mov eax, dword [edx + ebx]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 4]
inc eax
add ebx, 0x48
mov dword [ebp - 4], eax
cmp eax, dword [esi + 0x240]
jl 0x1004c971
xor eax, eax
mov dword [edi + 0x24], eax
mov dword [edi + 0x20], eax
mov dword [ebp - 4], eax
cmp dword [esi + 0x240], eax
jle 0x1004ca5b
mov edx, eax
xor ebx, ebx
mov ecx, dword [esi + 0x244]
mov ecx, dword [ecx + eax + 0x30]
cmp ecx, ebx
jbe 0x1004c9d6
mov dword [ebp + 8], ecx
mov dword [edi + 0x20], ecx
mov ebx, ecx
mov ecx, dword [esi + 0x244]
mov ecx, dword [ecx + eax + 0x34]
cmp ecx, edx
jbe 0x1004c9e9
mov edx, ecx
mov dword [edi + 0x24], edx
mov ecx, dword [ebp - 4]
inc ecx
add eax, 0x48
mov dword [ebp - 4], ecx
cmp ecx, dword [esi + 0x240]
jl 0x1004c9c0
jmp 0x1004ca5b
mov edx, dword [esi + 0x250]
mov ecx, dword [esi + 0xa0]
mov eax, dword [ecx + 0x30]
push edx
lea edx, [esi + 0xe4]
push edx
lea edx, [esi + 0xcc]
push edx
lea edx, [esi + 0xc0]
push edx
push ebx
push ecx
lea ecx, [esi + 0x140]
push ecx
lea edx, [esi + 0x134]
push edx
mov edx, dword [ebp - 0x30]
lea ecx, [esi + 0x128]
push ecx
mov ecx, dword [esi + 0xa4]
push edx
mov edx, dword [ecx + 0x44]
push edx
mov edx, eax
sub edx, dword [ecx + 0x30]
sub eax, dword [edi + 0x30]
push edx
push eax
push edi
push esi
call fcn.10060960
add esp, 0x3c
mov ecx, dword [esi + 0x20]
mov eax, dword [edi + 0x30]
cdq
idiv ecx
mov ebx, dword [esi + 0xa4]
mov dword [ebp + 8], ecx
mov ecx, eax
mov dword [edi + 0x2c], edx
mov eax, dword [ebx + 0x30]
cdq
idiv dword [ebp + 8]
sub ecx, eax
mov eax, dword [edi + 0x18]
push eax
push 1
push edi
mov dword [edi + 0x28], ecx
mov ecx, dword [ebp + 0xc]
push esi
push ecx
call fcn.10057740
mov eax, dword [ebp - 0x1c]
xor ebx, ebx
mov dword [edi + 0x138], ebx
mov dword [edi + 0x134], ebx
mov dword [edi + 0x130], ebx
mov dword [edi + 0x124], ebx
mov dword [edi + 0x140], ebx
mov dword [edi + 0x128], ebx
mov dword [edi + 0x12c], ebx
mov edx, dword [esi + 0x10]
imul edx, dword [esi + 0x14]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 8]
add esp, 0x14
mov dword [edi + 0x134], edx
mov dword [edi + 0x138], ebx
mov dword [edi + 0x130], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 4], ebx
cmp eax, ebx
jle 0x1004cc47
mov edi, edi
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x1c]
add eax, 0x200
sar eax, 0xa
mov ecx, eax
add eax, dword [ebp - 0x10]
shl ecx, 0xa
mov dword [ebp - 0x30], eax
imul eax, dword [ebp - 0x14]
sub edx, ecx
add dword [ebp - 0xc], edx
mov ecx, dword [esi + 0x244]
mov dword [ecx + ebx + 0x44], esi
mov ecx, dword [ebp - 0x24]
mov edx, dword [esi + 0x244]
lea eax, [eax + ecx - 1]
mov dword [edx + ebx + 4], edi
cdq
idiv ecx
mov edx, dword [esi + 0x244]
mov dword [edx + ebx + 0x18], eax
mov eax, dword [ebp - 0x14]
imul eax, dword [ebp - 0x10]
lea eax, [eax + ecx - 1]
cdq
idiv ecx
mov ecx, dword [esi + 0x244]
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x10], edx
mov dword [ecx + ebx + 0x14], eax
mov ecx, dword [ebp - 4]
test cl, 1
je 0x1004cb68
mov eax, dword [esi + 0xd0]
jmp 0x1004cb6e
mov eax, dword [esi + 0xd4]
mov edx, ecx
sar edx, 1
imul edx, dword [esi + 8]
shl edx, 4
add edx, eax
mov eax, dword [esi + 0x244]
mov dword [eax + ebx + 8], edx
test ecx, ecx
jle 0x1004cc32
mov edx, dword [esi + 0x244]
mov edx, dword [edx + ebx + 0x3c]
mov eax, dword [edx + 0x14]
mov dword [edx + 0x10], eax
mov eax, dword [eax]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
bswap eax
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
mov dword [edx], eax
mov eax, dword [edx + 0x14]
mov eax, dword [eax + 4]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
bswap eax
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
mov dword [edx + 4], eax
mov eax, dword [edx + 0x1c]
test eax, eax
je 0x1004cbe3
mov ecx, 0x20
sub ecx, eax
or eax, 0xffffffff
shl eax, cl
mov ecx, dword [ebp - 4]
and eax, dword [edx]
mov dword [edx + 8], eax
jmp 0x1004cbea
mov dword [edx + 8], 0
mov eax, dword [edx + 0x1c]
mov dword [edx + 0xc], eax
mov edx, dword [esi + 0x244]
mov edx, dword [edx + ebx + 0x40]
xor eax, eax
mov dword [edx + 0x1c], eax
mov edx, dword [esi + 0x244]
mov edx, dword [edx + ebx + 0x40]
mov dword [edx + 0x14], eax
mov edx, dword [esi + 0x244]
mov edx, dword [edx + ebx + 0x40]
mov dword [edx + 0x10], eax
mov edx, dword [esi + 0x244]
mov edx, dword [edx + ebx + 0x40]
mov dword [edx + 0xc], eax
mov edx, dword [esi + 0x244]
mov edx, dword [edx + ebx + 0x40]
mov dword [edx], eax
inc ecx
add ebx, 0x48
mov dword [ebp - 4], ecx
cmp ecx, dword [ebp - 8]
jl 0x1004caf0
mov eax, dword [ebp - 8]
xor ebx, ebx
cmp eax, 1
jle 0x1004cc90
dec eax
mov dword [ebp + 8], 0x48
mov dword [ebp - 0x24], eax
jmp 0x1004cc60
mov eax, dword [esi + 0x244]
add eax, dword [ebp + 8]
push ebx
push ebx
push eax
push fcn.1004c1a0
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebp + 8]
mov edx, dword [esi + 0x244]
mov dword [ecx + edx], eax
add ecx, 0x48
dec dword [ebp - 0x24]
mov dword [ebp + 8], ecx
jne 0x1004cc60
mov eax, dword [esi + 0x244]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 0x3c], ecx
mov edx, dword [esi + 0x244]
lea eax, [edi + 0x124]
mov dword [edx + 0x40], eax
mov eax, dword [esi + 0x244]
push eax
call fcn.1004c1a0
mov eax, dword [ebp - 8]
add esp, 4
cmp eax, 1
jle 0x1004cd01
dec eax
mov dword [ebp + 8], 0x48
mov dword [ebp - 0x24], eax
lea ecx, [ecx]
mov ecx, dword [esi + 0x244]
mov edx, dword [ebp + 8]
mov eax, dword [edx + ecx]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esi + 0x244]
mov edx, dword [ebp + 8]
mov eax, dword [edx + ecx]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add dword [ebp + 8], 0x48
dec dword [ebp - 0x24]
jne 0x1004ccd0
mov edx, dword [ebp + 0xc]
mov ecx, dword [edx + 0x10]
sub ecx, dword [edx + 0x14]
cmp dword [edx + 0xc], ebx
je 0x1004cd33
mov eax, dword [edx + 8]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
bswap eax
mov dword [ebp + 8], eax
mov edx, dword [edx + 0x10]
mov eax, dword [ebp + 8]
mov dword [edx], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + 0xc]
add eax, 7
shr eax, 3
add ecx, eax
mov edx, dword [edx + 0x1c]
cmp edx, ebx
je 0x1004cd3f
shr edx, 3
sub ecx, edx
mov eax, dword [ebp - 0x34]
cdq
and edx, 7
add eax, edx
mov edx, dword [ebp + 0xc]
sar eax, 3
sub ecx, eax
mov dword [edi + 0x120], ecx
mov ecx, dword [ebp - 8]
push ecx
push edx
push esi
mov eax, edi
call fcn.1004aa50
add esp, 0xc
pop edi
pop ebx
mov esp, ebp
pop ebp
ret