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

Disassembly:
sub esp, 0x490
mov eax, dword [0x44a5a8]
xor eax, esp
mov dword [esp + 0x48c], eax
mov eax, dword [esp + 0x498]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x49c]
push ebx
push ebp
mov dword [esp + 0x68], eax
xor ebp, ebp
mov eax, dword [esp + 0x4a8]
push esi
mov esi, dword [esp + 0x4a0]
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x4b0]
mov dword [esp + 0x60], eax
lea eax, [esp + 0x74]
push edi
push eax
push esi
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x9c], 0xff
call fcn.00406c10
add esp, 8
test eax, eax
je 0x406bf2
mov eax, dword [esi + 4]
mov dword [esp + 0x68], eax
cdq
xor eax, edx
sub eax, edx
mov dword [esi + 4], eax
cmp eax, 0x1000000
jbe 0x406096
mov ecx, dword [0x44b8a8]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.too_large
jmp 0x406bf2
cmp dword [esi], 0x1000000
ja 0x406078
mov eax, dword [esp + 0x84]
mov edi, dword [esp + 0x90]
mov ebx, dword [esp + 0x98]
mov edx, dword [esp + 0x7c]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x88]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x8c]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x94]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x80]
mov dword [esp + 0x20], edi
mov dword [esp + 0x30], eax
mov dword [esp + 0x44], ebx
mov dword [esp + 0x40], edx
cmp eax, 0xc
jne 0x406120
mov eax, dword [esp + 0x78]
mov dword [esp + 0x18], eax
cmp eax, 0x18
jge 0x40613e
mov ecx, edx
mov eax, 0x55555556
sub ecx, ebx
sub ecx, 0x18
imul ecx
mov ebp, edx
shr ebp, 0x1f
add ebp, edx
mov edx, dword [esp + 0x40]
jmp 0x406136
mov ecx, dword [esp + 0x78]
mov dword [esp + 0x18], ecx
cmp ecx, 0x10
jge 0x40613e
mov ebp, edx
sub ebp, ebx
sub ebp, eax
sar ebp, 2
mov dword [esp + 0x14], ebp
test ebp, ebp
jne 0x40617f
mov ecx, dword [esi + 0xac]
sub ecx, dword [esi + 0xb4]
add ecx, dword [esi + 0xa8]
lea eax, [ecx - 1]
cmp eax, 0x3ff
ja 0x406bd9
cmp edx, ecx
jl 0x406bbe
mov eax, edx
sub eax, ecx
cmp eax, 0x400
jg 0x406bbe
push eax
push esi
call fcn.004133f0
add esp, 8
cmp dword [esp + 0x18], 0x18
jne 0x406195
cmp edi, 0xff000000
jne 0x406195
mov eax, 3
jmp 0x40619f
xor eax, eax
test edi, edi
setne al
add eax, 3
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x10], eax
mov dword [esi + 8], eax
test ecx, ecx
je 0x4061b9
cmp ecx, 3
jl 0x4061b9
mov eax, ecx
mov dword [esp + 0x10], eax
mov edi, dword [esi + 4]
mov ebx, dword [esi]
push 0
push edi
push ebx
push eax
call fcn.0040dbc0
add esp, 0x10
test eax, eax
je 0x406078
push 0
push edi
push ebx
push dword [esp + 0x1c]
call fcn.0040dcf0
mov ebx, eax
add esp, 0x10
mov dword [esp + 0x60], ebx
test ebx, ebx
jne 0x40620b
mov ecx, dword [0x44b8a8]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.outofmem
jmp 0x406bf2
xor edi, edi
cmp dword [esp + 0x18], 0x10
jge 0x4066b7
test ebp, ebp
je 0x406690
cmp ebp, 0x100
jg 0x406690
test ebp, ebp
jle 0x406350
mov eax, dword [esi + 0xac]
xor ebx, ebx
mov edi, dword [esp + 0x30]
mov ecx, dword [esi + 0xb0]
cmp eax, ecx
jb 0x406265
cmp dword [esi + 0x20], 0
je 0x4062c0
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov ecx, dword [esi + 0xb0]
mov dl, byte [eax]
lea ebp, [ebx*4]
inc eax
mov dword [esp + 0x24], ebp
mov dword [esi + 0xac], eax
mov byte [esp + ebp + 0x9e], dl
cmp eax, ecx
jb 0x4062a1
mov ecx, ebp
cmp dword [esi + 0x20], 0
je 0x4062d3
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov ecx, dword [esi + 0xb0]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
mov byte [esp + ebp + 0x9d], dl
cmp eax, ecx
jae 0x4062db
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4062fd
lea ebp, [ebx*4]
mov byte [esp + ebp + 0x9e], 0
mov ecx, ebp
jmp 0x406286
mov byte [esp + ecx + 0x9d], 0
cmp dword [esi + 0x20], 0
je 0x4062fb
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4062fd
xor cl, cl
mov byte [esp + ebp + 0x9c], cl
cmp edi, 0xc
je 0x406335
cmp eax, dword [esi + 0xb0]
jae 0x40631a
inc eax
mov dword [esi + 0xac], eax
jmp 0x406335
cmp dword [esi + 0x20], 0
je 0x406335
push esi
call fcn.00412d00
add esp, 4
inc dword [esi + 0xac]
mov eax, dword [esi + 0xac]
mov byte [esp + ebp + 0x9f], 0xff
inc ebx
mov ebp, dword [esp + 0x14]
cmp ebx, ebp
jl 0x406240
mov ebx, dword [esp + 0x60]
xor edi, edi
mov ecx, dword [esp + 0x40]
xor eax, eax
cmp dword [esp + 0x30], 0xc
setne al
add eax, 3
imul eax, ebp
sub ecx, eax
sub ecx, dword [esp + 0x44]
sub ecx, dword [esp + 0x30]
push ecx
push esi
call fcn.004133f0
mov edx, dword [esp + 0x20]
add esp, 8
cmp edx, 1
jne 0x40638b
mov eax, dword [esi]
add eax, 7
shr eax, 3
jmp 0x4063a2
cmp edx, 4
jne 0x406397
mov eax, dword [esi]
inc eax
shr eax, 1
jmp 0x4063a2
cmp edx, 8
jne 0x406669
mov eax, dword [esi]
mov ecx, dword [esi + 4]
neg eax
and eax, 3
mov dword [esp + 0x1c], eax
cmp edx, 1
jne 0x406516
mov dword [esp + 0x34], 0
test ecx, ecx
jle 0x406aac
nop word [eax + eax]
mov eax, dword [esi + 0xac]
mov edx, 7
mov dword [esp + 0x14], edx
cmp eax, dword [esi + 0xb0]
jae 0x4063f2
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x406418
cmp dword [esi + 0x20], 0
je 0x406416
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov edx, dword [esp + 0x14]
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x406418
xor cl, cl
xor ebp, ebp
movzx eax, cl
mov dword [esp + 0x20], eax
cmp dword [esi], ebp
jle 0x4064f0
nop dword [eax]
mov ecx, edx
sar eax, cl
and eax, 1
lea ecx, [eax*4]
movzx eax, byte [esp + ecx + 0x9c]
mov byte [edi + ebx], al
movzx eax, byte [esp + ecx + 0x9d]
mov byte [edi + ebx + 1], al
movzx eax, byte [esp + ecx + 0x9e]
mov byte [edi + ebx + 2], al
add edi, 3
cmp dword [esp + 0x10], 4
jne 0x406470
mov byte [edi + ebx], 0xff
inc edi
mov ecx, dword [esi]
inc ebp
cmp ebp, ecx
je 0x4064f0
sub edx, 1
jns 0x4064e4
mov eax, dword [esi + 0xac]
mov dword [esp + 0x14], 7
cmp eax, dword [esi + 0xb0]
jae 0x4064a8
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
movzx eax, dl
mov edx, dword [esp + 0x14]
mov dword [esp + 0x20], eax
jmp 0x4064e8
cmp dword [esi + 0x20], 0
je 0x4064d5
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
mov ecx, dword [esi]
movzx eax, dl
mov edx, dword [esp + 0x14]
mov dword [esp + 0x20], eax
jmp 0x4064e8
xor dl, dl
movzx eax, dl
mov edx, dword [esp + 0x14]
mov dword [esp + 0x20], eax
jmp 0x4064e8
mov eax, dword [esp + 0x20]
cmp ebp, ecx
jl 0x406430
push dword [esp + 0x1c]
push esi
call fcn.004133f0
mov ebp, dword [esp + 0x3c]
add esp, 8
mov ecx, dword [esi + 4]
inc ebp
mov dword [esp + 0x34], ebp
cmp ebp, ecx
jl 0x4063d0
jmp 0x406aac
mov dword [esp + 0x20], 0
test ecx, ecx
jle 0x406aac
xor ebp, ebp
cmp dword [esi], ebp
jle 0x406642
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x406549
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x40656b
cmp dword [esi + 0x20], 0
je 0x406569
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x40656b
xor cl, cl
xor edx, edx
movzx ecx, cl
cmp dword [esp + 0x18], 4
jne 0x40657f
mov edx, ecx
and edx, 0xf
shr ecx, 4
movzx eax, byte [esp + ecx*4 + 0x9c]
mov byte [edi + ebx], al
movzx eax, byte [esp + ecx*4 + 0x9d]
mov byte [edi + ebx + 1], al
movzx eax, byte [esp + ecx*4 + 0x9e]
mov byte [edi + ebx + 2], al
add edi, 3
cmp dword [esp + 0x10], 4
jne 0x4065b1
mov byte [edi + ebx], 0xff
inc edi
lea eax, [ebp + 1]
cmp eax, dword [esi]
je 0x40663e
cmp dword [esp + 0x18], 8
jne 0x406601
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4065dc
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4065fe
cmp dword [esi + 0x20], 0
je 0x4065fc
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4065fe
xor cl, cl
movzx edx, cl
movzx eax, byte [esp + edx*4 + 0x9c]
mov byte [edi + ebx], al
movzx eax, byte [esp + edx*4 + 0x9d]
mov byte [edi + ebx + 1], al
movzx eax, byte [esp + edx*4 + 0x9e]
mov byte [edi + ebx + 2], al
add edi, 3
cmp dword [esp + 0x10], 4
jne 0x406633
mov byte [edi + ebx], 0xff
inc edi
add ebp, 2
cmp ebp, dword [esi]
jl 0x406530
mov eax, dword [esp + 0x1c]
push eax
push esi
call fcn.004133f0
mov eax, dword [esp + 0x28]
add esp, 8
mov ecx, dword [esi + 4]
inc eax
mov dword [esp + 0x20], eax
cmp eax, ecx
mov eax, dword [esp + 0x1c]
jl 0x406526
jmp 0x406aac
push ebx
call fcn.0041d0e3
mov ecx, dword [0x44b8a8]
add esp, 4
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.bad_bpp
jmp 0x406bf2
push ebx
call fcn.0041d0e3
mov ecx, dword [0x44b8a8]
add esp, 4
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.invalid
jmp 0x406bf2
mov eax, dword [esp + 0x40]
xor ebp, ebp
sub eax, dword [esp + 0x44]
sub eax, dword [esp + 0x30]
push eax
push esi
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x3c], 0
mov dword [esp + 0x64], ebp
mov dword [esp + 0x24], edi
mov dword [esp + 0x1c], edi
call fcn.004133f0
mov ebp, dword [esp + 0x20]
add esp, 8
cmp ebp, 0x18
jne 0x406723
mov eax, dword [esi]
lea eax, [eax + eax*2]
jmp 0x406730
cmp ebp, 0x10
jne 0x40672e
mov eax, dword [esi]
add eax, eax
jmp 0x406730
xor eax, eax
neg eax
and eax, 3
mov dword [esp + 0x40], eax
cmp ebp, 0x18
jne 0x40674c
mov edx, 1
mov dword [esp + 0x14], edx
jmp 0x40684a
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
cmp ebp, 0x20
jne 0x40678e
cmp edx, 0xff
jne 0x40678e
cmp ecx, 0xff00
jne 0x40678e
cmp eax, 0xff0000
jne 0x40678e
mov ebp, dword [esp + 0x20]
cmp ebp, 0xff000000
jne 0x4067aa
mov edx, 2
mov dword [esp + 0x14], edx
jmp 0x406846
test eax, eax
je 0x406b9a
test ecx, ecx
je 0x406b9a
test edx, edx
je 0x406b9a
mov ebp, dword [esp + 0x20]
push eax
call fcn.0040b2e0
push dword [esp + 0x2c]
sub eax, 7
mov dword [esp + 0x58], eax
call fcn.00405fa0
push dword [esp + 0x34]
mov dword [esp + 0x54], eax
call fcn.0040b2e0
push dword [esp + 0x38]
sub eax, 7
mov dword [esp + 0x64], eax
call fcn.00405fa0
push dword [esp + 0x48]
mov dword [esp + 0x60], eax
call fcn.0040b2e0
push dword [esp + 0x4c]
sub eax, 7
mov dword [esp + 0x70], eax
call fcn.00405fa0
push ebp
mov dword [esp + 0x50], eax
call fcn.0040b2e0
sub eax, 7
push ebp
mov dword [esp + 0x44], eax
call fcn.00405fa0
add esp, 0x20
mov ebp, eax
cmp dword [esp + 0x48], 8
mov dword [esp + 0x5c], ebp
jg 0x406b9a
cmp dword [esp + 0x4c], 8
jg 0x406b9a
cmp dword [esp + 0x34], 8
jg 0x406b9a
cmp ebp, 8
jg 0x406b9a
xor edx, edx
mov ebp, dword [esp + 0x18]
mov ecx, dword [esi + 4]
mov dword [esp + 0x30], edi
test ecx, ecx
jle 0x406aac
nop dword [eax]
mov eax, dword [esi]
test edx, edx
je 0x4069aa
xor ebp, ebp
test eax, eax
jle 0x406a83
nop dword [eax]
nop dword [eax + eax]
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x406899
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4068bb
cmp dword [esi + 0x20], 0
je 0x4068b9
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4068bb
xor cl, cl
mov byte [edi + ebx + 2], cl
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4068d8
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4068fa
cmp dword [esi + 0x20], 0
je 0x4068f8
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4068fa
xor cl, cl
mov byte [edi + ebx + 1], cl
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x406917
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x406939
cmp dword [esi + 0x20], 0
je 0x406937
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x406939
xor cl, cl
mov byte [edi + ebx], cl
add edi, 3
cmp dword [esp + 0x14], 2
jne 0x406983
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x40695f
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x406986
cmp dword [esi + 0x20], 0
je 0x40697f
push esi
call fcn.00412d00
mov eax, dword [esi + 0xac]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x406986
xor cl, cl
jmp 0x406986
or cl, 0xff
movzx eax, cl
or dword [esp + 0x3c], eax
cmp dword [esp + 0x10], 4
jne 0x406998
mov byte [edi + ebx], cl
inc edi
inc ebp
cmp ebp, dword [esi]
jl 0x406880
mov dword [esp + 0x1c], edi
jmp 0x406a83
mov dword [esp + 0x44], 0
test eax, eax
jle 0x406a83
nop word [eax + eax]
push esi
call fcn.00409180
cmp ebp, 0x10
jne 0x4069d2
add esp, 4
mov ebp, eax
jmp 0x4069e8
push esi
mov edi, eax
call fcn.00409180
mov ebp, eax
add esp, 8
shl ebp, 0x10
add ebp, edi
mov edi, dword [esp + 0x1c]
push dword [esp + 0x48]
mov eax, ebp
push dword [esp + 0x54]
and eax, dword [esp + 0x30]
push eax
call fcn.00413370
push dword [esp + 0x58]
mov byte [edi + ebx], al
mov eax, ebp
push dword [esp + 0x64]
and eax, dword [esp + 0x40]
push eax
call fcn.00413370
push dword [esp + 0x4c]
mov byte [edi + ebx + 1], al
mov eax, ebp
push dword [esp + 0x74]
and eax, dword [esp + 0x58]
push eax
call fcn.00413370
mov byte [edi + ebx + 2], al
add esp, 0x24
mov eax, dword [esp + 0x20]
add edi, 3
mov dword [esp + 0x1c], edi
test eax, eax
je 0x406a56
push dword [esp + 0x5c]
and ebp, eax
push dword [esp + 0x28]
push ebp
call fcn.00413370
add esp, 0xc
jmp 0x406a5b
mov eax, 0xff
or dword [esp + 0x3c], eax
cmp dword [esp + 0x10], 4
jne 0x406a6e
mov byte [edi + ebx], al
inc edi
mov dword [esp + 0x1c], edi
mov eax, dword [esp + 0x44]
mov ebp, dword [esp + 0x18]
inc eax
mov dword [esp + 0x44], eax
cmp eax, dword [esi]
jl 0x4069c0
push dword [esp + 0x40]
push esi
call fcn.004133f0
mov eax, dword [esp + 0x38]
add esp, 8
mov ecx, dword [esi + 4]
inc eax
mov edx, dword [esp + 0x14]
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x30], eax
cmp eax, ecx
jl 0x406860
mov edi, dword [esp + 0x10]
cmp edi, 4
jne 0x406ad9
cmp dword [esp + 0x3c], 0
jne 0x406ad9
mov eax, dword [esi]
imul eax, ecx
lea eax, [eax*4 - 1]
test eax, eax
js 0x406ad9
nop dword [eax]
mov byte [eax + ebx], 0xff
sub eax, 4
jns 0x406ad0
cmp dword [esp + 0x68], 0
jle 0x406b56
mov ecx, dword [esi + 4]
xor edx, edx
mov dword [esp + 0x24], edx
test ecx, 0xfffffffe
jle 0x406b56
mov eax, dword [esi]
sub ecx, edx
dec ecx
mov ebp, eax
imul ecx, eax
imul eax, dword [esp + 0x10]
imul ebp, edx
imul ecx, edi
imul ebp, edi
xor edi, edi
lea edx, [ecx + ebx]
test eax, eax
jle 0x406b3e
mov ebx, dword [esp + 0x10]
sub ebp, ecx
nop dword [eax + eax]
mov al, byte [edx]
lea edx, [edx + 1]
mov cl, byte [edx + ebp - 1]
inc edi
mov byte [edx + ebp - 1], al
mov byte [edx - 1], cl
mov eax, dword [esi]
imul eax, ebx
cmp edi, eax
jl 0x406b20
mov ebx, dword [esp + 0x60]
mov edx, dword [esp + 0x24]
mov ecx, dword [esi + 4]
inc edx
mov edi, dword [esp + 0x10]
mov eax, ecx
sar eax, 1
mov dword [esp + 0x24], edx
cmp edx, eax
jl 0x406af1
mov eax, dword [esp + 0x64]
test eax, eax
je 0x406b78
cmp eax, edi
je 0x406b78
push dword [esi + 4]
push dword [esi]
push eax
push edi
push ebx
call fcn.004079d0
mov ebx, eax
add esp, 0x14
test ebx, ebx
je 0x406bf2
mov ecx, dword [esp + 0x6c]
mov eax, dword [esi]
mov dword [ecx], eax
mov ecx, dword [esp + 0x70]
mov eax, dword [esi + 4]
mov dword [ecx], eax
mov ecx, dword [esp + 0x74]
test ecx, ecx
je 0x406b96
mov eax, dword [esi + 8]
mov dword [ecx], eax
mov eax, ebx
jmp 0x406bf4
push ebx
call fcn.0041d0e3
mov ecx, dword [0x44b8a8]
add esp, 4
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.bad_masks
jmp 0x406bf2
mov ecx, dword [0x44b8a8]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.bad_offset
jmp 0x406bf2
mov ecx, dword [0x44b8a8]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.bad_header
xor eax, eax
mov ecx, dword [esp + 0x49c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00418b49
add esp, 0x490
ret