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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xd4
push ebx
mov ebx, ecx
mov dword [esp + 0xac], 1
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [ebx]
mov dword [esp + 0x24], ebx
mov dword [esp + 0x74], esi
nop dword [eax]
push 0xffffffffffffffff
push dword [ebx + 0x1c]
xorps xmm0, xmm0
mov dword [esp + 0x94], 0
movlpd qword [esp + 0x98], xmm0
mov dword [esp + 0x80], 0
mov dword [esp + 0x8c], 0
mov dword [esp + 0x84], 0
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x406962
call edi
test eax, eax
je 0x4078bf
test eax, eax
jne 0x4078cb
cmp dword [esi + 0x24], eax
jne 0x4078c9
mov edi, dword [esi + 0x34]
mov eax, edi
mov edx, dword [esi + 0x30]
mov ecx, edx
push edi
push edx
push 0
add ecx, 1
mov dword [esp + 0x58], edx
push 0
push 0
adc eax, 0
mov dword [esi + 0x30], ecx
push 0
lea edx, [esp + 0x60]
mov dword [esp + 0x88], edi
mov ecx, esi
mov dword [esi + 0x34], eax
call fcn.00406810
mov edx, dword [esp + 0x48]
xor ecx, ecx
mov edi, eax
mov dword [esp + 0x40], ecx
mov eax, dword [esi + 0x70]
xorps xmm0, xmm0
mov dword [esp + 0xc], eax
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x68], ecx
mov dword [esp + 0x88], ecx
mov dword [esp + 0x20], ecx
movlpd qword [esp + 0x60], xmm0
mov dword [esp + 0x1c], edx
test edi, edi
jne 0x406f14
test edx, edx
jne 0x406f14
mov eax, dword [ebx + 8]
mov ebx, dword [esi + 0x64]
sub ebx, dword [esi + 0x60]
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x94]
mov dword [esp + 0x44], ecx
mov ecx, dword [esp + 0x90]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x38], eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], ebx
test eax, eax
jne 0x406a5e
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 + 0x38], eax
test eax, eax
je 0x406d7b
mov ecx, dword [esp + 0x34]
mov dword [eax], 0
test ecx, ecx
je 0x406a57
mov dword [ecx], eax
jmp 0x406a5e
mov ecx, dword [esp + 0x24]
mov dword [ecx + 8], eax
add eax, 0x10
mov dword [esp + 0x80], eax
mov dword [esp + 0x30], eax
test ebx, ebx
je 0x406a92
mov eax, dword [esi + 0x60]
add eax, 0x10
mov dword [esp + 0x10], ebx
add eax, dword [esi + 0x5c]
mov dword [esp + 0x14], 0
mov dword [esp + 0x20], ebx
mov dword [esp + 0x30], eax
jmp 0x406baa
mov edi, dword [esi]
mov ecx, eax
mov eax, dword [esi + 0xc]
xor ebx, ebx
mov dword [esp + 0x28], ecx
mov dword [esp + 0xa4], eax
test edi, edi
je 0x406aea
nop word [eax + eax]
lea edx, [esp + 0x58]
mov dword [esp + 0x58], edi
push edx
push ecx
push eax
mov eax, dword [eax]
call eax
mov ecx, dword [esp + 0x28]
mov edx, eax
mov eax, dword [esp + 0x58]
add ebx, eax
add ecx, eax
mov dword [esp + 0x3c], edx
sub edi, eax
mov dword [esp + 0x28], ecx
test edx, edx
jne 0x406af0
test eax, eax
je 0x406aea
mov eax, dword [esp + 0xa4]
test edi, edi
jne 0x406ab0
xor edx, edx
mov dword [esp + 0x3c], edx
add dword [esp + 0x10], ebx
mov eax, ebx
adc dword [esp + 0x14], 0
cmp dword [esp + 0x34], 0
cmovne eax, dword [esp + 0x20]
add dword [esi + 0x68], ebx
mov dword [esp + 0x20], eax
adc dword [esi + 0x6c], 0
xor ecx, ecx
cmp ebx, dword [esi]
setne cl
mov dword [esp + 0xc], ecx
je 0x406b24
mov dword [esi + 0x70], 1
test edx, edx
je 0x406b3e
mov dword [esi + 0x48], edx
xor edi, edi
mov dword [esi + 0x70], 1
mov dword [esp + 0xc], 1
jmp 0x406b42
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x10]
sub ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x14]
sbb eax, dword [esp + 0x44]
mov dword [esp + 0x64], eax
jne 0x406b5d
cmp ecx, 1
jb 0x406baa
push dword [esp + 0x70]
lea edx, [esp + 0x4c]
mov ecx, esi
push dword [esp + 0x50]
push 0
push 0
push 0
push 0
call fcn.00406810
mov edx, dword [esp + 0x48]
mov edi, eax
mov dword [esp + 0x1c], edx
test edi, edi
jne 0x406e10
test edx, edx
jne 0x406e10
mov eax, dword [esp + 0x10]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x20], eax
xor eax, eax
mov dword [esp + 0xc0], ebx
cmp dword [esp + 0x34], eax
lea ecx, [esp + 0xb8]
push ecx
mov ecx, dword [esp + 0x28]
sete al
mov dword [esp + 0xbc], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0xc0], eax
mov eax, dword [esp + 0x10]
push dword [ecx + 4]
mov dword [esp + 0xcc], eax
mov eax, dword [esi + 0x18]
push dword [esi + 0x1c]
mov dword [esp + 0xd8], 1
mov eax, dword [eax]
call eax
mov ecx, dword [esp + 0xc8]
mov eax, dword [esp + 0xcc]
mov dword [esp + 0x6c], 1
mov dword [esp + 0x7c], eax
cmp ecx, 1
je 0x406dd9
mov edx, dword [esp + 0x18]
test edx, edx
je 0x406c57
push dword [esp + 0xc0]
push dword [esp + 0x34]
push dword [esp + 0x88]
call fcn.00449190
mov eax, dword [esp + 0xcc]
add esp, 0xc
add dword [esi + 0x60], eax
mov ecx, dword [esp + 0xc8]
mov edx, dword [esp + 0x18]
jmp 0x406c5e
mov eax, dword [esp + 0xc0]
test ecx, ecx
jne 0x406cbf
mov esi, dword [esp + 0x74]
cmp dword [esp + 0xc], ecx
jne 0x406cd6
cmp eax, ebx
jne 0x406c97
mov eax, dword [esp + 0x38]
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x34], eax
mov eax, dword [eax]
mov dword [esp + 0x38], eax
test ebx, ebx
je 0x406a27
xor ebx, ebx
mov dword [esi + 0x60], ebx
mov dword [esi + 0x64], ebx
jmp 0x406a23
mov edi, 0xb
xor eax, eax
mov dword [esp + 0xc], 1
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], 0
mov dword [esp + 0x18], eax
jmp 0x406fff
mov esi, dword [esp + 0xc]
cmp ecx, 3
cmove esi, dword [esp + 0xb4]
mov dword [esp + 0xc], esi
mov esi, dword [esp + 0x74]
mov dword [esp + 0x40], 1
cmp eax, ebx
jne 0x406cf9
mov edx, dword [esp + 0x1c]
mov dword [esi + 0x60], 0
mov dword [esi + 0x64], 0
jmp 0x406e18
cmp ecx, 3
jne 0x406d3f
mov ecx, dword [esp + 0x30]
add ecx, eax
mov dword [esp + 0x8c], ecx
mov ecx, ebx
sub ecx, eax
xor ebx, ebx
test edx, edx
mov dword [esp + 0x78], ecx
mov edx, dword [esp + 0x1c]
setne bl
sub dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x20]
sbb dword [esp + 0x14], 0
cmp dword [esp + 0x34], 0
mov dword [esp + 0x84], ebx
cmove ecx, eax
jmp 0x406e14
test edx, edx
je 0x406d51
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], 0
jmp 0x406dbf
mov ecx, dword [esi + 0x5c]
test ecx, ecx
jne 0x406d76
mov ecx, dword [esi + 0x14]
mov eax, dword [esi]
add eax, 0x10
push eax
mov eax, dword [ecx]
push ecx
call eax
mov ecx, eax
test ecx, ecx
je 0x406d7b
mov eax, dword [esp + 0xc0]
mov dword [esi + 0x5c], ecx
add ecx, 0x10
jne 0x406d94
mov edx, dword [esp + 0x1c]
mov dword [esp + 0xc], 1
mov dword [esp + 0x68], 1
jmp 0x406e18
sub ebx, eax
mov dword [esi + 0x60], 0
sub dword [esp + 0x10], ebx
push ebx
sbb dword [esp + 0x18], 0
add eax, dword [esp + 0x34]
push eax
push ecx
mov dword [esi + 0x64], ebx
call fcn.00449190
mov eax, dword [esp + 0xcc]
add esp, 0xc
cmp dword [esp + 0x34], 0
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
cmove ecx, eax
mov dword [esp + 0xc], 0
jmp 0x406e14
cmp dword [esp + 0x18], 0
mov dword [esp + 0xc], 1
mov dword [esp + 0x88], 1
je 0x406ce2
push ebx
push dword [esp + 0x34]
push dword [esp + 0x88]
call fcn.00449190
add esp, 0xc
jmp 0x406ce2
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x20], ecx
test edi, edi
jne 0x406e6d
lea ebx, [esi + 0xb0]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], edi
je 0x406e52
mov eax, dword [esp + 0x70]
cmp eax, dword [esi + 0x94]
jb 0x406e52
ja 0x406e4b
mov eax, dword [esp + 0x4c]
cmp eax, dword [esi + 0x90]
jbe 0x406e52
mov eax, 1
jmp 0x406e54
xor eax, eax
mov edi, dword [esi + 0x9c]
push ebx
mov dword [esp + 0x20], eax
mov dword [esp + 0x4c], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x40]
mov ebx, dword [esp + 0x24]
mov dword [esp + 0x18], 0
test edi, edi
jne 0x406c9c
test ecx, ecx
je 0x406f29
test edx, edx
jne 0x406c9c
mov eax, dword [esi + 0x18]
push dword [ebx + 4]
push dword [esi + 0x1c]
mov eax, dword [eax + 4]
call eax
mov ebx, eax
mov dword [esp + 0x18], ebx
test ebx, ebx
je 0x406f31
xorps xmm0, xmm0
mov dword [esp + 0x40], edi
movlpd qword [esp + 0x90], xmm0
mov eax, dword [esp + 0x94]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x90]
movlpd qword [esp + 0x60], xmm0
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 0xc], 1
mov dword [esp + 0x34], edi
mov dword [esp + 0x30], edi
movlpd qword [esp + 0x98], xmm0
movlpd qword [esp + 0xa8], xmm0
mov dword [esp + 0x54], eax
jmp 0x4074f1
mov eax, dword [esp + 0x64]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 0x10], eax
jmp 0x406e75
test edx, edx
jne 0x406c9c
cmp dword [esp + 0xc], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], 0
jne 0x406ffb
mov ecx, dword [esi + 0x58]
mov eax, ecx
cmp ecx, dword [esi + 0x54]
jae 0x4072a1
cmp dword [esp + 0x7c], 0
je 0x4072a1
add ecx, 5
lea eax, [ecx + ecx*4]
lea ebx, [esi + eax*8]
mov ecx, ebx
call fcn.004066f0
mov ecx, eax
test ecx, ecx
jne 0x406fc4
cmp dword [ebx + 0x18], eax
jne 0x40728d
lea eax, [esp + 0xdc]
push eax
push ecx
push ebx
push fcn.004078e0
push ecx
push ecx
call fcn.0044d021
add esp, 0x18
mov dword [ebx + 0x18], eax
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x407293
call ebx
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
je 0x407293
jmp 0x406fca
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test ecx, ecx
jle 0x406fd9
movzx ecx, cx
or ecx, 0x80070000
test ecx, ecx
je 0x407293
mov eax, dword [esi + 0x58]
cmp eax, 1
jne 0x40729c
mov dword [esp + 0xc], eax
mov dword [esp + 0x40], 0
mov dword [esp + 0x30], ecx
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
xorps xmm0, xmm0
mov esi, dword [esp + 0x68]
mov edx, dword [esp + 0x10]
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x88]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x6c]
mov dword [esp + 0x80], ecx
mov ecx, dword [esp + 0x84]
mov dword [esp + 0xa4], ecx
mov ecx, dword [esp + 0x78]
mov dword [esp + 0x5c], ecx
mov ecx, dword [esp + 0x8c]
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x44], esi
mov esi, dword [esp + 0xc]
mov dword [esp + 0x54], ecx
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x3c], esi
mov esi, dword [esp + 0x74]
mov dword [esp + 0x7c], edi
movlpd qword [esp + 0x90], xmm0
movlpd qword [esp + 0x60], xmm0
movlpd qword [esp + 0x98], xmm0
movlpd qword [esp + 0xa8], xmm0
test edi, edi
jne 0x4074c7
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x3c]
mov dword [esp + 0x8c], esi
mov esi, dword [esp + 0x5c]
mov dword [esp + 0x78], esi
mov esi, dword [esp + 0xa4]
mov dword [esp + 0x84], esi
mov esi, dword [esp + 0x80]
mov dword [esp + 0x6c], esi
mov esi, dword [esp + 0x44]
mov dword [esp + 0xc], edi
mov edi, dword [esp + 0x38]
mov dword [esp + 0x68], esi
mov esi, dword [esp + 0x2c]
mov dword [esp + 0x34], edi
mov edi, dword [esp + 0x54]
mov dword [esp + 0x88], esi
mov esi, dword [esp + 0x28]
mov dword [esp + 0x30], edi
mov edi, dword [esp + 0x7c]
mov dword [esp + 0x20], esi
mov esi, dword [esp + 0x74]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], eax
movlpd qword [esp + 0x90], xmm0
movlpd qword [esp + 0x60], xmm0
test ecx, ecx
je 0x4074c7
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x3c]
mov dword [esp + 0x8c], esi
mov esi, dword [esp + 0x5c]
mov dword [esp + 0x78], esi
mov esi, dword [esp + 0xa4]
mov dword [esp + 0x84], esi
mov esi, dword [esp + 0x80]
mov dword [esp + 0x6c], esi
mov esi, dword [esp + 0x44]
mov dword [esp + 0xc], edi
mov edi, dword [esp + 0x38]
mov dword [esp + 0x68], esi
mov esi, dword [esp + 0x2c]
mov dword [esp + 0x34], edi
mov edi, dword [esp + 0x54]
mov dword [esp + 0x88], esi
mov esi, dword [esp + 0x28]
mov dword [esp + 0x30], edi
mov edi, dword [esp + 0x7c]
mov dword [esp + 0x20], esi
mov esi, dword [esp + 0x74]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], eax
movlpd qword [esp + 0x90], xmm0
movlpd qword [esp + 0x60], xmm0
test eax, eax
jne 0x4074c7
mov edi, dword [esp + 0x24]
mov eax, 1
mov dword [esp + 0x40], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x54]
mov edi, dword [edi + 8]
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x50]
mov dword [esp + 0x8c], ecx
mov ecx, dword [esp + 0x5c]
mov dword [esp + 0x78], ecx
mov ecx, dword [esp + 0xa4]
mov dword [esp + 0x84], ecx
mov ecx, dword [esp + 0x80]
mov dword [esp + 0x6c], ecx
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x88], ecx
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x20], ecx
movlpd qword [esp + 0x90], xmm0
mov ecx, dword [esp + 0x94]
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x90]
movlpd qword [esp + 0x60], xmm0
mov dword [esp + 0x5c], ecx
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x58], edi
mov edi, dword [esp + 0x3c]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0xc], edi
mov edi, dword [esp + 0x7c]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x98]
mov dword [esp + 0x54], ecx
mov ecx, dword [esp + 0x9c]
mov dword [esp + 0x14], ebx
nop dword [eax]
test eax, eax
je 0x4072ed
mov ebx, dword [esp + 0x20]
jmp 0x407317
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esi + 0x58]
inc eax
mov dword [esi + 0x58], eax
jmp 0x4072a7
mov dword [esi + 0x54], eax
jmp 0x4072a7
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x24]
mov ecx, dword [ecx + 4]
inc ecx
cmp ecx, eax
sbb eax, eax
and eax, ecx
add eax, 5
lea eax, [eax + eax*4]
push dword [esi + eax*8 + 0x1c]
lea eax, [esi + eax*8]
mov dword [esp + 0x38], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x406ffb
call ebx
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
jne 0x40789d
jmp 0x406ffb
mov eax, dword [esp + 0x10]
sub eax, edx
mov dword [esp + 0x2c], 0
mov dword [esp + 0x28], eax
mov eax, ebx
mov ebx, dword [esi]
sbb eax, ecx
cmp dword [esp + 0x2c], eax
jb 0x407317
mov eax, dword [esp + 0x28]
ja 0x407315
cmp ebx, eax
jbe 0x407317
mov ebx, eax
add edx, ebx
mov dword [esp + 0x28], 1
mov dword [esp + 0x98], edx
adc ecx, 0
mov dword [esp + 0x9c], ecx
cmp edx, dword [esp + 0x10]
jne 0x407345
cmp ecx, dword [esp + 0x14]
jne 0x407345
mov eax, 1
jmp 0x407347
xor eax, eax
mov ecx, dword [esi + 0x18]
lea edx, [esp + 0x28]
push edx
lea edx, [esp + 0xac]
push edx
lea edx, [esp + 0xa0]
push edx
push eax
mov eax, dword [esp + 0x68]
push ebx
add eax, 0x10
push eax
mov eax, dword [esp + 0x3c]
push dword [eax + 4]
mov eax, dword [ecx + 8]
push dword [esi + 0x1c]
call eax
mov ebx, eax
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40746e
cmp dword [esp + 0x28], eax
jne 0x4074f1
mov edx, dword [esp + 0x98]
mov ecx, dword [esp + 0x9c]
cmp edx, dword [esp + 0x10]
jne 0x4073ae
cmp ecx, dword [esp + 0x14]
je 0x4074f1
mov esi, dword [esp + 0xac]
mov eax, edx
sub eax, dword [esp + 0x5c]
mov ebx, ecx
sbb ebx, dword [esp + 0x50]
mov dword [esp + 0x44], ebx
mov ebx, dword [esp + 0xa8]
sub ebx, dword [esp + 0x54]
sbb esi, dword [esp + 0x38]
cmp dword [esp + 0x44], 0
mov dword [esp + 0x2c], esi
mov esi, dword [esp + 0x74]
ja 0x4073f6
jb 0x4073ea
cmp eax, 1
jae 0x4073f6
cmp dword [esp + 0x2c], 0
ja 0x4073f6
cmp ebx, 1
jb 0x407459
push dword [esp + 0x70]
lea edx, [esp + 0x4c]
mov ecx, esi
push dword [esp + 0x50]
push dword [esp + 0x34]
push ebx
push dword [esp + 0x54]
push eax
call fcn.00406810
mov edi, eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x1c], eax
test edi, edi
jne 0x4074ed
test eax, eax
jne 0x4074ed
mov edx, dword [esp + 0x98]
mov ecx, dword [esp + 0x9c]
mov eax, dword [esp + 0xa8]
mov ebx, dword [esp + 0xac]
mov dword [esp + 0x5c], edx
mov dword [esp + 0x50], ecx
mov dword [esp + 0x54], eax
mov dword [esp + 0x38], ebx
mov eax, dword [esp + 0x58]
mov ebx, dword [esp + 0x14]
mov eax, dword [eax]
mov dword [esp + 0x58], eax
xor eax, eax
jmp 0x407280
lea ebx, [esi + 0xb0]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], 0
je 0x4074a0
mov eax, dword [esp + 0x70]
cmp eax, dword [esi + 0x94]
ja 0x4074be
mov eax, dword [esp + 0x4c]
jb 0x4074a4
cmp eax, dword [esi + 0x90]
jae 0x4074be
jmp 0x4074a4
mov eax, dword [esp + 0x4c]
mov dword [esi + 0x90], eax
mov eax, dword [esp + 0x70]
mov dword [esi + 0x94], eax
mov dword [esi + 0x88], 1
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x4074ed
mov eax, dword [esp + 0x94]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x90]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 0x54], eax
mov ebx, dword [esp + 0x18]
mov eax, dword [esp + 0x24]
push 0xffffffffffffffff
push dword [eax + 0x20]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x407513
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4078bf
test eax, eax
jne 0x4078cb
cmp dword [esi + 0x24], 0
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x6c]
mov dword [esp + 0x58], 1
mov dword [esp + 0x3c], eax
jne 0x4078c9
cmp dword [esi + 0x50], 0
je 0x40754e
mov eax, 1
mov dword [esp + 0x1c], eax
mov dword [esp + 0x48], eax
jmp 0x4075c3
mov ecx, dword [esp + 0x68]
test ebx, ebx
je 0x40756b
cmp ebx, 2
mov dword [esi + 0x50], 1
mov eax, 1
mov dword [esi + 0x4c], ebx
cmove ecx, eax
mov eax, dword [esp + 0x30]
test eax, eax
je 0x407585
mov dword [esi + 0x50], 1
mov dword [esi + 0x40], eax
mov dword [esp + 0x3c], 0
test ecx, ecx
je 0x40759f
mov dword [esi + 0x50], 1
mov dword [esi + 0x38], 1
mov dword [esp + 0x3c], 0
cmp dword [esp + 0x88], 0
mov eax, dword [esp + 0x1c]
je 0x4075c3
mov dword [esi + 0x50], 1
mov dword [esi + 0x3c], 1
mov dword [esp + 0x3c], 0
cmp dword [esp + 0x40], 0
je 0x4076a8
test eax, eax
je 0x4075e7
xorps xmm0, xmm0
movlpd qword [esp + 0x98], xmm0
movlpd qword [esp + 0xa8], xmm0
mov eax, dword [esp + 0x98]
sub eax, dword [esp + 0x5c]
mov edi, dword [esp + 0x9c]
sbb edi, dword [esp + 0x50]
mov ebx, dword [esp + 0xac]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0xa8]
sub eax, dword [esp + 0x54]
mov dword [esp + 0x44], eax
lea eax, [esi + 0xb0]
sbb ebx, dword [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [esp + 0x2c]
add ecx, dword [esi + 0xa0]
mov eax, dword [esi + 0xa4]
mov edx, dword [esp + 0x44]
adc eax, edi
add edx, dword [esi + 0xa8]
mov edi, dword [esi + 0xac]
adc edi, ebx
mov dword [esp + 0x2c], eax
cmp dword [esi + 0x9c], 0
mov dword [esi + 0xa0], ecx
mov dword [esi + 0xa4], eax
mov dword [esi + 0xa8], edx
mov dword [esi + 0xac], edi
jne 0x407695
mov eax, dword [esi + 0x98]
test eax, eax
je 0x407695
push edi
push edx
push dword [esp + 0x34]
push ecx
push eax
mov eax, dword [eax]
call eax
test eax, eax
je 0x407695
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 + 0xc]
xor ecx, ecx
test ebx, ebx
sete cl
cmp dword [esp + 0x6c], 0
mov dword [esp + 0xb0], ecx
je 0x407799
test edi, edi
jne 0x4076da
cmp dword [esp + 0x3c], edi
je 0x4076da
cmp dword [esp + 0x1c], edi
jne 0x4076da
lea ecx, [edi + 1]
jmp 0x4076dc
xor ecx, ecx
mov eax, dword [esi + 0x18]
lea edx, [esp + 0x58]
push edx
lea edx, [esp + 0xb4]
push edx
push dword [esp + 0x8c]
mov eax, dword [eax + 0xc]
push dword [esp + 0x84]
push dword [esp + 0x9c]
push ecx
mov ecx, dword [esp + 0x3c]
push dword [ecx + 4]
push dword [esi + 0x1c]
call eax
mov edi, eax
test edi, edi
je 0x407728
mov dword [esp + 0x28], 1
mov dword [esi + 0x50], 1
jmp 0x407737
mov ecx, dword [esp + 0xb0]
test ecx, ecx
jne 0x407799
test ebx, ebx
jne 0x407799
lea ebx, [esi + 0xb0]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], 0
je 0x407769
mov eax, dword [esp + 0x70]
cmp eax, dword [esi + 0x94]
ja 0x407787
mov eax, dword [esp + 0x4c]
jb 0x40776d
cmp eax, dword [esi + 0x90]
jae 0x407787
jmp 0x40776d
mov eax, dword [esp + 0x4c]
mov dword [esi + 0x90], eax
mov eax, dword [esp + 0x70]
mov dword [esi + 0x94], eax
mov dword [esi + 0x88], 1
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0xb0]
mov ebx, dword [esp + 0xc]
cmp dword [esp + 0x58], 0
je 0x40780f
cmp dword [esp + 0x40], 0
je 0x4077ca
test edi, edi
jne 0x4077ca
cmp dword [esi + 0x50], edi
jne 0x4077ca
cmp dword [esp + 0x18], edi
jne 0x4077ca
cmp dword [esp + 0x1c], edi
jne 0x4077ca
cmp dword [esi + 0x84], edi
jne 0x4077e0
cmp dword [esp + 0x28], edi
je 0x40780f
cmp dword [esi + 0x84], 0
jne 0x4077e0
mov eax, dword [esp + 0x24]
mov eax, dword [eax + 4]
mov dword [esi + 0x80], eax
mov edi, dword [esp + 0x10]
mov eax, edi
mov edx, dword [esp + 0x14]
or eax, edx
jne 0x4077f2
test ebx, ebx
jne 0x407847
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
mov dword [esi + 0xc], eax
mov eax, esi
mov esi, dword [esp + 0x74]
mov dword [eax + 0x10], edi
mov dword [eax + 0x14], edx
inc dword [esi + 0x84]
test ebx, ebx
jne 0x407847
mov eax, dword [esp + 0x34]
push dword [eax + 0x20]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ebx, dword [esp + 0x24]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406910
call edi
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
jne 0x40789d
jmp 0x406910
test ecx, ecx
je 0x4078a6
push dword [esi + 0xe8]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x407871
call edi
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
jne 0x40789d
mov ebx, dword [esp + 0x24]
push dword [esi + 0xe4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x406910
call edi
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
je 0x406910
mov eax, ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [esp + 0x24]
cmp dword [ebx + 4], 0
je 0x4078c9
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x24], 1
jmp 0x407875
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