Function at 0x413903
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [ebp + 8]
push esi
mov esi, dword [0x41d294]
push edi
mov edi, ecx
mov dword [ebp - 0x10], eax
movzx eax, word [edi]
push eax
mov dword [ebp - 0x14], ecx
call esi
test eax, eax
pop ecx
je 0x413937
inc edi
inc edi
movzx eax, word [edi]
push eax
call esi
test eax, eax
pop ecx
jne 0x413927
mov dword [ebp - 0x14], edi
mov edi, dword [ebp - 0x10]
movzx eax, word [edi]
push eax
call esi
test eax, eax
pop ecx
je 0x413955
inc edi
inc edi
movzx eax, word [edi]
push eax
call esi
test eax, eax
pop ecx
jne 0x413945
mov dword [ebp - 0x10], edi
push edi
mov edi, dword [0x41d36c]
call edi
pop ecx
push dword [ebp - 0x14]
mov dword [ebp - 0xc], eax
call edi
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0xc]
test eax, eax
pop ecx
jbe 0x413997
mov ecx, dword [ebp - 0x10]
lea eax, [ecx + eax*2 - 2]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
movzx eax, word [eax]
push eax
call esi
test eax, eax
pop ecx
je 0x413997
dec dword [ebp - 0xc]
sub dword [ebp - 8], 2
cmp dword [ebp - 0xc], 0
ja 0x41397c
mov eax, dword [ebp - 4]
test eax, eax
jbe 0x4139c3
mov ecx, dword [ebp - 0x14]
lea eax, [ecx + eax*2 - 2]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
movzx eax, word [eax]
push eax
call esi
test eax, eax
pop ecx
je 0x4139c3
dec dword [ebp - 4]
sub dword [ebp - 8], 2
cmp dword [ebp - 4], 0
ja 0x4139a8
push dword [ebx + 0x38]
call edi
mov edi, eax
mov eax, dword [ebp - 4]
add eax, edi
add eax, dword [ebp - 0xc]
pop ecx
mov ecx, dword [ebx + 0x18]
lea eax, [ecx + eax*2 + 9]
and eax, 0xfffffffc
add eax, 0xa8
push eax
mov dword [ebp - 8], eax
call dword [0x41d354]
mov esi, eax
test esi, esi
pop ecx
je 0x413b99
push 0x30
push ebx
push esi
call fcn.00419cfc
mov eax, dword [ebp - 8]
mov dword [esi], eax
lea eax, [esi + 0xa8]
sub eax, esi
mov word [esi + 0x38], ax
add esp, 0xc
add edi, edi
lea eax, [edi + 2]
push eax
push dword [ebx + 0x38]
lea eax, [esi + 0xa8]
push eax
call fcn.00419cfc
lea edi, [esi + edi + 0xaa]
mov eax, edi
sub eax, esi
mov word [esi + 0x3a], ax
mov eax, dword [ebp - 0xc]
add esp, 0xc
add eax, eax
push eax
push dword [ebp - 0x10]
push edi
call fcn.00419cfc
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0xc]
and ecx, 0x3f
mov cx, word [ecx*2 + 0x42a138]
add eax, eax
add eax, edi
mov word [eax], cx
xor ecx, ecx
add esp, 0xc
cmp dword [ebp - 0xc], ecx
mov dword [ebp - 8], ecx
jbe 0x413a8c
lea edx, [edi + ecx*2]
and ecx, 0x3f
mov cx, word [ecx*2 + 0x42a138]
xor word [edx], cx
mov ecx, dword [ebp - 8]
inc ecx
cmp ecx, dword [ebp - 0xc]
mov dword [ebp - 8], ecx
jb 0x413a6f
lea edi, [eax + 2]
mov eax, edi
sub eax, esi
mov word [esi + 0x3c], ax
mov eax, dword [ebp - 4]
add eax, eax
push eax
push dword [ebp - 0x14]
push edi
call fcn.00419cfc
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 4]
add eax, eax
and ecx, 0x3f
mov cx, word [ecx*2 + 0x42a138]
xor edx, edx
add eax, edi
add esp, 0xc
cmp dword [ebp - 4], edx
mov word [eax], cx
mov dword [ebp - 8], edx
jbe 0x413ae8
lea ecx, [edi + edx*2]
and edx, 0x3f
mov dx, word [edx*2 + 0x42a138]
xor word [ecx], dx
mov edx, dword [ebp - 8]
inc edx
cmp edx, dword [ebp - 4]
mov dword [ebp - 8], edx
jb 0x413acb
add eax, 2
mov ecx, eax
sub ecx, esi
mov word [esi + 0x3e], cx
push dword [ebx + 0x18]
push dword [ebx + 0x30]
push eax
call fcn.00419cfc
add esp, 0xc
cmp dword [ebx + 4], 4
jge 0x413b39
push 0x1c
lea eax, [ebp - 0x30]
push eax
push dword [ebx + 0x3c]
call dword [0x41d094]
test eax, eax
je 0x413b39
push dword [ebp - 0x2c]
lea eax, [esi + 0x40]
push str.0x_X
push 0x14
push eax
call dword [0x41d34c]
add esp, 0x10
and word [esi + 0x66], 0
jmp 0x413b3e
and word [esi + 0x40], 0
mov edi, dword [0x41d2c4]
push 0x5c
push dword [ebx + 0x34]
call edi
push 0x2f
push dword [ebx + 0x34]
mov dword [ebp - 4], eax
call edi
add esp, 0x10
cmp dword [ebp - 4], eax
ja 0x413b60
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x413b6e
mov eax, dword [ebx + 0x34]
mov dword [ebp - 4], eax
jmp 0x413b72
add dword [ebp - 4], 2
push 0x20
push dword [ebp - 4]
lea eax, [esi + 0x68]
push eax
call dword [0x41d388]
and word [esi + 0xa6], 0
add esp, 0xc
push esi
call fcn.00413c5c
mov esi, eax
call fcn.00413810
pop edi
pop esi
leave
ret