Function at 0x404002
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x51f710
call fcn.004512a8
sub esp, 0x8c
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x10], ebx
mov byte [ebp - 4], 1
mov esi, dword [ebp + 8]
push ecx
lea eax, [ebp + 0x10]
mov ecx, esp
mov dword [ebp + 8], esp
push eax
cmp dword [esi + 0xc], ebx
je 0x404072
call fcn.0040215e
mov byte [ebp - 4], 2
mov byte [ebp - 4], 1
call fcn.00403bb8
pop ecx
mov edi, eax
push edi
lea ecx, [ebp - 0x10]
call fcn.004035b7
push dword [ebp - 0x10]
lea eax, [ebp + 0x10]
push ecx
mov ecx, esp
mov dword [ebp + 8], esp
push eax
call fcn.0040215e
mov byte [ebp - 4], 3
mov byte [ebp - 4], 1
call fcn.00403d68
jmp 0x4040af
call fcn.0040215e
mov byte [ebp - 4], 4
mov byte [ebp - 4], 1
call fcn.00403b81
pop ecx
mov edi, eax
push edi
lea ecx, [ebp - 0x10]
call fcn.004035b7
push dword [ebp - 0x10]
lea eax, [ebp + 0x10]
push ecx
mov ecx, esp
mov dword [ebp + 8], esp
push eax
call fcn.0040215e
mov byte [ebp - 4], 5
mov byte [ebp - 4], 1
call fcn.00403ccc
pop ecx
pop ecx
mov ecx, dword [esi + 0x18]
cmp dword [esi + 0x30], ebx
je 0x404153
lea eax, [ecx + 5]
cmp edi, eax
je 0x4040f6
xor esi, esi
mov byte [ebp - 4], 0
push dword [ebp - 0x10]
call fcn.00450d90
and dword [ebp - 0x10], 0
pop ecx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x10]
call fcn.00402189
mov ecx, dword [ebp - 0xc]
pop edi
mov eax, esi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret 0xc
mov eax, dword [ebp - 0x10]
add eax, ecx
xor edi, edi
cmp ecx, ebx
mov dword [ebp + 8], eax
jle 0x40411f
mov eax, edi
cdq
push 5
pop ebx
idiv ebx
mov eax, edx
mov edx, dword [ebp - 0x10]
add eax, ecx
add eax, edx
mov dl, byte [edi + edx]
xor byte [eax], dl
inc edi
cmp edi, ecx
jl 0x404104
push dword [ebp - 0x10]
lea ecx, [esi + 0x14]
push 5
push dword [ebp + 8]
call fcn.004323ff
test al, al
je 0x4040c4
mov esi, dword [ebp + 0xc]
push 5
push dword [ebp + 8]
push esi
call fcn.004513b0
add esp, 0xc
mov dword [esi + 0x10], 0x3fe
xor esi, esi
inc esi
jmp 0x4040c6
cmp edi, ecx
jne 0x4040c4
mov ecx, dword [ebp + 0xc]
lea eax, [ebp - 0x14]
push eax
call fcn.00403f25
mov byte [ebp - 4], 6
push ebx
lea ecx, [ebp - 0x14]
call fcn.004021dc
push 0xfde9
push eax
lea ecx, [ebp - 0x98]
call fcn.00403adc
mov byte [ebp - 4], 7
push dword [ebp - 0x98]
call fcn.00452130
pop ecx
mov edi, eax
mov dword [ebp + 8], ebx
mov byte [ebp - 4], 8
push edi
lea ecx, [ebp + 8]
call fcn.004035b7
mov ebx, dword [ebp + 8]
push edi
push dword [ebp - 0x98]
push ebx
call fcn.004513b0
add esp, 0xc
push dword [ebp - 0x10]
lea ecx, [esi + 0x14]
push edi
push ebx
call fcn.004323ff
test al, al
je 0x404218
fld dword [esi + 4]
push ecx
mov ecx, dword [ebp + 0xc]
fstp dword [esp]
call fcn.00403508
mov byte [ebp - 4], 7
push ebx
call fcn.00450d90
and dword [ebp + 8], 0
pop ecx
mov byte [ebp - 4], 6
lea eax, [ebp - 0x94]
cmp dword [ebp - 0x98], eax
je 0x404207
push dword [ebp - 0x98]
call fcn.00451e8b
pop ecx
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x14]
call fcn.00402189
jmp 0x40414b
mov byte [ebp - 4], 7
push ebx
call fcn.00450d90
and dword [ebp + 8], 0
pop ecx
mov byte [ebp - 4], 6
lea eax, [ebp - 0x94]
cmp dword [ebp - 0x98], eax
je 0x404245
push dword [ebp - 0x98]
call fcn.00451e8b
pop ecx
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x14]
call fcn.00402189
jmp 0x4040c4