Function at 0x10130ff
Capabilities:
Allocate or change rwx memory
Encode data using xor
Encrypt data using salsa20 or chacha

Disassembly:
push edi
pushfd
push ebp
mov ebp, esp
sub esp, 0x124
mov dword [ebp - 0x11c], eax
mov dword [ebp - 0x114], ecx
mov dword [ebp - 0x120], edx
mov dword [ebp - 0x118], ebx
mov ecx, 0xfffffff
mov dword [ebp - 0x124], esi
mov dword [ebp - 0x110], edi
lea edi, [ebp + 4]
sub edi, 4
mov dword [ebp - 0xc4], edi
add edi, 0xc
mov esi, dword [edi]
mov eax, dword [esi + 4]
mov ebx, dword [esi]
shr ebx, 2
and eax, ecx
and ebx, ecx
xor edx, edx
mov ecx, dword [0x10d4588]
mov dword [ebp - 0x68], ecx
lea ecx, [ecx + eax - 1]
mov eax, ecx
div dword [ebp - 0x68]
add ebx, 0x1000000
sub ecx, edx
mov eax, dword [0x10d4588]
mov dword [ebp - 0xb8], edi
mov dword [ebp - 0xc8], ebx
mov dword [ebp - 0x70], ecx
mov eax, dword [0x10f17c8]
mov dword [ebp - 0x6c], eax
mov eax, dword [0x10d4588]
mov eax, dword [0x10f17c8]
test eax, eax
je 0x1013231
and dword [ebp - 0x64], 0
mov eax, dword [0x10f17c8]
dec eax
lea ecx, [eax + 1]
xor eax, eax
mov dword [ebp - 0x5c], ecx
test ecx, ecx
je 0x10131da
mov edx, dword [0x113b250]
shr dword [ebp - 0x5c], 0x10
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [0x113b250], edx
shr edx, 0x10
shl eax, 0x10
or eax, edx
cmp dword [ebp - 0x5c], 0
jne 0x10131b0
xor edx, edx
div ecx
cmp dword [ebp - 0x6c], 0
mov dword [ebp - 0x5c], edx
jbe 0x1013223
mov eax, 0x23ad
inc dword [ebp - 0x64]
lea edx, [edx*4 + 0x113b06c]
mov ecx, 0xffffdc52
lock cmpxchg dword [edx], ecx
cmp eax, 0x23ad
je 0x10136c1
mov ecx, dword [0x10f17c8]
mov eax, dword [ebp - 0x5c]
inc eax
xor edx, edx
div ecx
mov eax, dword [ebp - 0x64]
mov dword [ebp - 0x5c], edx
cmp eax, dword [ebp - 0x6c]
jb 0x10131e7
and dword [ebp - 0x60], 0
cmp dword [ebp - 0x60], 0
jne 0x10132b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
and dword [ebp - 0x5c], 0
mov dword [ebp - 0x68], eax
inc dword [ebp - 0x5c]
push 0x40
push 0x1000
push dword [ebp - 0x70]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
jne 0x10136d8
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 0x5c], 0x11
jb 0x101323e
and dword [ebp - 0x60], 0
mov eax, dword [ebp - 0x60]
cmp eax, 0x10000
jb 0x101327a
test al, 3
je 0x1013290
test eax, eax
je 0x101328c
push 0x8000
push 0
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
and dword [ebp - 0x60], 0
push dword [ebp - 0x68]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 0x60]
test eax, eax
je 0x1013180
mov ecx, dword [ebp - 0x70]
test ecx, ecx
je 0x10132b2
mov byte [eax], 0
inc eax
dec ecx
jne 0x10132ab
mov eax, 0xab00b673
add dword [edi], 8
mov esi, dword [esi + 4]
and esi, 0xfffffff
lea eax, [esi + ebx]
mov dword [ebp - 0x68], eax
mov eax, dword [0x10d4588]
mov dword [ebp - 0x64], ebx
sub eax, esi
sub dword [ebp - 0x64], 0x1000000
lea ecx, [eax + 1]
xor eax, eax
mov dword [ebp - 0xbc], esi
mov dword [ebp - 0x5c], ecx
test ecx, ecx
je 0x1013316
mov edx, dword [0x113b250]
shr dword [ebp - 0x5c], 0x10
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [0x113b250], edx
shr edx, 0x10
shl eax, 0x10
or eax, edx
cmp dword [ebp - 0x5c], 0
jne 0x10132ec
xor edx, edx
div ecx
mov eax, dword [ebp - 0x60]
add eax, edx
push esi
push dword [ebp - 0x64]
mov dword [ebp - 0x5c], eax
mov eax, 0xe18f03ee
test esi, esi
mov eax, dword [ebp - 0x5c]
pop ecx
pop ecx
mov byte [ebp - 0x55], 0
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x70], ebx
mov dword [ebp - 0x6c], eax
je 0x1013719
mov esi, dword [ebp - 0x68]
lea edi, [ebp - 0x54]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x48]
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov dword [ebp - 0x108], eax
mov dword [ebp - 0xe0], eax
xor eax, eax
mov dword [ebp - 0xf4], eax
mov dword [ebp - 0xf0], eax
mov dword [ebp - 0xec], eax
mov dword [ebp - 0xe8], eax
mov eax, dword [0x1009a74]
mov dword [ebp - 0x10c], eax
mov eax, dword [0x1009a78]
mov dword [ebp - 0xf8], eax
mov eax, dword [0x1009a7c]
mov dword [ebp - 0xe4], eax
mov eax, dword [0x1009a80]
mov dword [ebp - 0xd0], eax
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x104], ecx
mov dword [ebp - 0xdc], ecx
lea ecx, [ebp - 0x44]
sub eax, ecx
sub ebx, dword [ebp - 0x5c]
mov dword [ebp - 0x100], edx
mov dword [ebp - 0xfc], esi
mov dword [ebp - 0xd8], edx
mov dword [ebp - 0xd4], esi
mov dword [ebp - 0xcc], eax
mov dword [ebp - 0xb4], ebx
lea esi, [ebp - 0x10c]
push 0x10
lea edi, [ebp - 0xb0]
pop ecx
rep movsd dword es:[edi], dword [esi]
mov edx, dword [ebp - 0x80]
mov ecx, dword [ebp - 0x90]
mov esi, dword [ebp - 0xb0]
mov eax, dword [ebp - 0xa0]
mov dword [ebp - 0xc0], 3
lea edi, [edx + esi]
rol edi, 7
mov ebx, dword [ebp - 0xac]
xor eax, edi
lea edi, [esi + eax]
rol edi, 9
xor ecx, edi
lea edi, [eax + ecx]
rol edi, 0xd
xor edx, edi
lea edi, [ecx + edx]
ror edi, 0xe
xor esi, edi
mov edi, dword [ebp - 0x9c]
add ebx, edi
rol ebx, 7
xor dword [ebp - 0x8c], ebx
mov ebx, dword [ebp - 0x8c]
add edi, ebx
rol edi, 9
xor dword [ebp - 0x7c], edi
mov edi, ebx
mov ebx, dword [ebp - 0x7c]
add ebx, edi
mov edi, dword [ebp - 0x7c]
rol ebx, 0xd
xor dword [ebp - 0xac], ebx
mov ebx, dword [ebp - 0xac]
add edi, ebx
ror edi, 0xe
mov ebx, dword [ebp - 0x88]
xor dword [ebp - 0x9c], edi
mov edi, dword [ebp - 0x98]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x78], edi
mov edi, ebx
mov ebx, dword [ebp - 0x78]
add edi, ebx
rol edi, 9
xor dword [ebp - 0xa8], edi
mov edi, ebx
mov ebx, dword [ebp - 0xa8]
add ebx, edi
mov edi, dword [ebp - 0xa8]
rol ebx, 0xd
xor dword [ebp - 0x98], ebx
mov ebx, dword [ebp - 0x98]
add edi, ebx
mov ebx, dword [ebp - 0x74]
ror edi, 0xe
xor dword [ebp - 0x88], edi
mov edi, dword [ebp - 0x84]
add edi, ebx
rol edi, 7
xor dword [ebp - 0xa4], edi
mov edi, ebx
mov ebx, dword [ebp - 0xa4]
add edi, ebx
rol edi, 9
xor dword [ebp - 0x94], edi
mov edi, ebx
mov ebx, dword [ebp - 0x94]
add ebx, edi
rol ebx, 0xd
mov edi, dword [ebp - 0x94]
xor dword [ebp - 0x84], ebx
mov ebx, dword [ebp - 0x84]
add edi, ebx
ror edi, 0xe
xor dword [ebp - 0x74], edi
mov edi, dword [ebp - 0xa4]
add edi, esi
rol edi, 7
xor dword [ebp - 0xac], edi
mov edi, dword [ebp - 0xac]
add edi, esi
rol edi, 9
xor dword [ebp - 0xa8], edi
mov ebx, dword [ebp - 0xa8]
mov edi, dword [ebp - 0xac]
add ebx, edi
rol ebx, 0xd
mov edi, dword [ebp - 0xa8]
xor dword [ebp - 0xa4], ebx
mov ebx, dword [ebp - 0xa4]
add ebx, edi
mov edi, dword [ebp - 0x9c]
add edi, eax
ror ebx, 0xe
xor esi, ebx
rol edi, 7
xor dword [ebp - 0x98], edi
mov ebx, dword [ebp - 0x98]
mov edi, dword [ebp - 0x9c]
add ebx, edi
mov edi, dword [ebp - 0x98]
rol ebx, 9
xor dword [ebp - 0x94], ebx
mov ebx, dword [ebp - 0x94]
add ebx, edi
rol ebx, 0xd
mov edi, dword [ebp - 0x94]
xor eax, ebx
add edi, eax
mov ebx, dword [ebp - 0x8c]
ror edi, 0xe
xor dword [ebp - 0x9c], edi
mov edi, dword [ebp - 0x88]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x84], edi
mov ebx, dword [ebp - 0x84]
mov edi, dword [ebp - 0x88]
add ebx, edi
rol ebx, 9
mov edi, dword [ebp - 0x84]
xor ecx, ebx
mov ebx, dword [ebp - 0x78]
add edi, ecx
rol edi, 0xd
xor dword [ebp - 0x8c], edi
mov edi, dword [ebp - 0x8c]
add edi, ecx
ror edi, 0xe
xor dword [ebp - 0x88], edi
mov edi, dword [ebp - 0x74]
add edi, ebx
rol edi, 7
xor edx, edi
mov edi, dword [ebp - 0x74]
add edi, edx
rol edi, 9
xor dword [ebp - 0x7c], edi
mov edi, dword [ebp - 0x7c]
add edi, edx
rol edi, 0xd
xor dword [ebp - 0x78], edi
mov edi, dword [ebp - 0x7c]
mov ebx, dword [ebp - 0x78]
add ebx, edi
ror ebx, 0xe
xor dword [ebp - 0x74], ebx
dec dword [ebp - 0xc0]
jne 0x1013418
mov dword [ebp - 0x80], edx
xor edx, edx
push 0x40
mov dword [ebp - 0xa0], eax
mov dword [ebp - 0x90], ecx
mov dword [ebp - 0xb0], esi
xor eax, eax
pop ebx
mov ecx, dword [ebp + eax - 0x10c]
add dword [ebp + eax - 0xb0], ecx
add eax, 4
cmp eax, ebx
jl 0x101365a
lea esi, [ebp - 0xb0]
lea edi, [ebp - 0x44]
inc dword [ebp - 0xec]
push 0x10
pop ecx
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x60], ebx
jbe 0x10136e0
mov esi, dword [ebp - 0xcc]
mov eax, dword [ebp - 0xb4]
lea edi, [esi + eax]
lea ecx, [ebp + edx - 0x44]
mov al, byte [edi + ecx]
xor al, byte [ecx]
xor byte [ebp - 0x55], al
inc edx
cmp edx, ebx
mov byte [esi + ecx], al
jb 0x1013697
sub dword [ebp - 0x60], ebx
add dword [ebp - 0x6c], ebx
add esi, ebx
add dword [ebp - 0x70], ebx
mov dword [ebp - 0xcc], esi
jmp 0x10133e8
mov eax, dword [0x10d4588]
imul eax, dword [ebp - 0x5c]
lea eax, [eax + 0x1109044]
mov dword [ebp - 0x60], eax
jmp 0x1013227
mov dword [ebp - 0x60], eax
jmp 0x101326c
cmp dword [ebp - 0x60], edx
jbe 0x1013707
mov esi, dword [ebp - 0x70]
lea eax, [ebp - 0x44]
sub esi, eax
mov edi, dword [ebp - 0x6c]
sub edi, eax
lea ecx, [ebp + edx - 0x44]
mov al, byte [esi + ecx]
xor al, byte [ecx]
xor byte [ebp - 0x55], al
mov byte [edi + ecx], al
inc edx
cmp edx, dword [ebp - 0x60]
jb 0x10136f2
mov esi, dword [ebp - 0xbc]
mov edi, dword [ebp - 0xb8]
mov ebx, dword [ebp - 0xc8]
mov eax, dword [ebp - 0x68]
movzx eax, byte [eax + 0x10]
movzx ecx, byte [ebp - 0x55]
sub ecx, eax
je 0x10137c3
lea ebp, [ebp - 0x63b27828]
call fcn.01020e87
and edi, 0xfffffffc
lea ecx, [edi + 0xfff]
mov esi, eax
mov edx, 0xffff
mov eax, 0xfffff000
and esi, eax
and ecx, eax
mov eax, dword [ebp - 0xc4]
mov dword [eax + 8], 0x10fe507
xor eax, eax
mov ebx, dword [0x113b250]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x113b250], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x101375f
mov ebx, 0xffff
div ebx
mov dword [ebp - 0x120], esi
inc edx
cmp edi, ecx
mov eax, edi
mov dword [ebp - 0x114], edx
mov dword [ebp - 0xb4], 0
jae 0x10137b9
mov edx, dword [ebp - 0xb4]
mov dword [eax], edx
add eax, 4
cmp eax, ecx
jb 0x10137aa
mov eax, 0x10fe507
jmp 0x101389e
mov ecx, 0x1000000
mov edi, dword [ebp - 0x5c]
mov eax, ebx
sub eax, edi
mov edx, dword [0x100b3f0]
sub ecx, edx
mov dword [ebp - 0xb8], eax
mov dword [ebp - 0x68], ecx
jne 0x10137ea
test eax, eax
je 0x1013891
mov ecx, dword [0x10b82b8]
sub edi, ebx
mov eax, dword [ebp - 0x64]
add eax, esi
xor ebx, ebx
mov dword [ebp - 0xb4], eax
dec ecx
js 0x101382a
lea eax, [ecx + ebx]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [eax*4 + 0x10b82bc]
and edx, 0xfffffff
cmp dword [ebp - 0x64], edx
jae 0x1013821
lea ecx, [eax - 1]
jmp 0x1013826
jbe 0x101382e
lea ebx, [eax + 1]
cmp ecx, ebx
jge 0x1013802
mov esi, ebx
jmp 0x1013889
mov esi, eax
jmp 0x1013889
mov eax, dword [esi*4 + 0x10b82bc]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0xb4]
jae 0x1013891
lea edx, [ecx + edi + 0x1000000]
mov ecx, eax
shl ecx, 2
sar ecx, 0x1e
sar eax, 0x1e
and ecx, 3
and eax, 3
xor ebx, ebx
dec ecx
je 0x1013879
dec ecx
je 0x1013871
dec ecx
jne 0x1013882
mov ebx, dword [ebp - 0x68]
jmp 0x1013882
mov ebx, dword [ebp - 0xb8]
jmp 0x1013882
mov ebx, dword [ebp - 0x68]
sub ebx, dword [ebp - 0xb8]
dec eax
dec eax
jne 0x1013888
add dword [edx], ebx
inc esi
cmp esi, dword [0x10b82b8]
jb 0x1013832
mov eax, dword [0x10d4588]
mov eax, 0xcd852d2a
mov eax, dword [ebp - 0x5c]
mov ecx, dword [ebp - 0xc4]
mov dword [ecx + 8], eax
mov ecx, dword [ebp - 0x114]
mov edx, dword [ebp - 0x120]
mov edi, dword [ebp - 0x110]
mov ebx, dword [ebp - 0x118]
mov eax, dword [ebp - 0x11c]
mov esi, dword [ebp - 0x124]
mov esp, ebp
pop ebp
popfd
ret