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

Disassembly:
sub esp, 0x64
push ebx
mov ebx, dword [esp + 0x6c]
push ebp
push esi
push edi
mov esi, ecx
push ebx
call sym.YunImage.fne_protected:_bool___thiscall_CxImage::EncodeSafeCheck_class_CxFile__
test al, al
jne 0x1002e671
mov ecx, dword [esi + 0xc]
mov eax, 0xff
cmp ecx, eax
jg 0x1002e64c
cmp dword [esi + 0x10], eax
jg 0x1002e64c
mov ecx, esi
call sym.YunImage.fne_public:_struct_tagRGBQUAD____thiscall_CxImage::GetPalette_void_const
mov cx, word [esi + 0x16]
mov dword [esp + 0x20], eax
cmp cx, 8
ja 0x1002e2f1
test eax, eax
je 0x1002e671
mov eax, dword [esi + 0xc]
mov ebp, dword [esi + 0x10]
add eax, 0x1f
mov edi, dword [esi + 0x1c]
cdq
and edx, 0x1f
and ecx, 0xffff
add eax, edx
mov dword [esp + 0x14], ecx
sar eax, 5
shl eax, 2
imul ebp, eax
mov ecx, esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x18], edi
call sym.YunImage.fne_public:_bool___thiscall_CxImage::AlphaIsValid_void_
test al, al
je 0x1002e34d
mov ecx, dword [esi + 0x28]
xor eax, eax
cmp ecx, eax
jne 0x1002e355
mov edx, dword [esi + 0x10]
mov ecx, 0x20
imul edx, dword [esi + 0xc]
shl edx, 2
mov dword [esp + 0x18], edx
mov edi, edx
jmp 0x1002e359
mov ecx, dword [esp + 0x14]
xor eax, eax
jmp 0x1002e359
mov ecx, dword [esp + 0x14]
mov edx, 1
mov word [esp + 0x42], cx
mov word [esp + 0x36], dx
mov word [esp + 0x38], dx
mov dl, byte [esi + 0xc]
mov word [esp + 0x5a], cx
mov byte [esp + 0x3c], dl
mov dl, byte [esi + 0x10]
mov byte [esp + 0x3d], dl
mov dl, byte [esi + 0x28]
mov byte [esp + 0x3e], dl
mov edx, dword [esi + 0x28]
push 1
lea ecx, [esp + 0x38]
lea edx, [edi + edx*4 + 0x28]
mov word [esp + 0x38], ax
add edx, ebp
mov word [esp + 0x44], ax
mov dword [esp + 0x48], edx
mov edx, dword [esi + 0xc]
mov dword [esp + 0x54], edx
mov edx, dword [esi + 0x10]
mov dword [esp + 0x60], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
mov eax, dword [ebx]
push 6
push ecx
shl edx, 1
mov ecx, ebx
mov byte [esp + 0x4b], 0
mov dword [esp + 0x54], 0x16
mov dword [esp + 0x58], 0x28
mov dword [esp + 0x60], edx
mov word [esp + 0x64], 1
mov dword [esp + 0x6c], edi
call dword [eax + 0xc]
mov edx, dword [ebx]
push 1
lea eax, [esp + 0x40]
push 0x10
push eax
mov ecx, ebx
call dword [edx + 0xc]
mov edx, dword [ebx]
push 1
lea eax, [esp + 0x50]
push 0x28
push eax
mov ecx, ebx
call dword [edx + 0xc]
mov eax, dword [esp + 0x20]
test eax, eax
je 0x1002e42b
mov ecx, dword [esi + 0x28]
mov edx, dword [ebx]
shl ecx, 2
push 1
push ecx
push eax
mov ecx, ebx
call dword [edx + 0xc]
mov ecx, esi
call sym.YunImage.fne_public:_bool___thiscall_CxImage::AlphaIsValid_void_
test al, al
je 0x1002e4d4
mov eax, dword [esi + 0x28]
test eax, eax
jne 0x1002e4d4
mov ebp, dword [esi + 0x34]
push edi
call dword [sym.imp.MSVCRT.dll_malloc]
mov edi, eax
mov eax, dword [esi + 0x10]
add esp, 4
mov dword [esp + 0x20], edi
test eax, eax
mov dword [esp + 0x14], 0
jle 0x1002e4b5
mov eax, dword [esi + 0xc]
xor ebx, ebx
test eax, eax
jle 0x1002e49d
mov dl, byte [ebp]
mov byte [edi], dl
mov al, byte [ebp + 1]
inc edi
inc ebp
mov edx, dword [esp + 0x14]
mov byte [edi], al
mov cl, byte [ebp + 1]
inc edi
inc ebp
push edx
push ebx
mov byte [edi], cl
inc edi
mov ecx, esi
inc ebp
call sym.YunImage.fne_public:_unsigned_char___thiscall_CxImage::AlphaGet_long_int__long_int_
mov byte [edi], al
mov eax, dword [esi + 0xc]
inc edi
inc ebx
cmp ebx, eax
jl 0x1002e470
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0x10]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jl 0x1002e467
mov ebx, dword [esp + 0x78]
mov edi, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov eax, dword [ebx]
push 1
push ecx
push edi
mov ecx, ebx
call dword [eax + 0xc]
push edi
call dword [sym.imp.MSVCRT.dll_free]
mov ebp, dword [esp + 0x20]
add esp, 4
jmp 0x1002e4e2
mov eax, dword [esi + 0x34]
mov edx, dword [ebx]
push 1
push edi
push eax
mov ecx, ebx
call dword [edx + 0xc]
push 1
push ebp
call dword [sym.imp.MSVCRT.dll_calloc]
add esp, 8
mov dword [esp + 0x20], eax
test eax, eax
je 0x1002e671
lea ecx, [esp + 0x24]
push ecx
mov ecx, esi
call sym.YunImage.fne_public:_struct_tagRGBQUAD___thiscall_CxImage::GetTransColor_void_
mov ecx, dword [esi + 0x14c]
mov edx, dword [eax]
cmp ecx, 0xffffffff
mov ecx, esi
mov dword [esp + 0x24], edx
setne byte [esp + 0x13]
call sym.YunImage.fne_public:_bool___thiscall_CxImage::AlphaPaletteIsValid_void_
mov ecx, esi
mov byte [esp + 0x12], al
call sym.YunImage.fne_public:_bool___thiscall_CxImage::AlphaIsValid_void_
mov byte [esp + 0x11], al
mov eax, dword [esi + 0x10]
xor edi, edi
test eax, eax
mov dword [esp + 0x18], edi
jle 0x1002e627
mov dword [esp + 0x14], edi
mov eax, dword [esi + 0xc]
xor ebp, ebp
test eax, eax
jle 0x1002e605
mov al, byte [esp + 0x11]
xor ebx, ebx
test al, al
je 0x1002e56e
push edi
push ebp
mov ecx, esi
call sym.YunImage.fne_public:_unsigned_char___thiscall_CxImage::AlphaGet_long_int__long_int_
test al, al
jne 0x1002e56e
mov ebx, 1
mov al, byte [esp + 0x12]
test al, al
je 0x1002e592
push 1
push edi
lea eax, [esp + 0x34]
push ebp
push eax
mov ecx, esi
call sym.YunImage.fne_public:_struct_tagRGBQUAD___thiscall_CxImage::GetPixelColor_long_int__long_int__bool_
mov cl, byte [eax + 3]
test cl, cl
jne 0x1002e592
mov ebx, 1
push 0
push edi
lea ecx, [esp + 0x38]
push ebp
push ecx
mov ecx, esi
call sym.YunImage.fne_public:_struct_tagRGBQUAD___thiscall_CxImage::GetPixelColor_long_int__long_int__bool_
mov cl, byte [esp + 0x13]
mov eax, dword [eax]
test cl, cl
je 0x1002e5b7
cmp eax, dword [esp + 0x24]
jne 0x1002e5b7
mov ebx, 1
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
mov edi, ebp
sar edi, 3
add edi, edx
mov edx, ebp
add edi, ecx
and edx, 0x80000007
jns 0x1002e5d7
dec edx
or edx, 0xfffffff8
inc edx
mov ecx, 7
mov al, 1
sub ecx, edx
mov dl, byte [edi]
shl al, cl
and bl, 1
shl bl, cl
not al
and al, dl
or al, bl
inc ebp
mov byte [edi], al
mov eax, dword [esi + 0xc]
mov edi, dword [esp + 0x18]
cmp ebp, eax
jl 0x1002e552
mov ebx, dword [esp + 0x78]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x14]
mov eax, dword [esi + 0x10]
inc edi
add edx, ecx
cmp edi, eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], edx
jl 0x1002e545
mov ebp, dword [esp + 0x1c]
mov esi, dword [esp + 0x20]
mov edx, dword [ebx]
push 1
push ebp
push esi
mov ecx, ebx
call dword [edx + 0xc]
push esi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x64
ret 4
mov edi, 0x100c68bc
or ecx, 0xffffffff
xor eax, eax
lea edx, [esi + 0x44]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x64
ret 4