Function at 0x1005f889
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 - 0x14c], eax
mov dword [ebp - 0x144], ecx
lea eax, [ebp + 4]
mov dword [ebp - 0x150], edx
mov dword [ebp - 0x148], ebx
mov dword [ebp - 0x13c], esi
mov dword [ebp - 0x140], edi
mov edi, dword [0x1007b9bc]
mov esi, dword [eax + 4]
sub eax, 4
mov dword [ebp - 0xe8], eax
mov eax, dword [esi]
shr eax, 4
xor edx, edx
lea ecx, [edi + eax - 1]
mov eax, ecx
div edi
sub ecx, edx
mov eax, dword [0x1007b9bc]
mov dword [ebp - 0x78], ecx
mov eax, dword [0x10012044]
mov dword [ebp - 0x74], eax
mov eax, dword [0x1007b9bc]
mov eax, dword [0x10012044]
test eax, eax
je 0x1005f977
xor edi, edi
mov eax, dword [0x10012044]
dec eax
lea ecx, [eax + 1]
mov edx, ecx
xor eax, eax
test ecx, ecx
je 0x1005f934
mov ebx, dword [0x1012ee38]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x1012ee38], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x1005f90d
xor edx, edx
div ecx
cmp dword [ebp - 0x74], 0
jbe 0x1005f971
mov eax, 0x3c6f
mov ecx, 0xffffc390
lea ebx, [edx*4 + 0x1012ee90]
inc edi
lock cmpxchg dword [ebx], ecx
cmp eax, 0x3c6f
je 0x1005fb53
mov ecx, dword [0x10012044]
lea eax, [edx + 1]
xor edx, edx
div ecx
cmp edi, dword [ebp - 0x74]
jb 0x1005f93e
xor edi, edi
test edi, edi
jne 0x1005f9ed
call dword [sym.imp.kernel32.dll_GetLastError]
xor edi, edi
mov ebx, eax
inc edi
push 0x40
push 0x1000
push dword [ebp - 0x78]
push 0
call dword [sym.imp.kernel32.dll_VirtualAlloc]
test eax, eax
jne 0x1005fb67
push eax
call dword [sym.imp.kernel32.dll_Sleep]
cmp edi, 0x11
jb 0x1005f981
xor edi, edi
cmp dword [0x1011fbc8], edi
ja 0x1005f9ba
test edi, 3
je 0x1005f9ce
test edi, edi
je 0x1005f9cc
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 0x1005f8e4
mov eax, edi
mov ecx, dword [ebp - 0x78]
test ecx, ecx
je 0x1005f9ed
mov byte [eax], 0
inc eax
dec ecx
jne 0x1005f9e6
mov eax, 0xda57bb80
mov ebx, dword [esi]
mov eax, ebx
shr eax, 1
and eax, 7
shr ebx, 4
lea eax, [eax + esi + 8]
mov esi, 0x10000000
lea ecx, [ebx + eax]
mov dword [ebp - 0x7c], eax
mov dword [ebp - 0xd0], eax
mov eax, dword [0x1007b9bc]
sub eax, ebx
mov dword [ebp - 0xc0], ecx
sub dword [ebp - 0x7c], esi
mov dword [ebp - 0xc4], ebx
lea ecx, [eax + 1]
xor eax, eax
mov dword [ebp - 0x5c], ecx
test ecx, ecx
je 0x1005fa5f
mov edx, dword [0x1012ee38]
shr dword [ebp - 0x5c], 0x10
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [0x1012ee38], edx
shr edx, 0x10
shl eax, 0x10
or eax, edx
cmp dword [ebp - 0x5c], 0
jne 0x1005fa35
xor edx, edx
div ecx
add edi, edx
push edi
push ebx
push dword [ebp - 0x7c]
mov dword [ebp - 0xc8], edi
mov eax, 0xefa077e2
mov eax, dword [ebp - 0xc0]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0xec], eax
mov eax, dword [ebp - 0xd0]
add esp, 0xc
mov dword [ebp - 0x74], edi
mov dword [ebp - 0xf0], ecx
mov byte [ebp - 0x55], 0
test ebx, ebx
mov edi, 0xfffff000
mov dword [ebp - 0xcc], ebx
mov dword [ebp - 0x78], eax
je 0x100601b8
lea eax, [ebp - 0xf0]
push eax
mov eax, 0x81ec46e7
mov ebx, dword [ebp - 0xf0]
and dword [ebp - 0x64], 0
and dword [ebp - 0x60], 0
mov eax, 0xfffffff
pop ecx
mov ecx, dword [ebp - 0xec]
and ecx, eax
mov dword [ebp - 0x5c], ecx
mov ecx, dword [0x1001256c]
and ebx, eax
add ebx, esi
mov eax, esi
sub eax, ecx
mov dword [ebp - 0xf4], eax
jne 0x1005fb6e
xor edi, edi
cmp dword [ebp - 0x5c], edi
jbe 0x1005fdcf
mov ecx, 0x7fffffff
mov esi, 0x13023717
movzx edx, byte [edi + ebx]
sub edx, esi
add dword [ebp - 0x64], edx
add edx, dword [ebp - 0x60]
mov eax, edx
imul eax, eax, 0x5858
rol eax, 9
ror edx, 9
xor eax, edx
mov edx, 0xecfdc8e9
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
add dword [ebp - 0x64], eax
mov dword [ebp - 0x60], eax
inc edi
cmp edi, dword [ebp - 0x5c]
jb 0x1005fb08
jmp 0x1005fdcf
mov edi, dword [0x1007b9bc]
imul edi, edx
lea edi, [edi + section..data]
jmp 0x1005f973
mov edi, eax
jmp 0x1005f9aa
mov edx, dword [0x1000003c]
mov eax, dword [ebp - 0x5c]
lea edx, [edx + 0x100000a0]
mov ecx, ebx
add eax, ebx
mov dword [ebp - 0x68], eax
mov eax, dword [edx]
add eax, esi
mov edx, dword [edx + 4]
mov dword [ebp - 0x70], edx
sub ecx, esi
mov edx, ecx
mov esi, ecx
and esi, edi
sub edx, esi
mov dword [ebp - 0x6c], edx
mov edx, dword [ebp - 0x5c]
add ecx, edx
mov edx, ecx
and edx, edi
mov edi, eax
sub ecx, edx
mov dword [ebp - 0xe0], ecx
mov ecx, dword [ebp - 0x70]
mov dword [ebp - 0xe4], edx
add ecx, eax
cmp eax, ecx
mov dword [ebp - 0xdc], ecx
je 0x1005fbce
cmp dword [edi], esi
jae 0x1005fbce
add edi, dword [edi + 4]
cmp edi, ecx
jne 0x1005fbc3
and dword [ebp - 0xd4], 0
cmp edi, ecx
je 0x1005fc07
cmp dword [edi], esi
jne 0x1005fc07
mov esi, dword [edi + 4]
sub esi, 8
shr esi, 1
je 0x1005fc07
lea ecx, [edi + 8]
movzx eax, word [ecx]
and eax, 0xfff
cmp eax, dword [ebp - 0x6c]
jae 0x1005fc07
inc dword [ebp - 0xd4]
inc ecx
inc ecx
cmp dword [ebp - 0xd4], esi
jne 0x1005fbea
mov ecx, 0x7fffffff
mov esi, 0x13023717
jmp 0x1005fc19
mov edx, dword [ebp - 0xe4]
cmp edi, dword [ebp - 0xdc]
je 0x1005fd7d
cmp dword [edi], edx
ja 0x1005fd7d
mov eax, dword [edi + 4]
add eax, 0xfffffff8
shr eax, 1
cmp dword [ebp - 0xd4], eax
jne 0x1005fc63
add edi, dword [edi + 4]
cmp edi, dword [ebp - 0xdc]
je 0x1005fd7d
mov eax, dword [ebp - 0xe4]
cmp dword [edi], eax
ja 0x1005fd7d
and dword [ebp - 0xd4], 0
jmp 0x1005fc2d
mov eax, dword [ebp - 0xe4]
cmp dword [edi], eax
jne 0x1005fc89
mov eax, dword [ebp - 0xd4]
movzx eax, word [edi + eax*2 + 8]
and eax, 0xfff
cmp eax, dword [ebp - 0xe0]
jae 0x1005fd7d
mov edx, dword [ebp - 0xd4]
mov eax, 0xf000
inc dword [ebp - 0xd4]
test word [edi + edx*2 + 8], ax
je 0x1005fc13
movzx eax, word [edi + edx*2 + 8]
mov edx, dword [edi]
and dword [ebp - 0x5c], 0
and eax, 0xfff
lea eax, [eax + edx + 0x10000000]
mov dword [ebp - 0x6c], eax
sub dword [ebp - 0x6c], ebx
mov dword [ebp - 0x70], eax
je 0x1005fd18
mov eax, dword [ebp - 0x5c]
movzx edx, byte [eax + ebx]
sub edx, esi
add dword [ebp - 0x64], edx
add edx, dword [ebp - 0x60]
mov eax, edx
imul eax, eax, 0x5858
rol eax, 9
ror edx, 9
xor eax, edx
mov edx, 0xecfdc8e9
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
add dword [ebp - 0x64], eax
inc dword [ebp - 0x5c]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x5c]
cmp eax, dword [ebp - 0x6c]
jb 0x1005fcc7
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
sub eax, dword [ebp - 0xf4]
xor ebx, ebx
mov dword [ebp - 0xf8], eax
movzx edx, byte [ebp + ebx - 0xf8]
sub edx, esi
add dword [ebp - 0x64], edx
add edx, dword [ebp - 0x60]
mov eax, edx
imul eax, eax, 0x5858
rol eax, 9
ror edx, 9
xor eax, edx
mov edx, 0xecfdc8e9
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
add dword [ebp - 0x64], eax
inc ebx
cmp ebx, 4
mov dword [ebp - 0x60], eax
jb 0x1005fd28
mov ebx, dword [ebp - 0x70]
add ebx, 4
jmp 0x1005fc13
xor edi, edi
mov eax, dword [ebp - 0x68]
sub eax, ebx
mov dword [ebp - 0x68], eax
je 0x1005fdcf
movzx edx, byte [edi + ebx]
sub edx, esi
add dword [ebp - 0x64], edx
add edx, dword [ebp - 0x60]
mov eax, edx
imul eax, eax, 0x5858
rol eax, 9
ror edx, 9
xor eax, edx
mov edx, 0xecfdc8e9
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
add dword [ebp - 0x64], eax
inc edi
mov dword [ebp - 0x60], eax
cmp edi, dword [ebp - 0x68]
jb 0x1005fd89
xor edi, edi
xor eax, eax
mov ecx, eax
and ecx, 7
mov cl, byte [ebp + ecx - 0x64]
mov byte [ebp + eax - 0x54], cl
inc eax
cmp eax, 0x10
jb 0x1005fdd3
mov eax, 0xbdba14e9
mov eax, dword [ebp - 0x54]
mov esi, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov dword [ebp - 0x134], eax
mov dword [ebp - 0x10c], eax
mov eax, dword [0x10120760]
mov dword [ebp - 0x130], ecx
mov dword [ebp - 0x108], ecx
mov ecx, dword [eax]
mov dword [ebp - 0x138], ecx
mov ecx, dword [eax + 4]
mov dword [ebp - 0x124], ecx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0xfc], eax
mov eax, dword [ebp - 0xc8]
mov dword [ebp - 0x110], ecx
lea ecx, [ebp - 0x44]
sub eax, ecx
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0xd0]
sub eax, dword [ebp - 0xc8]
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 - 0x68], eax
push 0x10
lea esi, [ebp - 0x138]
pop ecx
lea edi, [ebp - 0xbc]
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0xac]
mov esi, dword [ebp - 0xbc]
mov edx, dword [ebp - 0x8c]
mov ecx, dword [ebp - 0x9c]
mov dword [ebp - 0x70], 2
lea edi, [edx + esi]
mov ebx, dword [ebp - 0xb8]
rol edi, 7
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 - 0xa8]
add ebx, edi
rol ebx, 7
xor dword [ebp - 0x98], ebx
mov ebx, dword [ebp - 0x98]
add edi, ebx
rol edi, 9
xor dword [ebp - 0x88], edi
mov edi, ebx
mov ebx, dword [ebp - 0x88]
add ebx, edi
mov edi, dword [ebp - 0x88]
rol ebx, 0xd
xor dword [ebp - 0xb8], ebx
mov ebx, dword [ebp - 0xb8]
add edi, ebx
ror edi, 0xe
mov ebx, dword [ebp - 0x94]
xor dword [ebp - 0xa8], edi
mov edi, dword [ebp - 0xa4]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x84], edi
mov edi, ebx
mov ebx, dword [ebp - 0x84]
add edi, ebx
rol edi, 9
xor dword [ebp - 0xb4], edi
mov edi, ebx
mov ebx, dword [ebp - 0xb4]
add ebx, edi
mov edi, dword [ebp - 0xb4]
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 - 0xb0], edi
mov edi, ebx
mov ebx, dword [ebp - 0xb0]
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
xor dword [ebp - 0x80], edi
mov edi, dword [ebp - 0xb0]
add edi, esi
rol edi, 7
xor dword [ebp - 0xb8], edi
mov edi, dword [ebp - 0xb8]
add edi, esi
rol edi, 9
xor dword [ebp - 0xb4], edi
mov ebx, dword [ebp - 0xb4]
mov edi, dword [ebp - 0xb8]
add ebx, edi
mov edi, dword [ebp - 0xb4]
rol ebx, 0xd
xor dword [ebp - 0xb0], ebx
mov ebx, dword [ebp - 0xb0]
add ebx, edi
mov edi, dword [ebp - 0xa8]
add edi, eax
ror ebx, 0xe
xor esi, ebx
rol edi, 7
xor dword [ebp - 0xa4], edi
mov edi, dword [ebp - 0xa8]
mov ebx, dword [ebp - 0xa4]
add ebx, edi
mov edi, dword [ebp - 0xa4]
rol ebx, 9
xor dword [ebp - 0xa0], ebx
mov ebx, dword [ebp - 0xa0]
add ebx, edi
mov edi, dword [ebp - 0xa0]
rol ebx, 0xd
xor eax, ebx
add edi, eax
ror edi, 0xe
mov ebx, dword [ebp - 0x98]
xor dword [ebp - 0xa8], edi
mov edi, dword [ebp - 0x94]
add edi, 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
xor ecx, ebx
mov ebx, dword [ebp - 0x84]
mov edi, dword [ebp - 0x90]
add edi, ecx
rol edi, 0xd
xor dword [ebp - 0x98], edi
mov edi, dword [ebp - 0x98]
add edi, ecx
ror edi, 0xe
xor dword [ebp - 0x94], edi
mov edi, dword [ebp - 0x80]
add edi, ebx
rol edi, 7
xor edx, edi
mov edi, dword [ebp - 0x80]
add edi, edx
rol edi, 9
xor dword [ebp - 0x88], edi
mov edi, dword [ebp - 0x88]
add edi, edx
rol edi, 0xd
xor dword [ebp - 0x84], edi
mov ebx, dword [ebp - 0x84]
mov edi, dword [ebp - 0x88]
add ebx, edi
ror ebx, 0xe
xor dword [ebp - 0x80], ebx
dec dword [ebp - 0x70]
jne 0x1005feb4
mov dword [ebp - 0x8c], edx
xor edx, edx
push 0x40
mov dword [ebp - 0xac], eax
xor eax, eax
mov dword [ebp - 0x9c], ecx
mov dword [ebp - 0xbc], esi
pop ebx
mov ecx, dword [ebp + eax - 0x138]
add dword [ebp + eax - 0xbc], ecx
add eax, 4
cmp eax, ebx
jl 0x10060117
inc dword [ebp - 0x118]
lea edi, [ebp - 0x44]
lea esi, [ebp - 0xbc]
push 0x10
pop ecx
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0xcc], ebx
jbe 0x1006017b
mov esi, dword [ebp - 0x6c]
mov eax, dword [ebp - 0x68]
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 0x10060151
sub dword [ebp - 0xcc], ebx
add dword [ebp - 0x74], ebx
add esi, ebx
add dword [ebp - 0x78], ebx
mov dword [ebp - 0x6c], esi
jmp 0x1005fe84
cmp dword [ebp - 0xcc], edx
jbe 0x100601a8
mov esi, dword [ebp - 0x78]
mov edi, dword [ebp - 0x74]
lea eax, [ebp - 0x44]
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 - 0xcc]
jb 0x10060190
mov ebx, dword [ebp - 0xc4]
mov esi, 0x10000000
mov edi, 0xfffff000
mov eax, dword [ebp - 0xc0]
mov al, byte [eax + 8]
xor al, byte [ebp - 0x55]
je 0x10060253
call fcn.10097c60
mov ebx, eax
mov eax, dword [ebp - 0xe8]
mov dword [eax + 8], 0x100f1b6e
mov edx, 0xffff
lea ecx, [eax + 0xc]
and ecx, 0xfffffffc
and ebx, edi
lea esi, [ecx + 0xfff]
and esi, edi
xor eax, eax
mov edi, dword [0x1012ee38]
imul edi, edi, 0x343fd
add edi, 0x269ec3
mov dword [0x1012ee38], edi
shr edi, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, edi
test edx, edx
jne 0x100601f5
mov edi, 0xffff
div edi
mov dword [ebp - 0x150], ebx
mov eax, ecx
inc edx
mov dword [ebp - 0x144], edx
mov dword [ebp - 0x68], 0
cmp ecx, esi
jae 0x10060249
mov ecx, dword [ebp - 0x68]
mov dword [eax], ecx
add eax, 4
cmp eax, esi
jb 0x1006023d
mov eax, 0x100f1b6e
jmp 0x1006033e
mov ecx, dword [0x1001256c]
mov eax, dword [ebp - 0xd0]
sub eax, dword [ebp - 0xc8]
sub esi, ecx
mov dword [ebp - 0xc4], eax
mov dword [ebp - 0xc0], esi
jne 0x1006027d
test eax, eax
je 0x1006032e
mov esi, dword [ebp - 0xc8]
mov eax, dword [ebp - 0x7c]
mov ecx, dword [0x10103928]
sub esi, dword [ebp - 0xd0]
add eax, ebx
mov dword [ebp - 0x68], eax
xor ebx, ebx
dec ecx
js 0x100602c4
lea eax, [ebx + ecx]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [eax*4 + 0x1010392c]
and edx, 0xfffffff
cmp dword [ebp - 0x7c], edx
jae 0x100602bb
lea ecx, [eax - 1]
jmp 0x100602c0
jbe 0x100602c8
lea ebx, [eax + 1]
cmp ecx, ebx
jge 0x1006029c
mov edi, ebx
jmp 0x10060326
mov edi, eax
jmp 0x10060326
mov eax, dword [edi*4 + 0x1010392c]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0x68]
jae 0x1006032e
lea ebx, [ecx + esi + 0x10000000]
mov ecx, eax
shl ecx, 2
sar ecx, 0x1e
sar eax, 0x1e
and ecx, 3
and eax, 3
xor edx, edx
dec ecx
je 0x10060313
dec ecx
je 0x1006030b
dec ecx
jne 0x1006031f
mov edx, dword [ebp - 0xc0]
jmp 0x1006031f
mov edx, dword [ebp - 0xc4]
jmp 0x1006031f
mov edx, dword [ebp - 0xc0]
sub edx, dword [ebp - 0xc4]
dec eax
dec eax
jne 0x10060325
add dword [ebx], edx
inc edi
cmp edi, dword [0x10103928]
jb 0x100602cc
mov eax, dword [0x1007b9bc]
mov eax, 0x5e918023
mov eax, dword [ebp - 0xc8]
mov ecx, dword [ebp - 0xe8]
mov dword [ecx + 8], eax
mov ecx, dword [ebp - 0x144]
mov ebx, dword [ebp - 0x148]
mov edx, dword [ebp - 0x150]
mov esi, dword [ebp - 0x13c]
mov eax, dword [ebp - 0x14c]
mov edi, dword [ebp - 0x140]
mov esp, ebp
pop ebp
popfd
ret