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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc4
mov eax, ecx
mov dword [esp + 0x98], 1
push ebx
push esi
push edi
mov esi, dword [eax]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
mov dword [esp + 0x84], esi
nop
push 0xffffffffffffffff
push dword [eax + 0x1c]
xorps xmm0, xmm0
mov dword [esp + 0xa8], 0
xor ebx, ebx
movlpd qword [esp + 0x50], xmm0
mov dword [esp + 0xa4], 0
mov dword [esp + 0xa0], 0
mov dword [esp + 0x4c], ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x406dca
call edi
test eax, eax
je 0x407a5b
test eax, eax
jne 0x407a67
cmp dword [esi + 0x24], ebx
jne 0x407a65
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 + 0x4c], edx
push 0
push 0
adc eax, 0
mov dword [esi + 0x30], ecx
push 0
lea edx, [esp + 0x54]
mov dword [esp + 0x6c], edi
mov ecx, esi
mov dword [esi + 0x34], eax
call fcn.00406c80
mov ecx, dword [esp + 0x3c]
mov edi, eax
mov eax, dword [esi + 0x70]
xor edx, edx
mov dword [esp + 0x10], eax
xorps xmm0, xmm0
xor eax, eax
mov dword [esp + 0x34], edx
mov dword [esp + 0x94], edx
mov dword [esp + 0x80], eax
mov dword [esp + 0x7c], eax
mov dword [esp + 0x28], eax
movlpd qword [esp + 0x68], xmm0
mov dword [esp + 0x14], ecx
test edi, edi
jne 0x407309
test ecx, ecx
jne 0x407309
mov ecx, dword [esp + 0x4c]
mov ebx, dword [esi + 0x64]
sub ebx, dword [esi + 0x60]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x60], ecx
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x5c], ecx
mov ecx, dword [esp + 0x6c]
mov eax, dword [eax + 8]
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x68]
mov dword [esp + 0x50], eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x38], ebx
nop
test eax, eax
jne 0x406ec7
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 + 0x50], eax
test eax, eax
je 0x4071d8
mov ecx, dword [esp + 0x24]
mov dword [eax], 0
test ecx, ecx
je 0x406ec0
mov dword [ecx], eax
jmp 0x406ec7
mov ecx, dword [esp + 0x18]
mov dword [ecx + 8], eax
add eax, 0x10
mov dword [esp + 0x48], eax
mov dword [esp + 0x30], eax
test ebx, ebx
je 0x406ef8
mov eax, dword [esi + 0x60]
add eax, 0x10
mov dword [esp + 0x1c], ebx
add eax, dword [esi + 0x5c]
mov dword [esp + 0x20], 0
mov dword [esp + 0x28], ebx
mov dword [esp + 0x30], eax
jmp 0x407007
mov edi, dword [esi]
mov ecx, eax
mov eax, dword [esi + 0xc]
xor ebx, ebx
mov dword [esp + 0x58], ecx
mov dword [esp + 0x68], eax
test edi, edi
je 0x406f47
nop dword [eax]
lea edx, [esp + 0x10]
mov dword [esp + 0x10], edi
push edx
push ecx
push eax
mov eax, dword [eax]
call eax
mov ecx, dword [esp + 0x58]
mov edx, eax
mov eax, dword [esp + 0x10]
add ebx, eax
add ecx, eax
mov dword [esp + 0x2c], edx
sub edi, eax
mov dword [esp + 0x58], ecx
test edx, edx
jne 0x406f4d
test eax, eax
je 0x406f47
mov eax, dword [esp + 0x68]
test edi, edi
jne 0x406f10
xor edx, edx
mov dword [esp + 0x2c], edx
add dword [esp + 0x1c], ebx
mov eax, ebx
adc dword [esp + 0x20], 0
cmp dword [esp + 0x24], 0
cmovne eax, dword [esp + 0x28]
add dword [esi + 0x68], ebx
mov dword [esp + 0x28], eax
adc dword [esi + 0x6c], 0
xor ecx, ecx
cmp ebx, dword [esi]
setne cl
mov dword [esp + 0x10], ecx
je 0x406f81
mov dword [esi + 0x70], 1
test edx, edx
je 0x406f9b
mov dword [esi + 0x48], edx
xor edi, edi
mov dword [esi + 0x70], 1
mov dword [esp + 0x10], 1
jmp 0x406f9f
mov edi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
sub ecx, dword [esp + 0x5c]
mov eax, dword [esp + 0x20]
sbb eax, dword [esp + 0x60]
mov dword [esp + 0x6c], eax
jne 0x406fba
cmp ecx, 1
jb 0x407007
push dword [esp + 0x54]
lea edx, [esp + 0x40]
mov ecx, esi
push dword [esp + 0x44]
push 0
push 0
push 0
push 0
call fcn.00406c80
mov ecx, dword [esp + 0x3c]
mov edi, eax
mov dword [esp + 0x14], ecx
test edi, edi
jne 0x407267
test ecx, ecx
jne 0x407267
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x28], eax
xor eax, eax
mov dword [esp + 0xb0], ebx
cmp dword [esp + 0x24], eax
lea ecx, [esp + 0xa8]
push ecx
mov ecx, dword [esp + 0x1c]
sete al
mov dword [esp + 0xac], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0xb0], eax
mov eax, dword [esp + 0x14]
push dword [ecx + 4]
mov dword [esp + 0xbc], eax
mov eax, dword [esi + 0x18]
push dword [esi + 0x1c]
mov dword [esp + 0xc8], 1
mov eax, dword [eax]
call eax
mov ecx, dword [esp + 0xb8]
mov eax, dword [esp + 0xbc]
mov dword [esp + 0x94], 1
mov dword [esp + 0x44], eax
cmp ecx, 1
je 0x407236
mov edx, dword [esp + 0x38]
test edx, edx
je 0x4070b4
push dword [esp + 0xb0]
push dword [esp + 0x34]
push dword [esp + 0x50]
call fcn.00437af0
mov eax, dword [esp + 0xbc]
add esp, 0xc
add dword [esi + 0x60], eax
mov ecx, dword [esp + 0xb8]
mov edx, dword [esp + 0x38]
jmp 0x4070bb
mov eax, dword [esp + 0xb0]
test ecx, ecx
jne 0x407116
mov esi, dword [esp + 0x84]
cmp dword [esp + 0x10], ecx
jne 0x407130
cmp eax, ebx
jne 0x4070f7
mov eax, dword [esp + 0x50]
mov ebx, dword [esp + 0x38]
mov dword [esp + 0x24], eax
mov eax, dword [eax]
mov dword [esp + 0x50], eax
test ebx, ebx
je 0x406e90
xor ebx, ebx
mov dword [esi + 0x60], ebx
mov dword [esi + 0x64], ebx
jmp 0x406e8b
mov ebx, dword [esp + 0x44]
mov eax, 1
mov edi, 0xb
mov dword [esp + 0x10], eax
mov dword [esp + 0x24], 0
jmp 0x407336
mov esi, dword [esp + 0x10]
cmp ecx, 3
cmove esi, dword [esp + 0xa4]
mov dword [esp + 0x10], esi
mov esi, dword [esp + 0x84]
mov dword [esp + 0x34], 1
cmp eax, ebx
jne 0x407153
mov ecx, dword [esp + 0x14]
mov dword [esi + 0x60], 0
mov dword [esi + 0x64], 0
jmp 0x40726f
cmp ecx, 3
jne 0x40719c
mov ecx, dword [esp + 0x30]
add ecx, eax
mov dword [esp + 0xa0], ecx
mov ecx, ebx
sub ecx, eax
xor ebx, ebx
test edx, edx
mov dword [esp + 0x9c], ecx
mov edx, dword [esp + 0x28]
setne bl
sub dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x14]
sbb dword [esp + 0x20], 0
cmp dword [esp + 0x24], 0
mov dword [esp + 0x98], ebx
cmove edx, eax
jmp 0x40726b
test edx, edx
je 0x4071ae
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], 0
jmp 0x40721c
mov ecx, dword [esi + 0x5c]
test ecx, ecx
jne 0x4071d3
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 0x4071d8
mov eax, dword [esp + 0xb0]
mov dword [esi + 0x5c], ecx
add ecx, 0x10
jne 0x4071f1
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x10], 1
mov dword [esp + 0x80], 1
jmp 0x40726f
sub ebx, eax
mov dword [esi + 0x60], 0
sub dword [esp + 0x1c], ebx
push ebx
sbb dword [esp + 0x24], 0
add eax, dword [esp + 0x34]
push eax
push ecx
mov dword [esi + 0x64], ebx
call fcn.00437af0
mov eax, dword [esp + 0xbc]
add esp, 0xc
cmp dword [esp + 0x24], 0
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x14]
cmove edx, eax
mov dword [esp + 0x10], 0
jmp 0x40726b
cmp dword [esp + 0x38], 0
mov dword [esp + 0x10], 1
mov dword [esp + 0x7c], 1
je 0x40713c
push ebx
push dword [esp + 0x34]
push dword [esp + 0x50]
call fcn.00437af0
add esp, 0xc
jmp 0x40713c
mov edx, dword [esp + 0x28]
mov dword [esp + 0x28], edx
test edi, edi
jne 0x4072c4
lea ebx, [esi + 0xb0]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], edi
je 0x4072a9
mov eax, dword [esp + 0x54]
cmp eax, dword [esi + 0x94]
jb 0x4072a9
ja 0x4072a2
mov eax, dword [esp + 0x40]
cmp eax, dword [esi + 0x90]
jbe 0x4072a9
mov eax, 1
jmp 0x4072ab
xor eax, eax
mov edi, dword [esi + 0x9c]
push ebx
mov dword [esp + 0x18], eax
mov dword [esp + 0x40], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x44]
mov dword [esp + 0x24], 0
test edi, edi
jne 0x40731f
test edx, edx
je 0x40731b
test ecx, ecx
jne 0x40731f
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 0x407332
mov eax, 1
mov dword [esp + 0x34], edi
mov dword [esp + 0x10], eax
jmp 0x407336
mov eax, dword [esp + 0x6c]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 0x1c], eax
jmp 0x4072cc
test ecx, ecx
je 0x407332
mov eax, 1
mov dword [esp + 0x24], 0
mov dword [esp + 0x10], eax
jmp 0x407336
mov eax, dword [esp + 0x10]
mov dword [esp + 0x68], 0
mov dword [esp + 0x58], 0
test eax, eax
jne 0x407427
mov ecx, dword [esi + 0x58]
mov eax, ecx
cmp ecx, dword [esi + 0x54]
jae 0x4073e6
test ebx, ebx
je 0x4073e6
add ecx, 5
lea eax, [ecx + ecx*4]
lea ebx, [esi + eax*8]
mov ecx, ebx
call fcn.00406bd0
mov ecx, eax
test ecx, ecx
jne 0x4073b3
cmp dword [ebx + 0x18], eax
jne 0x4073c2
lea eax, [esp + 0xcc]
push eax
push ecx
push ebx
push fcn.00407a70
push ecx
push ecx
call fcn.004387b4
add esp, 0x18
mov dword [ebx + 0x18], eax
test eax, eax
jne 0x4073c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
je 0x4073c2
jle 0x4073be
movzx ecx, cx
or ecx, 0x80070000
test ecx, ecx
jne 0x4073cb
mov eax, dword [esi + 0x58]
inc eax
mov dword [esi + 0x58], eax
jmp 0x4073e6
mov eax, dword [esi + 0x58]
cmp eax, 1
jne 0x4073e3
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x58], ecx
jmp 0x40742b
mov dword [esi + 0x54], eax
mov ecx, dword [esp + 0x18]
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 ebx, [esi + eax*8]
mov dword [esp + 0x6c], ebx
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x407427
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ecx, 1
cmovne ecx, eax
test ecx, ecx
jne 0x407a08
mov eax, dword [esp + 0x34]
xorps xmm0, xmm0
movlpd qword [esp + 0x48], xmm0
movlpd qword [esp + 0x60], xmm0
movlpd qword [esp + 0x70], xmm0
movlpd qword [esp + 0x88], xmm0
test edi, edi
jne 0x407670
test eax, eax
je 0x407670
cmp dword [esp + 0x24], edi
jne 0x407670
mov ecx, dword [esp + 0x18]
lea eax, [edi + 1]
mov edx, dword [esp + 0x70]
mov ecx, dword [ecx + 8]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x44], ecx
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x74]
nop dword [eax]
test eax, eax
je 0x4074aa
mov ebx, dword [esp + 0x28]
jmp 0x4074d6
mov eax, dword [esp + 0x1c]
mov ebx, dword [esi]
sub eax, edx
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x20]
sbb eax, ecx
mov dword [esp + 0x60], 0
cmp dword [esp + 0x60], eax
jb 0x4074d6
mov eax, dword [esp + 0x48]
ja 0x4074d4
cmp ebx, eax
jbe 0x4074d6
mov ebx, eax
add edx, ebx
mov dword [esp + 0x48], 1
mov dword [esp + 0x70], edx
adc ecx, 0
mov dword [esp + 0x74], ecx
cmp edx, dword [esp + 0x1c]
jne 0x4074fe
cmp ecx, dword [esp + 0x20]
jne 0x4074fe
mov eax, 1
jmp 0x407500
xor eax, eax
mov ecx, dword [esi + 0x18]
lea edx, [esp + 0x48]
push edx
lea edx, [esp + 0x8c]
push edx
lea edx, [esp + 0x78]
push edx
push eax
mov eax, dword [esp + 0x3c]
push ebx
add eax, 0x10
push eax
mov eax, dword [esp + 0x30]
push dword [eax + 4]
mov eax, dword [ecx + 8]
push dword [esi + 0x1c]
call eax
mov ebx, eax
mov dword [esp + 0x24], ebx
test ebx, ebx
jne 0x407617
cmp dword [esp + 0x48], eax
jne 0x407694
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x74]
cmp edx, dword [esp + 0x1c]
jne 0x40755e
cmp ecx, dword [esp + 0x20]
je 0x407694
mov esi, dword [esp + 0x8c]
mov eax, edx
sub eax, dword [esp + 0x44]
mov ebx, ecx
sbb ebx, dword [esp + 0x38]
mov dword [esp + 0x5c], ebx
mov ebx, dword [esp + 0x88]
sub ebx, dword [esp + 0x30]
sbb esi, dword [esp + 0x50]
cmp dword [esp + 0x5c], 0
mov dword [esp + 0x60], esi
mov esi, dword [esp + 0x84]
ja 0x4075a9
jb 0x40759d
cmp eax, 1
jae 0x4075a9
cmp dword [esp + 0x60], 0
ja 0x4075a9
cmp ebx, 1
jb 0x407606
push dword [esp + 0x54]
lea edx, [esp + 0x40]
mov ecx, esi
push dword [esp + 0x44]
push dword [esp + 0x68]
push ebx
push dword [esp + 0x6c]
push eax
call fcn.00406c80
mov edi, eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x14], eax
test edi, edi
jne 0x407690
test eax, eax
jne 0x407690
mov eax, dword [esp + 0x88]
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x74]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x8c]
mov dword [esp + 0x44], edx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x50], eax
mov ebx, dword [esp + 0x2c]
xor eax, eax
mov ebx, dword [ebx]
mov dword [esp + 0x2c], ebx
jmp 0x4074a0
lea ebx, [esi + 0xb0]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], 0
je 0x407649
mov eax, dword [esp + 0x54]
cmp eax, dword [esi + 0x94]
ja 0x407667
mov eax, dword [esp + 0x40]
jb 0x40764d
cmp eax, dword [esi + 0x90]
jae 0x407667
jmp 0x40764d
mov eax, dword [esp + 0x40]
mov dword [esi + 0x90], eax
mov eax, dword [esp + 0x54]
mov dword [esi + 0x94], eax
mov dword [esi + 0x88], 1
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x407690
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 0x30], eax
mov ebx, dword [esp + 0x24]
mov eax, dword [esp + 0x18]
push 0xffffffffffffffff
push dword [eax + 0x20]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x4076b6
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x407a5b
test eax, eax
jne 0x407a67
cmp dword [esi + 0x24], 0
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x94]
mov dword [esp + 0x48], 1
mov dword [esp + 0x2c], eax
jne 0x407a65
cmp dword [esi + 0x50], 0
je 0x4076f4
mov eax, 1
mov dword [esp + 0x14], eax
mov dword [esp + 0x3c], eax
jmp 0x407769
mov ecx, dword [esp + 0x80]
test ebx, ebx
je 0x407714
cmp ebx, 2
mov dword [esi + 0x50], 1
mov eax, 1
mov dword [esi + 0x4c], ebx
cmove ecx, eax
mov eax, dword [esp + 0x58]
test eax, eax
je 0x40772e
mov dword [esi + 0x50], 1
mov dword [esi + 0x40], eax
mov dword [esp + 0x2c], 0
test ecx, ecx
je 0x407748
mov dword [esi + 0x50], 1
mov dword [esi + 0x38], 1
mov dword [esp + 0x2c], 0
cmp dword [esp + 0x7c], 0
mov eax, dword [esp + 0x14]
je 0x407769
mov dword [esi + 0x50], 1
mov dword [esi + 0x3c], 1
mov dword [esp + 0x2c], 0
cmp dword [esp + 0x34], 0
je 0x407845
test eax, eax
je 0x40778a
xorps xmm0, xmm0
movlpd qword [esp + 0x70], xmm0
movlpd qword [esp + 0x88], xmm0
mov edi, dword [esp + 0x70]
sub edi, dword [esp + 0x44]
mov ebx, dword [esp + 0x74]
sbb ebx, dword [esp + 0x38]
mov eax, dword [esp + 0x88]
sub eax, dword [esp + 0x30]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x8c]
sbb eax, dword [esp + 0x50]
mov dword [esp + 0x5c], eax
lea eax, [esi + 0xb0]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0xa0]
mov edx, dword [esi + 0xa8]
add eax, edi
mov edi, dword [esi + 0xa4]
mov ecx, dword [esi + 0xac]
adc edi, ebx
add edx, dword [esp + 0x7c]
mov dword [esp + 0x58], eax
adc ecx, dword [esp + 0x5c]
cmp dword [esi + 0x9c], 0
mov dword [esi + 0xa0], eax
mov dword [esi + 0xa4], edi
mov dword [esi + 0xa8], edx
mov dword [esi + 0xac], ecx
jne 0x407832
mov eax, dword [esi + 0x98]
test eax, eax
je 0x407832
push ecx
push edx
push edi
push dword [esp + 0x64]
push eax
mov eax, dword [eax]
call eax
test eax, eax
je 0x407832
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 + 0x10]
xor ecx, ecx
test ebx, ebx
sete cl
cmp dword [esp + 0x94], 0
mov dword [esp + 0x90], ecx
je 0x407939
test edi, edi
jne 0x40787a
cmp dword [esp + 0x2c], edi
je 0x40787a
cmp dword [esp + 0x14], edi
jne 0x40787a
lea ecx, [edi + 1]
jmp 0x40787c
xor ecx, ecx
mov eax, dword [esi + 0x18]
lea edx, [esp + 0x48]
push edx
lea edx, [esp + 0x94]
push edx
push dword [esp + 0xa0]
mov eax, dword [eax + 0xc]
push dword [esp + 0xa8]
push dword [esp + 0xb0]
push ecx
mov ecx, dword [esp + 0x30]
push dword [ecx + 4]
push dword [esi + 0x1c]
call eax
mov edi, eax
test edi, edi
je 0x4078c8
mov dword [esp + 0x60], 1
mov dword [esi + 0x50], 1
jmp 0x4078d7
mov ecx, dword [esp + 0x90]
test ecx, ecx
jne 0x407939
test ebx, ebx
jne 0x407939
lea ebx, [esi + 0xb0]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x88], 0
je 0x407909
mov eax, dword [esp + 0x54]
cmp eax, dword [esi + 0x94]
ja 0x407927
mov eax, dword [esp + 0x40]
jb 0x40790d
cmp eax, dword [esi + 0x90]
jae 0x407927
jmp 0x40790d
mov eax, dword [esp + 0x40]
mov dword [esi + 0x90], eax
mov eax, dword [esp + 0x54]
mov dword [esi + 0x94], eax
mov dword [esi + 0x88], 1
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x90]
mov ebx, dword [esp + 0x10]
cmp dword [esp + 0x48], 0
je 0x4079b2
cmp dword [esp + 0x34], 0
je 0x40796a
test edi, edi
jne 0x40796a
cmp dword [esi + 0x50], edi
jne 0x40796a
cmp dword [esp + 0x24], edi
jne 0x40796a
cmp dword [esp + 0x14], edi
jne 0x40796a
cmp dword [esi + 0x84], edi
jne 0x407980
cmp dword [esp + 0x60], edi
je 0x4079b2
cmp dword [esi + 0x84], 0
jne 0x407980
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 4]
mov dword [esi + 0x80], eax
mov edi, dword [esp + 0x1c]
mov eax, edi
mov edx, dword [esp + 0x20]
or eax, edx
jne 0x407992
test ebx, ebx
jne 0x4079dc
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x28]
mov dword [esi + 0xc], eax
mov eax, esi
mov esi, dword [esp + 0x84]
mov dword [eax + 0x10], edi
mov dword [eax + 0x14], edx
inc dword [esi + 0x84]
test ebx, ebx
jne 0x4079dc
mov eax, dword [esp + 0x68]
push dword [eax + 0x20]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov eax, dword [esp + 0x18]
jne 0x406d80
call edi
lea ecx, [ebx + 1]
jmp 0x407a49
test ecx, ecx
je 0x407a11
push dword [esi + 0xe8]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x407a28
call edi
mov ebx, 1
test eax, eax
mov ecx, ebx
cmovne ecx, eax
test ecx, ecx
je 0x407a2d
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 0x407a65
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x24], 1
mov ebx, 1
push dword [esi + 0xe4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
mov eax, dword [esp + 0x18]
jne 0x406d80
call edi
mov ecx, ebx
test eax, eax
cmovne ecx, eax
test ecx, ecx
jne 0x407a08
mov eax, dword [esp + 0x18]
jmp 0x406d80
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