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

Disassembly:
sub esp, 8
push ebx
push ebp
push esi
xor ebx, ebx
mov esi, eax
test dword [esi + 8], 0x80000
push edi
mov dword [esp + 0x14], ebx
lea ebp, [ebx + 1]
je 0x40954a
mov eax, dword [esi + 0x1c]
sub eax, dword [esi + 0x40]
cmp eax, dword [esi + 0x24]
ja 0x40954a
mov eax, ebp
jmp 0x40954c
xor eax, eax
cmp dword [esi], ebx
jne 0x40956c
mov ecx, dword [esi + 0x7c]
mov edx, dword [esi + 0x8c]
mov ecx, dword [ecx]
sub ecx, edx
cmp ecx, 0x14ccc
jb 0x40956c
mov ecx, dword [esi + 0x74]
add ecx, edx
jmp 0x409572
lea ecx, [esi + 0x39272]
mov edx, dword [esi + 0x2c]
mov dword [esi + 0x30], ecx
mov dword [esp + 0x10], ecx
add ecx, 0x14cbc
mov dword [esi + 0x34], ecx
mov cl, byte [esi + 0x38]
mov dword [esi + 0x58], ebx
mov dword [esi + 0x5c], ebx
shr byte [edx], cl
xor ecx, ecx
mov edx, 8
cmp dword [esi + 0x38], edx
lea edi, [edx - 0x10]
sete cl
sub dword [esi + 0x28], ecx
test dword [esi + 8], 0x1000
je 0x409612
cmp dword [esi + 0x64], ebx
jne 0x409612
mov ecx, dword [esi + 0x44]
mov ebx, 0x78
shl ebx, cl
add ecx, edx
mov dword [esi + 0x44], ecx
or dword [esi + 0x48], ebx
cmp ecx, edx
jb 0x4095e3
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x4095d7
mov bl, byte [esi + 0x48]
mov byte [ecx], bl
add dword [esi + 0x30], ebp
shr dword [esi + 0x48], 8
add dword [esi + 0x44], edi
cmp dword [esi + 0x44], edx
jae 0x4095c7
mov ecx, dword [esi + 0x44]
mov ebx, ebp
shl ebx, cl
add ecx, edx
mov dword [esi + 0x44], ecx
or dword [esi + 0x48], ebx
cmp ecx, edx
jb 0x409612
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x409606
mov bl, byte [esi + 0x48]
mov byte [ecx], bl
add dword [esi + 0x30], ebp
shr dword [esi + 0x48], 8
add dword [esi + 0x44], edi
cmp dword [esi + 0x44], edx
jae 0x4095f6
mov ecx, dword [esi + 0x44]
xor ebx, ebx
cmp dword [esp + 0x1c], 4
sete bl
shl ebx, cl
inc ecx
mov dword [esi + 0x44], ecx
or dword [esi + 0x48], ebx
cmp ecx, edx
jb 0x40964c
lea esp, [esp]
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x409640
mov bl, byte [esi + 0x48]
mov byte [ecx], bl
add dword [esi + 0x30], ebp
shr dword [esi + 0x48], 8
add dword [esi + 0x44], edi
cmp dword [esi + 0x44], edx
jae 0x409630
mov edi, dword [esi + 0x30]
mov ebp, dword [esi + 0x48]
mov ebx, dword [esi + 0x44]
test eax, eax
jne 0x409759
test dword [esi + 8], 0x40000
jne 0x40966c
cmp dword [esi + 0x3c], 0x30
jae 0x409673
call fcn.004091f0
jmp 0x409678
call fcn.00408c70
mov eax, esi
call fcn.004092d0
mov ecx, dword [esi + 0x3c]
test ecx, ecx
je 0x409694
mov edx, dword [esi + 0x30]
sub edx, edi
inc edx
cmp edx, ecx
jae 0x40975d
test eax, eax
jne 0x4096ad
mov dword [esi + 0x30], edi
mov dword [esi + 0x48], ebp
mov dword [esi + 0x44], ebx
call fcn.004091f0
mov eax, esi
call fcn.004092d0
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x409930
mov ecx, dword [esi + 0x44]
mov ebp, 8
lea ebx, [ebp - 7]
cmp eax, 4
jne 0x40988c
test ecx, ecx
je 0x4096fd
xor edx, edx
shl edx, cl
mov dword [esi + 0x44], ebp
or dword [esi + 0x48], edx
jmp 0x4096e0
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x4096f0
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebx
shr dword [esi + 0x48], 8
add dword [esi + 0x44], 0xfffffff8
cmp dword [esi + 0x44], ebp
jae 0x4096e0
test dword [esi + 8], 0x1000
je 0x409930
mov edx, dword [esi + 0x18]
mov edi, 4
mov ecx, dword [esi + 0x44]
mov eax, edx
shr eax, 0x18
shl eax, cl
or dword [esi + 0x48], eax
lea eax, [ecx + 8]
mov dword [esi + 0x44], eax
cmp eax, ebp
jb 0x40974d
lea esp, [esp]
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x409740
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebx
shr dword [esi + 0x48], 8
add dword [esi + 0x44], 0xfffffff8
cmp dword [esi + 0x44], ebp
jae 0x409730
shl edx, 8
sub edi, ebx
jne 0x409712
jmp 0x409930
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0x1c]
sub ecx, dword [esi + 0x40]
cmp ecx, dword [esi + 0x24]
ja 0x409694
xor edx, edx
mov ecx, ebx
shl edx, cl
lea eax, [ebx + 2]
mov ebx, 8
mov dword [esi + 0x30], edi
or edx, ebp
mov dword [esi + 0x48], edx
mov dword [esi + 0x44], eax
lea ebp, [ebx - 7]
cmp eax, ebx
jb 0x4097ad
lea esp, [esp]
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x4097a0
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebp
shr dword [esi + 0x48], 8
add dword [esi + 0x44], 0xfffffff8
cmp dword [esi + 0x44], ebx
jae 0x409790
mov ecx, dword [esi + 0x44]
test ecx, ecx
je 0x4097dd
xor edx, edx
shl edx, cl
mov dword [esi + 0x44], ebx
or dword [esi + 0x48], edx
mov edi, edi
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x4097d0
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebp
shr dword [esi + 0x48], 8
add dword [esi + 0x44], 0xfffffff8
cmp dword [esi + 0x44], ebx
jae 0x4097c0
mov edx, 2
mov edi, 0xffff
mov ecx, dword [esi + 0x44]
movzx eax, word [esi + 0x3c]
shl eax, cl
or dword [esi + 0x48], eax
lea eax, [ecx + 0x10]
mov dword [esi + 0x44], eax
cmp eax, ebx
jb 0x40981d
lea ecx, [ecx]
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x409810
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebp
shr dword [esi + 0x48], 8
add dword [esi + 0x44], 0xfffffff8
cmp dword [esi + 0x44], ebx
jae 0x409800
xor dword [esi + 0x3c], edi
mov eax, dword [esi + 0x3c]
sub edx, ebp
test edx, edx
jne 0x4097e7
test eax, eax
jbe 0x4096ad
lea ebx, [edx - 8]
lea edi, [edx + 8]
lea ebp, [edx + 1]
lea ebx, [ebx]
mov eax, dword [esi + 0x40]
mov ecx, dword [esi + 0x44]
add eax, edx
and eax, 0x7fff
movzx eax, byte [eax + esi + 0x90]
shl eax, cl
or dword [esi + 0x48], eax
lea eax, [ecx + 8]
mov dword [esi + 0x44], eax
cmp eax, edi
jb 0x409880
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x409874
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebp
shr dword [esi + 0x48], 8
add dword [esi + 0x44], ebx
cmp dword [esi + 0x44], edi
jae 0x409864
add edx, ebp
cmp edx, dword [esi + 0x3c]
jb 0x409840
jmp 0x4096ad
xor edx, edx
shl edx, cl
lea eax, [ecx + 3]
xor edi, edi
mov dword [esi + 0x44], eax
or dword [esi + 0x48], edx
cmp eax, ebp
jb 0x4098bd
nop
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x4098b0
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebx
shr dword [esi + 0x48], 8
add dword [esi + 0x44], 0xfffffff8
cmp dword [esi + 0x44], ebp
jae 0x4098a0
mov ecx, dword [esi + 0x44]
test ecx, ecx
je 0x4098ed
xor edx, edx
shl edx, cl
mov dword [esi + 0x44], ebp
or dword [esi + 0x48], edx
mov edi, edi
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x4098e0
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebx
shr dword [esi + 0x48], 8
add dword [esi + 0x44], 0xfffffff8
cmp dword [esi + 0x44], ebp
jae 0x4098d0
mov edx, 2
mov ecx, dword [esi + 0x44]
movzx eax, di
shl eax, cl
or dword [esi + 0x48], eax
lea eax, [ecx + 0x10]
mov dword [esi + 0x44], eax
cmp eax, ebp
jb 0x409924
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x409917
mov cl, byte [esi + 0x48]
mov byte [eax], cl
add dword [esi + 0x30], ebx
shr dword [esi + 0x48], 8
add dword [esi + 0x44], 0xfffffff8
cmp dword [esi + 0x44], ebp
jae 0x409907
sub edx, ebx
xor edi, 0xffff
test edx, edx
jne 0x4098f2
push 0x240
lea edx, [esi + 0x8192]
push 0
push edx
call sub.msvcrt.dll_memset
push 0x40
lea eax, [esi + 0x83d2]
push 0
push eax
call sub.msvcrt.dll_memset
mov eax, dword [esi + 0x3c]
add dword [esi + 0x40], eax
mov edi, dword [esi + 0x30]
mov eax, dword [esp + 0x28]
inc dword [esi + 0x64]
add esp, 0x18
sub edi, eax
lea ecx, [esi + 0x9273]
lea edx, [esi + 0x9272]
mov dword [esi + 0x28], ecx
mov dword [esi + 0x2c], edx
mov dword [esi + 0x38], 8
mov dword [esi + 0x3c], 0
je 0x409a13
cmp dword [esi], 0
je 0x4099c6
mov ecx, dword [esi + 0x84]
sub ecx, dword [esi + 0x70]
mov edx, dword [esi + 0x78]
mov dword [edx], ecx
mov eax, dword [esi + 4]
mov edx, dword [esi]
push eax
lea ecx, [esi + 0x39272]
push edi
push ecx
call edx
add esp, 0xc
test eax, eax
jne 0x409a13
pop edi
or eax, 0xffffffff
mov dword [esi + 0x6c], eax
pop esi
pop ebp
pop ebx
add esp, 8
ret
lea ecx, [esi + 0x39272]
cmp eax, ecx
jne 0x409a0d
mov edx, dword [esi + 0x7c]
mov eax, dword [esi + 0x8c]
mov ebx, dword [edx]
sub ebx, eax
cmp edi, ebx
jae 0x4099e3
mov ebx, edi
push ebx
push ecx
mov ecx, dword [esi + 0x74]
add ecx, eax
push ecx
call sub.msvcrt.dll_memcpy
add dword [esi + 0x8c], ebx
add esp, 0xc
sub edi, ebx
je 0x409a13
mov dword [esi + 0x5c], edi
mov eax, edi
pop edi
mov dword [esi + 0x58], ebx
pop esi
pop ebp
pop ebx
add esp, 8
ret
add dword [esi + 0x8c], edi
mov eax, dword [esi + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret