Function at 0x401300
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
mov eax, dword [esp + 0x28]
push ebx
push esi
push edi
mov ecx, dword [eax]
xor ebx, ebx
mov dword [esp + 0x10], ecx
mov edi, 1
mov edx, dword [eax + 4]
push 0x49e468
mov dword [esp + 0x18], edx
push str.dataAISetting.dat
mov ecx, dword [eax + 8]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x20], ecx
mov ecx, 9
mov edx, dword [eax + 0xc]
mov eax, 0x1e
mov dword [esp + 0x24], edx
mov dword [0x4d9050], ebx
mov dword [0x4d7ea4], ecx
mov dword [0x4d7f30], edi
mov dword [0x4d7f1c], eax
mov dword [0x4d7ea8], 0xffffffff
mov dword [0x4d7f34], edi
mov dword [0x4d7f20], eax
mov dword [0x4d7eac], 0xffffffff
mov dword [0x4d7eb0], ecx
mov dword [0x4d7f3c], edi
mov dword [0x4d7eb4], 0x1a
mov dword [0x4d7f40], 4
mov dword [0x4d7f18], ebx
mov byte [0x4d7f54], bl
call fcn.00492394
mov esi, eax
add esp, 8
cmp esi, ebx
jne 0x401468
push 0x49e450
push str.dataAISetting.dat
call fcn.00492394
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x40145f
xor ecx, ecx
mov eax, 0x4c10bc
mov dl, byte [eax]
mov bl, byte [esp + ecx + 0x10]
xor bl, dl
sub eax, 4
mov byte [esp + ecx + 0x10], bl
inc ecx
cmp eax, 0x4c107c
jg 0x4013db
push esi
push edi
lea eax, [esp + 0x18]
push 0x10
push eax
call fcn.0049226a
push esi
push edi
push 4
push 0x4d9050
call fcn.0049226a
push esi
push edi
push 0x14
push 0x4d7ea4
call fcn.0049226a
push esi
push edi
push 0x14
push 0x4d7f30
call fcn.0049226a
add esp, 0x40
push esi
push edi
push 0x14
push 0x4d7f1c
call fcn.0049226a
push esi
push edi
push 4
push 0x4d7f18
call fcn.0049226a
push esi
push edi
push edi
push 0x4d7f54
call fcn.0049226a
push esi
call fcn.00492214
add esp, 0x34
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x24
ret
push esi
push 1
lea ecx, [esp + 0x28]
push 0x10
push ecx
call fcn.0049212c
add esp, 0x10
cmp eax, 1
jb 0x401505
xor ecx, ecx
mov eax, 0x4c10bc
mov dl, byte [eax]
sub eax, 4
xor byte [esp + ecx + 0x20], dl
inc ecx
cmp eax, 0x4c107c
jg 0x40148a
mov al, byte [esp + 0x2f]
lea edi, [esp + 0x20]
and al, 0xf
mov byte [esp + 0x2f], al
movsx eax, al
mov byte [esp + eax + 0x20], bl
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [edi]
jne 0x4014d8
cmp cl, bl
je 0x4014d4
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [edi + 1]
jne 0x4014d8
add eax, 2
add edi, 2
cmp cl, bl
jne 0x4014b4
xor eax, eax
jmp 0x4014dd
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x401591
push 1
push 0x45
push esi
call fcn.004920a0
add esp, 0xc
test eax, eax
jne 0x401625
inc dword [0x4d7f60]
jmp 0x401468
xor ecx, ecx
mov eax, 0x4c10bc
mov dl, byte [eax]
sub eax, 4
xor byte [esp + ecx + 0x10], dl
inc ecx
cmp eax, 0x4c107c
jg 0x40150c
push esi
push 1
lea eax, [esp + 0x18]
push 0x10
push eax
call fcn.0049226a
push esi
push 1
push 4
push 0x4d9050
call fcn.0049226a
push esi
push 1
push 0x14
push 0x4d7ea4
call fcn.0049226a
push esi
push 1
push 0x14
push 0x4d7f30
call fcn.0049226a
add esp, 0x40
push esi
push 1
push 0x14
push 0x4d7f1c
call fcn.0049226a
push esi
push 1
push 4
push 0x4d7f18
call fcn.0049226a
push esi
push 1
push 1
push 0x4d7f54
call fcn.0049226a
add esp, 0x30
jmp 0x401685
push esi
push 1
push 4
push 0x4d9050
call fcn.0049212c
add esp, 0x10
cmp eax, 1
jb 0x401625
push esi
push 5
push 4
push 0x4d7ea4
call fcn.0049212c
add esp, 0x10
cmp eax, 5
jb 0x401625
push esi
push 5
push 4
push 0x4d7f30
call fcn.0049212c
add esp, 0x10
cmp eax, 5
jb 0x401625
push esi
push 5
push 4
push 0x4d7f1c
call fcn.0049212c
add esp, 0x10
cmp eax, 5
jb 0x401625
push esi
push 1
push 4
push 0x4d7f18
call fcn.0049212c
add esp, 0x10
cmp eax, 1
jb 0x401625
push esi
push 1
push 1
push 0x4d7f54
call fcn.0049212c
add esp, 0x10
cmp eax, 1
jb 0x401625
mov dword [esp + 0xc], 1
jmp 0x401685
push esi
push 1
push 4
push 0x4d9050
call fcn.0049226a
push esi
push 1
push 0x14
push 0x4d7ea4
call fcn.0049226a
push esi
push 1
push 0x14
push 0x4d7f30
call fcn.0049226a
push esi
push 1
push 0x14
push 0x4d7f1c
call fcn.0049226a
add esp, 0x40
push esi
push 1
push 4
push 0x4d7f18
call fcn.0049226a
push esi
push 1
push 1
push 0x4d7f54
call fcn.0049226a
add esp, 0x20
push esi
call fcn.00492214
mov eax, dword [0x463087c]
add esp, 4
cmp eax, ebx
jne 0x40169d
mov byte [0x4d7f54], bl
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
add esp, 0x24
ret