Function at 0x10358c8
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, 0x154
mov dword [ebp - 0x144], eax
mov dword [ebp - 0x148], ecx
lea eax, [ebp + 4]
sub eax, 4
mov ecx, 0xfffffff
mov dword [ebp - 0x150], edx
mov dword [ebp - 0x140], ebx
mov dword [ebp - 0x154], esi
lea esi, [eax + 0xc]
mov dword [ebp - 0x14c], edi
mov dword [ebp - 0xec], eax
mov eax, dword [esi]
mov ebx, dword [eax]
shr ebx, 2
mov dword [ebp - 0x78], eax
mov eax, dword [eax + 4]
and eax, ecx
and ebx, ecx
mov ecx, dword [0x102543c]
xor edx, edx
mov dword [ebp - 0x74], ecx
lea ecx, [eax + ecx - 1]
mov eax, ecx
div dword [ebp - 0x74]
mov eax, dword [0x102543c]
mov edi, 0x1000000
add ebx, edi
mov dword [ebp - 0xc8], esi
mov dword [ebp - 0xcc], ebx
sub ecx, edx
mov dword [ebp - 0x7c], ecx
mov eax, dword [0x101a35c]
mov dword [ebp - 0x84], eax
mov eax, dword [0x102543c]
mov eax, dword [0x101a35c]
test eax, eax
je 0x1035a05
and dword [ebp - 0x70], 0
mov eax, dword [0x101a35c]
dec eax
lea ecx, [eax + 1]
mov dword [ebp - 0x5c], ecx
xor eax, eax
test ecx, ecx
je 0x10359a8
mov edx, dword [0x10410fc]
shr dword [ebp - 0x5c], 0x10
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [0x10410fc], edx
shr edx, 0x10
shl eax, 0x10
or eax, edx
cmp dword [ebp - 0x5c], 0
jne 0x103597e
xor edx, edx
div ecx
cmp dword [ebp - 0x84], 0
mov dword [ebp - 0x5c], edx
jbe 0x10359f7
inc dword [ebp - 0x70]
lea edx, [edx*4 + 0x1042454]
mov ecx, 0xffff16be
mov eax, 0xe941
lock cmpxchg dword [edx], ecx
cmp eax, 0xe941
je 0x1035bc5
mov ecx, dword [0x101a35c]
mov eax, dword [ebp - 0x5c]
inc eax
xor edx, edx
div ecx
mov eax, dword [ebp - 0x70]
mov dword [ebp - 0x5c], edx
cmp eax, dword [ebp - 0x84]
jb 0x10359b8
and dword [ebp - 0x60], 0
cmp dword [ebp - 0x60], 0
jne 0x1035a90
call dword [sym.imp.KERNEL32.dll_GetLastError]
and dword [ebp - 0x5c], 0
mov dword [ebp - 0x74], eax
inc dword [ebp - 0x5c]
push 0x40
push 0x1000
push dword [ebp - 0x7c]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
jne 0x1035bdc
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 0x5c], 0x11
jb 0x1035a12
and dword [ebp - 0x60], 0
cmp dword [ebp - 0x60], 0x10000
jb 0x1035a52
test dword [ebp - 0x60], 3
je 0x1035a6c
cmp dword [ebp - 0x60], 0
je 0x1035a68
push 0x8000
push 0
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
and dword [ebp - 0x60], 0
push dword [ebp - 0x74]
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [ebp - 0x60], 0
je 0x103594b
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x7c]
test ecx, ecx
je 0x1035a90
mov byte [eax], 0
inc eax
dec ecx
jne 0x1035a89
mov eax, 0xba17a17c
mov eax, dword [ebp - 0x78]
add dword [esi], 8
mov esi, dword [eax + 4]
and esi, 0xfffffff
lea eax, [esi + ebx]
mov dword [ebp - 0x74], eax
mov eax, dword [0x102543c]
sub eax, esi
lea ecx, [eax + 1]
mov edx, ecx
mov dword [ebp - 0x80], ebx
sub dword [ebp - 0x80], edi
mov dword [ebp - 0x78], esi
xor eax, eax
test ecx, ecx
je 0x1035aec
mov ebx, dword [0x10410fc]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x10410fc], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x1035ac5
xor edx, edx
div ecx
mov eax, dword [ebp - 0x60]
lea ebx, [edx + eax]
mov eax, ebx
push esi
push dword [ebp - 0x80]
mov dword [ebp - 0x70], ebx
mov eax, 0xbf7fad8
mov eax, dword [ebp - 0x74]
test esi, esi
pop ecx
pop ecx
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0xf0], eax
mov eax, dword [ebp - 0xcc]
mov dword [ebp - 0x84], ebx
mov ebx, 0xfffff000
mov dword [ebp - 0xf4], ecx
mov byte [ebp - 0x55], 0
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x7c], eax
je 0x10361f9
lea esi, [ebp - 0xf4]
mov eax, 0x3a6ef608
mov esi, dword [ebp - 0xf4]
mov eax, dword [ebp - 0xf0]
mov ecx, 0xfffffff
and dword [ebp - 0x68], 0
and dword [ebp - 0x64], 0
and eax, ecx
and esi, ecx
add esi, edi
mov ecx, dword [0x1004f44]
mov dword [ebp - 0x5c], eax
mov eax, edi
sub eax, ecx
mov dword [ebp - 0xfc], eax
jne 0x1035be4
xor edi, edi
cmp dword [ebp - 0x5c], edi
jbe 0x1035e06
mov ecx, 0x637ce67c
movzx edx, byte [edi + esi]
add edx, ecx
add dword [ebp - 0x68], edx
add edx, dword [ebp - 0x64]
mov eax, edx
imul eax, eax, 0x3041
rol eax, 0xc
ror edx, 0xc
xor eax, edx
mov edx, ecx
mul edx
add eax, edx
mov edx, ecx
mul edx
add eax, edx
add dword [ebp - 0x68], eax
mov dword [ebp - 0x64], eax
inc edi
cmp edi, dword [ebp - 0x5c]
jb 0x1035b8c
jmp 0x1035e06
mov eax, dword [0x102543c]
imul eax, dword [ebp - 0x5c]
lea eax, [eax + 0x1038008]
mov dword [ebp - 0x60], eax
jmp 0x10359fb
mov dword [ebp - 0x60], eax
jmp 0x1035a40
mov edx, dword [0x100003c]
lea edx, [edx + 0x10000a0]
mov eax, dword [ebp - 0x5c]
mov ecx, esi
add eax, esi
mov dword [ebp - 0xd4], eax
mov eax, dword [edx]
add eax, edi
sub ecx, edi
mov edx, dword [edx + 4]
mov edi, ecx
and edi, ebx
mov dword [ebp - 0x6c], edi
mov edi, ecx
sub edi, dword [ebp - 0x6c]
mov dword [ebp - 0xd0], edi
mov edi, dword [ebp - 0x5c]
add edx, eax
add ecx, edi
mov edi, ecx
and edi, ebx
sub ecx, edi
mov ebx, eax
cmp eax, edx
mov dword [ebp - 0xe8], edi
mov dword [ebp - 0xe4], ecx
mov dword [ebp - 0xe0], edx
je 0x1035c4f
mov eax, dword [ebp - 0x6c]
cmp dword [ebx], eax
jae 0x1035c4f
add ebx, dword [ebx + 4]
cmp ebx, dword [ebp - 0xe0]
jne 0x1035c3d
and dword [ebp - 0xd8], 0
cmp ebx, dword [ebp - 0xe0]
mov edx, 0xfff
je 0x1035c94
mov eax, dword [ebp - 0x6c]
cmp dword [ebx], eax
jne 0x1035c94
mov eax, dword [ebx + 4]
sub eax, 8
shr eax, 1
je 0x1035c94
lea ecx, [ebx + 8]
movzx edi, word [ecx]
and edi, edx
cmp edi, dword [ebp - 0xd0]
jae 0x1035c94
inc dword [ebp - 0xd8]
inc ecx
inc ecx
cmp dword [ebp - 0xd8], eax
jne 0x1035c77
mov ecx, 0x637ce67c
cmp ebx, dword [ebp - 0xe0]
je 0x1035dc7
mov eax, dword [ebx]
cmp eax, dword [ebp - 0xe8]
ja 0x1035dc7
mov edi, dword [ebp - 0xd8]
mov eax, dword [ebx + 4]
add eax, 0xfffffff8
shr eax, 1
cmp edi, eax
jne 0x1035ce6
add ebx, dword [ebx + 4]
cmp ebx, dword [ebp - 0xe0]
je 0x1035dc7
mov eax, dword [ebp - 0xe8]
cmp dword [ebx], eax
ja 0x1035dc7
xor edi, edi
jmp 0x1035cb9
mov eax, dword [ebp - 0xe8]
cmp dword [ebx], eax
jne 0x1035d03
movzx eax, word [ebx + edi*2 + 8]
and eax, edx
cmp eax, dword [ebp - 0xe4]
jae 0x1035dc7
mov eax, edi
inc edi
mov dword [ebp - 0xd8], edi
mov edi, 0xf000
test word [ebx + eax*2 + 8], di
je 0x1035c99
movzx eax, word [ebx + eax*2 + 8]
and eax, edx
mov edx, dword [ebx]
lea eax, [eax + edx + 0x1000000]
mov dword [ebp - 0x6c], eax
xor edi, edi
sub dword [ebp - 0x6c], esi
mov dword [ebp - 0xd0], eax
je 0x1035d6c
movzx edx, byte [edi + esi]
add edx, ecx
add dword [ebp - 0x68], edx
add edx, dword [ebp - 0x64]
mov eax, edx
imul eax, eax, 0x3041
rol eax, 0xc
ror edx, 0xc
xor eax, edx
mov edx, ecx
mul edx
add eax, edx
mov edx, ecx
mul edx
add eax, edx
add dword [ebp - 0x68], eax
inc edi
mov dword [ebp - 0x64], eax
cmp edi, dword [ebp - 0x6c]
jb 0x1035d38
mov esi, dword [ebp - 0xd0]
mov eax, dword [esi]
sub eax, dword [ebp - 0xfc]
mov dword [ebp - 0xf8], eax
xor edi, edi
movzx edx, byte [ebp + edi - 0xf8]
add edx, ecx
add dword [ebp - 0x68], edx
add edx, dword [ebp - 0x64]
mov eax, edx
imul eax, eax, 0x3041
rol eax, 0xc
ror edx, 0xc
xor eax, edx
mov edx, ecx
mul edx
add eax, edx
mov edx, ecx
mul edx
add eax, edx
add dword [ebp - 0x68], eax
mov dword [ebp - 0x64], eax
inc edi
cmp edi, 4
jb 0x1035d82
mov edx, 0xfff
add esi, 4
jmp 0x1035c99
xor edi, edi
mov ebx, dword [ebp - 0xd4]
sub ebx, esi
je 0x1035e06
movzx edx, byte [edi + esi]
add edx, ecx
add dword [ebp - 0x68], edx
add edx, dword [ebp - 0x64]
mov eax, edx
imul eax, eax, 0x3041
rol eax, 0xc
ror edx, 0xc
xor eax, edx
mov edx, ecx
mul edx
add eax, edx
mov edx, ecx
mul edx
add eax, edx
add dword [ebp - 0x68], eax
mov dword [ebp - 0x64], eax
inc edi
cmp edi, ebx
jb 0x1035dd3
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 0x1035e0a
mov eax, 0x7659ce55
mov edx, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x50]
mov esi, dword [ebp - 0x48]
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x138], eax
mov dword [ebp - 0x110], eax
mov eax, dword [0x101be7c]
mov dword [ebp - 0x13c], eax
mov eax, dword [0x101be80]
mov dword [ebp - 0x128], eax
mov eax, dword [0x101be84]
mov dword [ebp - 0x114], eax
mov eax, dword [0x101be88]
mov dword [ebp - 0x100], eax
mov eax, dword [ebp - 0x70]
mov dword [ebp - 0x134], ecx
mov dword [ebp - 0x10c], ecx
lea ecx, [ebp - 0x44]
sub eax, ecx
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0xcc]
sub eax, dword [ebp - 0x70]
mov dword [ebp - 0x130], edx
mov dword [ebp - 0x12c], esi
mov dword [ebp - 0x108], edx
mov dword [ebp - 0x104], esi
mov dword [ebp - 0x124], edi
mov dword [ebp - 0x120], edi
mov dword [ebp - 0x11c], edi
mov dword [ebp - 0x118], edi
mov dword [ebp - 0xd4], eax
lea esi, [ebp - 0x13c]
lea edi, [ebp - 0xc4]
push 0x10
pop ecx
rep movsd dword es:[edi], dword [esi]
mov edx, dword [ebp - 0x94]
mov ecx, dword [ebp - 0xa4]
mov eax, dword [ebp - 0xb4]
mov esi, dword [ebp - 0xc4]
mov dword [ebp - 0x6c], 2
lea edi, [esi + edx]
rol edi, 7
mov ebx, dword [ebp - 0xc0]
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 - 0xb0]
add ebx, edi
rol ebx, 7
xor dword [ebp - 0xa0], ebx
mov ebx, dword [ebp - 0xa0]
add edi, ebx
rol edi, 9
xor dword [ebp - 0x90], edi
mov edi, ebx
mov ebx, dword [ebp - 0x90]
add ebx, edi
rol ebx, 0xd
mov edi, dword [ebp - 0x90]
xor dword [ebp - 0xc0], ebx
mov ebx, dword [ebp - 0xc0]
add edi, ebx
mov ebx, dword [ebp - 0x9c]
ror edi, 0xe
xor dword [ebp - 0xb0], edi
mov edi, dword [ebp - 0xac]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x8c], edi
mov edi, ebx
mov ebx, dword [ebp - 0x8c]
add edi, ebx
rol edi, 9
xor dword [ebp - 0xbc], edi
mov edi, ebx
mov ebx, dword [ebp - 0xbc]
add ebx, edi
rol ebx, 0xd
mov edi, dword [ebp - 0xbc]
xor dword [ebp - 0xac], ebx
mov ebx, dword [ebp - 0xac]
add edi, ebx
mov ebx, dword [ebp - 0x88]
ror edi, 0xe
xor dword [ebp - 0x9c], edi
mov edi, dword [ebp - 0x98]
add edi, ebx
rol edi, 7
xor dword [ebp - 0xb8], edi
mov edi, ebx
mov ebx, dword [ebp - 0xb8]
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
ror edi, 0xe
xor dword [ebp - 0x88], edi
mov edi, dword [ebp - 0xb8]
add edi, esi
rol edi, 7
xor dword [ebp - 0xc0], edi
mov edi, dword [ebp - 0xc0]
add edi, esi
rol edi, 9
xor dword [ebp - 0xbc], edi
mov edi, dword [ebp - 0xc0]
mov ebx, dword [ebp - 0xbc]
add ebx, edi
rol ebx, 0xd
mov edi, dword [ebp - 0xbc]
xor dword [ebp - 0xb8], ebx
mov ebx, dword [ebp - 0xb8]
add ebx, edi
mov edi, dword [ebp - 0xb0]
add edi, eax
ror ebx, 0xe
xor esi, ebx
rol edi, 7
xor dword [ebp - 0xac], edi
mov edi, dword [ebp - 0xb0]
mov ebx, dword [ebp - 0xac]
add ebx, edi
mov edi, dword [ebp - 0xac]
rol ebx, 9
xor dword [ebp - 0xa8], ebx
mov ebx, dword [ebp - 0xa8]
add ebx, edi
mov edi, dword [ebp - 0xa8]
rol ebx, 0xd
xor eax, ebx
add edi, eax
ror edi, 0xe
mov ebx, dword [ebp - 0xa0]
xor dword [ebp - 0xb0], edi
mov edi, dword [ebp - 0x9c]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x98], edi
mov edi, dword [ebp - 0x9c]
mov ebx, dword [ebp - 0x98]
add ebx, edi
mov edi, dword [ebp - 0x98]
rol ebx, 9
xor ecx, ebx
add edi, ecx
mov ebx, dword [ebp - 0x8c]
rol edi, 0xd
xor dword [ebp - 0xa0], edi
mov edi, dword [ebp - 0xa0]
add edi, ecx
ror edi, 0xe
xor dword [ebp - 0x9c], edi
mov edi, dword [ebp - 0x88]
add edi, ebx
rol edi, 7
xor edx, edi
mov edi, dword [ebp - 0x88]
add edi, edx
rol edi, 9
xor dword [ebp - 0x90], edi
mov edi, dword [ebp - 0x90]
add edi, edx
rol edi, 0xd
xor dword [ebp - 0x8c], edi
mov ebx, dword [ebp - 0x8c]
mov edi, dword [ebp - 0x90]
add ebx, edi
ror ebx, 0xe
xor dword [ebp - 0x88], ebx
dec dword [ebp - 0x6c]
jne 0x1035eec
mov dword [ebp - 0x94], edx
push 0x40
xor edx, edx
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xa4], ecx
xor eax, eax
mov dword [ebp - 0xc4], esi
pop ebx
mov ecx, dword [ebp + eax - 0x13c]
add dword [ebp + eax - 0xc4], ecx
add eax, 4
cmp eax, ebx
jl 0x103615e
lea esi, [ebp - 0xc4]
inc dword [ebp - 0x11c]
lea edi, [ebp - 0x44]
push 0x10
pop ecx
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x60], ebx
jbe 0x10361c2
mov eax, dword [ebp - 0xd4]
mov esi, dword [ebp - 0x5c]
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
mov byte [ecx + esi], al
cmp edx, ebx
jb 0x1036198
sub dword [ebp - 0x60], ebx
add dword [ebp - 0x84], ebx
add esi, ebx
add dword [ebp - 0x7c], ebx
mov dword [ebp - 0x5c], esi
jmp 0x1035ebc
cmp dword [ebp - 0x60], edx
jbe 0x10361ec
mov esi, dword [ebp - 0x7c]
lea eax, [ebp - 0x44]
mov edi, dword [ebp - 0x84]
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
inc edx
mov byte [ecx + edi], al
cmp edx, dword [ebp - 0x60]
jb 0x10361d7
mov esi, dword [ebp - 0x78]
mov edi, 0x1000000
mov ebx, 0xfffff000
mov eax, dword [ebp - 0x74]
movzx eax, byte [eax + 8]
movzx ecx, byte [ebp - 0x55]
sub ecx, eax
je 0x103629e
call fcn.0100cd3b
mov edi, dword [ebp - 0xc8]
mov esi, eax
and edi, 0xfffffffc
mov edx, 0xffff
mov eax, dword [ebp - 0xec]
and esi, ebx
mov dword [eax + 8], 0x1023648
lea ecx, [edi + 0xfff]
and ecx, ebx
xor eax, eax
mov ebx, dword [0x10410fc]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x10410fc], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x103623a
mov ebx, 0xffff
div ebx
mov eax, edi
inc edx
cmp edi, ecx
mov dword [ebp - 0x150], esi
mov dword [ebp - 0x148], edx
mov dword [ebp - 0xc8], 0
jae 0x1036294
mov edx, dword [ebp - 0xc8]
mov dword [eax], edx
add eax, 4
cmp eax, ecx
jb 0x1036285
mov eax, 0x1023648
jmp 0x1036374
mov ecx, dword [0x1004f44]
mov eax, dword [ebp - 0xcc]
sub eax, dword [ebp - 0x70]
sub edi, ecx
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x74], edi
jne 0x10362bf
test eax, eax
je 0x1036367
mov eax, dword [ebp - 0x80]
mov ecx, dword [0x1009298]
mov edi, dword [ebp - 0x70]
sub edi, dword [ebp - 0xcc]
add eax, esi
xor esi, esi
dec ecx
mov dword [ebp - 0xc8], eax
js 0x1036306
lea eax, [ecx + esi]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [eax*4 + 0x100929c]
and edx, 0xfffffff
cmp dword [ebp - 0x80], edx
jae 0x10362fd
lea ecx, [eax - 1]
jmp 0x1036302
jbe 0x103630a
lea esi, [eax + 1]
cmp ecx, esi
jge 0x10362de
mov ebx, esi
jmp 0x103635f
mov ebx, eax
jmp 0x103635f
mov eax, dword [ebx*4 + 0x100929c]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0xc8]
jae 0x1036367
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 0x1036352
dec ecx
je 0x103634d
dec ecx
jne 0x1036358
mov edx, dword [ebp - 0x74]
jmp 0x1036358
mov edx, dword [ebp - 0x78]
jmp 0x1036358
mov edx, dword [ebp - 0x74]
sub edx, dword [ebp - 0x78]
dec eax
dec eax
jne 0x103635e
add dword [esi], edx
inc ebx
cmp ebx, dword [0x1009298]
jb 0x103630e
mov eax, dword [0x102543c]
mov eax, 0x4643a3c5
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0xec]
mov dword [ecx + 8], eax
mov esi, dword [ebp - 0x154]
mov edx, dword [ebp - 0x150]
mov ecx, dword [ebp - 0x148]
mov eax, dword [ebp - 0x144]
mov edi, dword [ebp - 0x14c]
mov ebx, dword [ebp - 0x140]
mov esp, ebp
pop ebp
popfd
ret