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

Disassembly:
pushfd
push ebp
mov ebp, esp
sub esp, 0x120
mov dword [ebp - 0x118], eax
mov dword [ebp - 0x110], ecx
mov dword [ebp - 0x11c], edx
mov dword [ebp - 0x114], ebx
lea eax, [ebp + 4]
mov dword [ebp - 0x120], esi
mov dword [ebp - 0x10c], edi
mov esi, dword [eax + 4]
mov ebx, dword [0x10d4588]
sub eax, 4
mov dword [ebp - 0xc0], eax
mov eax, dword [esi]
shr eax, 1
and eax, 0xfffffff
lea ecx, [ebx + eax - 1]
mov eax, ecx
xor edx, edx
div ebx
sub ecx, edx
mov eax, dword [0x10d4588]
mov dword [ebp - 0x68], ecx
mov eax, dword [0x10f17c8]
mov dword [ebp - 0x60], eax
mov eax, dword [0x10d4588]
mov eax, dword [0x10f17c8]
test eax, eax
je 0x10122de
xor edi, edi
mov eax, dword [0x10f17c8]
dec eax
lea ecx, [eax + 1]
xor eax, eax
mov edx, ecx
test ecx, ecx
je 0x101229b
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 0x1012274
xor edx, edx
div ecx
cmp dword [ebp - 0x60], 0
jbe 0x10122d8
mov eax, 0x23ad
inc edi
mov ecx, 0xffffdc52
lea ebx, [edx*4 + 0x113b06c]
lock cmpxchg dword [ebx], ecx
cmp eax, 0x23ad
je 0x101275b
mov ecx, dword [0x10f17c8]
lea eax, [edx + 1]
xor edx, edx
div ecx
cmp edi, dword [ebp - 0x60]
jb 0x10122a5
xor edi, edi
test edi, edi
jne 0x1012354
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor edi, edi
mov ebx, eax
inc edi
push 0x40
push 0x1000
push dword [ebp - 0x68]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
jne 0x101276f
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp edi, 0x11
jb 0x10122e8
xor edi, edi
cmp edi, 0x10000
jb 0x1012321
test edi, 3
je 0x1012335
test edi, edi
je 0x1012333
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor edi, edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
test edi, edi
je 0x101224b
mov ecx, dword [ebp - 0x68]
test ecx, ecx
mov eax, edi
je 0x1012354
mov byte [eax], 0
inc eax
dec ecx
jne 0x101234d
mov eax, 0x3a80a05e
mov eax, dword [esi + 4]
and eax, 7
lea ebx, [eax + esi + 8]
mov esi, dword [esi]
shr esi, 1
and esi, 0xfffffff
lea eax, [esi + ebx]
mov dword [ebp - 0xac], eax
mov eax, dword [0x10d4588]
mov dword [ebp - 0x64], ebx
sub eax, esi
sub dword [ebp - 0x64], 0x1000000
mov dword [ebp - 0xbc], ebx
mov dword [ebp - 0xb0], esi
lea ecx, [eax + 1]
xor eax, eax
mov dword [ebp - 0x5c], ecx
test ecx, ecx
je 0x10123c9
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 0x101239f
xor edx, edx
div ecx
push esi
add edi, edx
push dword [ebp - 0x64]
mov eax, edi
mov dword [ebp - 0x5c], edi
mov eax, 0x234dda54
pop ecx
test esi, esi
pop ecx
mov byte [ebp - 0x55], 0
mov dword [ebp - 0xb8], esi
mov dword [ebp - 0x68], ebx
mov dword [ebp - 0x60], edi
je 0x10127af
mov esi, dword [ebp - 0xac]
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 eax, dword [ebp - 0x54]
mov esi, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x50]
mov dword [ebp - 0x104], eax
mov dword [ebp - 0xdc], eax
xor eax, eax
mov dword [ebp - 0xf0], eax
mov dword [ebp - 0xec], eax
mov dword [ebp - 0xe8], eax
mov dword [ebp - 0xe4], eax
mov eax, dword [0x1009a74]
mov dword [ebp - 0x108], eax
mov eax, dword [0x1009a78]
mov dword [ebp - 0xf4], eax
mov eax, dword [0x1009a7c]
mov dword [ebp - 0xe0], eax
mov eax, dword [0x1009a80]
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x100], ecx
mov dword [ebp - 0xd8], ecx
lea ecx, [ebp - 0x44]
sub eax, ecx
sub ebx, dword [ebp - 0x5c]
mov dword [ebp - 0xfc], edx
mov dword [ebp - 0xf8], esi
mov dword [ebp - 0xd4], edx
mov dword [ebp - 0xd0], esi
mov dword [ebp - 0xc8], eax
mov dword [ebp - 0xb4], ebx
lea esi, [ebp - 0x108]
push 0x10
pop ecx
lea edi, [ebp - 0xa8]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0x88]
mov eax, dword [ebp - 0x98]
mov esi, dword [ebp - 0xa8]
mov edx, dword [ebp - 0x78]
mov dword [ebp - 0xc4], 3
mov ebx, dword [ebp - 0xa4]
lea edi, [edx + esi]
rol edi, 7
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 - 0x94]
add ebx, edi
rol ebx, 7
xor dword [ebp - 0x84], ebx
mov ebx, dword [ebp - 0x84]
add edi, ebx
rol edi, 9
xor dword [ebp - 0x74], edi
mov edi, ebx
mov ebx, dword [ebp - 0x74]
add ebx, edi
mov edi, dword [ebp - 0x74]
rol ebx, 0xd
xor dword [ebp - 0xa4], ebx
mov ebx, dword [ebp - 0xa4]
add edi, ebx
ror edi, 0xe
mov ebx, dword [ebp - 0x80]
xor dword [ebp - 0x94], edi
mov edi, dword [ebp - 0x90]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x70], edi
mov edi, ebx
mov ebx, dword [ebp - 0x70]
add edi, ebx
rol edi, 9
xor dword [ebp - 0xa0], edi
mov edi, ebx
mov ebx, dword [ebp - 0xa0]
add ebx, edi
mov edi, dword [ebp - 0xa0]
rol ebx, 0xd
xor dword [ebp - 0x90], ebx
mov ebx, dword [ebp - 0x90]
add edi, ebx
ror edi, 0xe
mov ebx, dword [ebp - 0x6c]
xor dword [ebp - 0x80], edi
mov edi, dword [ebp - 0x7c]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x9c], edi
mov edi, ebx
mov ebx, dword [ebp - 0x9c]
add edi, ebx
rol edi, 9
xor dword [ebp - 0x8c], edi
mov edi, ebx
mov ebx, dword [ebp - 0x8c]
add ebx, edi
mov edi, dword [ebp - 0x8c]
rol ebx, 0xd
xor dword [ebp - 0x7c], ebx
mov ebx, dword [ebp - 0x7c]
add edi, ebx
ror edi, 0xe
xor dword [ebp - 0x6c], edi
mov edi, dword [ebp - 0x9c]
add edi, esi
rol edi, 7
xor dword [ebp - 0xa4], edi
mov edi, dword [ebp - 0xa4]
add edi, esi
rol edi, 9
xor dword [ebp - 0xa0], edi
mov edi, dword [ebp - 0xa4]
mov ebx, dword [ebp - 0xa0]
add ebx, edi
rol ebx, 0xd
mov edi, dword [ebp - 0xa0]
xor dword [ebp - 0x9c], ebx
mov ebx, dword [ebp - 0x9c]
add ebx, edi
mov edi, dword [ebp - 0x94]
add edi, eax
ror ebx, 0xe
xor esi, ebx
rol edi, 7
xor dword [ebp - 0x90], edi
mov ebx, dword [ebp - 0x90]
mov edi, dword [ebp - 0x94]
add ebx, edi
rol ebx, 9
mov edi, dword [ebp - 0x90]
xor dword [ebp - 0x8c], ebx
mov ebx, dword [ebp - 0x8c]
add ebx, edi
mov edi, dword [ebp - 0x8c]
rol ebx, 0xd
xor eax, ebx
add edi, eax
ror edi, 0xe
mov ebx, dword [ebp - 0x84]
xor dword [ebp - 0x94], edi
mov edi, dword [ebp - 0x80]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x7c], edi
mov ebx, dword [ebp - 0x7c]
mov edi, dword [ebp - 0x80]
add ebx, edi
mov edi, dword [ebp - 0x7c]
rol ebx, 9
xor ecx, ebx
mov ebx, dword [ebp - 0x70]
add edi, ecx
rol edi, 0xd
xor dword [ebp - 0x84], edi
mov edi, dword [ebp - 0x84]
add edi, ecx
ror edi, 0xe
xor dword [ebp - 0x80], edi
mov edi, dword [ebp - 0x6c]
add edi, ebx
rol edi, 7
xor edx, edi
mov edi, dword [ebp - 0x6c]
add edi, edx
rol edi, 9
xor dword [ebp - 0x74], edi
mov edi, dword [ebp - 0x74]
add edi, edx
rol edi, 0xd
xor dword [ebp - 0x70], edi
mov ebx, dword [ebp - 0x70]
mov edi, dword [ebp - 0x74]
add ebx, edi
ror ebx, 0xe
xor dword [ebp - 0x6c], ebx
dec dword [ebp - 0xc4]
jne 0x10124cd
mov dword [ebp - 0x78], edx
xor edx, edx
push 0x40
mov dword [ebp - 0x98], eax
xor eax, eax
mov dword [ebp - 0x88], ecx
mov dword [ebp - 0xa8], esi
pop ebx
mov ecx, dword [ebp + eax - 0x108]
add dword [ebp + eax - 0xa8], ecx
add eax, 4
cmp eax, ebx
jl 0x10126ee
inc dword [ebp - 0xe8]
push 0x10
pop ecx
lea edi, [ebp - 0x44]
lea esi, [ebp - 0xa8]
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0xb8], ebx
jbe 0x1012776
mov esi, dword [ebp - 0xc8]
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 0x101272e
sub dword [ebp - 0xb8], ebx
add dword [ebp - 0x60], ebx
add esi, ebx
add dword [ebp - 0x68], ebx
mov dword [ebp - 0xc8], esi
jmp 0x101249d
mov edi, dword [0x10d4588]
imul edi, edx
lea edi, [edi + 0x1109044]
jmp 0x10122da
mov edi, eax
jmp 0x1012311
cmp dword [ebp - 0xb8], edx
jbe 0x10127a3
mov esi, dword [ebp - 0x68]
mov edi, dword [ebp - 0x60]
lea eax, [ebp - 0x44]
sub esi, eax
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 - 0xb8]
jb 0x101278b
mov ebx, dword [ebp - 0xbc]
mov esi, dword [ebp - 0xb0]
mov eax, dword [ebp - 0xac]
movzx eax, byte [eax + 0x10]
movzx ecx, byte [ebp - 0x55]
sub ecx, eax
je 0x101285f
lea ebp, [ebp - 0x63b27828]
call fcn.01020e87
mov edx, dword [ebp - 0xc0]
mov dword [edx + 8], 0x10fe507
lea ecx, [edx + 0xc]
and ecx, 0xfffffffc
mov ebx, eax
lea esi, [ecx + 0xfff]
mov eax, 0xfffff000
and ebx, eax
and esi, eax
mov edx, 0xffff
xor eax, eax
mov edi, dword [0x113b250]
imul edi, edi, 0x343fd
add edi, 0x269ec3
mov dword [0x113b250], edi
shr edi, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, edi
test edx, edx
jne 0x10127fb
mov edi, 0xffff
div edi
mov eax, ecx
inc edx
mov dword [ebp - 0x11c], ebx
cmp ecx, esi
mov dword [ebp - 0x110], edx
mov dword [ebp - 0xb4], 0
jae 0x1012855
mov ecx, dword [ebp - 0xb4]
mov dword [eax], ecx
add eax, 4
cmp eax, esi
jb 0x1012846
mov eax, 0x10fe507
jmp 0x1012943
mov edx, dword [0x100b3f0]
mov eax, ebx
mov edi, dword [ebp - 0x5c]
mov ecx, 0x1000000
sub eax, edi
sub ecx, edx
mov dword [ebp - 0xb0], eax
mov dword [ebp - 0xac], ecx
jne 0x1012889
test eax, eax
je 0x1012936
mov eax, dword [ebp - 0x64]
mov ecx, dword [0x10b82b8]
sub edi, ebx
add eax, esi
xor ebx, ebx
dec ecx
mov dword [ebp - 0xb4], eax
js 0x10128c9
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 0x10128c0
lea ecx, [eax - 1]
jmp 0x10128c5
jbe 0x10128cd
lea ebx, [eax + 1]
cmp ecx, ebx
jge 0x10128a1
mov esi, ebx
jmp 0x101292e
mov esi, eax
jmp 0x101292e
mov eax, dword [esi*4 + 0x10b82bc]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0xb4]
jae 0x1012936
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 0x101291b
dec ecx
je 0x1012913
dec ecx
jne 0x1012927
mov ebx, dword [ebp - 0xac]
jmp 0x1012927
mov ebx, dword [ebp - 0xb0]
jmp 0x1012927
mov ebx, dword [ebp - 0xac]
sub ebx, dword [ebp - 0xb0]
dec eax
dec eax
jne 0x101292d
add dword [edx], ebx
inc esi
cmp esi, dword [0x10b82b8]
jb 0x10128d1
mov eax, dword [0x10d4588]
mov eax, 0x66b3c977
mov eax, dword [ebp - 0x5c]
mov ecx, dword [ebp - 0xc0]
mov dword [ecx + 8], eax
mov esi, dword [ebp - 0x120]
mov ebx, dword [ebp - 0x114]
mov eax, dword [ebp - 0x118]
mov edi, dword [ebp - 0x10c]
mov ecx, dword [ebp - 0x110]
mov edx, dword [ebp - 0x11c]
mov esp, ebp
pop ebp
popfd
ret