Function at 0x40a128
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e31b6
mov eax, dword fs:[0]
push eax
mov eax, 0x4b2c
call fcn.004c3960
mov eax, dword [0x540698]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
xor esi, esi
mov dword [ebp - 0x4b34], ebx
mov dword [ebp - 0x4b38], esi
mov dword [ebp - 4], esi
mov dword [ebp - 0x4b30], esi
mov dword [ebp - 0x4b2c], esi
mov dword [ebp - 0x4b28], esi
push 0x4fa988
lea ecx, [ebp + 0xc]
mov byte [ebp - 4], 2
call fcn.00403865
test eax, eax
jne 0x40a20c
mov ecx, dword [0x541ad4]
mov eax, ecx
imul eax, ecx
imul eax, ecx
push 0x12
cdq
pop edi
idiv edi
cmp edx, 2
jne 0x40a1d6
push 0x1d
pop edi
jmp 0x40a1c6
mov eax, ecx
or eax, 0xffffff61
add ecx, eax
mov eax, ecx
imul eax, ecx
inc esi
cmp esi, eax
jg 0x40a1d0
mov eax, ecx
cdq
idiv edi
cmp edx, 0x5c
jne 0x40a1b3
mov dword [0x541ad4], esi
lea eax, [ebp - 0x4b30]
push eax
mov ecx, ebx
call fcn.00409f66
lea ecx, [ebp - 0x4b30]
call fcn.00406958
mov ecx, dword [ebp + 0xc]
add ecx, 0xfffffff0
call fcn.00404fef
mov ecx, dword [ebp + 0x10]
add ecx, 0xfffffff0
call fcn.00404fef
mov eax, ebx
jmp 0x40a3f5
mov edi, dword [0x541ad4]
push 0xf
lea ecx, [edi + 1]
lea eax, [edi + 2]
imul eax, ecx
imul eax, edi
cdq
pop ecx
idiv ecx
mov ebx, esi
mov dword [ebp - 0x4b24], ebx
cmp edx, 0xd
jne 0x40a256
mov edx, esi
push 8
mov ecx, edx
pop ebx
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, edi
sar ecx, 1
xor ecx, eax
dec ebx
jne 0x40a238
add edi, ecx
inc edx
cmp edx, 0x100
jl 0x40a233
mov ebx, esi
lea ecx, [edi + 1]
lea eax, [edi + 2]
imul eax, ecx
imul eax, edi
cdq
mov dword [ebp - 0x4b1c], 0xe
idiv dword [ebp - 0x4b1c]
cmp edx, 0xd
cmove edi, ecx
mov dword [0x541ad4], edi
push ebx
push dword [ebp + 0x10]
lea ecx, [ebp + 0xc]
call fcn.004039d8
mov ebx, eax
mov dword [ebp - 0x4b1c], eax
call fcn.0040b9fd
test al, al
jne 0x40a2a2
inc dword [0x541ad4]
cmp ebx, 0xffffffff
jne 0x40a2b3
mov eax, dword [ebp + 0xc]
mov ebx, dword [eax - 0xc]
mov dword [ebp - 0x4b1c], ebx
mov ecx, dword [ebp - 0x4b24]
mov eax, ebx
sub eax, ecx
push eax
push ecx
lea eax, [ebp - 0x4b20]
push eax
lea ecx, [ebp + 0xc]
call fcn.00404de0
lea eax, [ebp - 0x4b20]
push eax
lea ecx, [ebp - 0x4b30]
mov byte [ebp - 4], 3
call fcn.00408509
mov eax, dword [ebp + 0xc]
cmp ebx, dword [eax - 0xc]
jge 0x40a3ae
call fcn.0040bb07
test al, al
jne 0x40a369
xor eax, eax
push 0x4b06
mov word [ebp - 0x4b18], ax
lea eax, [ebp - 0x4b16]
push esi
push eax
call fcn.004c3990
add esp, 0xc
mov ebx, esi
mov edi, esi
mov edx, esi
test ebx, ebx
je 0x40a345
test edx, edx
je 0x40a345
lea eax, [edi + edx]
lea ecx, [edi + edx]
mov ax, word [ebp + eax*2 - 0x4bdc]
inc ax
add ax, word [ebp + ecx*2 - 0x4b1a]
mov word [ebp + ecx*2 - 0x4b18], ax
inc edx
cmp edx, 0x62
jl 0x40a31d
add edi, 0x62
inc ebx
cmp edi, 0x2584
jl 0x40a31b
movsx edx, word [ebp - 0x12]
mov ebx, dword [ebp - 0x4b1c]
mov dword [0x541ad4], edx
jmp 0x40a36f
mov edx, dword [0x541ad4]
lea ecx, [edx + 1]
lea eax, [edx + 2]
imul eax, ecx
imul eax, edx
push 0x16
cdq
pop ecx
idiv ecx
inc ebx
mov dword [ebp - 0x4b24], ebx
cmp edx, 9
jne 0x40a397
call fcn.004c2f1b
mov dword [0x541ad4], eax
mov ecx, dword [ebp - 0x4b20]
mov byte [ebp - 4], 2
lea ecx, [ecx - 0x10]
call fcn.00404fef
jmp 0x40a27f
mov ecx, dword [ebp - 0x4b20]
lea ecx, [ecx - 0x10]
call fcn.00404fef
mov ecx, dword [ebp - 0x4b34]
lea eax, [ebp - 0x4b30]
push eax
call fcn.00409f66
lea ecx, [ebp - 0x4b30]
call fcn.00406958
mov ecx, dword [ebp + 0xc]
lea ecx, [ecx - 0x10]
call fcn.00404fef
mov ecx, dword [ebp + 0x10]
lea ecx, [ecx - 0x10]
call fcn.00404fef
mov eax, dword [ebp - 0x4b34]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004c29c4
leave
ret