Function at 0x40ed40
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4628a0
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x4785d0]
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 edi, ecx
mov dword [ebp - 0x54], 0
mov dword [ebp - 4], 0
mov ebx, dword [ebp + 0x18]
xor ecx, ecx
test ebx, ebx
je 0x40ed99
cmp dword [ebp + 0x1c], 0x10
lea eax, [ebp + 8]
cmovae eax, dword [ebp + 8]
inc ecx
xor byte [eax + ecx - 1], 0x83
cmp ecx, ebx
jb 0x40ed84
push ebx
call fcn.0041aa39
cmp dword [ebp + 0x1c], 0x10
mov ecx, eax
lea eax, [ebp + 8]
cmovae eax, dword [ebp + 8]
push ebx
push eax
push ecx
mov dword [ebp - 0x48], ecx
call fcn.004201d0
add esp, 0x10
mov eax, ebx
cdq
shld edx, eax, 2
push 0
push 3
shl eax, 2
push edx
push eax
call fcn.0045fab0
mov ecx, eax
mov eax, 0x6bca1af3
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
imul eax, eax, 0x4c
mov edx, ecx
sub edx, eax
je 0x40ee03
and edx, 0x80000003
jns 0x40edf8
dec edx
or edx, 0xfffffffc
inc edx
je 0x40ee03
mov eax, 4
sub eax, edx
add ecx, eax
lea eax, [ecx + 1]
push eax
mov dword [ebp - 0x44], ecx
call fcn.0041aa39
add esp, 4
lea ecx, [ebp - 0x50]
push dword [ebp - 0x48]
mov dword [ebp - 0x50], 0
push eax
mov dword [ebp - 0x4c], 0
call fcn.00410340
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x28], 0
mov esi, dword [ebp - 0x50]
push ecx
lea eax, [ebp - 0x44]
mov edx, ebx
mov ebx, dword [ebp - 0x48]
push eax
push esi
mov ecx, ebx
call fcn.00401050
add esp, 0xc
test al, al
je 0x40ef1e
mov eax, dword [ebp - 0x44]
mov byte [esi + eax], 0
cmp byte [esi], 0
je 0x40ef1e
mov edi, edi
mov dword [ebp - 0x2c], 0xf
mov dword [ebp - 0x30], 0
mov byte [ebp - 0x40], 0
mov byte [ebp - 4], 3
mov cl, byte [esi]
movsx eax, cl
add eax, 0xffffffd5
cmp eax, 0x53
ja case.0x40ee9a.44
movzx eax, byte [eax + 0x40eff4]
jmp dword [eax*4 + 0x40efe0]
push 3
push 0x46d5a4
lea ecx, [ebp - 0x40]
call fcn.00407c90
jmp 0x40eef3
push 3
push 0x46d5a8
lea ecx, [ebp - 0x40]
call fcn.00407c90
jmp 0x40eef3
push 3
push 0x46d5ac
lea ecx, [ebp - 0x40]
call fcn.00407c90
jmp 0x40eef3
push 3
push 0x46d5b0
lea ecx, [ebp - 0x40]
call fcn.00407c90
jmp 0x40eef3
mov byte [ebp - 0x40], cl
mov dword [ebp - 0x30], 1
mov byte [ebp - 0x3f], 0
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x28]
call fcn.00407b90
cmp dword [ebp - 0x2c], 0x10
jb 0x40ef14
push dword [ebp - 0x40]
call fcn.0041a4c1
add esp, 4
inc esi
cmp byte [esi], 0
jne 0x40ee70
push ebx
call fcn.0041b043
mov dword [edi + 0x14], 0xf
mov dword [edi + 0x10], 0
mov byte [edi], 0
mov ecx, dword [ebp - 0x14]
add esp, 4
cmp ecx, 0x10
jae 0x40ef59
mov eax, dword [ebp - 0x18]
inc eax
je 0x40ef65
push eax
lea eax, [ebp - 0x28]
push eax
push edi
call fcn.00419440
mov ecx, dword [ebp - 0x14]
add esp, 0xc
jmp 0x40ef65
mov eax, dword [ebp - 0x28]
mov dword [edi], eax
mov dword [ebp - 0x28], 0
mov eax, dword [ebp - 0x18]
mov byte [ebp - 4], 0
mov esi, dword [ebp - 0x4c]
mov dword [edi + 0x10], eax
mov dword [edi + 0x14], ecx
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x28], 0
test esi, esi
je 0x40efb0
or ebx, 0xffffffff
lea ecx, [esi + 4]
mov eax, ebx
lock xadd dword [ecx], eax
jne 0x40efb0
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lea eax, [esi + 8]
lock xadd dword [eax], ebx
dec ebx
jne 0x40efb0
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
cmp dword [ebp + 0x1c], 0x10
jb 0x40efc1
push dword [ebp + 8]
call fcn.0041a4c1
add esp, 4
mov eax, edi
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.00419056
mov esp, ebp
pop ebp
ret