Function at 0x4ae640
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x631ecd
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x6a6040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
call fcn.00409430
mov ecx, dword [edi + 4]
lea edx, [ebp - 0x14]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 4], 0
mov edx, dword [edi + 0x18]
test dl, 1
jne 0x4ae8eb
mov ebx, dword [ebp + 8]
lea ecx, [edi + 4]
xor esi, esi
test dl, 2
jne 0x4ae7d5
mov eax, dword [ebx + 0xc]
lea ecx, [edi + 4]
xor eax, dword [ebx + 4]
xor edx, edx
xor eax, dword [ebx + 8]
xor eax, dword [ebx]
div dword [edi + 0x10]
mov eax, dword [edi + 0x14]
mov esi, dword [eax + edx*4]
lea eax, [eax + edx*4]
mov dword [ebp - 0x18], eax
test esi, esi
je 0x4ae7d3
mov edx, dword [ebx + 4]
xor ecx, ecx
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebx]
nop word [eax + eax]
cmp dword [esi + 4], ecx
jne 0x4ae6fa
cmp dword [esi + 8], edx
jne 0x4ae6fa
mov eax, dword [esi + 0xc]
cmp eax, dword [ebx + 8]
jne 0x4ae6fa
mov eax, dword [esi + 0x10]
cmp eax, dword [ebx + 0xc]
je 0x4ae70e
mov dword [ebp - 0x1c], esi
mov esi, dword [esi]
test esi, esi
jne 0x4ae6e0
mov esi, dword [ebp - 0x18]
lea ecx, [edi + 4]
jmp 0x4ae7d5
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x4ae71d
lea esi, [eax + 1]
jmp 0x4ae8f0
sub eax, 2
je 0x4ae764
sub eax, 0xc6
je 0x4ae73b
push dword [ebp + 0xc]
lea ecx, [esi + 0x14]
call fcn.005a5c40
xor esi, esi
jmp 0x4ae8f0
mov ecx, dword [esi + 0x14]
test ecx, ecx
je 0x4ae752
or eax, 0xffffffff
lock xadd dword [ecx], eax
dec eax
jne 0x4ae752
push ecx
call fcn.005a47b0
push dword [ebp + 0xc]
lea ecx, [esi + 0x14]
call fcn.005a5bd0
xor esi, esi
jmp 0x4ae8f0
push ecx
mov ecx, dword [ebp - 0x24]
lea eax, [edi + 4]
push eax
call fcn.004b2b10
mov dword [ebp - 0x14], eax
test eax, eax
je 0x4ae8eb
push dword [ebp + 0xc]
mov ecx, eax
push ebx
call fcn.004b29c0
mov eax, dword [ebp - 0x14]
mov ecx, dword [esi]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x14]
test ecx, ecx
jne 0x4ae79b
mov ecx, dword [ebp - 0x18]
add edi, 0x1c
mov dword [ecx], eax
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x14], esi
mov ecx, dword [edi]
cmp ecx, edi
je 0x4ae7cc
test ecx, ecx
je 0x4ae7cc
mov eax, dword [ecx]
xor ebx, ebx
cmp eax, edi
cmove eax, ebx
cmp dword [ecx + 8], ebx
je 0x4ae7c6
cmp dword [ecx + 0xc], esi
jne 0x4ae7c6
mov dword [ecx + 0xc], edx
mov ecx, eax
test eax, eax
jne 0x4ae7b0
xor esi, esi
jmp 0x4ae8f0
mov esi, eax
mov edx, dword [edi + 0xc]
mov eax, dword [edi + 8]
cmp edx, eax
jb 0x4ae8d9
mov esi, 2
lea ecx, [eax + eax]
cmp eax, esi
cmovb ecx, esi
cmp ecx, edx
jae 0x4ae7fe
mov esi, 3
jmp 0x4ae8f0
push dword [edi + 0x18]
mov eax, dword [edi]
push edi
push ecx
mov ecx, edi
call dword [eax + 8]
mov esi, eax
mov dword [ebp + 0x10], esi
test esi, esi
je 0x4ae8eb
mov cl, byte [esi + 0x18]
not cl
test cl, 1
je 0x4ae8eb
cmp dword [edi + 0x14], 0
je 0x4ae8af
cmp dword [edi + 0x10], 0
mov dword [ebp - 0x1c], 0
jbe 0x4ae8af
xor ecx, ecx
xor edx, edx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x20], edx
mov eax, dword [edi + 0x14]
mov ebx, dword [ecx + eax]
test ebx, ebx
je 0x4ae887
mov ecx, dword [ebp + 0x10]
mov esi, dword [ebx]
xor edx, edx
dec dword [edi + 0xc]
mov eax, dword [ebx + 0x10]
xor eax, dword [ebx + 0xc]
xor eax, dword [ebx + 8]
xor eax, dword [ebx + 4]
div dword [ecx + 0x10]
mov eax, dword [ecx + 0x14]
lea ecx, [eax + edx*4]
mov eax, dword [ecx]
mov dword [ebx], eax
mov dword [ecx], ebx
mov ebx, esi
mov ecx, dword [ebp + 0x10]
inc dword [ecx + 0xc]
test esi, esi
jne 0x4ae853
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x20]
mov eax, dword [edi + 0x14]
add ecx, 4
mov dword [ebp - 0x18], ecx
mov dword [edx + eax], 0
add edx, 4
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x1c], eax
cmp eax, dword [edi + 0x10]
jb 0x4ae846
mov esi, dword [ebp + 0x10]
mov ebx, dword [ebp + 8]
mov eax, dword [edi]
mov ecx, edi
push esi
call dword [eax + 4]
mov eax, dword [esi]
mov ecx, esi
push 1
call dword [eax + 0xc]
mov eax, dword [ebx + 0xc]
lea ecx, [edi + 4]
xor eax, dword [ebx + 4]
xor edx, edx
xor eax, dword [ebx + 8]
xor eax, dword [ebx]
div dword [edi + 0x10]
mov eax, dword [edi + 0x14]
lea esi, [eax + edx*4]
push ecx
push ecx
mov ecx, dword [ecx]
call fcn.004b2b10
mov edx, eax
mov dword [ebp - 0x14], edx
test edx, edx
jne 0x4ae91b
mov esi, 2
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x4ae905
push ecx
lea ecx, [ebp - 0x28]
push ecx
mov ecx, dword [ebp - 0x24]
push eax
call fcn.004b2a00
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebx]
mov ecx, dword [ebx + 4]
mov dword [edx + 4], eax
mov dword [edx + 8], ecx
mov eax, dword [ebx + 8]
mov ecx, dword [ebx + 0xc]
mov dword [edx + 0xc], eax
mov eax, dword [ebp + 0xc]
mov dword [edx + 0x10], ecx
mov eax, dword [eax]
test eax, eax
je 0x4ae940
lock inc dword [eax]
jmp 0x4ae942
xor eax, eax
mov ecx, 0x14
mov dword [edx + ecx], eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [esi]
mov dword [eax], ecx
mov eax, dword [ebp - 0x14]
mov dword [esi], eax
inc dword [edi + 0xc]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc