Function at 0x4cbf20
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xc
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
test eax, eax
sete dl
test edi, edi
sete al
or eax, edx
test al, 1
je 0x4cbf47
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [ebp + 8]
push eax
push eax
push edi
push esi
call fcn.004cbce0
mov eax, dword [edi + 8]
add esp, 0x10
test al, 8
jne 0x4cc14f
cmp byte [edi + 0x19], 3
je 0x4cc2aa
test al, 0x10
je 0x4cbfb3
mov eax, dword [ebp + 8]
test byte [eax + 0x72], 8
je 0x4cc2a2
mov al, byte [edi + 0x19]
cmp al, 3
je 0x4cc2bf
mov dx, word [edi + 0x16]
sub esp, 0xc
and eax, 0xff
push eax
mov eax, edx
and eax, 0xffff
push eax
lea eax, [edi + 0x50]
push eax
mov eax, dword [edi + 0x4c]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.004dc140
add esp, 0x20
mov eax, dword [edi + 8]
test al, 0x20
jne 0x4cc1ba
test al, 0x40
jne 0x4cc27f
test ah, 1
jne 0x4cc25d
test ah, 4
jne 0x4cc214
test ah, 0x40
jne 0x4cc1d9
test al, al
js 0x4cc198
test ah, 2
jne 0x4cc172
test ah, 0x20
je 0x4cc025
mov eax, dword [edi + 0xd8]
xor esi, esi
test eax, eax
jle 0x4cc025
mov eax, esi
push ebx
push ebx
mov ecx, dword [edi + 0xd4]
mov edx, dword [ebp + 8]
shl eax, 4
inc esi
add eax, ecx
push eax
push edx
call fcn.004dc680
add esp, 0x10
cmp dword [edi + 0xd8], esi
jg 0x4cc000
mov ecx, dword [edi + 0x30]
xor esi, esi
cmp ecx, 0
jle 0x4cc067
mov edx, dword [edi + 0x38]
mov ebx, esi
shl ebx, 4
mov eax, dword [ebx + edx]
test eax, eax
jle 0x4cc100
push eax
push eax
mov eax, dword [ebp + 8]
push str.Unable_to_write_international_text
push eax
call fcn.004d0530
mov edx, dword [edi + 0x38]
add esp, 0x10
mov dword [ebx + edx], 0xfffffffd
mov ecx, dword [edi + 0x30]
inc esi
cmp ecx, esi
jg 0x4cc032
mov eax, dword [edi + 0xc0]
test eax, eax
je 0x4cbf3f
mov ebx, dword [edi + 0xbc]
lea eax, [eax + eax*4]
lea eax, [ebx + eax*4]
cmp eax, ebx
jbe 0x4cbf3f
push eax
push eax
mov eax, dword [ebp + 8]
push ebx
push eax
call fcn.004c9e10
add esp, 0x10
mov edx, eax
cmp eax, 1
je 0x4cc0e5
mov al, byte [ebx + 0x10]
test al, al
je 0x4cc0e5
and eax, 0xff
test al, 2
je 0x4cc0e5
test al, 4
jne 0x4cc0e5
xor eax, eax
mov al, byte [ebx + 3]
shr eax, 5
cmp edx, 3
sete dl
or eax, edx
test al, 1
jne 0x4cc0d0
mov eax, dword [ebp + 8]
test byte [eax + 0x6e], 1
je 0x4cc0e5
mov eax, dword [ebx + 0xc]
push eax
mov eax, dword [ebx + 8]
push eax
mov eax, dword [ebp + 8]
push ebx
push eax
call fcn.004daff0
add esp, 0x10
mov eax, dword [edi + 0xc0]
mov edx, dword [edi + 0xbc]
add ebx, 0x14
lea eax, [eax + eax*4]
lea eax, [edx + eax*4]
jmp 0x4cc081
je 0x4cc123
inc eax
jne 0x4cc062
push 0
mov eax, dword [ebx + edx + 8]
push eax
mov ecx, dword [ebx + edx + 4]
mov edx, dword [ebp + 8]
push ecx
push edx
call fcn.004dc940
jmp 0x4cc052
sub esp, 0xc
push 0
push 0
mov eax, dword [ebx + edx + 8]
push eax
mov eax, dword [ebx + edx + 4]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.004dca10
mov edx, dword [edi + 0x38]
add esp, 0x20
mov dword [ebx + edx], 0xfffffffe
jmp 0x4cc05f
push ebx
mov ax, word [edi + 0x14]
mov edx, dword [ebp + 8]
and eax, 0xffff
push eax
mov ecx, dword [edi + 0x10]
push ecx
push edx
call fcn.004db8d0
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x4cbf6b
lea eax, [edi + 0x3c]
mov ecx, dword [ebp + 8]
push ebx
push ebx
push eax
push ecx
call fcn.004dce10
mov eax, dword [ebp + 8]
add esp, 0x10
mov edx, dword [eax + 0x68]
or dh, 2
mov dword [eax + 0x68], edx
mov eax, dword [edi + 8]
jmp 0x4cbfef
xor eax, eax
mov esi, dword [ebp + 8]
mov al, byte [edi + 0x78]
push eax
mov eax, dword [edi + 0x74]
push eax
mov eax, dword [edi + 0x70]
push eax
push esi
call fcn.004dcdb0
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x4cbfe6
push eax
xor eax, eax
mov al, byte [edi + 0x19]
push eax
lea eax, [edi + 0x5a]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.004dc270
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x4cbfbb
push ecx
push ecx
mov edx, dword [edi + 0xec]
push edx
mov eax, dword [edi + 0xe8]
push eax
mov eax, dword [edi + 0xe4]
push eax
mov eax, dword [edi + 0xe0]
push eax
xor eax, eax
mov al, byte [edi + 0xdc]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.004dcd30
add esp, 0x20
mov eax, dword [edi + 8]
jmp 0x4cbfde
mov eax, dword [edi + 0xb0]
mov ebx, dword [ebp + 8]
push eax
mov eax, dword [edi + 0xac]
push eax
xor eax, eax
mov al, byte [edi + 0xb5]
push eax
xor eax, eax
mov al, byte [edi + 0xb4]
push eax
mov eax, dword [edi + 0xa8]
push eax
mov eax, dword [edi + 0xa4]
push eax
mov esi, dword [edi + 0xa0]
push esi
push ebx
call fcn.004dcba0
add esp, 0x20
mov eax, dword [edi + 8]
jmp 0x4cbfd5
xor eax, eax
mov al, byte [edi + 0x6c]
push eax
mov edx, dword [edi + 0x68]
push edx
mov eax, dword [edi + 0x64]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.004dcb40
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x4cbfcc
push esi
mov ax, word [edi + 0x14]
mov ecx, dword [ebp + 8]
and eax, 0xffff
push eax
mov ebx, dword [edi + 0x7c]
push ebx
push ecx
call fcn.004dc3a0
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x4cbfc3
mov al, byte [edi + 0x19]
jmp 0x4cbf87
push eax
push eax
mov eax, dword [ebp + 8]
push str.Valid_palette_required_for_paletted_images
push eax
call fcn.004d0690
jmp 0x4cc167
mov dx, word [edi + 0x16]
xor ecx, ecx
test dx, dx
je 0x4cbf8b
mov eax, dword [edi + 0x4c]
xor byte [ecx + eax], 0xff
inc ecx
mov dx, word [edi + 0x16]
mov eax, edx
and eax, 0xffff
cmp eax, ecx
jg 0x4cc2ce
mov al, byte [edi + 0x19]
jmp 0x4cbf8b