Function at 0x405870
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x14]
sub esp, 0x10
mov edx, dword [esp + 0x20]
push ebx
push esi
push edi
push ebp
xor esi, esi
lea ebx, [edx + eax*2]
mov edx, dword [esp + 0x28]
mov eax, ebx
mov ebp, dword [0x45f100]
shl eax, 5
sub eax, ebx
cmp ebp, esi
lea ecx, [edx + eax*4 + 0x2c]
mov dword [esp + 0x14], ecx
je 0x4058e9
mov dword [0x4eb4f0], esi
mov eax, 0x4eb4f0
mov edi, 0x4eb240
mov ecx, 0x54
mov dword [eax + 4], esi
mov dword [eax + 8], esi
mov dword [eax + 0xc], esi
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, 0x4eb3a0
mov ecx, 0x54
rep stosd dword es:[edi], eax
mov dword [0x4eb390], esi
mov eax, 0x4eb390
mov dword [0x45f100], esi
mov dword [eax + 4], esi
mov dword [eax + 8], esi
mov dword [eax + 0xc], esi
push 0x240
xor edi, edi
mov ecx, dword [esp + 0x28]
push edi
push ecx
call fcn.00406e00
add esp, 0xc
call fcn.00413690
mov ecx, 0x240
mov dword [ebx*4 + 0x4eb390], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], edi
fld dword [esp + 0x18]
fld dword [eax]
fmul dword [eax]
add eax, 4
dec ecx
faddp st(1)
jne 0x40591f
fcom qword [0x41a140]
fstp dword [esp + 0x18]
fnstsw ax
test ah, 0x40
je 0x405949
mov dword [ebx*4 + 0x4eb4f0], 0
jmp 0x405963
fldln2
fld dword [esp + 0x18]
fyl2x
fmul dword [0x45f104]
call fcn.00413690
mov dword [ebx*4 + 0x4eb4f0], eax
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 0x14]
test ecx, ecx
je 0x40597a
mov ecx, dword [eax + 0x18]
cmp ecx, 2
je 0x405a42
lea eax, [ebx + ebx*4]
mov ebp, dword [esp + 0x2c]
mov dword [esp + 0x10], 0x15
lea ecx, [ebx + eax*4]
mov edi, dword [0x45f0f4]
add edi, 4
lea ebx, [ecx*4]
add ebp, ebx
mov eax, dword [edi]
mov edx, dword [edi - 4]
mov dword [esp + 0x18], 0
cmp edx, eax
jge 0x4059cc
fld dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
sub eax, edx
lea ecx, [ecx + edx*4]
fld dword [ecx]
fmul dword [ecx]
add ecx, 4
dec eax
faddp st(1)
jne 0x4059bc
fstp dword [esp + 0x18]
mov eax, dword [esp + 0x18]
test eax, 0x7fffffff
jne 0x4059e3
mov dword [ebx + 0x4eb240], 0
jmp 0x4059fc
fldln2
fld dword [esp + 0x18]
fyl2x
fmul dword [0x45f104]
call fcn.00413690
mov dword [ebx + 0x4eb240], eax
mov eax, dword [ebp]
test eax, 0x7fffffff
jne 0x405a12
mov dword [ebx + 0x4eb3a0], 0
jmp 0x405a2a
fldln2
fld dword [ebp]
fyl2x
fmul dword [0x45f104]
call fcn.00413690
mov dword [ebx + 0x4eb3a0], eax
add ebx, 4
add ebp, 4
add edi, 4
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
jne 0x40599e
mov eax, dword [esp + 0x34]
cmp eax, 1
jne 0x405bba
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x14]
lea ecx, [edx*8 + 0x4eb390]
mov ebx, dword [eax + 0x14]
mov edx, 2
mov edi, edx
fild dword [ecx]
fcomp qword [0x41a140]
fnstsw ax
test ah, 0x40
jne 0x405a78
inc esi
test ebx, ebx
je 0x405a85
mov eax, dword [esp + 0x14]
cmp dword [eax + 0x18], edx
je 0x405a86
inc esi
add ecx, 4
dec edi
jne 0x405a68
mov edx, dword [esp + 0x30]
inc esi
xor edi, edi
lea eax, [edx + edx*4]
lea ecx, [edx + eax*4]
lea ebx, [ecx*8 + 0x4eb240]
mov ecx, 0x15
mov eax, dword [ebx]
mov edx, dword [ebx + 0x54]
sub eax, edx
add ebx, 4
cdq
xor eax, edx
sub edi, edx
add edi, eax
dec ecx
jne 0x405aa5
cmp edi, 0x64
jge 0x405abf
inc esi
cmp esi, 6
jne 0x405b99
xor ecx, ecx
mov eax, dword [esp + 0x30]
shl eax, 4
mov edx, dword [esp + 0x28]
mov dword [esp + 0x14], 0x45f0e4
lea ebx, [eax + edx + 0xc]
mov dword [esp + 0x10], ebx
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
xor esi, esi
xor edi, edi
mov dword [eax], esi
mov eax, dword [edx - 4]
mov ebx, dword [edx]
cmp ebx, eax
jle 0x405b3e
mov edx, dword [esp + 0x30]
sub ebx, eax
lea ebp, [edx + edx*4]
lea ebp, [edx + ebp*4]
lea ebp, [eax + ebp*2]
shl ebp, 2
mov eax, dword [ebp + 0x4eb240]
mov edx, dword [ebp + 0x4eb294]
sub eax, edx
add ebp, 4
cdq
xor eax, edx
sub esi, edx
add esi, eax
mov edx, dword [ebp + 0x4eb3f0]
mov eax, dword [ebp + 0x4eb39c]
sub eax, edx
cdq
xor eax, edx
sub edi, edx
add edi, eax
dec ebx
jne 0x405b0e
cmp esi, 0xa
jge 0x405b65
cmp edi, 0xa
jge 0x405b65
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x1c]
mov dword [eax], 1
mov eax, 1
shl eax, cl
or edx, eax
mov dword [esp + 0x1c], edx
jmp 0x405b6f
mov eax, dword [esp + 0x10]
mov dword [eax], 0
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
add eax, 4
add edx, 4
inc ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edx
cmp eax, 0x45f0f4
jb 0x405ae5
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x10
ret
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x28]
shl eax, 4
xor ecx, ecx
mov dword [eax + edx + 0xc], ecx
mov dword [eax + edx + 0x10], ecx
mov dword [eax + edx + 0x14], ecx
mov dword [eax + edx + 0x18], ecx
lea eax, [eax + edx + 0xc]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x10
ret