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

Disassembly:
sub esp, 0x478
push ebx
push esi
lea edx, [esp + 0x5c]
mov dword [esp + 0x78], 0xff
mov esi, ecx
xor ebx, ebx
call fcn.004f9d63
test eax, eax
je 0x4faaa6
mov eax, dword [esi + 4]
mov dword [esp + 0x44], eax
cdq
push ebp
mov ebp, eax
mov eax, 0x1000000
xor ebp, edx
sub ebp, edx
mov dword [esi + 4], ebp
cmp ebp, eax
ja 0x4fa08f
mov ecx, dword [esi]
mov dword [esp + 0x14], ecx
cmp ecx, eax
jbe 0x4fa0a8
mov eax, dword fs:[0x2c]
mov eax, dword [eax]
mov dword [eax + 0xc], str.too_large
xor eax, eax
jmp 0x4faaa5
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x80]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x74]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x78]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 0xc], edx
mov edx, dword [esp + 0x60]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
push edi
mov edi, dword [esp + 0x68]
mov dword [esp + 0x44], edi
cmp eax, 0xc
jne 0x4fa111
cmp edx, 0x18
jge 0x4fa125
mov eax, edi
sub eax, dword [esp + 0x10]
sub eax, 0x18
push 3
pop ebx
cdq
idiv ebx
mov ebx, eax
jmp 0x4fa121
cmp edx, 0x10
jge 0x4fa125
mov ebx, edi
sub ebx, dword [esp + 0x10]
sub ebx, eax
sar ebx, 2
test ebx, ebx
jne 0x4fa16d
mov ecx, dword [esi + 0xac]
sub ecx, dword [esi + 0xb4]
add ecx, dword [esi + 0xa8]
lea eax, [ecx - 1]
cmp eax, 0x3ff
ja 0x4faa90
cmp edi, ecx
jl 0x4faa7c
mov edx, edi
sub edx, ecx
cmp edx, 0x400
jg 0x4faa7c
mov ecx, esi
call fcn.004f29b7
mov ecx, dword [esi]
mov ebp, dword [esi + 4]
mov dword [esp + 0x18], ecx
cmp dword [esp + 0x1c], 0x18
jne 0x4fa183
cmp dword [esp + 0x14], 0xff000000
jne 0x4fa183
push 3
pop eax
jmp 0x4fa191
xor eax, eax
cmp dword [esp + 0x14], eax
push 3
setne al
pop edx
add eax, edx
push 0
push ebp
mov edx, ecx
mov dword [esi + 8], eax
push 4
pop ecx
call fcn.004f248a
pop ecx
pop ecx
test eax, eax
jne 0x4fa1be
mov eax, dword fs:[0x2c]
mov eax, dword [eax]
mov dword [eax + 0xc], str.too_large
jmp 0x4faaa2
mov edx, dword [esp + 0x18]
push 0
push ebp
push 4
pop ecx
call fcn.004f254b
mov ebp, eax
mov dword [esp + 0x60], ebp
pop ecx
pop ecx
test ebp, ebp
jne 0x4fa1f0
mov eax, dword fs:[0x2c]
mov eax, dword [eax]
mov dword [eax + 0xc], str.outofmem
jmp 0x4faaa2
cmp dword [esp + 0x1c], 0x10
jge 0x4fa643
xor edi, edi
mov dword [esp + 0x48], edi
test ebx, ebx
je 0x4fa624
cmp ebx, 0x100
jg 0x4fa624
xor ecx, ecx
mov dword [esp + 0x14], ecx
test ebx, ebx
jle 0x4fa341
mov edi, dword [esp + 0x20]
lea ebp, [esi + 0x20]
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4fa243
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa26a
lea ebp, [esi + 0x20]
cmp dword [ebp], 0
je 0x4fa268
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
mov ecx, dword [esp + 0x14]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa26a
xor dl, dl
mov dword [esp + 0x34], ebp
mov byte [esp + ecx*4 + 0x8a], dl
cmp eax, dword [esi + 0xb0]
jae 0x4fa288
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa2ac
cmp dword [ebp], 0
je 0x4fa2aa
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
mov ecx, dword [esp + 0x14]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa2ac
xor dl, dl
mov byte [esp + ecx*4 + 0x89], dl
cmp eax, dword [esi + 0xb0]
jae 0x4fa2c9
mov dl, byte [eax]
lea ebp, [esi + 0x20]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa2ed
cmp dword [ebp], 0
je 0x4fa2eb
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
mov ecx, dword [esp + 0x14]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa2ed
xor dl, dl
mov byte [esp + ecx*4 + 0x88], dl
cmp edi, 0xc
je 0x4fa324
cmp eax, dword [esi + 0xb0]
jae 0x4fa30a
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa324
mov eax, dword [esp + 0x34]
cmp dword [eax], 0
je 0x4fa324
mov ecx, esi
call fcn.004f295c
inc dword [esi + 0xac]
mov ecx, dword [esp + 0x14]
mov byte [esp + ecx*4 + 0x8b], 0xff
inc ecx
mov dword [esp + 0x14], ecx
cmp ecx, ebx
jl 0x4fa22a
mov edi, dword [esp + 0x48]
mov ebp, dword [esp + 0x58]
xor eax, eax
mov ecx, esi
cmp dword [esp + 0x20], 0xc
push 3
setne al
pop edx
add eax, edx
mov edx, dword [esp + 0x44]
imul eax, ebx
sub edx, eax
sub edx, dword [esp + 0x10]
sub edx, dword [esp + 0x20]
call fcn.004f29b7
mov eax, dword [esp + 0x1c]
cmp eax, 1
jne 0x4fa37b
mov ebx, dword [esi]
add ebx, 7
shr ebx, 3
jmp 0x4fa392
cmp eax, 4
jne 0x4fa387
mov ebx, dword [esi]
inc ebx
shr ebx, 1
jmp 0x4fa392
cmp eax, 8
jne 0x4fa605
mov ebx, dword [esi]
push 3
neg ebx
pop ecx
and ebx, ecx
mov ecx, dword [esi + 4]
mov dword [esp + 0x2c], ebx
mov edx, ecx
cmp eax, 1
jne 0x4fa4cf
and dword [esp + 0x30], 0
test ecx, ecx
jle 0x4fa9b9
mov eax, dword [esi + 0xac]
mov dword [esp + 0x34], 7
cmp eax, dword [esi + 0xb0]
jae 0x4fa3d9
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa3f0
cmp dword [esi + 0x20], 0
je 0x4fa3ee
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
jmp 0x4fa3ce
xor cl, cl
and dword [esp + 0x10], 0
cmp dword [esi], 0
movzx eax, cl
mov dword [esp + 0x18], eax
jle 0x4fa4ab
mov ebx, dword [esp + 0x34]
mov edx, eax
mov ecx, ebx
sar edx, cl
and edx, 1
mov al, byte [esp + edx*4 + 0x88]
mov byte [edi + ebp], al
mov al, byte [esp + edx*4 + 0x89]
mov byte [edi + ebp + 1], al
mov al, byte [esp + edx*4 + 0x8a]
mov byte [edi + ebp + 2], al
mov eax, dword [esp + 0x10]
mov byte [edi + ebp + 3], 0xff
add edi, 4
mov ecx, dword [esi]
inc eax
mov edx, eax
mov dword [esp + 0x10], edx
cmp eax, ecx
je 0x4fa4a7
sub ebx, 1
jns 0x4fa49b
mov eax, dword [esi + 0xac]
push 7
pop ebx
cmp eax, dword [esi + 0xb0]
jae 0x4fa46c
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa48e
cmp dword [esi + 0x20], 0
je 0x4fa48c
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
mov ecx, dword [esi]
jmp 0x4fa48e
xor dl, dl
movzx eax, dl
mov edx, dword [esp + 0x10]
mov dword [esp + 0x18], eax
jmp 0x4fa49f
mov eax, dword [esp + 0x18]
cmp edx, ecx
jl 0x4fa409
mov ebx, dword [esp + 0x2c]
mov edx, ebx
mov ecx, esi
call fcn.004f29b7
mov eax, dword [esp + 0x30]
mov ecx, dword [esi + 4]
inc eax
mov dword [esp + 0x30], eax
mov edx, ecx
cmp eax, ecx
jl 0x4fa3b8
jmp 0x4fa9b9
and dword [esp + 0x18], 0
test ecx, ecx
jle 0x4fa9b9
and dword [esp + 0x10], 0
cmp dword [esi], 0
jle 0x4fa5e1
mov ebx, dword [esp + 0x1c]
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4fa507
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa51e
cmp dword [esi + 0x20], 0
je 0x4fa51c
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
jmp 0x4fa4fc
xor cl, cl
xor edx, edx
movzx ecx, cl
cmp ebx, 4
jne 0x4fa530
mov edx, ecx
and edx, 0xf
shr ecx, 4
mov al, byte [esp + ecx*4 + 0x88]
mov byte [edi + ebp], al
mov al, byte [esp + ecx*4 + 0x89]
mov byte [edi + ebp + 1], al
mov al, byte [esp + ecx*4 + 0x8a]
mov ecx, dword [esp + 0x10]
mov byte [edi + ebp + 2], al
mov byte [edi + ebp + 3], 0xff
add edi, 4
lea eax, [ecx + 1]
cmp eax, dword [esi]
je 0x4fa5dd
cmp ebx, 8
jne 0x4fa5a6
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4fa581
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa59f
push 0x20
pop edx
mov eax, esi
mov ecx, edx
cmp dword [eax + ecx], 0
je 0x4fa59d
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
jmp 0x4fa576
xor cl, cl
movzx edx, cl
mov ecx, dword [esp + 0x10]
mov al, byte [esp + edx*4 + 0x88]
add ecx, 2
mov byte [edi + ebp], al
mov al, byte [esp + edx*4 + 0x89]
mov byte [edi + ebp + 1], al
mov al, byte [esp + edx*4 + 0x8a]
mov byte [edi + ebp + 2], al
mov byte [edi + ebp + 3], 0xff
add edi, 4
mov dword [esp + 0x10], ecx
cmp ecx, dword [esi]
jl 0x4fa4ee
mov ebx, dword [esp + 0x2c]
mov edx, ebx
mov ecx, esi
call fcn.004f29b7
mov eax, dword [esp + 0x18]
mov ecx, dword [esi + 4]
inc eax
mov dword [esp + 0x18], eax
mov edx, ecx
cmp eax, ecx
jl 0x4fa4dc
jmp 0x4fa9b9
push ebp
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword fs:[0x2c]
pop ecx
mov eax, dword [eax]
mov dword [eax + 0xc], str.bad_bpp
jmp 0x4faaa2
push ebp
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword fs:[0x2c]
pop ecx
mov eax, dword [eax]
mov dword [eax + 0xc], str.invalid
jmp 0x4faaa2
sub edi, dword [esp + 0x10]
xor eax, eax
sub edi, dword [esp + 0x20]
mov ebx, eax
mov edx, edi
mov dword [esp + 0x50], eax
mov ecx, esi
mov dword [esp + 0x54], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x24], eax
call fcn.004f29b7
mov eax, dword [esp + 0x1c]
cmp eax, 0x18
jne 0x4fa68e
imul ecx, dword [esi], 3
jmp 0x4fa69b
cmp eax, 0x10
jne 0x4fa699
mov ecx, dword [esi]
add ecx, ecx
jmp 0x4fa69b
xor ecx, ecx
push 3
pop edx
neg ecx
and ecx, edx
mov dword [esp + 0x60], ecx
push 0x20
pop edi
cmp eax, 0x18
jne 0x4fa6bb
mov dword [esp + 0x24], 1
jmp 0x4fa7b9
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x28]
cmp eax, edi
jne 0x4fa6f8
cmp edx, 0xff
jne 0x4fa6f8
cmp dword [esp + 0x38], 0xff00
jne 0x4fa6f8
cmp ecx, 0xff0000
jne 0x4fa6f8
cmp dword [esp + 0x14], 0xff000000
jne 0x4fa718
mov dword [esp + 0x24], 2
jmp 0x4fa7b9
mov eax, ebx
mov dword [esp + 0x24], eax
test ecx, ecx
je 0x4faa60
cmp dword [esp + 0x38], eax
je 0x4faa60
test edx, edx
je 0x4faa60
call fcn.004f9c33
mov ecx, dword [esp + 0x28]
push 7
pop ebx
sub eax, ebx
mov dword [esp + 0x50], eax
call fcn.004f9c91
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x2c], eax
call fcn.004f9c33
mov ecx, dword [esp + 0x38]
sub eax, ebx
mov dword [esp + 0x54], eax
call fcn.004f9c91
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x30], eax
call fcn.004f9c33
mov ecx, dword [esp + 0x3c]
sub eax, ebx
mov dword [esp + 0x44], eax
call fcn.004f9c91
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x18], eax
call fcn.004f9c33
mov ecx, dword [esp + 0x14]
sub eax, ebx
mov dword [esp + 0x34], eax
call fcn.004f9c91
cmp dword [esp + 0x2c], 8
mov dword [esp + 0x48], eax
jg 0x4faa60
cmp dword [esp + 0x30], 8
jg 0x4faa60
cmp dword [esp + 0x18], 8
jg 0x4faa60
cmp eax, 8
jg 0x4faa60
mov ebx, dword [esp + 0x5c]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esi + 4]
mov edx, ecx
and dword [esp + 0x10], 0
test ecx, ecx
jle 0x4fa9b9
and dword [esp + 0x20], 0
cmp dword [esp + 0x24], 0
je 0x4fa8eb
cmp dword [esi], 0
jle 0x4fa994
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4fa7fd
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa814
cmp dword [esi + 0x20], 0
je 0x4fa812
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
jmp 0x4fa7f2
xor cl, cl
mov eax, esi
mov byte [ebx + ebp + 2], cl
mov edx, edi
lea edi, [eax + edx]
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4fa838
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa851
lea edi, [esi + 0x20]
cmp dword [edi], 0
je 0x4fa84f
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
jmp 0x4fa82d
xor cl, cl
mov byte [ebx + ebp + 1], cl
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4fa86e
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa884
cmp dword [edi], 0
je 0x4fa882
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
jmp 0x4fa863
xor cl, cl
push 3
pop eax
mov byte [ebx + ebp], cl
add ebx, eax
cmp dword [esp + 0x24], 2
jne 0x4fa8c4
mov eax, dword [esi + 0xac]
cmp eax, dword [esi + 0xb0]
jae 0x4fa8ac
mov cl, byte [eax]
inc eax
mov dword [esi + 0xac], eax
jmp 0x4fa8c7
cmp dword [edi], 0
je 0x4fa8c0
mov ecx, esi
call fcn.004f295c
mov eax, dword [esi + 0xac]
jmp 0x4fa8a1
xor cl, cl
jmp 0x4fa8c7
or cl, 0xff
movzx eax, cl
or dword [esp + 0x40], eax
mov byte [ebx + ebp], cl
inc ebx
mov ecx, dword [esp + 0x20]
inc ecx
push 0x20
mov dword [esp + 0x24], ecx
pop edi
cmp ecx, dword [esi]
jl 0x4fa7e4
jmp 0x4fa991
cmp dword [esi], 0
jle 0x4fa994
mov ecx, esi
cmp eax, 0x10
jne 0x4fa902
call fcn.004f2b31
jmp 0x4fa907
call fcn.004f2ba9
push dword [esp + 0x2c]
mov edx, dword [esp + 0x54]
mov edi, eax
mov ecx, edi
and ecx, dword [esp + 0x2c]
call fcn.004f9ccf
push dword [esp + 0x34]
mov edx, dword [esp + 0x5c]
mov ecx, edi
and ecx, dword [esp + 0x40]
mov byte [ebx + ebp], al
call fcn.004f9ccf
push dword [esp + 0x20]
mov edx, dword [esp + 0x50]
mov ecx, edi
and ecx, dword [esp + 0x48]
mov byte [ebx + ebp + 1], al
call fcn.004f9ccf
mov byte [ebx + ebp + 2], al
add esp, 0xc
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4fa96c
push dword [esp + 0x48]
mov edx, dword [esp + 0x38]
and edi, eax
mov ecx, edi
call fcn.004f9ccf
pop ecx
jmp 0x4fa971
mov eax, 0xff
or dword [esp + 0x40], eax
mov ecx, dword [esp + 0x20]
mov byte [ebx + ebp + 3], al
add ebx, 4
mov eax, dword [esp + 0x1c]
inc ecx
mov dword [esp + 0x20], ecx
cmp ecx, dword [esi]
jl 0x4fa8f4
push 0x20
pop edi
mov edx, dword [esp + 0x60]
mov ecx, esi
call fcn.004f29b7
mov eax, dword [esp + 0x10]
mov ecx, dword [esi + 4]
inc eax
mov dword [esp + 0x10], eax
cmp eax, ecx
mov eax, dword [esp + 0x1c]
mov edx, ecx
jl 0x4fa7cb
cmp dword [esp + 0x40], 0
jne 0x4fa9dc
mov eax, dword [esi]
imul eax, ecx
lea eax, [eax*4 - 1]
test eax, eax
js 0x4fa9dc
mov byte [eax + ebp], 0xff
sub eax, 4
jns 0x4fa9d0
mov edx, dword [esi + 4]
cmp dword [esp + 0x4c], 0
jle 0x4faa45
xor edi, edi
test edx, 0xfffffffe
jle 0x4faa45
mov ecx, dword [esi]
sub edx, edi
and dword [esp + 0x4c], 0
mov eax, ecx
imul eax, edi
lea ebx, [eax*4]
mov eax, ecx
add ebx, ebp
shl eax, 2
dec edx
imul edx, ecx
lea edx, [edx*4]
add edx, ebp
test eax, eax
jle 0x4faa39
mov ebp, dword [esp + 0x4c]
sub ebx, edx
mov al, byte [edx]
inc ebp
mov cl, byte [edx + ebx]
mov byte [edx + ebx], al
mov byte [edx], cl
inc edx
mov eax, dword [esi]
shl eax, 2
cmp ebp, eax
jl 0x4faa20
mov ebp, dword [esp + 0x58]
mov edx, dword [esi + 4]
inc edi
mov eax, edx
sar eax, 1
cmp edi, eax
jl 0x4fa9ed
mov eax, dword [esi]
mov dword [0x65a614], eax
mov eax, dword [esi + 4]
mov dword [0x65a60c], eax
mov eax, dword [esi + 8]
mov dword [0x65a618], eax
mov eax, ebp
jmp 0x4faaa4
push ebp
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword fs:[0x2c]
pop ecx
mov eax, dword [eax]
mov dword [eax + 0xc], str.bad_masks
jmp 0x4faaa2
mov eax, dword fs:[0x2c]
mov eax, dword [eax]
mov dword [eax + 0xc], str.bad_offset
jmp 0x4faaa2
mov eax, dword fs:[0x2c]
mov eax, dword [eax]
mov dword [eax + 0xc], str.bad_header
xor eax, eax
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x478
ret