Function at 0x40e620
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x210
mov eax, dword [0x4fc00c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0x10]
lea eax, [ebp - 0x204]
push esi
push 0x200
push 0
push eax
mov dword [ebp - 0x208], ecx
mov dword [ebp - 0x210], ebx
call fcn.0047ebc0
push str.scr_MapiPiece
lea eax, [ebp - 0x204]
push 0x200
push eax
call fcn.00483128
add esp, 0x14
lea ecx, [ebp - 0x204]
call fcn.0044d1d0
push str..aibm
lea eax, [ebp - 0x204]
push 0x200
push eax
call fcn.00484a35
add esp, 0xc
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x204]
push eax
push 0x4dc30c
call fcn.004523e0
mov ecx, eax
call fcn.004526f0
mov esi, eax
test esi, esi
jne 0x40e6f9
lea edx, [ebp - 0x20c]
lea ecx, [ebp - 0x204]
call fcn.0044eb80
mov esi, eax
test esi, esi
jne 0x40e6f9
lea eax, [ebp - 0x204]
push eax
push str.open_failed__s
push ebx
call fcn.0044d1b0
add esp, 0xc
xor al, al
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0047d312
mov esp, ebp
pop ebp
ret 0xc
mov ebx, dword [ebp - 0x20c]
mov edx, 4
xor ecx, ecx
cmp ebx, edx
jbe 0x40e728
nop word [eax + eax]
mov al, byte [ecx + 0x4dd138]
xor byte [edx + esi], al
lea eax, [ecx + 1]
inc edx
cmp eax, 0x40
sbb ecx, ecx
and ecx, eax
cmp edx, ebx
jb 0x40e710
push edi
xor edi, edi
cmp ebx, 4
jb 0x40e739
mov eax, dword [esi]
mov edi, 4
jmp 0x40e73f
mov eax, dword [ebp - 0x20c]
cmp eax, 0x4d424941
je 0x40e75c
push eax
push str.label_error__x
push dword [ebp - 0x210]
call fcn.0044d1b0
jmp 0x40e844
lea ecx, [edi + 4]
cmp ecx, ebx
ja 0x40e76a
mov eax, dword [edi + esi]
mov edi, ecx
jmp 0x40e770
mov eax, dword [ebp - 0x20c]
test eax, eax
je 0x40e78a
push eax
push str.version_error__x
push dword [ebp - 0x210]
call fcn.0044d1b0
jmp 0x40e844
mov eax, dword [ebp - 0x208]
lea edx, [edi + 4]
cmp edx, ebx
ja 0x40e7a0
mov ecx, dword [edi + esi]
mov edi, edx
mov dword [eax], ecx
jmp 0x40e7a2
mov ecx, dword [eax]
push 4
push 0x3000
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, eax
mov eax, dword [ebp - 0x208]
mov dword [eax + 4], ecx
test ecx, ecx
jne 0x40e7c8
push str.piece_alloc_failed
jmp 0x40e834
mov edx, dword [eax]
lea eax, [edi + edx]
mov dword [ebp - 0x20c], eax
cmp eax, ebx
mov eax, dword [ebp - 0x208]
ja 0x40e7f7
push edx
lea eax, [edi + esi]
push eax
push ecx
call fcn.004803e0
mov edi, dword [ebp - 0x20c]
add esp, 0xc
mov eax, dword [ebp - 0x208]
lea edx, [edi + 1]
cmp edx, ebx
ja 0x40e808
mov cl, byte [edi + esi]
mov edi, edx
mov byte [eax + 8], cl
jmp 0x40e80b
mov cl, byte [eax + 8]
push 4
movzx eax, cl
push 0x3000
add eax, eax
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edx, eax
mov eax, dword [ebp - 0x208]
mov dword [eax + 0xc], edx
test edx, edx
jne 0x40e86a
push str.palm_alloc_failed
push 0x200
push dword [ebp - 0x210]
call fcn.00483128
add esp, 0xc
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0047d312
mov esp, ebp
pop ebp
ret 0xc
movzx ecx, byte [eax + 8]
add ecx, ecx
lea eax, [edi + ecx]
cmp eax, ebx
ja 0x40e885
push ecx
lea eax, [edi + esi]
push eax
push edx
call fcn.004803e0
add esp, 0xc
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov ecx, dword [ebp - 4]
mov al, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0047d312
mov esp, ebp
pop ebp
ret 0xc