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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x24
cmp dword [ebp + 0xc], 0
jle 0x420527
mov eax, 0x40000000
mov ecx, dword [ebp + 8]
cdq
idiv dword [ecx + 0x30]
inc eax
cmp dword [ebp + 0xc], eax
jne 0x420531
mov eax, 0xb
jmp 0x420a19
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
mov dword [ebx], 0
mov cl, byte [eax + 0xb]
test cl, cl
setne dl
xor eax, eax
cmp cl, 0xd
setne al
test edx, eax
je 0x420559
movzx eax, cl
jmp 0x420a19
mov edx, dword [ebp + 8]
cmp dword [edx + 0x3c], 0
jne 0x420698
cmp byte [edx + 0x11], 0
jne 0x420698
cmp byte [edx + 3], 0
jne 0x42058d
mov edx, 1
mov eax, dword [ebp + 8]
call fcn.0042007f
mov esi, eax
test eax, eax
jne 0x420680
mov ecx, dword [ebp + 8]
cmp byte [ecx + 2], 0
je 0x42068f
push dword [ecx + 0x50]
call fcn.00405683
pop ecx
test eax, eax
je 0x42068f
mov ebx, dword [ebp + 8]
push dword [ebx + 0x58]
call fcn.0041b5a5
pop edx
test eax, eax
jne 0x42068f
push ebx
call fcn.0041fbd6
pop edi
test eax, eax
jne 0x4205d8
push dword [ebx + 0x50]
call fcn.00405650
pop esi
jmp 0x42068f
mov eax, dword [ebp + 8]
push 4
push dword [eax + 0x58]
call fcn.0041b57b
pop ecx
mov esi, eax
pop ebx
test eax, eax
je 0x420607
mov edx, dword [ebp + 8]
push 0
push dword [edx + 0x58]
call fcn.0041b589
mov ecx, dword [ebp + 8]
mov edx, esi
mov eax, ecx
mov byte [ecx + 0xa], 0
jmp 0x420685
mov ebx, dword [ebp + 8]
mov eax, ebx
add eax, 0x5c
mov byte [ebx + 0xa], 4
push eax
push dword [ebx + 0x50]
call fcn.00405847
mov esi, eax
pop eax
test esi, esi
pop edx
je 0x42063c
push 0
push dword [ebx + 0x58]
call fcn.0041b589
mov eax, 5
mov byte [ebx + 0xa], 0
jmp 0x420a19
mov eax, dword [ebp + 8]
mov byte [eax], 1
mov byte [eax + 1], 0
mov byte [eax + 0x12], 0
mov dword [eax + 0x80], 0
mov dword [eax + 0x84], 0
mov dword [eax + 0x88], 0
mov dword [eax + 0x8c], 0
mov eax, dword [ebp + 8]
call fcn.0041f4a4
mov esi, eax
test eax, eax
je 0x42068f
mov edx, esi
mov eax, dword [ebp + 8]
call fcn.0041eca3
jmp 0x420a19
mov dword [ebp - 0x10], 0
jmp 0x4206b9
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
call fcn.0041f0ea
mov edx, dword [ebp + 8]
cmp byte [edx + 0x11], 0
mov dword [ebp - 0x10], eax
je 0x4206b9
cmp byte [edx + 0xa], 0
jne 0x4206b9
mov byte [edx + 0xa], 1
mov edx, dword [ebp - 0x10]
test edx, edx
jne 0x4209f5
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x40]
cmp dword [ecx + 0x34], eax
jl 0x4206df
cmp dword [ecx + 0x68], 0
je 0x4206df
cmp byte [ecx + 0x11], 0
je 0x420763
mov ebx, dword [ebp + 8]
push 1
mov edx, dword [ebx + 0x2c]
add edx, dword [ebx + 0x30]
movzx eax, byte [ebx + 0x11]
lea eax, [edx + eax*8 + 0x34]
push eax
call fcn.00406c50
mov edx, eax
pop edi
mov dword [ebp - 0x10], eax
test edx, edx
pop eax
mov eax, 7
je 0x420a19
cld
xor al, al
mov ecx, 0xc
mov edi, edx
rep stosd dword es:[edi], eax
cmp byte [ebx + 0x11], 0
je 0x420735
mov eax, dword [ebx + 0x2c]
add eax, dword [ebx + 0x30]
add eax, dword [ebp - 0x10]
mov dword [eax + 0x30], 0
mov dword [eax + 0x34], 0
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp + 8]
mov dword [eax], edx
mov edx, dword [ecx + 0x74]
mov dword [eax + 0x18], edx
mov dword [ecx + 0x74], eax
mov eax, dword [ecx + 0x34]
mov edx, dword [ecx + 0x38]
inc eax
mov dword [ecx + 0x34], eax
cmp eax, edx
jle 0x4207dc
lea eax, [edx + 1]
mov dword [ecx + 0x38], eax
jmp 0x4207dc
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x10], 0
mov esi, dword [ebx + 0x70]
test esi, esi
jne 0x4207a3
mov eax, ebx
call fcn.004201eb
test eax, eax
jne 0x4207d4
cmp byte [ebx + 8], 0
je 0x420797
mov dword [ebx + 0x20], 0
mov eax, ebx
call fcn.0041eec0
test eax, eax
jne 0x4207d4
mov eax, dword [ebp + 8]
mov esi, dword [eax + 0x68]
xor eax, eax
test esi, esi
je 0x4207d4
cmp byte [esi + 0x26], 0
je 0x4207bb
mov dword [esi + 0x2c], 0
mov eax, esi
call fcn.0042031b
test eax, eax
jne 0x4207d4
cmp byte [esi + 0x28], 0
je 0x4207c8
mov edx, dword [ebp + 8]
mov byte [edx + 0x10], 1
mov eax, esi
call fcn.0041fd20
mov dword [ebp - 0x10], esi
xor eax, eax
test eax, eax
jne 0x420a19
mov edx, dword [ebp - 0x10]
mov ebx, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov dword [edx + 4], ecx
mov ecx, dword [ebx + 0x44]
test ecx, ecx
je 0x42080e
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebx + 0x18]
jg 0x42080e
shr eax, 3
movzx eax, byte [eax + ecx]
mov ecx, dword [ebp + 0xc]
and ecx, 7
sar eax, cl
and eax, 1
mov byte [edx + 0x24], al
jmp 0x420812
mov byte [edx + 0x24], 0
mov eax, dword [ebp - 0x10]
mov byte [eax + 0x27], 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x48]
test edx, edx
je 0x420849
mov ebx, dword [ebp + 0xc]
cmp ebx, dword [ecx + 0x1c]
jg 0x420849
mov eax, ebx
mov ecx, ebx
shr eax, 3
and ecx, 7
movzx eax, byte [eax + edx]
sar eax, cl
test al, 1
je 0x420849
mov eax, dword [ebp - 0x10]
call fcn.0041f0bd
jmp 0x420885
mov edx, dword [ebp - 0x10]
cmp byte [edx + 0x25], 0
je 0x420885
mov eax, dword [edx + 0x20]
mov ecx, dword [edx + 0x1c]
test eax, eax
je 0x420861
mov dword [eax + 0x1c], ecx
jmp 0x420866
mov eax, dword [edx]
mov dword [eax + 0x78], ecx
mov ecx, dword [edx + 0x1c]
test ecx, ecx
je 0x420873
mov eax, dword [edx + 0x20]
mov dword [ecx + 0x20], eax
mov dword [edx + 0x1c], 0
mov dword [edx + 0x20], 0
mov byte [edx + 0x25], 0
mov eax, dword [ebp - 0x10]
mov byte [eax + 0x26], 0
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x10]
mov ecx, dword [edx + 0x2c]
inc dword [edx + 0x3c]
mov word [eax + 0x2a], 1
test ecx, ecx
jle 0x4208ad
add eax, dword [edx + 0x30]
cld
lea edi, [eax + 0x30]
xor eax, eax
rep stosb byte es:[edi], al
mov ecx, dword [ebp + 8]
mov bl, byte [ecx + 0xb]
test bl, bl
je 0x4208cf
mov eax, dword [ebp - 0x10]
add eax, 0x30
push eax
call fcn.00420406
mov ebx, dword [ebp + 8]
movzx eax, byte [ebx + 0xb]
jmp 0x420a19
push dword [ebp + 8]
call fcn.0041fbd6
pop esi
cmp eax, dword [ebp + 0xc]
jl 0x4208e6
mov eax, dword [ebp + 8]
cmp byte [eax + 0x11], 0
je 0x4208fa
mov edx, dword [ebp + 8]
mov edi, dword [ebp - 0x10]
cld
mov ecx, dword [edx + 0x30]
add edi, 0x30
mov al, bl
jmp 0x4209c7
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
dec eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x20], eax
mov eax, dword [edx + 0x30]
mov ecx, eax
mov ebx, eax
mov eax, dword [ebp - 0x20]
mov edi, dword [ebp - 0x20]
mul ecx
sar ebx, 0x1f
mov esi, edx
imul edi, ebx
imul ecx, dword [ebp - 0x1c]
add esi, edi
mov dword [ebp - 0x30], eax
add esi, ecx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x2c], esi
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
push dword [edx + 0x58]
call fcn.0041b535
add esp, 0xc
mov esi, eax
test eax, eax
jne 0x420968
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 0x10]
add eax, 0x30
push dword [ecx + 0x30]
push eax
push dword [ecx + 0x58]
call fcn.0041b519
add esp, 0xc
mov esi, eax
test eax, eax
je 0x4209c9
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x18]
push eax
push dword [ebx + 0x58]
call fcn.0041b56d
pop ecx
test eax, eax
pop ebx
jne 0x4209a5
mov eax, dword [ebp + 8]
mov dword [ebp - 0x24], 0
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
mov ebx, dword [eax + 0x30]
mov eax, dword [ebp + 0xc]
imul eax, ebx
cmp ecx, dword [ebp - 0x24]
mov dword [ebp - 0x28], eax
jg 0x4209a5
jl 0x4209bc
cmp edx, dword [ebp - 0x28]
jb 0x4209bc
mov eax, dword [ebp - 0x10]
mov dword [eax + 4], 0
add eax, 0x30
push eax
call fcn.00420406
mov eax, esi
jmp 0x420a19
mov edi, dword [ebp - 0x10]
xor eax, eax
cld
add edi, 0x30
mov ecx, ebx
rep stosb byte es:[edi], al
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
and edx, 0x7ff
mov esi, dword [ebp - 0x10]
mov eax, dword [ecx + edx*4 + 0xbc]
mov dword [esi + 8], eax
mov dword [ecx + edx*4 + 0xbc], esi
mov eax, dword [esi + 8]
test eax, eax
je 0x420a0c
mov dword [eax + 0xc], esi
jmp 0x420a0c
mov ax, word [edx + 0x2a]
test ax, ax
jne 0x420a07
mov eax, edx
call fcn.00420163
jmp 0x420a0c
inc eax
mov word [edx + 0x2a], ax
mov eax, dword [ebp - 0x10]
mov ebx, dword [ebp + 0x10]
add eax, 0x30
mov dword [ebx], eax
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret