Function at 0x403fba
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14c
cmp dword [ebp + 0xc], 0x100
push ebx
push esi
push edi
jbe 0x403fdd
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x400]
mov dword [ebp - 0x2c], ecx
jmp 0x403fe4
mov dword [ebp - 0x2c], 0x10
push 0x44
lea eax, [ebp - 0x84]
push 0
push eax
call fcn.00410fe8
add esp, 0xc
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov edx, dword [eax]
add eax, 4
inc dword [ebp + edx*4 - 0x84]
dec ecx
jne 0x403ffd
mov eax, dword [ebp + 0xc]
cmp dword [ebp - 0x84], eax
jne 0x404028
xor ecx, ecx
mov edx, dword [ebp + 0x1c]
mov eax, dword [ebp + 0x20]
mov dword [edx], ecx
mov dword [eax], ecx
jmp 0x40441e
mov ecx, 1
lea eax, [ebp - 0x80]
cmp dword [eax], 0
jne 0x404040
add eax, 4
inc ecx
lea edx, [ebp - 0x44]
cmp eax, edx
jbe 0x404030
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0xc], ecx
mov edx, ecx
cmp dword [eax], ecx
jae 0x40404e
mov dword [eax], edx
mov esi, 0x10
lea eax, [ebp - 0x44]
cmp dword [eax], 0
jne 0x404069
sub eax, 4
dec esi
lea edi, [ebp - 0x84]
cmp eax, edi
jne 0x404056
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x1c], esi
cmp dword [eax], esi
jbe 0x404075
mov dword [eax], esi
mov eax, 1
shl eax, cl
mov dword [ebp - 0x18], eax
cmp esi, ecx
jbe 0x4040a1
lea eax, [ebp + ecx*4 - 0x84]
mov edi, dword [eax]
sub dword [ebp - 0x18], edi
js 0x4040b9
add eax, 4
inc ecx
mov edi, dword [ebp - 0x18]
add edi, edi
cmp esi, ecx
mov dword [ebp - 0x18], edi
ja 0x40408a
lea ecx, [ebp + esi*4 - 0x84]
mov eax, dword [ecx]
sub dword [ebp - 0x18], eax
jns 0x4040c3
mov eax, 2
jmp 0x404420
mov eax, 2
jmp 0x404420
add eax, dword [ebp - 0x18]
xor edi, edi
dec esi
mov dword [ecx], eax
lea eax, [ebp - 0x80]
lea ecx, [ebp - 0x104]
mov dword [ebp - 0x108], edi
je 0x4040e9
add edi, dword [eax]
add eax, 4
mov dword [ecx], edi
add ecx, 4
dec esi
jne 0x4040dc
mov esi, dword [ebp + 8]
xor edi, edi
mov eax, dword [esi]
add esi, 4
test eax, eax
je 0x40410a
lea ecx, [ebp + eax*4 - 0x10c]
mov eax, dword [ecx]
inc eax
mov dword [ecx], eax
mov dword [eax*4 + 0x4174f4], edi
inc edi
cmp edi, dword [ebp + 0xc]
jb 0x4040ee
xor edi, edi
xor ebx, ebx
mov dword [ebp - 8], edi
mov dword [ebp - 0x10c], edi
mov dword [ebp - 0xc8], edi
mov dword [ebp - 0x14c], edi
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x28], 0x4174f8
mov dword [ebp - 0x20], 0xffffffff
cmp dword [ebp - 0x1c], edx
jl 0x4043e5
mov eax, dword [ebp - 0xc]
lea ecx, [ebp + eax*4 - 0x84]
mov dword [ebp - 0x40], ecx
mov eax, dword [ecx]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
dec dword [ebp - 0x30]
test eax, eax
je 0x4043d6
mov esi, dword [ebp - 0x20]
shl esi, 2
mov eax, dword [ebp + esi - 0xc4]
add eax, ebx
cmp eax, dword [ebp - 0xc]
jge 0x4042b1
mov eax, dword [ebp - 0x30]
inc eax
mov dword [ebp - 0x38], eax
add ebx, dword [ebp + esi - 0xc4]
add esi, 4
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp + 0x20]
sub edx, ebx
inc dword [ebp - 0x20]
mov eax, dword [eax]
cmp edx, eax
jbe 0x4041a2
mov edx, eax
mov eax, dword [ebp - 0xc]
sub eax, ebx
mov dword [ebp - 4], eax
mov eax, 1
mov cl, byte [ebp - 4]
shl eax, cl
cmp eax, dword [ebp - 0x38]
jbe 0x4041dd
mov ecx, dword [ebp - 0x30]
inc dword [ebp - 4]
inc ecx
sub eax, ecx
mov ecx, dword [ebp - 0x40]
cmp edx, dword [ebp - 4]
jbe 0x4041dd
add eax, eax
add ecx, 4
cmp eax, dword [ecx]
jbe 0x4041dd
sub eax, dword [ecx]
inc dword [ebp - 4]
cmp edx, dword [ebp - 4]
ja 0x4041ca
mov eax, dword [ebp - 4]
add eax, ebx
cmp eax, dword [ebp - 0x2c]
jbe 0x4041f4
cmp dword [ebp - 0x2c], ebx
jbe 0x4041f4
mov eax, dword [ebp - 0x2c]
sub eax, ebx
mov dword [ebp - 4], eax
mov eax, 1
mov cl, byte [ebp - 4]
shl eax, cl
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x24], eax
lea edx, [eax*8 + 8]
mov dword [ebp + esi - 0xc4], ecx
push edx
call fcn.00410f68
add esp, 4
test eax, eax
je 0x404403
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp + 0x1c]
push ebp
sbb al, 0x41
add eax, 4
add dword [0x430608], ecx
mov dword [ebp + 0x1c], eax
lea ecx, [eax + 4]
test esi, esi
mov dword [edx], ecx
mov dword [ebp - 0x3c], ecx
mov dword [eax], 0
invalid
invalid
invalid