Function at 0x407020
Capabilities:
Create thread
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xbc
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, ecx
push esi
push edi
mov dword [esp + 0x18], eax
mov esi, dword [eax]
lea ecx, [ecx]
push 0xffffffffffffffff
push dword [eax + 0x1c]
xorps xmm0, xmm0
mov dword [esp + 0xa0], 0
xor edi, edi
movlpd qword [esp + 0x48], xmm0
mov dword [esp + 0xa4], 0
mov dword [esp + 0x98], 0
mov dword [esp + 0x24], edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x40708a
call ebx
test eax, eax
je 0x407c89
test eax, eax
jne 0x407c95
cmp dword [esi + 0x24], edi
jne 0x407c93
mov ebx, dword [esi + 0x34]
mov eax, ebx
mov edx, dword [esi + 0x30]
mov ecx, edx
push ebx
push edx
push 0
add ecx, 1
mov dword [esp + 0x5c], edx
push 0
push 0
adc eax, 0
mov dword [esi + 0x30], ecx
push 0
lea edx, [esp + 0x38]
mov dword [esp + 0x6c], ebx
mov ecx, esi
mov dword [esi + 0x34], eax
call fcn.00406f00
mov ecx, dword [esi + 0x70]
mov ebx, eax
xor eax, eax
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x20]
xor edx, edx
mov dword [esp + 0x14], ebx
xorps xmm0, xmm0
mov dword [esp + 0x28], edx
mov dword [esp + 0x8c], edx
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], eax
mov dword [esp + 0x48], eax
movlpd qword [esp + 0x68], xmm0
test ebx, ebx
jne 0x4075d2
test ecx, ecx
jne 0x4075be
mov ecx, dword [esp + 0x44]
mov edi, dword [esi + 0x64]
sub edi, dword [esi + 0x60]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x74], ecx
mov ecx, dword [esp + 0x6c]
mov eax, dword [eax + 8]
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x68]
mov dword [esp + 0x4c], eax
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x34], edi
lea esp, [esp]
test eax, eax
jne 0x407187
mov ecx, dword [esi + 0x14]
mov eax, dword [esi]
add eax, 0x10
push eax
mov eax, dword [ecx]
push ecx
call eax
mov dword [esp + 0x4c], eax
test eax, eax
je 0x407488
mov ecx, dword [esp + 0x3c]
mov dword [eax], 0
test ecx, ecx
je 0x407180
mov dword [ecx], eax
jmp 0x407187
mov ecx, dword [esp + 0x18]
mov dword [ecx + 8], eax
add eax, 0x10
mov dword [esp + 0x40], eax
mov dword [esp + 0x38], eax
test edi, edi
je 0x4071be
mov eax, dword [esi + 0x60]
mov edx, edi
add eax, 0x10
mov dword [esp + 0x2c], edi
add eax, dword [esi + 0x5c]
mov dword [esp + 0x30], 0
mov dword [esp + 0x48], edi
mov dword [esp + 0x24], edx
mov dword [esp + 0x38], eax
jmp 0x4072ce
mov edi, dword [esi]
xor edx, edx
mov dword [esp + 0x24], edx
mov ebx, eax
mov eax, dword [esi + 0xc]
mov dword [esp + 0x68], eax
test edi, edi
je 0x40720a
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], edi
push ecx
push ebx
push eax
mov eax, dword [eax]
call eax
mov edx, dword [esp + 0x24]
mov ecx, eax
mov eax, dword [esp + 0x10]
add edx, eax
add ebx, eax
mov dword [esp + 0x14], ecx
sub edi, eax
mov dword [esp + 0x24], edx
test ecx, ecx
jne 0x407210
test eax, eax
je 0x40720a
mov eax, dword [esp + 0x68]
test edi, edi
jne 0x4071d3
xor ecx, ecx
mov dword [esp + 0x14], ecx
mov eax, dword [esp + 0x2c]
mov edi, dword [esp + 0x30]
add eax, edx
mov ebx, dword [esp + 0x48]
adc edi, 0
mov dword [esp + 0x2c], eax
cmp dword [esp + 0x3c], 0
mov dword [esp + 0x30], edi
cmove ebx, edx
add dword [esi + 0x68], edx
mov dword [esp + 0x48], ebx
adc dword [esi + 0x6c], 0
xor ebx, ebx
cmp edx, dword [esi]
setne bl
mov dword [esp + 0x10], ebx
test ebx, ebx
je 0x407252
mov dword [esi + 0x70], 1
test ecx, ecx
je 0x407270
mov dword [esi + 0x48], ecx
mov dword [esi + 0x70], 1
mov dword [esp + 0x10], 1
mov dword [esp + 0x14], 0
mov ecx, eax
mov eax, edi
sub ecx, dword [esp + 0x74]
sbb eax, dword [esp + 0x58]
mov dword [esp + 0x6c], eax
jne 0x407287
cmp ecx, 1
jb 0x4072ca
push dword [esp + 0x54]
lea edx, [esp + 0x24]
mov ecx, esi
push dword [esp + 0x54]
push 0
push 0
push 0
push 0
call fcn.00406f00
mov ebx, eax
mov dword [esp + 0x14], ebx
test ebx, ebx
jne 0x407577
cmp dword [esp + 0x20], eax
jne 0x407524
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
mov dword [esp + 0x74], eax
mov dword [esp + 0x58], edi
mov edi, dword [esp + 0x34]
mov ecx, dword [esp + 0x10]
xor eax, eax
cmp dword [esp + 0x3c], eax
mov dword [esp + 0xac], ecx
lea ecx, [esp + 0xa0]
sete al
mov dword [esp + 0xa8], edx
push ecx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0xa4], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0xa8], eax
mov eax, dword [esi + 0x18]
push dword [ecx + 4]
mov dword [esp + 0xbc], 1
push dword [esi + 0x1c]
mov eax, dword [eax]
call eax
mov ebx, dword [esp + 0xb0]
mov eax, dword [esp + 0xb4]
mov dword [esp + 0x8c], 1
mov dword [esp + 0x1c], eax
cmp ebx, 1
je 0x4074e1
test edi, edi
mov edi, dword [esp + 0xa8]
je 0x407364
push edi
push dword [esp + 0x3c]
push dword [esp + 0x48]
call fcn.00448c70
add esp, 0xc
add dword [esi + 0x60], edi
test ebx, ebx
jne 0x4073bc
cmp dword [esp + 0x10], ebx
jne 0x4073cf
cmp edi, dword [esp + 0x24]
jne 0x40739b
mov eax, dword [esp + 0x4c]
mov edi, dword [esp + 0x34]
mov dword [esp + 0x3c], eax
mov eax, dword [eax]
mov dword [esp + 0x4c], eax
test edi, edi
je 0x407150
xor edi, edi
mov dword [esi + 0x60], edi
mov dword [esi + 0x64], edi
jmp 0x407148
mov edi, dword [esp + 0x1c]
mov ebx, 0xb
xor eax, eax
mov dword [esp + 0x14], ebx
mov ecx, 1
mov dword [esp + 0x24], eax
mov dword [esp + 0x10], ecx
jmp 0x4075f7
mov ecx, dword [esp + 0x10]
cmp ebx, 3
mov eax, 1
cmove ecx, eax
mov dword [esp + 0x10], ecx
mov ebx, dword [esp + 0x24]
mov edx, 1
mov dword [esp + 0x28], edx
cmp edi, ebx
jne 0x4073f3
mov dword [esi + 0x60], 0
mov dword [esi + 0x64], 0
jmp 0x40751c
cmp dword [esp + 0xb0], 3
jne 0x407449
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x90]
add eax, edi
mov dword [esp + 0x98], eax
mov eax, ebx
sub eax, edi
mov ebx, edx
cmp dword [esp + 0x34], ecx
mov dword [esp + 0x9c], eax
cmovne ecx, ebx
sub dword [esp + 0x2c], eax
mov dword [esp + 0x90], ecx
sbb dword [esp + 0x30], 0
cmp dword [esp + 0x3c], 0
jne 0x40751c
mov dword [esp + 0x48], edi
jmp 0x40751c
cmp dword [esp + 0x34], 0
je 0x40745e
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], 0
jmp 0x4074c7
mov eax, dword [esi + 0x5c]
test eax, eax
jne 0x407481
mov ecx, dword [esi + 0x14]
mov eax, dword [esi]
add eax, 0x10
push eax
mov eax, dword [ecx]
push ecx
call eax
test eax, eax
je 0x407488
mov edi, dword [esp + 0xa8]
mov dword [esi + 0x5c], eax
lea ecx, [eax + 0x10]
test ecx, ecx
jne 0x40749a
mov dword [esp + 0x10], 1
mov dword [esp + 0x78], 1
jmp 0x407518
mov eax, dword [esp + 0x38]
sub ebx, edi
sub dword [esp + 0x2c], ebx
push ebx
sbb dword [esp + 0x34], 0
add eax, edi
push eax
push ecx
mov dword [esi + 0x64], ebx
mov dword [esi + 0x60], 0
call fcn.00448c70
mov edi, dword [esp + 0xb4]
add esp, 0xc
mov edx, dword [esp + 0x48]
cmp dword [esp + 0x3c], 0
mov dword [esp + 0x10], 0
cmove edx, edi
mov dword [esp + 0x48], edx
jmp 0x407518
mov dword [esp + 0x10], 1
mov dword [esp + 0x7c], 1
test edi, edi
je 0x40750a
mov ebx, dword [esp + 0x24]
push ebx
push dword [esp + 0x3c]
push dword [esp + 0x48]
call fcn.00448c70
add esp, 0xc
mov dword [esi + 0x60], 0
mov dword [esi + 0x64], 0
mov edx, dword [esp + 0x28]
mov ebx, dword [esp + 0x14]
test ebx, ebx
jne 0x40757b
lea edi, [esi + 0xb0]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], 0
je 0x40755e
mov eax, dword [esp + 0x54]
cmp eax, dword [esi + 0x94]
jb 0x40755e
ja 0x407554
mov eax, dword [esp + 0x50]
cmp eax, dword [esi + 0x90]
jbe 0x40755e
mov dword [esp + 0x20], 1
jmp 0x407566
mov dword [esp + 0x20], 0
mov ebx, dword [esi + 0x9c]
push edi
mov dword [esp + 0x18], ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esp + 0x28]
mov edi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
xor eax, eax
mov dword [esp + 0x24], eax
test ebx, ebx
jne 0x4075e8
test edx, edx
je 0x4075e4
test ecx, ecx
jne 0x4075e8
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 dword [esp + 0x24], eax
test eax, eax
je 0x4075f3
mov ecx, 1
mov dword [esp + 0x28], ebx
mov dword [esp + 0x10], ecx
jmp 0x4075f7
mov edx, dword [esp + 0x6c]
mov dword [esp + 0x30], edx
mov edx, dword [esp + 0x68]
mov dword [esp + 0x2c], edx
mov edx, eax
jmp 0x407583
mov eax, dword [esp + 0x6c]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 0x2c], eax
jmp 0x407583
test ecx, ecx
je 0x4075f3
mov ecx, 1
mov dword [esp + 0x10], ecx
jmp 0x4075f7
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x68], 0
mov dword [esp + 0x74], 0
test ecx, ecx
jne 0x4076eb
mov eax, dword [esi + 0x58]
cmp eax, dword [esi + 0x54]
jae 0x4076a5
test edi, edi
je 0x4076a5
lea eax, [eax + eax*4]
lea eax, [eax + 0x19]
lea edi, [esi + eax*8]
mov ecx, edi
call fcn.00406da0
mov ecx, eax
test ecx, ecx
jne 0x407672
cmp dword [edi + 0x18], eax
jne 0x407681
lea eax, [esp + 0xc4]
push eax
push ecx
push edi
push fcn.00407d40
push ecx
push ecx
call fcn.00446f69
add esp, 0x18
mov dword [edi + 0x18], eax
test eax, eax
jne 0x407681
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
je 0x407681
jle 0x40767d
movzx ecx, cx
or ecx, 0x80070000
test ecx, ecx
jne 0x407686
inc dword [esi + 0x58]
jmp 0x4076a5
mov eax, dword [esi + 0x58]
cmp eax, 1
jne 0x4076a2
xor edx, edx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x28], edx
mov dword [esp + 0x74], ecx
jmp 0x4076ef
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 0x4076e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
jne 0x407c36
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
xorps xmm0, xmm0
movlpd qword [esp + 0x40], xmm0
movlpd qword [esp + 0x58], xmm0
movlpd qword [esp + 0x60], xmm0
movlpd qword [esp + 0x80], xmm0
test ebx, ebx
jne 0x4078ba
test edx, edx
je 0x4078ba
test eax, eax
jne 0x4078ba
mov ecx, dword [esp + 0x18]
lea eax, [ebx + 1]
mov edx, dword [esp + 0x60]
mov ebx, dword [ecx + 8]
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x5c]
mov dword [esp + 0x4c], ecx
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x1c], ebx
test eax, eax
je 0x407765
mov edi, dword [esp + 0x48]
jmp 0x40778d
mov ebx, dword [esp + 0x2c]
mov eax, dword [esp + 0x30]
sub ebx, edx
mov edi, dword [esi]
sbb eax, ecx
mov dword [esp + 0x40], 0
cmp dword [esp + 0x40], eax
jb 0x407789
ja 0x407787
cmp edi, ebx
jbe 0x407789
mov edi, ebx
mov ebx, dword [esp + 0x1c]
add edx, edi
mov dword [esp + 0x40], 1
mov dword [esp + 0x60], edx
adc ecx, 0
mov dword [esp + 0x64], ecx
cmp edx, dword [esp + 0x2c]
jne 0x4077b5
cmp ecx, dword [esp + 0x30]
jne 0x4077b5
mov eax, 1
jmp 0x4077b7
xor eax, eax
mov ecx, dword [esi + 0x18]
lea edx, [esp + 0x40]
push edx
lea edx, [esp + 0x84]
push edx
lea edx, [esp + 0x68]
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 dword [esp + 0x24], eax
test eax, eax
jne 0x4078a9
cmp dword [esp + 0x40], eax
jne 0x4078da
mov edx, dword [esp + 0x60]
mov ecx, dword [esp + 0x64]
cmp edx, dword [esp + 0x2c]
jne 0x40780f
cmp ecx, dword [esp + 0x30]
je 0x4078da
mov edi, dword [esp + 0x80]
mov eax, edx
sub eax, dword [esp + 0x38]
mov ebx, ecx
sbb ebx, dword [esp + 0x3c]
sub edi, dword [esp + 0x34]
mov dword [esp + 0x58], ebx
mov ebx, dword [esp + 0x84]
sbb ebx, dword [esp + 0x4c]
cmp dword [esp + 0x58], 0
ja 0x40784c
jb 0x407843
cmp eax, 1
jae 0x40784c
test ebx, ebx
jne 0x40784c
cmp edi, 1
jb 0x40789c
push dword [esp + 0x54]
lea edx, [esp + 0x24]
mov ecx, esi
push dword [esp + 0x54]
push ebx
push edi
push dword [esp + 0x68]
push eax
call fcn.00406f00
mov edi, eax
mov dword [esp + 0x14], edi
test edi, edi
jne 0x4078de
cmp dword [esp + 0x20], eax
jne 0x4078de
mov edx, dword [esp + 0x60]
mov ecx, dword [esp + 0x64]
mov eax, dword [esp + 0x80]
mov edi, dword [esp + 0x84]
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x4c], edi
mov ebx, dword [esp + 0x1c]
xor eax, eax
mov ebx, dword [ebx]
jmp 0x407757
push dword [esp + 0x54]
mov ecx, esi
push dword [esp + 0x54]
call fcn.00406fc0
jmp 0x4078da
mov eax, dword [esp + 0x44]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 0x34], eax
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
push 0xffffffffffffffff
push dword [eax + 0x20]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x407900
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x407c89
test eax, eax
jne 0x407c95
mov eax, dword [esp + 0x8c]
xor ebx, ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x40], 1
mov dword [esp + 0x1c], eax
cmp dword [esi + 0x24], ebx
jne 0x407c93
cmp dword [esi + 0x50], ebx
je 0x40793a
mov eax, 1
mov dword [esp + 0x20], eax
jmp 0x4079a3
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x78]
test eax, eax
je 0x40795b
cmp eax, 2
mov dword [esi + 0x4c], eax
mov eax, 1
mov dword [esi + 0x50], 1
cmove ecx, eax
mov eax, dword [esp + 0x74]
test eax, eax
je 0x407971
mov dword [esi + 0x50], 1
mov dword [esi + 0x40], eax
mov dword [esp + 0x1c], ebx
test ecx, ecx
je 0x407987
mov dword [esi + 0x50], 1
mov dword [esi + 0x38], 1
mov dword [esp + 0x1c], ebx
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x7c], ebx
je 0x4079a3
mov dword [esi + 0x50], 1
mov dword [esi + 0x3c], 1
mov dword [esp + 0x1c], ebx
cmp dword [esp + 0x28], ebx
je 0x407a73
test eax, eax
je 0x4079c3
xorps xmm0, xmm0
movlpd qword [esp + 0x60], xmm0
movlpd qword [esp + 0x80], xmm0
mov eax, dword [esp + 0x60]
sub eax, dword [esp + 0x38]
mov edi, dword [esp + 0x80]
mov ebx, dword [esp + 0x84]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x64]
sbb eax, dword [esp + 0x3c]
sub edi, dword [esp + 0x34]
mov dword [esp + 0x58], eax
lea eax, [esi + 0xb0]
sbb ebx, dword [esp + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esp + 0x7c]
add dword [esi + 0xa0], eax
mov eax, dword [esp + 0x58]
adc dword [esi + 0xa4], eax
add dword [esi + 0xa8], edi
adc dword [esi + 0xac], ebx
cmp dword [esi + 0x9c], 0
jne 0x407a5c
mov eax, dword [esi + 0x98]
test eax, eax
je 0x407a5c
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 0x407a5c
mov dword [esi + 0x9c], 0xa
mov edi, dword [esi + 0x9c]
lea eax, [esi + 0xb0]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
xor ecx, ecx
test edx, edx
sete cl
cmp dword [esp + 0x8c], 0
mov dword [esp + 0x94], ecx
je 0x407b6c
test edi, edi
jne 0x407aa8
cmp dword [esp + 0x1c], edi
je 0x407aa8
cmp dword [esp + 0x20], edi
jne 0x407aa8
lea ecx, [edi + 1]
jmp 0x407aaa
xor ecx, ecx
mov eax, dword [esi + 0x18]
lea edx, [esp + 0x40]
push edx
lea edx, [esp + 0x98]
push edx
push dword [esp + 0x98]
mov eax, dword [eax + 0xc]
push dword [esp + 0xa8]
push dword [esp + 0xa8]
push ecx
mov ecx, dword [esp + 0x30]
push dword [ecx + 4]
push dword [esi + 0x1c]
call eax
mov edi, eax
mov dword [esp + 0x14], edi
test edi, edi
je 0x407af3
mov ebx, 1
mov dword [esi + 0x50], ebx
jmp 0x407b06
mov ecx, dword [esp + 0x94]
mov edx, dword [esp + 0x10]
test ecx, ecx
jne 0x407b6c
test edx, edx
jne 0x407b6c
lea edi, [esi + 0xb0]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], 0
je 0x407b38
mov eax, dword [esp + 0x54]
cmp eax, dword [esi + 0x94]
ja 0x407b56
mov eax, dword [esp + 0x50]
jb 0x407b3c
cmp eax, dword [esi + 0x90]
jae 0x407b56
jmp 0x407b3c
mov eax, dword [esp + 0x50]
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 + 0x94]
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
cmp dword [esp + 0x40], 0
je 0x407bde
cmp dword [esp + 0x28], 0
je 0x407b9b
test edi, edi
jne 0x407b9b
cmp dword [esi + 0x50], edi
jne 0x407b9b
cmp dword [esp + 0x24], edi
jne 0x407b9b
cmp dword [esp + 0x20], edi
jne 0x407b9b
cmp dword [esi + 0x84], edi
jne 0x407bb1
test ebx, ebx
je 0x407bde
cmp dword [esi + 0x84], 0
jne 0x407bb1
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 4]
mov dword [esi + 0x80], eax
mov edi, dword [esp + 0x2c]
mov eax, edi
mov ebx, dword [esp + 0x30]
or eax, ebx
jne 0x407bc3
test edx, edx
jne 0x407c0a
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x48]
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 0x407c0a
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 0x407040
call ebx
mov ecx, 1
jmp 0x407c77
test ecx, ecx
je 0x407c3f
push dword [esi + 0xe8]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x407c56
call ebx
mov edi, 1
test eax, eax
mov ecx, edi
cmovne ecx, eax
test ecx, ecx
je 0x407c5b
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 0x407c93
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 0x407040
call ebx
mov ecx, edi
test eax, eax
cmovne ecx, eax
test ecx, ecx
jne 0x407c36
mov eax, dword [esp + 0x18]
jmp 0x407040
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