Function at 0x40b970
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x590ae8
mov eax, dword fs:[0]
push eax
sub esp, 0xd0
push ebx
push edi
mov eax, dword [0x5d5de8]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [esi + 0x70], 0
lea ebx, [esi + 0x70]
jne 0x40c222
mov eax, dword [esi]
mov edx, dword [eax + 0x68]
mov ecx, esi
call edx
cmp byte [esi + 0x52], 0
jne 0x40c23c
cmp dword [esi + 0x48], 0
mov byte [esi + 0x78], 1
je 0x40b9cd
mov eax, dword [esi]
mov edx, dword [eax + 0x7c]
mov ecx, esi
call edx
push 0x7c
lea eax, [ebp - 0xd8]
push 0
push eax
call fcn.00569a00
mov cl, byte [esi + 0x76]
mov edi, dword [esi + 0x6c]
mov edx, dword [esi + 0x24]
mov eax, dword [esi + 0x28]
add esp, 0xc
neg cl
mov dword [ebp - 0xd8], 0x7c
mov dword [ebp - 0xd4], 7
mov dword [ebp - 0xcc], edx
mov dword [ebp - 0xd0], eax
sbb ecx, ecx
and ecx, 0x3800
add edi, 0x3c
add ecx, 0x800
push edi
mov dword [ebp - 0x70], ecx
mov dword [ebp - 0x50], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], 0
mov ecx, dword [esi + 0x6c]
push ebx
push ecx
lea ecx, [ebp - 0xd8]
call fcn.00402210
test eax, eax
jne 0x40c235
mov edx, dword [esi]
mov eax, dword [edx + 0xbc]
mov ecx, esi
call eax
test al, al
je 0x40c235
mov eax, dword [esi + 0x6c]
mov edx, dword [eax + 0x24]
mov ecx, 0x18
sub ecx, dword [eax + 0x14]
mov ebx, 0x10
sub ebx, dword [eax + 0x18]
mov dword [ebp - 0x3c], ecx
mov ecx, 8
sub ecx, dword [eax + 0x1c]
mov dword [ebp - 0x40], edx
mov edx, dword [esi + 0xdc]
mov dword [ebp - 0x4c], ecx
mov ecx, dword [eax + 0x20]
mov eax, dword [eax + 0x28]
mov dword [ebp - 0x34], eax
mov eax, dword [esi + 0xe0]
mov dword [ebp - 0x38], eax
mov eax, dword [esi + 0xd4]
cmp eax, 0x10
mov dword [ebp - 0x48], ecx
mov ecx, dword [esi + 0xd8]
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x30], edx
jne 0x40be03
mov edi, dword [esi + 0xa4]
xor edx, edx
cmp edi, edx
mov dword [ebp - 0x14], edi
je 0x40c20c
cmp dword [esi + 0x38], edx
mov byte [ebp - 0xd], 1
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x18], edx
je 0x40bb9e
mov eax, dword [esi + 0x24]
imul eax, dword [esi + 0x28]
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00568c31
mov ecx, dword [esi + 0x24]
imul ecx, dword [esi + 0x28]
mov edx, eax
mov eax, dword [esi + 0x38]
add esp, 4
test ecx, ecx
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x20], 0
jle 0x40bb9e
jmp 0x40bb27
mov eax, dword [ebp - 0x28]
mov edx, dword [eax]
mov ecx, dword [ebp - 0x4c]
add eax, 4
mov dword [ebp - 0x28], eax
mov eax, edx
shr eax, cl
mov ecx, dword [ebp - 0x34]
mov edi, edx
shl eax, cl
mov ecx, ebx
shr edi, cl
mov ecx, dword [ebp - 0x40]
and eax, dword [ebp - 0x38]
shl edi, cl
mov ecx, dword [ebp - 0x3c]
and edi, dword [ebp - 0x30]
or eax, edi
mov edi, edx
shr edi, cl
mov ecx, dword [ebp - 0x48]
shl edi, cl
mov ecx, dword [ebp - 0x1c]
and edi, dword [ebp - 0x44]
or eax, edi
cmp byte [ebp - 0xd], 0
mov word [ecx], ax
je 0x40bb80
shr edx, 0x18
cmp edx, 0xff
jge 0x40bb80
movzx edx, ax
mov byte [ebp - 0xd], 0
mov dword [ebp - 0x18], edx
mov ecx, dword [esi + 0x24]
imul ecx, dword [esi + 0x28]
mov eax, dword [ebp - 0x20]
add dword [ebp - 0x1c], 2
add eax, 1
cmp eax, ecx
mov dword [ebp - 0x20], eax
jl 0x40bb24
mov edx, dword [ebp - 0x24]
mov edi, dword [ebp - 0x14]
cmp byte [esi + 0x51], 0
je 0x40bd89
mov ecx, dword [esi + 0x38]
test ecx, ecx
je 0x40bd89
cmp byte [esi + 0x77], 0
je 0x40bc07
movzx eax, word [edx]
mov ecx, edi
xor edi, edi
cmp dword [esi + 0x28], edi
mov dword [ebp - 0x18], eax
mov ebx, edx
jle 0x40bdcd
xor eax, eax
cmp dword [esi + 0x24], eax
jle 0x40bbe9
mov dx, word [ebx]
mov word [ecx], dx
add eax, 1
add ecx, 2
add ebx, 2
cmp eax, dword [esi + 0x24]
jl 0x40bbd5
mov eax, dword [esi + 0x90]
cdq
sub eax, edx
sar eax, 1
sub eax, dword [esi + 0x24]
add edi, 1
cmp edi, dword [esi + 0x28]
lea ecx, [ecx + eax*2]
jl 0x40bbce
jmp 0x40bdcd
mov eax, dword [esi + 0x24]
imul eax, dword [esi + 0x28]
xor edi, edi
test eax, eax
jle 0x40bd16
jmp 0x40bc20
mov eax, dword [ecx]
movzx ebx, word [edx]
and eax, 0xff000000
add ecx, 4
add edx, 2
cmp eax, 0xff000000
jne 0x40bc3d
cmp word [ebp - 0x18], bx
je 0x40bc50
mov eax, dword [esi + 0x24]
imul eax, dword [esi + 0x28]
add edi, 1
cmp edi, eax
jl 0x40bc20
jmp 0x40bd16
push 0x2000
call fcn.00568c31
push 0x2000
mov edi, eax
push 0
push edi
mov dword [ebp - 0x28], edi
call fcn.00569a00
mov ecx, dword [esi + 0x24]
imul ecx, dword [esi + 0x28]
mov edx, dword [esi + 0x38]
mov ebx, dword [ebp - 0x24]
add esp, 0x10
test ecx, ecx
mov dword [ebp - 0x20], 0
jle 0x40bccd
mov eax, dword [edx]
movzx ecx, word [ebx]
shr eax, 0x18
add edx, 4
add ebx, 2
test eax, eax
jle 0x40bcbd
movzx ecx, cx
mov eax, ecx
shr eax, 5
and ecx, 0x8000001f
lea eax, [edi + eax*4]
jns 0x40bcb1
dec ecx
or ecx, 0xffffffe0
inc ecx
mov edi, 1
shl edi, cl
or dword [eax], edi
mov edi, dword [ebp - 0x28]
mov ecx, dword [esi + 0x24]
imul ecx, dword [esi + 0x28]
add dword [ebp - 0x20], 1
cmp dword [ebp - 0x20], ecx
jl 0x40bc87
xor edx, edx
nop
mov eax, dword [edi + edx*4]
cmp eax, 0xffff
je 0x40bd02
xor ecx, ecx
lea esp, [esp]
mov ebx, 1
shl ebx, cl
test eax, ebx
je 0x40bcf5
add ecx, 1
cmp ecx, 0x20
jl 0x40bce0
jmp 0x40bd02
mov eax, edx
shl eax, 5
add eax, ecx
movzx ecx, ax
mov dword [ebp - 0x18], ecx
add edx, 1
cmp edx, 0x800
jl 0x40bcd0
push edi
call fcn.00569095
add esp, 4
mov eax, dword [esi + 0x38]
test eax, eax
je 0x40bdcd
cmp dword [esi + 0x28], 0
mov ecx, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x24]
mov edi, eax
mov dword [ebp - 0x14], 0
jle 0x40bdcd
xor edx, edx
cmp dword [esi + 0x24], edx
jle 0x40bd68
mov eax, dword [edi]
shr eax, 0x18
add edi, 4
cmp eax, 0xff
mov ax, word [ebp - 0x18]
jl 0x40bd57
mov ax, word [ebx]
mov word [ecx], ax
add edx, 1
add ecx, 2
add ebx, 2
cmp edx, dword [esi + 0x24]
jl 0x40bd41
mov eax, dword [esi + 0x90]
cdq
sub eax, edx
sar eax, 1
sub eax, dword [esi + 0x24]
lea ecx, [ecx + eax*2]
mov eax, dword [ebp - 0x14]
add eax, 1
cmp eax, dword [esi + 0x28]
mov dword [ebp - 0x14], eax
jl 0x40bd3a
jmp 0x40bdcd
test edx, edx
je 0x40bdcd
mov ecx, edi
xor edi, edi
cmp dword [esi + 0x28], edi
mov ebx, edx
jle 0x40bdcd
xor eax, eax
cmp dword [esi + 0x24], eax
jle 0x40bdb4
nop
mov dx, word [ebx]
mov word [ecx], dx
add eax, 1
add ecx, 2
add ebx, 2
cmp eax, dword [esi + 0x24]
jl 0x40bda0
mov eax, dword [esi + 0x90]
cdq
sub eax, edx
sar eax, 1
sub eax, dword [esi + 0x24]
add edi, 1
cmp edi, dword [esi + 0x28]
lea ecx, [ecx + eax*2]
jl 0x40bd98
mov eax, dword [ebp - 0x24]
push eax
call fcn.00569095
add esp, 4
cmp byte [esi + 0x51], 0
je 0x40c20c
movzx eax, word [ebp - 0x18]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov eax, dword [esi + 0x70]
mov ecx, dword [eax]
lea edx, [ebp - 0x2c]
push edx
push 8
push eax
mov eax, dword [ecx + 0x74]
call eax
jmp 0x40c20c
cmp eax, 0x20
jne 0x40c235
mov edi, dword [esi + 0xa4]
test edi, edi
mov dword [ebp - 0x20], edi
je 0x40c20c
cmp byte [esi + 0x51], 0
mov byte [ebp - 0xd], 1
mov dword [ebp - 0x18], 0
je 0x40c15e
mov eax, dword [esi + 0x38]
test eax, eax
je 0x40c15e
cmp byte [esi + 0x77], 0
je 0x40bf31
mov eax, dword [eax]
mov ecx, dword [ebp - 0x4c]
mov edi, eax
shr edi, cl
mov ecx, dword [ebp - 0x34]
mov edx, eax
shl edi, cl
mov ecx, ebx
shr edx, cl
mov ecx, dword [ebp - 0x40]
and edi, dword [ebp - 0x38]
shl edx, cl
mov ecx, dword [ebp - 0x3c]
shr eax, cl
mov ecx, dword [ebp - 0x48]
and edx, dword [ebp - 0x30]
shl eax, cl
or edi, edx
and eax, dword [ebp - 0x44]
or edi, eax
cmp dword [esi + 0x28], 0
mov eax, dword [esi + 0x38]
mov dword [ebp - 0x18], edi
mov edi, dword [ebp - 0x20]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x20], 0
jle 0x40c13f
jmp 0x40bea0
cmp dword [esi + 0x24], 0
mov dword [ebp - 0x1c], 0
jle 0x40bf05
lea ecx, [ecx]
mov ecx, dword [ebp - 0x14]
mov eax, dword [ecx]
add ecx, 4
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0x4c]
mov edx, eax
shr edx, cl
mov ecx, dword [ebp - 0x34]
add edi, 4
shl edx, cl
mov ecx, eax
mov dword [ebp - 0x28], ecx
mov ecx, ebx
and edx, dword [ebp - 0x38]
mov ebx, eax
shr ebx, cl
mov ecx, dword [ebp - 0x40]
shl ebx, cl
mov ecx, dword [ebp - 0x3c]
shr eax, cl
mov ecx, dword [ebp - 0x48]
and ebx, dword [ebp - 0x30]
shl eax, cl
or edx, ebx
mov ebx, dword [ebp - 0x24]
and eax, dword [ebp - 0x44]
or edx, eax
mov eax, dword [ebp - 0x1c]
mov dword [edi - 4], edx
add eax, 1
cmp eax, dword [esi + 0x24]
mov dword [ebp - 0x1c], eax
jl 0x40beb0
mov eax, dword [esi + 0x90]
cdq
and edx, 3
add eax, edx
sar eax, 2
sub eax, dword [esi + 0x24]
lea edi, [edi + eax*4]
mov eax, dword [ebp - 0x20]
add eax, 1
cmp eax, dword [esi + 0x28]
mov dword [ebp - 0x20], eax
jl 0x40bea0
jmp 0x40c13f
mov edi, dword [esi + 0x24]
imul edi, dword [esi + 0x28]
test edi, edi
mov ecx, eax
jle 0x40bf6d
mov eax, dword [esi + 0x24]
imul eax, dword [esi + 0x28]
mov dword [ebp - 0x14], eax
mov eax, dword [ecx]
add ecx, 4
cmp byte [ebp - 0xd], 0
je 0x40bf67
mov edx, eax
shr edx, 0x18
cmp edx, 0xff
jge 0x40bf67
mov byte [ebp - 0xd], 0
mov dword [ebp - 0x18], eax
sub dword [ebp - 0x14], 1
jne 0x40bf48
mov ecx, dword [esi + 0x38]
xor edx, edx
test edi, edi
jle 0x40c077
lea ebx, [ebx]
mov eax, dword [ecx]
mov edi, eax
and edi, 0xff000000
add ecx, 4
cmp edi, 0xff000000
jne 0x40bf9f
and eax, 0xffffff
cmp dword [ebp - 0x18], eax
je 0x40bfb2
mov eax, dword [esi + 0x24]
imul eax, dword [esi + 0x28]
add edx, 1
cmp edx, eax
jl 0x40bf80
jmp 0x40c077
push 0x200000
call fcn.00568c31
push 0x200000
mov edi, eax
push 0
push edi
mov dword [ebp - 0x1c], edi
call fcn.00569a00
mov ecx, dword [esi + 0x24]
imul ecx, dword [esi + 0x28]
mov eax, dword [esi + 0x38]
add esp, 0x10
test ecx, ecx
mov dword [ebp - 0x14], 0
jle 0x40c027
mov ecx, dword [eax]
mov edx, ecx
add eax, 4
shr edx, 0x18
test edx, edx
mov dword [ebp - 0x28], eax
jle 0x40c013
mov eax, ecx
shr eax, 5
and ecx, 0x1f
mov edx, 1
and eax, 0x7ffff
shl edx, cl
lea eax, [edi + eax*4]
or dword [eax], edx
mov eax, dword [ebp - 0x28]
mov edx, dword [esi + 0x24]
imul edx, dword [esi + 0x28]
mov ecx, dword [ebp - 0x14]
add ecx, 1
cmp ecx, edx
mov dword [ebp - 0x14], ecx
jl 0x40bfe6
xor edx, edx
lea esp, [esp]
mov eax, dword [edi + edx*4]
cmp eax, 0xffff
je 0x40c056
xor ecx, ecx
lea esp, [esp]
mov edi, 1
shl edi, cl
test eax, edi
je 0x40c063
add ecx, 1
cmp ecx, 0x20
jl 0x40c040
mov edi, dword [ebp - 0x1c]
add edx, 1
cmp edx, 0x80000
jl 0x40c030
jmp 0x40c06e
mov edi, dword [ebp - 0x1c]
shl edx, 5
add edx, ecx
mov dword [ebp - 0x18], edx
push edi
call fcn.00569095
add esp, 4
mov ecx, dword [esi + 0x38]
test ecx, ecx
je 0x40c13f
cmp dword [esi + 0x28], 0
mov edi, dword [ebp - 0x20]
mov dword [ebp - 0x1c], 0
jle 0x40c13f
jmp 0x40c0a0
cmp dword [esi + 0x24], 0
mov dword [ebp - 0x14], 0
jle 0x40c118
lea ecx, [ecx]
mov eax, dword [ecx]
mov edx, eax
add ecx, 4
shr edx, 0x18
cmp edx, 0xff
mov dword [ebp - 0x20], ecx
jge 0x40c0cc
mov eax, dword [ebp - 0x18]
mov dword [edi], eax
jmp 0x40c107
mov ecx, dword [ebp - 0x4c]
mov edx, eax
shr edx, cl
mov ecx, dword [ebp - 0x34]
shl edx, cl
mov ecx, eax
mov dword [ebp - 0x28], ecx
mov ecx, ebx
and edx, dword [ebp - 0x38]
mov ebx, eax
shr ebx, cl
mov ecx, dword [ebp - 0x40]
shl ebx, cl
mov ecx, dword [ebp - 0x3c]
shr eax, cl
mov ecx, dword [ebp - 0x48]
and ebx, dword [ebp - 0x30]
shl eax, cl
mov ecx, dword [ebp - 0x20]
or edx, ebx
mov ebx, dword [ebp - 0x24]
and eax, dword [ebp - 0x44]
or edx, eax
mov dword [edi], edx
mov eax, dword [ebp - 0x14]
add eax, 1
add edi, 4
cmp eax, dword [esi + 0x24]
mov dword [ebp - 0x14], eax
jl 0x40c0b0
mov eax, dword [esi + 0x90]
cdq
and edx, 3
add eax, edx
sar eax, 2
sub eax, dword [esi + 0x24]
lea edi, [edi + eax*4]
mov eax, dword [ebp - 0x1c]
add eax, 1
cmp eax, dword [esi + 0x28]
mov dword [ebp - 0x1c], eax
jl 0x40c0a0
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], eax
mov eax, dword [esi + 0x70]
mov ecx, dword [eax]
lea edx, [ebp - 0x58]
push edx
push 8
push eax
mov eax, dword [ecx + 0x74]
call eax
jmp 0x40c20c
mov eax, dword [esi + 0x38]
test eax, eax
je 0x40c20c
cmp dword [esi + 0x28], 0
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], 0
jle 0x40c20c
lea ecx, [ecx]
cmp dword [esi + 0x24], 0
mov dword [ebp - 0x1c], 0
jle 0x40c1e5
lea ecx, [ecx]
mov ecx, dword [ebp - 0x14]
mov eax, dword [ecx]
add ecx, 4
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0x4c]
mov edx, eax
shr edx, cl
mov ecx, dword [ebp - 0x34]
add edi, 4
shl edx, cl
mov ecx, eax
mov dword [ebp - 0x28], ecx
mov ecx, ebx
and edx, dword [ebp - 0x38]
mov ebx, eax
shr ebx, cl
mov ecx, dword [ebp - 0x40]
shl ebx, cl
mov ecx, dword [ebp - 0x3c]
shr eax, cl
mov ecx, dword [ebp - 0x48]
and ebx, dword [ebp - 0x30]
shl eax, cl
or edx, ebx
mov ebx, dword [ebp - 0x24]
and eax, dword [ebp - 0x44]
or edx, eax
mov eax, dword [ebp - 0x1c]
mov dword [edi - 4], edx
add eax, 1
cmp eax, dword [esi + 0x24]
mov dword [ebp - 0x1c], eax
jl 0x40c190
mov eax, dword [esi + 0x90]
cdq
and edx, 3
add eax, edx
sar eax, 2
sub eax, dword [esi + 0x24]
lea edi, [edi + eax*4]
mov eax, dword [ebp - 0x18]
add eax, 1
cmp eax, dword [esi + 0x28]
mov dword [ebp - 0x18], eax
jl 0x40c180
mov eax, dword [esi]
mov edx, dword [eax + 0xc0]
mov ecx, esi
call edx
mov eax, dword [ebp - 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov esp, ebp
pop ebp
ret