Function at 0x10040398
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x10062242
call fcn.10060508
sub esp, 0x8c
cmp byte [ebp + 0xc], 0
mov eax, edx
push ebx
push esi
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x44], ecx
je 0x100403f6
cmp byte [ebp + 0x20], 0
je 0x100403cd
mov eax, dword [ebp + 0x14]
mov byte [eax], 1
jmp 0x10040669
mov edx, dword [ebp + 8]
mov dword [edx], 0
cmp dword [edx], 1
jge 0x10040669
mov esi, dword [ebp + 0x1c]
mov ecx, dword [edx]
mov eax, dword [esi]
or dword [eax + ecx*4], 0xffffffff
inc dword [edx]
cmp dword [edx], 1
jl 0x100403e2
jmp 0x10040669
cmp byte [ebp + 0x18], 0
je 0x10040663
xor ebx, ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 4], ebx
cmp dword [eax + 0x10], ebx
je 0x10040650
mov dword [ebp - 0x34], 0x3779
cmp dword [ebp - 0x34], 0x38f5
jle 0x1004044e
mov esi, ebx
mov edi, ebx
mov eax, edi
mov ecx, 0x1007c858
xor eax, esi
cdq
push edx
push eax
call fcn.10004668
inc edi
cmp edi, 0x57cc
jl 0x1004042b
inc esi
cmp esi, 0x7d9d
jl 0x10040429
push 0x2e
pop eax
mov word [ebp - 0x20], ax
xor eax, eax
mov byte [ebp - 4], 1
cmp dword [ebp - 0x34], 0x33c3
mov word [ebp - 0x1e], ax
jge 0x10040495
mov edx, str.dcib_qyvroctk_wtvep_irec_uhgne
mov ecx, 0x1007c858
call fcn.10006b3c
jmp 0x10040495
mov dword [ebp - 4], ebx
lea ecx, [ebp - 0x5c]
xor eax, eax
mov dword [ebp - 0x48], 7
mov word [ebp - 0x5c], ax
lea eax, [ebp - 0x20]
push eax
mov dword [ebp - 0x4c], ebx
call fcn.10004db8
mov edx, dword [ebp - 0x30]
lea eax, [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 3
call fcn.1003cc0b
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x5c]
mov byte [ebp - 4], 5
call fcn.10004e40
mov edi, dword [ebp - 0x28]
mov eax, edi
mov esi, dword [ebp - 0x2c]
sub eax, esi
push 0x18
cdq
pop ecx
idiv ecx
mov dword [ebp - 0x20], ebx
test eax, eax
jne 0x1004063e
push 0x2d
pop eax
push 2
mov ecx, ebx
mov dword [ebp - 0x18], 0x7c028a00
mov byte [ebp - 0x14], 0x69
mov word [ebp + 0xc], ax
pop esi
mov dword [ebp - 0x1c], ecx
cmp esi, 2
jne 0x1004051b
push 3
pop ecx
push ecx
mov dword [ebp - 0x1c], ecx
pop esi
jmp 0x10040574
movzx edx, byte [ebp + esi - 0x17]
mov eax, esi
sub eax, ecx
push 0x5138
push 0x5250
movzx eax, byte [ebp + eax - 0x1a]
movzx eax, word [ebp + eax*2 + 0xc]
mov ecx, eax
and eax, edx
or ecx, edx
mov edx, 0x2e0b
sub ecx, eax
movzx eax, byte [ebp + esi - 0x18]
mov word [ebp + eax*2 + 0xc], cx
lea eax, [ebp - 0x1c]
push eax
push 0x3d34
push 0x7b
push 1
push ebx
push 1
push 0x22b5
mov ecx, 0x3ed1
call fcn.1003d34f
mov ecx, dword [ebp - 0x1c]
add esp, 0x24
add esi, 2
cmp esi, 5
jb 0x1004050c
xor eax, eax
mov dword [ebp - 0x60], 7
mov word [ebp + 0xe], ax
lea ecx, [ebp - 0x74]
mov word [ebp - 0x74], ax
lea eax, [ebp + 0xc]
push eax
mov dword [ebp - 0x64], ebx
call fcn.10004db8
mov edx, dword [ebp - 0x30]
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], 6
call fcn.1003cc0b
pop ecx
mov esi, eax
lea eax, [ebp - 0x2c]
cmp eax, esi
je 0x100405d9
mov ecx, eax
call fcn.10041a9e
mov ecx, dword [esi]
mov dword [ebp - 0x2c], ecx
mov eax, dword [esi + 4]
mov dword [ebp - 0x28], eax
mov eax, dword [esi + 8]
mov dword [ebp - 0x24], eax
mov dword [esi], ebx
mov dword [esi + 4], ebx
mov dword [esi + 8], ebx
lea ecx, [ebp - 0x80]
call fcn.10041a9e
push ebx
push 1
lea ecx, [ebp - 0x74]
mov byte [ebp - 4], 5
call fcn.10004e40
mov edi, dword [ebp - 0x28]
mov esi, dword [ebp - 0x2c]
jmp 0x1004063e
push esi
lea ecx, [ebp - 0x98]
call fcn.100078fc
push 1
push ecx
lea eax, [ebp - 0x40]
mov byte [ebp - 4], 8
push eax
push 0x2c06
push ecx
push ecx
mov edx, 0x4cd2
lea ecx, [ebp - 0x98]
call fcn.1003d19e
add esp, 0x18
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x98]
push ebx
push 1
call fcn.10004e40
add esi, 0x18
cmp esi, edi
jne 0x100405f8
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], bl
call fcn.10041a9e
mov ecx, dword [ebp - 0x44]
lea eax, [ebp - 0x40]
push eax
call fcn.1004191c
lea ecx, [ebp - 0x40]
call fcn.10041b2e
jmp 0x10040669
mov eax, dword [ebp + 0x10]
and dword [eax], 0
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret