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

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
mov ebx, dword [ebp + 8]
test ebx, ebx
je 0x50c26c
push esi
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x50c26b
push esi
push ebx
call fcn.0050bdb9
test byte [esi + 8], 8
pop ecx
pop ecx
je 0x50c177
movzx eax, word [esi + 0x14]
push eax
push dword [esi + 0x10]
push ebx
call fcn.00518889
add esp, 0xc
test byte [esi + 8], 0x10
je 0x50c021
test dword [ebx + 0x74], 0x80000
je 0x50c007
cmp byte [esi + 0x19], 3
jne 0x50c007
xor eax, eax
xor ecx, ecx
cmp ax, word [esi + 0x16]
jae 0x50c007
mov eax, dword [esi + 0x4c]
or dl, 0xff
sub dl, byte [eax + ecx]
mov byte [eax + ecx], dl
movzx eax, word [esi + 0x16]
inc ecx
cmp ecx, eax
jl 0x50bff2
movzx eax, byte [esi + 0x19]
push eax
movzx eax, word [esi + 0x16]
push eax
lea eax, [esi + 0x50]
push eax
push dword [esi + 0x4c]
push ebx
call fcn.00518c80
add esp, 0x14
test byte [esi + 8], 0x20
je 0x50c039
movzx eax, byte [esi + 0x19]
push eax
lea eax, [esi + 0x5a]
push eax
push ebx
call fcn.00518d6e
add esp, 0xc
test byte [esi + 8], 0x40
je 0x50c050
movzx eax, word [esi + 0x14]
push eax
push dword [esi + 0x7c]
push ebx
call fcn.00518e55
add esp, 0xc
test dword [esi + 8], 0x100
je 0x50c06d
movzx eax, byte [esi + 0x6c]
push eax
push dword [esi + 0x68]
push dword [esi + 0x64]
push ebx
call fcn.0051933f
add esp, 0x10
test dword [esi + 8], 0x400
je 0x50c0ad
push dword [esi + 0xb0]
movzx eax, byte [esi + 0xb5]
push dword [esi + 0xac]
push eax
movzx eax, byte [esi + 0xb4]
push eax
push dword [esi + 0xa8]
push dword [esi + 0xa4]
push dword [esi + 0xa0]
push ebx
call fcn.005193a9
add esp, 0x20
test dword [esi + 8], 0x4000
je 0x50c0d3
push dword [esi + 0xe4]
movzx eax, byte [esi + 0xdc]
push dword [esi + 0xe0]
push eax
push ebx
call fcn.0051950d
add esp, 0x10
test byte [esi + 8], 0x80
je 0x50c0ed
movzx eax, byte [esi + 0x78]
push eax
push dword [esi + 0x74]
push dword [esi + 0x70]
push ebx
call fcn.005195a6
add esp, 0x10
push edi
mov edi, 0x200
test dword [esi + 8], edi
je 0x50c107
lea eax, [esi + 0x3c]
push eax
push ebx
call fcn.00519610
or dword [ebx + 0x6c], edi
pop ecx
pop ecx
test dword [esi + 8], 0x2000
je 0x50c13c
xor edi, edi
cmp dword [esi + 0xd8], edi
jle 0x50c13c
mov dword [ebp - 4], edi
mov eax, dword [esi + 0xd4]
add eax, dword [ebp - 4]
push eax
push ebx
call fcn.00519ff5
add dword [ebp - 4], 0x10
inc edi
pop ecx
pop ecx
cmp edi, dword [esi + 0xd8]
jl 0x50c11d
xor edi, edi
mov dword [ebp - 4], edi
cmp dword [esi + 0x30], edi
jle 0x50c1ed
push 0xfffffffffffffffd
pop ebx
mov eax, dword [esi + 0x38]
mov eax, dword [edi + eax]
test eax, eax
jle 0x50c18c
mov eax, dword [esi + 0x38]
add eax, edi
push dword [eax + 8]
push dword [eax + 0x18]
push dword [eax + 0x14]
push dword [eax + 4]
push dword [eax]
push dword [ebp + 8]
call fcn.005191eb
add esp, 0x18
jmp 0x50c1d2
cmp byte [esi + 0x19], 3
jne 0x50bfd3
push str.Valid_palette_required_for_paletted_images
push ebx
call fcn.0050d7d7
jne 0x50c1b5
mov eax, dword [esi + 0x38]
push dword [eax + edi]
push 0
push dword [eax + edi + 8]
push dword [eax + edi + 4]
push dword [ebp + 8]
call fcn.0051910b
mov eax, dword [esi + 0x38]
add esp, 0x14
mov dword [edi + eax], 0xfffffffe
jmp 0x50c1d8
cmp eax, 0xffffffff
jne 0x50c1d8
mov eax, dword [esi + 0x38]
push 0
push dword [eax + edi + 8]
push dword [eax + edi + 4]
push dword [ebp + 8]
call fcn.00519083
add esp, 0x10
mov eax, dword [esi + 0x38]
mov dword [edi + eax], ebx
inc dword [ebp - 4]
mov eax, dword [ebp - 4]
add edi, 0x1c
cmp eax, dword [esi + 0x30]
jl 0x50c14d
mov ebx, dword [ebp + 8]
mov eax, dword [esi + 0xc0]
test eax, eax
je 0x50c26a
mov ecx, dword [esi + 0xbc]
imul eax, eax, 0x14
add eax, ecx
cmp ecx, eax
jae 0x50c26a
lea edi, [ecx + 0x10]
lea eax, [edi - 0x10]
push eax
push ebx
call fcn.0050f7ea
pop ecx
pop ecx
cmp eax, 1
je 0x50c251
mov cl, byte [edi]
test cl, cl
je 0x50c251
test cl, 2
je 0x50c251
test cl, 0xc
jne 0x50c251
test byte [edi - 0xd], 0x20
jne 0x50c23e
cmp eax, 3
je 0x50c23e
test dword [ebx + 0x70], 0x10000
je 0x50c251
push dword [edi - 4]
lea eax, [edi - 0x10]
push dword [edi - 8]
push eax
push ebx
call fcn.00517f06
add esp, 0x10
mov eax, dword [esi + 0xc0]
imul eax, eax, 0x14
add eax, dword [esi + 0xbc]
add edi, 0x14
lea ecx, [edi - 0x10]
cmp ecx, eax
jb 0x50c209
pop edi
pop esi
pop ebx
leave
ret