Function at 0x402d10
Capabilities:
Encode data using xor

Disassembly:
push esi
push edi
push ebx
push ebp
sub esp, 8
mov ebp, eax
mov ebx, dword [esp + 0x28]
mov edi, edx
push dword [esp + 0x2c]
push ebp
push edi
push ebx
mov esi, ecx
call fcn.0044d38b
add esp, 0x10
test esi, esi
lea edx, [ebx + eax*4]
jne 0x402d5d
cmp edi, 1
je 0x402edc
cmp edi, 2
je 0x402ea9
cmp edi, 3
je 0x402e6c
cmp edi, 4
je 0x402e28
jmp 0x402d81
cmp edi, 1
je 0x402fb3
cmp edi, 2
je 0x402f80
cmp edi, 3
je 0x402f43
cmp edi, 4
je 0x402eff
cmp dword [0x48c430], 0
je 0x402e20
test ebp, ebp
jle 0x402e20
fld dword [0x460358]
fstp st(0)
fldz
fstp dword [esp]
xor esi, esi
fld1
fstp dword [esp + 4]
mov edi, ebx
fld dword [0x46035c]
fstp st(0)
mov ebx, eax
fld dword [0x460360]
fstp st(0)
fld dword [edi + esi*4]
fcom dword [esp + 4]
fnstsw ax
sahf
jb 0x402dd4
fstp st(0)
mov eax, 0x7fffffff
jmp 0x402e16
fld dword [0x460358]
fcomp st(1)
fnstsw ax
sahf
jb 0x402dea
fstp st(0)
mov eax, 0x80000000
jmp 0x402e16
fcom dword [esp]
fnstsw ax
sahf
jb 0x402e05
fmul dword [0x46035c]
fadd dword [0x460360]
call fcn.0040c080
jmp 0x402e16
fmul dword [0x46035c]
fsub dword [0x460360]
call fcn.0040c080
mov dword [edi + esi*4], eax
inc esi
cmp esi, ebp
jl 0x402dbf
mov eax, ebx
add esp, 8
pop ebp
pop ebx
pop edi
pop esi
ret
mov esi, eax
imul esi, edi
sub esi, edi
js 0x402d81
mov dword [esp], ebp
movzx ebp, byte [esi + ebx + 1]
shl ebp, 8
movzx ecx, byte [esi + ebx]
or ecx, ebp
movzx ebp, byte [esi + ebx + 2]
shl ebp, 0x10
or ecx, ebp
movzx ebp, byte [esi + ebx + 3]
shl ebp, 0x18
or ecx, ebp
mov dword [edx - 4], ecx
add edx, 0xfffffffc
sub esi, edi
jns 0x402e38
mov ebp, dword [esp]
jmp 0x402d81
mov esi, eax
imul esi, edi
sub esi, edi
js 0x402d81
mov dword [esp], ebp
movzx ecx, byte [esi + ebx]
movzx ebp, byte [esi + ebx + 1]
shl ecx, 8
shl ebp, 0x10
or ecx, ebp
movzx ebp, byte [esi + ebx + 2]
shl ebp, 0x18
or ecx, ebp
mov dword [edx - 4], ecx
add edx, 0xfffffffc
sub esi, edi
jns 0x402e7c
mov ebp, dword [esp]
jmp 0x402d81
mov ecx, eax
imul ecx, edi
sub ecx, edi
js 0x402d81
mov dword [esp], ebp
movzx esi, byte [ecx + ebx]
movzx ebp, byte [ecx + ebx + 1]
shl esi, 0x10
shl ebp, 0x18
or esi, ebp
mov dword [edx - 4], esi
add edx, 0xfffffffc
sub ecx, edi
jns 0x402eb9
mov ebp, dword [esp]
jmp 0x402d81
mov ecx, eax
imul ecx, edi
sub ecx, edi
js 0x402d81
movzx esi, byte [ecx + ebx]
shl esi, 0x18
mov dword [edx - 4], esi
add edx, 0xfffffffc
sub ecx, edi
jns 0x402ee9
jmp 0x402d81
mov esi, eax
imul esi, edi
sub esi, edi
js 0x402d81
mov dword [esp], ebp
movzx ecx, byte [esi + ebx]
movzx ebp, byte [esi + ebx + 1]
shl ecx, 0x18
shl ebp, 0x10
or ecx, ebp
movzx ebp, byte [esi + ebx + 2]
shl ebp, 8
or ecx, ebp
movzx ebp, byte [esi + ebx + 3]
or ecx, ebp
mov dword [edx - 4], ecx
add edx, 0xfffffffc
sub esi, edi
jns 0x402f0f
mov ebp, dword [esp]
jmp 0x402d81
mov esi, eax
imul esi, edi
sub esi, edi
js 0x402d81
mov dword [esp], ebp
movzx ecx, byte [esi + ebx]
movzx ebp, byte [esi + ebx + 1]
shl ecx, 0x18
shl ebp, 0x10
or ecx, ebp
movzx ebp, byte [esi + ebx + 2]
shl ebp, 8
or ecx, ebp
mov dword [edx - 4], ecx
add edx, 0xfffffffc
sub esi, edi
jns 0x402f53
mov ebp, dword [esp]
jmp 0x402d81
mov ecx, eax
imul ecx, edi
sub ecx, edi
js 0x402d81
mov dword [esp], ebp
movzx esi, byte [ecx + ebx]
movzx ebp, byte [ecx + ebx + 1]
shl esi, 0x18
shl ebp, 0x10
or esi, ebp
mov dword [edx - 4], esi
add edx, 0xfffffffc
sub ecx, edi
jns 0x402f90
mov ebp, dword [esp]
jmp 0x402d81
mov ecx, eax
imul ecx, edi
sub ecx, edi
js 0x402d81
movzx esi, byte [ecx + ebx]
xor esi, 0xffffff80
shl esi, 0x18
or esi, 0x7f0000
mov dword [edx - 4], esi
add edx, 0xfffffffc
sub ecx, edi
jns 0x402fc0
jmp 0x402d81