Function at 0x404940
Capabilities:
Create thread
Resume thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41a1d0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xbc
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x20], ebx
mov ebx, ecx
mov esi, dword [ebp + 8]
mov edx, dword [ebp + 0x14]
mov dword [ebp - 0x2c], ebx
test edx, edx
mov dword [ebp + 0x18], 0
je 0x404992
test esi, esi
je 0x404992
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x404992
mov eax, dword [ebx + 0x48]
test eax, eax
je 0x4049aa
mov esi, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x20]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0x20
mov dword [ebx], 0x408560
push esi
mov dword [ebx + 4], edx
lea edi, [ebx + 8]
call fcn.0040ccbc
pop ecx
mov edx, dword [edi + 0x18]
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x38], esi
cmp edx, 8
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x44], edx
jb 0x4049d6
mov edx, dword [edi + 4]
jmp 0x4049d9
lea edx, [ebx + 0xc]
cmp esi, edx
jae 0x404e59
xor edx, edx
test edx, edx
jne 0x404a23
mov dword [ebp - 0x60], eax
cmp eax, 0x7ffffffe
jbe 0x404a02
mov dword [ebp - 0x64], eax
call fcn.0040c10d
mov eax, dword [ebp - 0x64]
mov edx, dword [edi + 0x18]
mov dword [ebp - 0x44], edx
cmp eax, dword [ebp - 0x44]
ja 0x404b8a
test eax, eax
je 0x404b69
mov eax, dword [ebp - 0x60]
test eax, eax
ja 0x404b1e
jmp 0x404ab6
mov edx, dword [ebp - 0x44]
cmp edx, 8
jb 0x404a30
mov edx, dword [edi + 4]
jmp 0x404a33
lea edx, [ebx + 0xc]
mov dword [ebp - 0x58], edi
sub esi, edx
mov edx, dword [edi + 0x14]
mov dword [ebp - 0x50], edi
sar esi, 1
cmp edx, esi
mov dword [ebp - 0x48], esi
jb 0x404a58
mov ecx, edx
sub ecx, esi
cmp eax, ecx
cmovb ecx, eax
mov dword [ebp - 0x68], ecx
mov dword [ebp - 0x6c], ecx
jmp 0x404a78
mov dword [ebp - 0x64], eax
call fcn.0040c259
mov eax, dword [ebp - 0x64]
mov esi, dword [ebp - 0x48]
mov edx, dword [edi + 0x14]
mov ecx, edx
sub ecx, esi
cmp eax, ecx
cmovb ecx, eax
mov dword [ebp - 0x68], ecx
mov dword [ebp - 0x6c], ecx
mov eax, ecx
add eax, esi
mov dword [ebp - 0x68], eax
cmp edx, eax
jae 0x404a8e
call fcn.0040c259
mov esi, dword [ebp - 0x48]
mov edx, dword [edi + 0x14]
mov ecx, edx
sub ecx, dword [ebp - 0x68]
mov eax, 0xffffffff
cmp ecx, 0xffffffff
cmovae ecx, eax
mov dword [ebp - 0x70], ecx
test ecx, ecx
ja 0x404dac
cmp edx, esi
cmovb esi, edx
test esi, esi
ja 0x404d58
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp + 0xc]
add esp, 0xfffffff0
mov dword [esp], eax
add ecx, 0x24
call fcn.004044e0
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp + 0x18]
push dword [edx + 0x44]
mov dword [edx + 0x40], eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
xor eax, eax
push eax
push 4
push dword [ebp - 0x2c]
push 0x409c60
push eax
push eax
call fcn.0040d265
add esp, 0x18
mov edx, dword [ebp - 0x2c]
push eax
mov dword [edx + 0x48], eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov edi, dword [ebp - 0x28]
mov esi, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x20]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0x20
mov ebx, dword [ebp - 0x40]
mov eax, dword [ebx + 0x18]
cmp eax, 8
jb 0x404b2e
mov edx, dword [ebx + 4]
jmp 0x404b31
lea edx, [ebx + 4]
mov edi, dword [ebp - 0x30]
lea esi, [edi + edi]
push esi
add eax, eax
push dword [ebp - 0x38]
push eax
push edx
call fcn.0040ccd6
add esp, 0x10
mov eax, dword [ebx + 0x18]
mov dword [ebx + 0x14], edi
cmp eax, 8
jb 0x404b57
mov ebx, dword [ebx + 4]
jmp 0x404b5a
add ebx, 4
xor eax, eax
mov word [ebp - 0x74], ax
mov word [ebx + esi], ax
jmp 0x404ab6
mov eax, dword [ebp - 0x44]
mov dword [edi + 0x14], 0
cmp eax, 8
jb 0x404b7d
mov ebx, dword [edi + 4]
jmp 0x404b80
add ebx, 0xc
xor eax, eax
mov word [ebx], ax
jmp 0x404a13
mov edx, dword [edi + 0x14]
mov dword [ebp - 0x90], edi
mov ebx, eax
mov dword [ebp - 0x88], eax
or ebx, 7
mov dword [ebp - 0x80], edx
mov dword [ebp - 0x9c], ebx
cmp ebx, 0x7ffffffe
jbe 0x404bb9
mov dword [ebp - 0x9c], eax
mov ebx, eax
jmp 0x404bcf
mov ecx, dword [ebp - 0x44]
shr ecx, 1
mov eax, 0xaaaaaaab
mul ebx
shr edx, 1
cmp ecx, edx
ja 0x404d35
mov dword [ebp - 4], 0
mov dword [ebp - 0x98], 0
inc ebx
jne 0x404be7
xor ebx, ebx
jmp 0x404c2c
xor edx, edx
mov eax, 0xffffffff
div ebx
cmp eax, 2
jae 0x404c2c
mov dword [ebp - 0xb8], 0
lea eax, [ebp - 0xb8]
push eax
lea ecx, [ebp - 0xc8]
call fcn.0040cd64
mov dword [ebp - 0xc8], vtable.std::bad_alloc.0
lea eax, [ebp - 0xc8]
push 0x41f2d8
push eax
call fcn.0040ce75
push edi
add ebx, ebx
mov dword [esp], ebx
call fcn.0040c522
pop ecx
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x98], eax
mov dword [ebp - 4], 0xffffffff
nop
mov edi, dword [ebp - 0x80]
test edi, edi
ja 0x404cfc
mov esi, dword [ebp - 0x90]
mov eax, dword [esi + 0x18]
mov ebx, esi
cmp eax, 8
jae 0x404ce5
mov eax, dword [ebp - 0x98]
mov dword [ebx + 0x18], 7
xor edx, edx
mov dword [ebx + 0x14], edx
mov word [ebp - 0x7c], dx
mov word [ebp - 0x78], dx
mov word [ebx + 4], dx
mov ebx, dword [ebp - 0x9c]
mov dword [esi + 4], eax
mov dword [esi + 0x18], ebx
mov dword [esi + 0x14], edi
add esi, 4
cmp ebx, 8
cmovae esi, eax
mov word [esi + edi*2], dx
jmp 0x404a13
push dword [esi + 4]
call fcn.0040c587
pop ecx
mov esi, dword [ebp - 0x90]
mov edi, dword [ebp - 0x80]
jmp 0x404c68
mov esi, dword [ebp - 0x90]
mov eax, dword [esi + 0x18]
cmp eax, 8
jb 0x404d0f
mov ecx, dword [esi + 4]
jmp 0x404d12
lea ecx, [esi + 4]
mov eax, dword [ebp - 0x9c]
lea ebx, [eax + eax + 2]
lea edx, [edi + edi]
push edx
push ecx
push ebx
push dword [ebp - 0x98]
call fcn.0040ccd6
add esp, 0x10
jmp 0x404c5e
mov eax, ecx
neg eax
add eax, 0x7ffffffe
cmp eax, dword [ebp - 0x44]
jb 0x404bcf
mov eax, dword [ebp - 0x44]
lea ebx, [eax + ecx]
mov dword [ebp - 0x9c], ebx
jmp 0x404bcf
mov eax, dword [edi + 0x18]
cmp eax, 8
jb 0x404d65
mov ecx, dword [edi + 4]
jmp 0x404d68
lea ecx, [ebx + 0xc]
mov dword [ebp - 0xac], ebx
add eax, eax
lea ebx, [ecx + esi*2]
sub edx, esi
add edx, edx
push edx
push ebx
mov ebx, dword [ebp - 0xac]
push eax
push ecx
call fcn.0040cec1
add esp, 0x10
mov edx, dword [edi + 0x14]
mov eax, dword [edi + 0x18]
sub edx, esi
mov dword [edi + 0x14], edx
cmp eax, 8
jb 0x404d9e
mov ebx, dword [edi + 4]
jmp 0x404da1
add ebx, 0xc
xor eax, eax
mov word [ebx + edx*2], ax
jmp 0x404ab6
mov eax, dword [edi + 0x18]
mov dword [ebp - 0xb0], eax
cmp eax, 8
jb 0x404dc5
mov eax, dword [edi + 4]
mov dword [ebp - 0xb4], eax
jmp 0x404dce
lea eax, [ebx + 0xc]
mov dword [ebp - 0xb4], eax
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp - 0xb4]
mov dword [ebp - 0xa8], edi
mov dword [ebp - 0xa4], esi
mov esi, dword [ebp - 0x70]
mov dword [ebp - 0xac], ebx
lea edi, [eax + eax]
lea ebx, [ecx + eax*2]
mov dword [ebp - 0xa0], ebx
mov ebx, dword [ebp - 0xb0]
sub ebx, eax
add ebx, ebx
lea edi, [edi + esi*2]
add edi, ecx
neg esi
sub esi, eax
add esi, edx
add esi, esi
push esi
mov esi, dword [ebp - 0xa4]
push edi
mov edi, dword [ebp - 0xa8]
push ebx
mov ebx, dword [ebp - 0xac]
push dword [ebp - 0xa0]
call fcn.0040cec1
add esp, 0x10
mov eax, dword [edi + 0x14]
sub eax, dword [ebp - 0x70]
mov edx, dword [edi + 0x18]
mov dword [edi + 0x14], eax
cmp edx, 8
jb 0x404e48
mov ecx, dword [edi + 4]
jmp 0x404e4b
lea ecx, [ebx + 0xc]
xor edx, edx
mov word [ecx + eax*2], dx
mov edx, dword [edi + 0x14]
jmp 0x404aa9
mov edx, dword [ebp - 0x44]
cmp edx, 8
jb 0x404e6c
mov edx, dword [edi + 4]
mov dword [ebp - 0xbc], edx
jmp 0x404e75
lea edx, [ebx + 0xc]
mov dword [ebp - 0xbc], edx
mov ecx, dword [edi + 0x14]
lea edx, [edx + ecx*2]
cmp edx, esi
jbe 0x4049e1
mov edx, 1
jmp 0x4049e3