Function at 0x406cb0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xcc
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, ecx
push esi
mov esi, dword [eax]
push edi
mov dword [esp + 0x18], eax
lea ecx, [ecx]
push 0xffffffffffffffff
push dword [eax + 0x1c]
xorps xmm0, xmm0
xor edi, edi
movlpd qword [esp + 0x90], xmm0
mov dword [esp + 0xa4], 0
mov dword [esp + 0xa0], 0
mov dword [esp + 0x8c], 0
mov dword [esp + 0x28], edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x406d1d
call ebx
test eax, eax
je 0x407946
test eax, eax
jne 0x407952
cmp dword [esi + 0x24], edi
jne 0x407950
mov ebx, dword [esi + 0x34]
mov edx, dword [esi + 0x30]
push ebx
push edx
push 0
mov ecx, edx
add ecx, 1
push 0
mov eax, ebx
push 0
mov dword [esp + 0x60], edx
adc eax, 0
mov dword [esi + 0x30], ecx
push 0
lea edx, [esp + 0x2c]
mov ecx, esi
mov dword [esp + 0x6c], ebx
mov dword [esi + 0x34], eax
call fcn.00406b90
mov ecx, dword [esi + 0x70]
xor edx, edx
mov dword [esp + 0x10], ecx
xor ecx, ecx
xorps xmm0, xmm0
mov dword [esp + 0x1c], eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x7c], edx
mov dword [esp + 0x64], ecx
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x44], ecx
movlpd qword [esp + 0x90], xmm0
test eax, eax
jne 0x407287
mov ecx, dword [esp + 0x14]
test ecx, ecx
jne 0x40726a
mov ecx, dword [esp + 0x8c]
mov eax, dword [esp + 0x18]
mov edi, dword [esi + 0x64]
mov eax, dword [eax + 8]
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x88]
mov dword [esp + 0x60], ecx
mov ecx, dword [esp + 0x94]
xor ebx, ebx
sub edi, dword [esi + 0x60]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x90]
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x48], eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x34], edi
jmp 0x406df0
test eax, eax
jne 0x406e23
mov eax, dword [esi]
mov ecx, dword [esi + 0x14]
add eax, 0x10
push eax
mov eax, dword [ecx]
push ecx
call eax
mov dword [esp + 0x48], eax
test eax, eax
je 0x407172
mov dword [eax], 0
test ebx, ebx
je 0x406e1c
mov dword [ebx], eax
jmp 0x406e23
mov ecx, dword [esp + 0x18]
mov dword [ecx + 8], eax
add eax, 0x10
mov dword [esp + 0x38], eax
mov dword [esp + 0x30], eax
test edi, edi
je 0x406e56
mov eax, dword [esi + 0x60]
add eax, 0x10
add eax, dword [esi + 0x5c]
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], 0
mov dword [esp + 0x44], edi
mov ebx, edi
mov dword [esp + 0x30], eax
jmp 0x406f6d
mov edi, dword [esi]
mov ebx, eax
mov eax, dword [esi + 0xc]
xor ecx, ecx
mov dword [esp + 0x68], eax
mov dword [esp + 0x40], ecx
test edi, edi
je 0x406ea7
jmp 0x406e70
lea ecx, [esp + 0x10]
push ecx
push ebx
push eax
mov eax, dword [eax]
mov dword [esp + 0x1c], edi
call eax
mov ecx, dword [esp + 0x40]
mov edx, eax
mov eax, dword [esp + 0x10]
add ecx, eax
add ebx, eax
sub edi, eax
mov dword [esp + 0x1c], edx
mov dword [esp + 0x40], ecx
test edx, edx
jne 0x406ead
test eax, eax
je 0x406ea7
mov eax, dword [esp + 0x68]
test edi, edi
jne 0x406e70
xor edx, edx
mov dword [esp + 0x1c], edx
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x2c]
mov ebx, dword [esp + 0x44]
add eax, ecx
adc edi, 0
cmp dword [esp + 0x3c], 0
mov dword [esp + 0x28], eax
cmove ebx, ecx
add dword [esi + 0x68], ecx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x2c], edi
adc dword [esi + 0x6c], 0
xor ebx, ebx
cmp ecx, dword [esi]
setne bl
mov dword [esp + 0x10], ebx
test ebx, ebx
je 0x406eef
mov dword [esi + 0x70], 1
test edx, edx
je 0x406f0d
mov dword [esi + 0x48], edx
mov dword [esi + 0x70], 1
mov dword [esp + 0x10], 1
mov dword [esp + 0x1c], 0
mov ecx, eax
sub ecx, dword [esp + 0x60]
mov eax, edi
sbb eax, dword [esp + 0x50]
mov dword [esp + 0xac], eax
jne 0x406f27
cmp ecx, 1
jb 0x406f65
push dword [esp + 0x54]
mov ebx, dword [esp + 0x50]
push ebx
push 0
push 0
push 0
push 0
lea edx, [esp + 0x2c]
mov ecx, esi
call fcn.00406b90
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x40704f
cmp dword [esp + 0x14], eax
jne 0x407212
mov eax, dword [esp + 0x28]
mov dword [esp + 0x60], eax
mov dword [esp + 0x50], edi
mov edi, dword [esp + 0x34]
mov ebx, dword [esp + 0x40]
xor eax, eax
cmp dword [esp + 0x3c], eax
lea ecx, [esp + 0xb0]
sete al
push ecx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0xbc], ebx
push dword [ecx + 4]
mov dword [esp + 0xcc], 1
push dword [esi + 0x1c]
mov dword [esp + 0xbc], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0xc0], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0xc8], eax
mov eax, dword [esi + 0x18]
mov eax, dword [eax]
call eax
mov eax, dword [esp + 0xc4]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0xc0]
mov dword [esp + 0x7c], 1
cmp eax, 1
je 0x4071cb
test edi, edi
mov edi, dword [esp + 0xb8]
je 0x407007
push edi
push dword [esp + 0x34]
push dword [esp + 0x40]
call fcn.00445a90
mov eax, dword [esp + 0xcc]
add esp, 0xc
add dword [esi + 0x60], edi
test eax, eax
jne 0x4070af
cmp dword [esp + 0x10], eax
jne 0x4070c2
cmp edi, ebx
jne 0x407046
mov eax, dword [esp + 0x48]
mov edi, dword [esp + 0x34]
mov ebx, eax
mov eax, dword [eax]
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x48], eax
test edi, edi
je 0x406df0
xor edi, edi
mov dword [esi + 0x60], edi
mov dword [esi + 0x64], edi
jmp 0x406de7
mov eax, 0xb
mov dword [esp + 0x1c], eax
mov edx, dword [esp + 0x24]
mov edi, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
xor ebx, ebx
mov dword [esp + 0x30], ebx
test eax, eax
jne 0x4072a6
test edx, edx
je 0x4072a2
test ecx, ecx
jne 0x4072a6
mov ecx, dword [esp + 0x18]
mov eax, dword [esi + 0x18]
push dword [ecx + 4]
mov eax, dword [eax + 4]
push dword [esi + 0x1c]
call eax
mov ebx, eax
mov dword [esp + 0x30], ebx
test ebx, ebx
je 0x4072b1
mov eax, 1
mov dword [esp + 0x24], 0
mov dword [esp + 0x10], eax
jmp 0x4072b5
mov ecx, dword [esp + 0x10]
cmp eax, 3
mov edx, 1
cmove ecx, edx
mov dword [esp + 0x10], ecx
mov edx, 1
mov dword [esp + 0x24], edx
cmp edi, ebx
jne 0x4070e2
mov dword [esi + 0x60], 0
mov dword [esi + 0x64], 0
jmp 0x407202
cmp eax, 3
jne 0x407133
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x84]
add eax, edi
mov dword [esp + 0x9c], eax
mov eax, ebx
sub eax, edi
cmp dword [esp + 0x34], ecx
mov ebx, edx
cmovne ecx, ebx
sub dword [esp + 0x28], eax
mov dword [esp + 0x98], eax
mov dword [esp + 0x84], ecx
sbb dword [esp + 0x2c], 0
cmp dword [esp + 0x3c], 0
jne 0x407202
mov dword [esp + 0x44], edi
jmp 0x407202
cmp dword [esp + 0x34], 0
je 0x407148
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], 0
jmp 0x4071b1
mov eax, dword [esi + 0x5c]
test eax, eax
jne 0x40716b
mov eax, dword [esi]
mov ecx, dword [esi + 0x14]
add eax, 0x10
push eax
mov eax, dword [ecx]
push ecx
call eax
test eax, eax
je 0x407172
mov edi, dword [esp + 0xb8]
mov dword [esi + 0x5c], eax
lea ecx, [eax + 0x10]
test ecx, ecx
jne 0x407184
mov dword [esp + 0x10], 1
mov dword [esp + 0x64], 1
jmp 0x4071fe
mov eax, dword [esp + 0x30]
sub ebx, edi
sub dword [esp + 0x28], ebx
push ebx
mov dword [esi + 0x64], ebx
sbb dword [esp + 0x30], 0
add eax, edi
push eax
push ecx
mov dword [esi + 0x60], 0
call fcn.00445a90
mov edi, dword [esp + 0xc4]
add esp, 0xc
mov edx, dword [esp + 0x44]
cmp dword [esp + 0x3c], 0
mov dword [esp + 0x10], 0
cmove edx, edi
mov dword [esp + 0x44], edx
jmp 0x4071fe
mov dword [esp + 0x10], 1
mov dword [esp + 0x6c], 1
test edi, edi
je 0x4071f0
push ebx
push dword [esp + 0x34]
push dword [esp + 0x40]
call fcn.00445a90
add esp, 0xc
mov dword [esi + 0x60], 0
mov dword [esi + 0x64], 0
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x407053
mov ebx, dword [esp + 0x4c]
lea edi, [esi + 0xb0]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], 0
je 0x407248
mov eax, dword [esp + 0x54]
cmp eax, dword [esi + 0x94]
jb 0x407248
ja 0x40723e
cmp ebx, dword [esi + 0x90]
jbe 0x407248
mov dword [esp + 0x14], 1
jmp 0x407250
mov dword [esp + 0x14], 0
mov eax, dword [esi + 0x9c]
push edi
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x1c]
jmp 0x40704f
mov edx, dword [esp + 0x94]
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x90]
mov dword [esp + 0x28], edx
mov edx, edi
jmp 0x40705b
mov ecx, dword [esp + 0x94]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x90]
mov dword [esp + 0x28], ecx
jmp 0x407057
test ecx, ecx
je 0x4072b1
mov eax, 1
mov dword [esp + 0x10], eax
jmp 0x4072b5
mov eax, dword [esp + 0x10]
mov dword [esp + 0x68], 0
mov dword [esp + 0x60], 0
test eax, eax
jne 0x40739d
mov eax, dword [esi + 0x58]
cmp eax, dword [esi + 0x54]
jae 0x40735b
test edi, edi
je 0x40735b
lea eax, [eax + eax*4]
lea eax, [eax + 0x19]
lea edi, [esi + eax*8]
mov ecx, edi
call fcn.00406a30
mov ecx, eax
test ecx, ecx
jne 0x40732c
cmp dword [edi + 0x18], eax
jne 0x40733b
lea eax, [esp + 0xd4]
push eax
push ecx
push edi
push fcn.00407a00
push ecx
push ecx
call fcn.00440e5d
add esp, 0x18
mov dword [edi + 0x18], eax
test eax, eax
jne 0x40733b
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
je 0x40733b
jle 0x407337
movzx ecx, cx
or ecx, 0x80070000
test ecx, ecx
jne 0x407340
inc dword [esi + 0x58]
jmp 0x40735b
mov eax, dword [esi + 0x58]
cmp eax, 1
jne 0x407358
xor edx, edx
mov dword [esp + 0x10], eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x60], ecx
jmp 0x4073a1
mov dword [esi + 0x54], eax
mov eax, dword [esp + 0x18]
mov ecx, dword [eax + 4]
inc ecx
cmp ecx, dword [esi + 0x58]
sbb eax, eax
and eax, ecx
add eax, 5
lea eax, [eax + eax*4]
push dword [esi + eax*8 + 0x1c]
lea edi, [esi + eax*8]
mov dword [esp + 0x6c], edi
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x40739d
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
jne 0x4078f3
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
xorps xmm0, xmm0
movlpd qword [esp + 0x88], xmm0
movlpd qword [esp + 0xa0], xmm0
movlpd qword [esp + 0x58], xmm0
movlpd qword [esp + 0x70], xmm0
test eax, eax
jne 0x407570
test edx, edx
je 0x407570
test ebx, ebx
jne 0x407570
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x58]
lea eax, [ebx + 1]
mov ebx, dword [ecx + 8]
mov ecx, dword [esp + 0x8c]
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x88]
mov dword [esp + 0x40], ecx
mov ecx, dword [esp + 0xa4]
mov dword [esp + 0x48], ecx
mov ecx, dword [esp + 0xa0]
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x5c]
mov dword [esp + 0x20], ebx
test eax, eax
je 0x40742a
mov edi, dword [esp + 0x44]
jmp 0x407452
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x2c]
mov edi, dword [esi]
sub ebx, edx
sbb eax, ecx
mov dword [esp + 0x38], 0
cmp dword [esp + 0x38], eax
jb 0x40744e
ja 0x40744c
cmp edi, ebx
jbe 0x40744e
mov edi, ebx
mov ebx, dword [esp + 0x20]
add edx, edi
adc ecx, 0
mov dword [esp + 0x58], edx
mov dword [esp + 0x5c], ecx
mov dword [esp + 0x38], 1
cmp edx, dword [esp + 0x28]
jne 0x40747a
cmp ecx, dword [esp + 0x2c]
jne 0x40747a
mov eax, 1
jmp 0x40747c
xor eax, eax
mov ecx, dword [esi + 0x18]
lea edx, [esp + 0x38]
push edx
lea edx, [esp + 0x74]
push edx
lea edx, [esp + 0x60]
push edx
push eax
push edi
lea eax, [ebx + 0x10]
push eax
mov eax, dword [esp + 0x30]
push dword [eax + 4]
mov eax, dword [ecx + 8]
push dword [esi + 0x1c]
call eax
mov edi, eax
mov dword [esp + 0x30], edi
test edi, edi
jne 0x40755f
cmp dword [esp + 0x38], eax
jne 0x4075a0
mov edx, dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
cmp edx, dword [esp + 0x28]
jne 0x4074d3
cmp ecx, dword [esp + 0x2c]
je 0x4075a0
mov edi, dword [esp + 0x70]
mov eax, edx
sub eax, dword [esp + 0x40]
mov ebx, ecx
sbb ebx, dword [esp + 0x3c]
sub edi, dword [esp + 0x34]
mov dword [esp + 0x50], ebx
mov ebx, dword [esp + 0x74]
sbb ebx, dword [esp + 0x48]
cmp dword [esp + 0x50], 0
ja 0x40750a
jb 0x407501
cmp eax, 1
jae 0x40750a
test ebx, ebx
jne 0x40750a
cmp edi, 1
jb 0x407552
push dword [esp + 0x54]
lea edx, [esp + 0x18]
push dword [esp + 0x50]
mov ecx, esi
push ebx
push edi
push dword [esp + 0x60]
push eax
call fcn.00406b90
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x40759c
cmp dword [esp + 0x14], eax
jne 0x40759c
mov edx, dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
mov eax, dword [esp + 0x70]
mov edi, dword [esp + 0x74]
mov dword [esp + 0x40], edx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x48], edi
mov ebx, dword [esp + 0x20]
xor eax, eax
mov ebx, dword [ebx]
jmp 0x40741c
push dword [esp + 0x54]
mov ecx, esi
push dword [esp + 0x50]
call fcn.00406c50
jmp 0x4075a0
mov eax, dword [esp + 0x8c]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x88]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0xa4]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0xa0]
mov dword [esp + 0x34], eax
mov edi, dword [esp + 0x30]
mov eax, dword [esp + 0x18]
push 0xffffffffffffffff
push dword [eax + 0x20]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x4075c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x407946
test eax, eax
jne 0x407952
mov eax, dword [esp + 0x7c]
xor ebx, ebx
mov dword [esp + 0xa8], ebx
mov dword [esp + 0x38], 1
mov dword [esp + 0x20], eax
cmp dword [esi + 0x24], ebx
jne 0x407950
cmp dword [esi + 0x50], ebx
je 0x4075fc
mov eax, 1
mov dword [esp + 0x14], eax
jmp 0x407661
mov ecx, dword [esp + 0x64]
test edi, edi
je 0x407619
cmp edi, 2
mov eax, 1
mov dword [esi + 0x50], 1
mov dword [esi + 0x4c], edi
cmove ecx, eax
mov eax, dword [esp + 0x60]
test eax, eax
je 0x40762f
mov dword [esi + 0x50], 1
mov dword [esi + 0x40], eax
mov dword [esp + 0x20], ebx
test ecx, ecx
je 0x407645
mov dword [esi + 0x50], 1
mov dword [esi + 0x38], 1
mov dword [esp + 0x20], ebx
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x6c], ebx
je 0x407661
mov dword [esi + 0x50], 1
mov dword [esi + 0x3c], 1
mov dword [esp + 0x20], ebx
cmp dword [esp + 0x24], ebx
je 0x407731
test eax, eax
je 0x40767e
xorps xmm0, xmm0
movlpd qword [esp + 0x58], xmm0
movlpd qword [esp + 0x70], xmm0
mov eax, dword [esp + 0x58]
sub eax, dword [esp + 0x40]
mov edi, dword [esp + 0x70]
mov ebx, dword [esp + 0x74]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x5c]
sbb eax, dword [esp + 0x3c]
sub edi, dword [esp + 0x34]
mov dword [esp + 0x50], eax
sbb ebx, dword [esp + 0x48]
lea eax, [esi + 0xb0]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esp + 0x6c]
add dword [esi + 0xa0], eax
mov eax, dword [esp + 0x50]
adc dword [esi + 0xa4], eax
add dword [esi + 0xa8], edi
adc dword [esi + 0xac], ebx
cmp dword [esi + 0x9c], 0
jne 0x407711
mov eax, dword [esi + 0x98]
test eax, eax
je 0x407711
push dword [esi + 0xac]
push dword [esi + 0xa8]
push dword [esi + 0xa4]
push dword [esi + 0xa0]
push eax
mov eax, dword [eax]
call eax
test eax, eax
je 0x407711
mov dword [esi + 0x9c], 0xa
mov edi, dword [esi + 0x9c]
lea eax, [esi + 0xb0]
push eax
mov dword [esp + 0x20], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, dword [esp + 0xa8]
jmp 0x407735
mov edi, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
xor ecx, ecx
test edx, edx
sete cl
cmp dword [esp + 0x7c], 0
mov dword [esp + 0x80], ecx
je 0x407825
test edi, edi
jne 0x407767
cmp dword [esp + 0x20], edi
je 0x407767
cmp dword [esp + 0x14], edi
jne 0x407767
lea ecx, [edi + 1]
jmp 0x407769
xor ecx, ecx
mov edi, dword [esp + 0x18]
mov eax, dword [esi + 0x18]
lea edx, [esp + 0x38]
mov eax, dword [eax + 0xc]
push edx
lea edx, [esp + 0x84]
push edx
push dword [esp + 0x8c]
push dword [esp + 0xa4]
push dword [esp + 0xac]
push ecx
push dword [edi + 4]
push dword [esi + 0x1c]
call eax
mov dword [esp + 0x1c], eax
test eax, eax
je 0x4077b0
mov ebx, 1
mov dword [esi + 0x50], ebx
jmp 0x4077c3
mov ecx, dword [esp + 0x80]
mov edx, dword [esp + 0x10]
test ecx, ecx
jne 0x40782d
test edx, edx
jne 0x40782d
lea edi, [esi + 0xb0]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], 0
je 0x4077f5
mov eax, dword [esp + 0x54]
cmp eax, dword [esi + 0x94]
ja 0x407813
mov eax, dword [esp + 0x4c]
jb 0x4077f9
cmp eax, dword [esi + 0x90]
jae 0x407813
jmp 0x4077f9
mov eax, dword [esp + 0x4c]
mov dword [esi + 0x90], eax
mov eax, dword [esp + 0x54]
mov dword [esi + 0x94], eax
mov dword [esi + 0x88], 1
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x80]
mov edx, dword [esp + 0x10]
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
cmp dword [esp + 0x38], 0
je 0x40789b
cmp dword [esp + 0x24], 0
je 0x40785c
test eax, eax
jne 0x40785c
cmp dword [esi + 0x50], eax
jne 0x40785c
cmp dword [esp + 0x30], eax
jne 0x40785c
cmp dword [esp + 0x14], eax
jne 0x40785c
cmp dword [esi + 0x84], eax
jne 0x40786e
test ebx, ebx
je 0x40789b
cmp dword [esi + 0x84], 0
jne 0x40786e
mov eax, dword [edi + 4]
mov dword [esi + 0x80], eax
mov edi, dword [esp + 0x28]
mov ebx, dword [esp + 0x2c]
mov eax, edi
or eax, ebx
jne 0x407880
test edx, edx
jne 0x4078c7
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x44]
mov dword [eax + 0xc], edx
mov edx, dword [esp + 0x10]
mov dword [eax + 0x10], edi
mov dword [eax + 0x14], ebx
inc dword [esi + 0x84]
test edx, edx
jne 0x4078c7
mov eax, dword [esp + 0x68]
push dword [eax + 0x20]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov eax, dword [esp + 0x18]
jne 0x406cd0
call ebx
mov ecx, 1
jmp 0x407934
test ecx, ecx
je 0x4078fc
push dword [esi + 0xe8]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x407913
call ebx
mov edi, 1
test eax, eax
mov ecx, edi
cmovne ecx, eax
test ecx, ecx
je 0x407918
mov eax, ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x18]
cmp dword [eax + 4], 0
je 0x407950
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x24], 1
mov edi, 1
push dword [esi + 0xe4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
mov eax, dword [esp + 0x18]
jne 0x406cd0
call ebx
mov ecx, edi
test eax, eax
cmovne ecx, eax
test ecx, ecx
jne 0x4078f3
mov eax, dword [esp + 0x18]
jmp 0x406cd0
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret