Function at 0x404b80
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 0x404ba7
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.00404940
mov eax, dword [edi + 8]
add esp, 0x10
test al, 8
jne 0x404daf
cmp byte [edi + 0x19], 3
je 0x404f0a
test al, 0x10
je 0x404c13
mov eax, dword [ebp + 8]
test byte [eax + 0x72], 8
je 0x404f02
mov al, byte [edi + 0x19]
cmp al, 3
je 0x404f1f
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.00414da0
add esp, 0x20
mov eax, dword [edi + 8]
test al, 0x20
jne 0x404e1a
test al, 0x40
jne 0x404edf
test ah, 1
jne 0x404ebd
test ah, 4
jne 0x404e74
test ah, 0x40
jne 0x404e39
test al, al
js 0x404df8
test ah, 2
jne 0x404dd2
test ah, 0x20
je 0x404c85
mov eax, dword [edi + 0xd8]
xor esi, esi
test eax, eax
jle 0x404c85
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.004152e0
add esp, 0x10
cmp dword [edi + 0xd8], esi
jg 0x404c60
mov ecx, dword [edi + 0x30]
xor esi, esi
cmp ecx, 0
jle 0x404cc7
mov edx, dword [edi + 0x38]
mov ebx, esi
shl ebx, 4
mov eax, dword [ebx + edx]
test eax, eax
jle 0x404d60
push eax
push eax
mov eax, dword [ebp + 8]
push str.Unable_to_write_international_text
push eax
call fcn.00409190
mov edx, dword [edi + 0x38]
add esp, 0x10
mov dword [ebx + edx], 0xfffffffd
mov ecx, dword [edi + 0x30]
inc esi
cmp ecx, esi
jg 0x404c92
mov eax, dword [edi + 0xc0]
test eax, eax
je 0x404b9f
mov ebx, dword [edi + 0xbc]
lea eax, [eax + eax*4]
lea eax, [ebx + eax*4]
cmp eax, ebx
jbe 0x404b9f
push eax
push eax
mov eax, dword [ebp + 8]
push ebx
push eax
call fcn.00402a70
add esp, 0x10
mov edx, eax
cmp eax, 1
je 0x404d45
mov al, byte [ebx + 0x10]
test al, al
je 0x404d45
and eax, 0xff
test al, 2
je 0x404d45
test al, 4
jne 0x404d45
xor eax, eax
mov al, byte [ebx + 3]
shr eax, 5
cmp edx, 3
sete dl
or eax, edx
test al, 1
jne 0x404d30
mov eax, dword [ebp + 8]
test byte [eax + 0x6e], 1
je 0x404d45
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.00413c50
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 0x404ce1
je 0x404d83
inc eax
jne 0x404cc2
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.004155a0
jmp 0x404cb2
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.00415670
mov edx, dword [edi + 0x38]
add esp, 0x20
mov dword [ebx + edx], 0xfffffffe
jmp 0x404cbf
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.00414530
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x404bcb
lea eax, [edi + 0x3c]
mov ecx, dword [ebp + 8]
push ebx
push ebx
push eax
push ecx
call fcn.00415a70
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 0x404c4f
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.00415a10
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x404c46
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.00414ed0
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x404c1b
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.00415990
add esp, 0x20
mov eax, dword [edi + 8]
jmp 0x404c3e
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.00415800
add esp, 0x20
mov eax, dword [edi + 8]
jmp 0x404c35
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.004157a0
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x404c2c
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.00415000
add esp, 0x10
mov eax, dword [edi + 8]
jmp 0x404c23
mov al, byte [edi + 0x19]
jmp 0x404be7
push eax
push eax
mov eax, dword [ebp + 8]
push str.Valid_palette_required_for_paletted_images
push eax
call fcn.004092f0
jmp 0x404dc7
mov dx, word [edi + 0x16]
xor ecx, ecx
test dx, dx
je 0x404beb
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 0x404f2e
mov al, byte [edi + 0x19]
jmp 0x404beb