Function at 0x1028c2a
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, 0x150
mov dword [ebp - 0x13c], eax
mov dword [ebp - 0x150], ecx
lea eax, [ebp + 4]
mov dword [ebp - 0x14c], edx
mov dword [ebp - 0x148], ebx
mov dword [ebp - 0x144], esi
mov dword [ebp - 0x140], edi
mov esi, dword [0x1021358]
mov edi, dword [eax + 4]
sub eax, 4
mov dword [ebp - 0xd4], eax
mov eax, dword [edi]
shr eax, 4
lea ecx, [esi + eax - 1]
xor edx, edx
mov eax, ecx
div esi
mov eax, dword [0x1021358]
sub ecx, edx
mov dword [ebp - 0x7c], ecx
mov eax, dword [0x10049b0]
mov dword [ebp - 0x78], eax
mov eax, dword [0x1021358]
mov eax, dword [0x10049b0]
test eax, eax
je 0x1028d24
mov eax, dword [0x10049b0]
xor esi, esi
dec eax
lea ecx, [eax + 1]
xor eax, eax
mov edx, ecx
test ecx, ecx
je 0x1028cd9
mov ebx, dword [0x1042fc4]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x1042fc4], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x1028cb2
xor edx, edx
div ecx
cmp dword [ebp - 0x78], 0
jbe 0x1028d16
inc esi
mov eax, 0xb4c4
lea ebx, [edx*4 + 0x10430d4]
mov ecx, 0xffff4b3b
lock cmpxchg dword [ebx], ecx
cmp eax, 0xb4c4
je 0x1028efe
lea eax, [edx + 1]
xor edx, edx
mov ecx, dword [0x10049b0]
div ecx
cmp esi, dword [ebp - 0x78]
jb 0x1028ce3
and dword [ebp - 0x5c], 0
cmp dword [ebp - 0x5c], 0
jne 0x1028da7
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor esi, esi
mov ebx, eax
push 0x40
push 0x1000
push dword [ebp - 0x7c]
push 0
inc esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
jne 0x1028f14
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp esi, 0x11
jb 0x1028d2e
and dword [ebp - 0x5c], 0
cmp dword [ebp - 0x5c], 0x10000
jb 0x1028d6b
test dword [ebp - 0x5c], 3
je 0x1028d85
cmp dword [ebp - 0x5c], 0
je 0x1028d81
push 0x8000
push 0
push dword [ebp - 0x5c]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
and dword [ebp - 0x5c], 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [ebp - 0x5c], 0
je 0x1028c85
mov ecx, dword [ebp - 0x7c]
mov eax, dword [ebp - 0x5c]
test ecx, ecx
je 0x1028da7
mov byte [eax], 0
inc eax
dec ecx
jne 0x1028da0
mov eax, 0x5ec2dccc
mov esi, dword [edi]
mov eax, esi
and eax, 7
shr esi, 4
lea eax, [eax + edi + 8]
lea ebx, [esi + eax]
mov dword [ebp - 0x80], eax
mov edi, 0x1000000
mov dword [ebp - 0xd0], eax
mov eax, dword [0x1021358]
sub eax, esi
sub dword [ebp - 0x80], edi
lea ecx, [eax + 1]
xor eax, eax
test ecx, ecx
mov dword [ebp - 0xc4], esi
mov dword [ebp - 0xcc], ebx
mov dword [ebp - 0x60], ecx
je 0x1028e17
mov edx, dword [0x1042fc4]
shr dword [ebp - 0x60], 0x10
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [0x1042fc4], edx
shr edx, 0x10
shl eax, 0x10
or eax, edx
cmp dword [ebp - 0x60], 0
jne 0x1028ded
xor edx, edx
div ecx
mov eax, dword [ebp - 0x5c]
push esi
push dword [ebp - 0x80]
add eax, edx
mov dword [ebp - 0x5c], eax
mov eax, 0x5726a91
mov eax, dword [ebx]
test esi, esi
mov dword [ebp - 0xdc], eax
mov eax, dword [ebx + 4]
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp - 0xd0]
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x5c]
pop ecx
pop ecx
mov byte [ebp - 0x55], 0
mov dword [ebp - 0xc8], esi
mov dword [ebp - 0x78], eax
je 0x102955a
lea esi, [ebp - 0xdc]
mov eax, 0xeffe979b
mov ebx, dword [ebp - 0xdc]
mov ecx, dword [0x10051bc]
mov eax, dword [ebp - 0xd8]
and dword [ebp - 0x68], 0
and dword [ebp - 0x64], 0
and eax, 0xfffffff
and ebx, 0xfffffff
mov dword [ebp - 0x60], eax
mov eax, edi
add ebx, edi
sub eax, ecx
mov dword [ebp - 0xf8], eax
jne 0x1028f1c
xor edi, edi
cmp dword [ebp - 0x60], edi
jbe 0x1029163
mov ecx, 0x7fffffff
mov esi, 0x5737992
movzx eax, byte [edi + ebx]
mov edx, esi
add eax, esi
add dword [ebp - 0x68], eax
add eax, dword [ebp - 0x64]
mul edx
lea edx, [eax + edx*2 - 0x7fffffff]
sar eax, 0x1f
and eax, ecx
sub edx, eax
mov eax, edx
sar eax, 0x1f
and eax, ecx
add eax, edx
mov edx, eax
imul edx, edx, 0x1745
rol edx, 2
ror eax, 2
xor edx, eax
add dword [ebp - 0x68], edx
inc edi
mov dword [ebp - 0x64], edx
cmp edi, dword [ebp - 0x60]
jb 0x1028eb6
jmp 0x1029163
mov eax, dword [0x1021358]
imul eax, edx
lea eax, [eax + 0x1039008]
mov dword [ebp - 0x5c], eax
jmp 0x1028d1a
mov dword [ebp - 0x5c], eax
jmp 0x1028d59
mov ecx, ebx
mov edx, dword [0x100003c]
mov eax, dword [ebp - 0x60]
add eax, ebx
lea edx, [edx + 0x10000a0]
mov dword [ebp - 0x6c], eax
mov eax, dword [edx]
mov edx, dword [edx + 4]
mov dword [ebp - 0x74], edx
add eax, edi
sub ecx, edi
mov edx, ecx
mov edi, 0xfffff000
mov esi, ecx
and edx, edi
sub esi, edx
mov dword [ebp - 0x70], esi
mov esi, dword [ebp - 0x60]
add ecx, esi
mov esi, ecx
and esi, edi
mov edi, eax
sub ecx, esi
mov dword [ebp - 0xec], ecx
mov ecx, dword [ebp - 0x74]
add ecx, eax
mov dword [ebp - 0xf0], esi
mov dword [ebp - 0xe8], ecx
cmp eax, ecx
je 0x1028f81
cmp dword [edi], edx
jae 0x1028f81
add edi, dword [edi + 4]
cmp edi, ecx
jne 0x1028f76
xor eax, eax
cmp edi, ecx
je 0x1028fad
cmp dword [edi], edx
jne 0x1028fad
mov edx, dword [edi + 4]
sub edx, 8
shr edx, 1
je 0x1028fad
lea ecx, [edi + 8]
movzx esi, word [ecx]
and esi, 0xfff
cmp esi, dword [ebp - 0x70]
jae 0x1028fad
inc eax
inc ecx
inc ecx
cmp eax, edx
jne 0x1028f98
mov ecx, 0x7fffffff
mov esi, 0x5737992
jmp 0x1028fbf
mov eax, dword [ebp - 0xe0]
cmp edi, dword [ebp - 0xe8]
je 0x1029114
mov edx, dword [ebp - 0xf0]
cmp dword [edi], edx
ja 0x1029114
mov edx, dword [edi + 4]
add edx, 0xfffffff8
shr edx, 1
cmp eax, edx
jne 0x1029006
add edi, dword [edi + 4]
cmp edi, dword [ebp - 0xe8]
je 0x1029114
mov eax, dword [ebp - 0xf0]
cmp dword [edi], eax
ja 0x1029114
xor eax, eax
jmp 0x1028fd9
mov edx, dword [ebp - 0xf0]
cmp dword [edi], edx
jne 0x1029027
movzx edx, word [edi + eax*2 + 8]
and edx, 0xfff
cmp edx, dword [ebp - 0xec]
jae 0x1029114
mov edx, eax
inc eax
mov dword [ebp - 0xe0], eax
mov eax, 0xf000
test word [edi + edx*2 + 8], ax
je 0x1028fb9
movzx eax, word [edi + edx*2 + 8]
mov edx, dword [edi]
and dword [ebp - 0x60], 0
and eax, 0xfff
lea eax, [eax + edx + 0x1000000]
mov dword [ebp - 0x70], eax
sub dword [ebp - 0x70], ebx
mov dword [ebp - 0x74], eax
je 0x10290b2
mov edx, esi
mov eax, dword [ebp - 0x60]
movzx eax, byte [eax + ebx]
add eax, esi
add dword [ebp - 0x68], eax
add eax, dword [ebp - 0x64]
mul edx
lea edx, [eax + edx*2 - 0x7fffffff]
sar eax, 0x1f
and eax, ecx
sub edx, eax
mov eax, edx
sar eax, 0x1f
and eax, ecx
add eax, edx
mov edx, eax
imul edx, edx, 0x1745
rol edx, 2
ror eax, 2
xor edx, eax
mov eax, edx
add dword [ebp - 0x68], eax
inc dword [ebp - 0x60]
mov eax, dword [ebp - 0x60]
mov dword [ebp - 0x64], edx
cmp eax, dword [ebp - 0x70]
jb 0x1029062
mov eax, dword [ebp - 0x74]
mov eax, dword [eax]
sub eax, dword [ebp - 0xf8]
mov dword [ebp - 0xf4], eax
xor ebx, ebx
mov edx, esi
movzx eax, byte [ebp + ebx - 0xf4]
add eax, esi
add dword [ebp - 0x68], eax
add eax, dword [ebp - 0x64]
mul edx
lea edx, [eax + edx*2 - 0x7fffffff]
sar eax, 0x1f
and eax, ecx
sub edx, eax
mov eax, edx
sar eax, 0x1f
and eax, ecx
add eax, edx
mov edx, eax
imul edx, edx, 0x1745
rol edx, 2
ror eax, 2
xor edx, eax
add dword [ebp - 0x68], edx
inc ebx
mov dword [ebp - 0x64], edx
cmp ebx, 4
jb 0x10290c2
mov ebx, dword [ebp - 0x74]
add ebx, 4
jmp 0x1028fb9
mov eax, dword [ebp - 0x6c]
xor edi, edi
sub eax, ebx
mov dword [ebp - 0x6c], eax
je 0x1029163
mov edx, esi
movzx eax, byte [edi + ebx]
add eax, esi
add dword [ebp - 0x68], eax
add eax, dword [ebp - 0x64]
mul edx
lea edx, [eax + edx*2 - 0x7fffffff]
sar eax, 0x1f
and eax, ecx
sub edx, eax
mov eax, edx
sar eax, 0x1f
and eax, ecx
add eax, edx
mov edx, eax
imul edx, edx, 0x1745
rol edx, 2
ror eax, 2
xor edx, eax
add dword [ebp - 0x68], edx
mov dword [ebp - 0x64], edx
inc edi
cmp edi, dword [ebp - 0x6c]
jb 0x1029120
xor edi, edi
xor eax, eax
mov ecx, eax
and ecx, 7
mov cl, byte [ebp + ecx - 0x68]
mov byte [ebp + eax - 0x54], cl
inc eax
cmp eax, 0x10
jb 0x1029167
mov eax, 0x4d47e454
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x50]
mov esi, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov dword [ebp - 0x134], eax
mov dword [ebp - 0x10c], eax
mov eax, dword [0x1002168]
mov dword [ebp - 0x138], eax
mov eax, dword [0x100216c]
mov dword [ebp - 0x124], eax
mov eax, dword [0x1002170]
mov dword [ebp - 0x110], eax
mov eax, dword [0x1002174]
mov dword [ebp - 0xfc], eax
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x130], ecx
mov dword [ebp - 0x108], ecx
lea ecx, [ebp - 0x44]
sub eax, ecx
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0xd0]
sub eax, dword [ebp - 0x5c]
mov dword [ebp - 0x12c], edx
mov dword [ebp - 0x128], esi
mov dword [ebp - 0x104], edx
mov dword [ebp - 0x100], esi
mov dword [ebp - 0x120], edi
mov dword [ebp - 0x11c], edi
mov dword [ebp - 0x118], edi
mov dword [ebp - 0x114], edi
mov dword [ebp - 0x6c], eax
push 0x10
lea edi, [ebp - 0xc0]
lea esi, [ebp - 0x138]
pop ecx
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0xa0]
mov eax, dword [ebp - 0xb0]
mov esi, dword [ebp - 0xc0]
mov edx, dword [ebp - 0x90]
mov dword [ebp - 0x74], 2
lea edi, [esi + edx]
rol edi, 7
mov ebx, dword [ebp - 0xbc]
xor eax, edi
lea edi, [esi + eax]
rol edi, 9
xor ecx, edi
lea edi, [ecx + eax]
rol edi, 0xd
xor edx, edi
lea edi, [ecx + edx]
ror edi, 0xe
xor esi, edi
mov edi, dword [ebp - 0xac]
add ebx, edi
rol ebx, 7
xor dword [ebp - 0x9c], 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
rol ebx, 0xd
mov edi, dword [ebp - 0x8c]
xor dword [ebp - 0xbc], ebx
mov ebx, dword [ebp - 0xbc]
add edi, ebx
mov ebx, dword [ebp - 0x98]
ror edi, 0xe
xor dword [ebp - 0xac], edi
mov edi, dword [ebp - 0xa8]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x88], edi
mov edi, ebx
mov ebx, dword [ebp - 0x88]
add edi, ebx
rol edi, 9
xor dword [ebp - 0xb8], edi
mov edi, ebx
mov ebx, dword [ebp - 0xb8]
add ebx, edi
rol ebx, 0xd
mov edi, dword [ebp - 0xb8]
xor dword [ebp - 0xa8], ebx
mov ebx, dword [ebp - 0xa8]
add edi, ebx
ror edi, 0xe
mov ebx, dword [ebp - 0x84]
xor dword [ebp - 0x98], edi
mov edi, dword [ebp - 0x94]
add edi, ebx
rol edi, 7
xor dword [ebp - 0xb4], edi
mov edi, ebx
mov ebx, dword [ebp - 0xb4]
add edi, ebx
rol edi, 9
xor dword [ebp - 0xa4], edi
mov edi, ebx
mov ebx, dword [ebp - 0xa4]
add ebx, edi
mov edi, dword [ebp - 0xa4]
rol ebx, 0xd
xor dword [ebp - 0x94], ebx
mov ebx, dword [ebp - 0x94]
add edi, ebx
ror edi, 0xe
xor dword [ebp - 0x84], edi
mov edi, dword [ebp - 0xb4]
add edi, esi
rol edi, 7
xor dword [ebp - 0xbc], edi
mov edi, dword [ebp - 0xbc]
add edi, esi
rol edi, 9
xor dword [ebp - 0xb8], edi
mov ebx, dword [ebp - 0xb8]
mov edi, dword [ebp - 0xbc]
add ebx, edi
mov edi, dword [ebp - 0xb8]
rol ebx, 0xd
xor dword [ebp - 0xb4], ebx
mov ebx, dword [ebp - 0xb4]
add ebx, edi
mov edi, dword [ebp - 0xac]
add edi, eax
ror ebx, 0xe
xor esi, ebx
rol edi, 7
xor dword [ebp - 0xa8], edi
mov edi, dword [ebp - 0xac]
mov ebx, dword [ebp - 0xa8]
add ebx, edi
rol ebx, 9
mov edi, dword [ebp - 0xa8]
xor dword [ebp - 0xa4], ebx
mov ebx, dword [ebp - 0xa4]
add ebx, edi
mov edi, dword [ebp - 0xa4]
rol ebx, 0xd
xor eax, ebx
mov ebx, dword [ebp - 0x9c]
add edi, eax
ror edi, 0xe
xor dword [ebp - 0xac], edi
mov edi, dword [ebp - 0x98]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x94], edi
mov edi, dword [ebp - 0x98]
mov ebx, dword [ebp - 0x94]
add ebx, edi
rol ebx, 9
mov edi, dword [ebp - 0x94]
xor ecx, ebx
mov ebx, dword [ebp - 0x88]
add edi, ecx
rol edi, 0xd
xor dword [ebp - 0x9c], edi
mov edi, dword [ebp - 0x9c]
add edi, ecx
ror edi, 0xe
xor dword [ebp - 0x98], edi
mov edi, dword [ebp - 0x84]
add edi, ebx
rol edi, 7
xor edx, edi
mov edi, dword [ebp - 0x84]
add edi, edx
rol edi, 9
xor dword [ebp - 0x8c], edi
mov edi, dword [ebp - 0x8c]
add edi, edx
rol edi, 0xd
xor dword [ebp - 0x88], edi
mov ebx, dword [ebp - 0x88]
mov edi, dword [ebp - 0x8c]
add ebx, edi
ror ebx, 0xe
xor dword [ebp - 0x84], ebx
dec dword [ebp - 0x74]
jne 0x1029246
mov dword [ebp - 0x90], edx
xor edx, edx
push 0x40
mov dword [ebp - 0xb0], eax
mov dword [ebp - 0xa0], ecx
mov dword [ebp - 0xc0], esi
pop ebx
xor eax, eax
mov ecx, dword [ebp + eax - 0x138]
add dword [ebp + eax - 0xc0], ecx
add eax, 4
cmp eax, ebx
jl 0x10294b8
lea edi, [ebp - 0x44]
inc dword [ebp - 0x118]
lea esi, [ebp - 0xc0]
push 0x10
pop ecx
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0xc8], ebx
jbe 0x102951c
mov esi, dword [ebp - 0x70]
mov eax, dword [ebp - 0x6c]
lea edi, [esi + eax]
lea ecx, [ebp + edx - 0x44]
mov al, byte [ecx + edi]
xor al, byte [ecx]
xor byte [ebp - 0x55], al
inc edx
cmp edx, ebx
mov byte [ecx + esi], al
jb 0x10294f2
sub dword [ebp - 0xc8], ebx
add dword [ebp - 0x78], ebx
add esi, ebx
add dword [ebp - 0x7c], ebx
mov dword [ebp - 0x70], esi
jmp 0x1029216
cmp dword [ebp - 0xc8], edx
jbe 0x1029549
lea eax, [ebp - 0x44]
mov edi, dword [ebp - 0x78]
mov esi, dword [ebp - 0x7c]
sub esi, eax
sub edi, eax
lea ecx, [ebp + edx - 0x44]
mov al, byte [ecx + esi]
xor al, byte [ecx]
xor byte [ebp - 0x55], al
mov byte [ecx + edi], al
inc edx
cmp edx, dword [ebp - 0xc8]
jb 0x1029531
mov esi, dword [ebp - 0xc4]
mov ebx, dword [ebp - 0xcc]
mov edi, 0x1000000
movzx ecx, byte [ebp - 0x55]
movzx eax, byte [ebx + 8]
sub ecx, eax
je 0x10295f8
call fcn.0100d9b4
mov edi, eax
mov eax, dword [ebp - 0xd4]
mov edx, 0xfffff000
mov dword [eax + 8], 0x1016d68
lea ecx, [eax + 0xc]
and ecx, 0xfffffffc
and edi, edx
lea esi, [ecx + 0xfff]
and esi, edx
mov edx, 0xffff
xor eax, eax
mov ebx, dword [0x1042fc4]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x1042fc4], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x102959a
mov ebx, 0xffff
div ebx
mov eax, ecx
mov dword [ebp - 0x14c], edi
inc edx
mov dword [ebp - 0x150], edx
cmp ecx, esi
mov dword [ebp - 0x6c], 0
jae 0x10295ee
mov ecx, dword [ebp - 0x6c]
mov dword [eax], ecx
add eax, 4
cmp eax, esi
jb 0x10295e2
mov eax, 0x1016d68
jmp 0x10296da
mov ecx, dword [0x10051bc]
mov eax, dword [ebp - 0xd0]
sub eax, dword [ebp - 0x5c]
mov dword [ebp - 0xcc], eax
sub edi, ecx
mov dword [ebp - 0xc4], edi
jne 0x102961f
test eax, eax
je 0x10296cd
mov edi, dword [ebp - 0x5c]
sub edi, dword [ebp - 0xd0]
mov ecx, dword [0x1001168]
mov eax, dword [ebp - 0x80]
add eax, esi
xor esi, esi
dec ecx
mov dword [ebp - 0x6c], eax
js 0x1029663
lea eax, [ecx + esi]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [eax*4 + 0x100116c]
and edx, 0xfffffff
cmp dword [ebp - 0x80], edx
jae 0x102965a
lea ecx, [eax - 1]
jmp 0x102965f
jbe 0x1029667
lea esi, [eax + 1]
cmp ecx, esi
jge 0x102963b
mov ebx, esi
jmp 0x10296c5
mov ebx, eax
jmp 0x10296c5
mov eax, dword [ebx*4 + 0x100116c]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0x6c]
jae 0x10296cd
lea esi, [ecx + edi + 0x1000000]
mov ecx, eax
shl ecx, 2
sar ecx, 0x1e
sar eax, 0x1e
and ecx, 3
and eax, 3
xor edx, edx
dec ecx
je 0x10296b2
dec ecx
je 0x10296aa
dec ecx
jne 0x10296be
mov edx, dword [ebp - 0xc4]
jmp 0x10296be
mov edx, dword [ebp - 0xcc]
jmp 0x10296be
mov edx, dword [ebp - 0xc4]
sub edx, dword [ebp - 0xcc]
dec eax
dec eax
jne 0x10296c4
add dword [esi], edx
inc ebx
cmp ebx, dword [0x1001168]
jb 0x102966b
mov eax, dword [0x1021358]
mov eax, 0xa561e984
mov eax, dword [ebp - 0x5c]
mov ecx, dword [ebp - 0xd4]
mov dword [ecx + 8], eax
mov edi, dword [ebp - 0x140]
mov ecx, dword [ebp - 0x150]
mov esi, dword [ebp - 0x144]
mov eax, dword [ebp - 0x13c]
mov ebx, dword [ebp - 0x148]
mov edx, dword [ebp - 0x14c]
mov esp, ebp
pop ebp
popfd
ret