Function at 0x47fc98
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
lea eax, [ebp + 4]
mov dword [ebp - 0x144], ecx
mov dword [ebp - 0x150], edx
mov dword [ebp - 0x148], ebx
mov dword [ebp - 0x13c], esi
mov dword [ebp - 0x140], edi
mov edi, 0xfffffff
mov ebx, dword [0x4c7398]
mov esi, dword [eax + 4]
sub eax, 4
mov dword [ebp - 0xd4], eax
mov eax, dword [esi + 4]
and eax, edi
lea ecx, [ebx + eax - 1]
xor edx, edx
mov eax, ecx
div ebx
sub ecx, edx
mov eax, dword [0x4c7398]
mov dword [ebp - 0x78], ecx
mov eax, dword [0x403ef8]
mov dword [ebp - 0x68], eax
mov eax, dword [0x4c7398]
mov eax, dword [0x403ef8]
test eax, eax
je 0x47fd95
and dword [ebp - 0x6c], 0
mov eax, dword [0x403ef8]
dec eax
lea ecx, [eax + 1]
xor eax, eax
test ecx, ecx
mov edx, ecx
je 0x47fd4d
mov ebx, dword [0x51b214]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x51b214], ebx
shr ebx, 0x10
shl eax, 0x10
or eax, ebx
shr edx, 0x10
jne 0x47fd28
xor edx, edx
div ecx
cmp dword [ebp - 0x68], 0
jbe 0x47fd8f
lea ebx, [edx*4 + 0x529524]
mov eax, 0x3c6f
mov ecx, 0xffffc390
inc dword [ebp - 0x6c]
lock cmpxchg dword [ebx], ecx
cmp eax, 0x3c6f
je 0x47ff50
mov ecx, dword [0x403ef8]
lea eax, [edx + 1]
xor edx, edx
div ecx
mov eax, dword [ebp - 0x6c]
cmp eax, dword [ebp - 0x68]
jb 0x47fd57
xor ebx, ebx
test ebx, ebx
jne 0x47fe0e
call dword [sym.imp.kernel32.dll_GetLastError]
mov dword [ebp - 0x70], eax
xor ebx, ebx
inc ebx
push 0x40
push 0x1000
push dword [ebp - 0x78]
push 0
call dword [sym.imp.kernel32.dll_VirtualAlloc]
test eax, eax
jne 0x47ff64
push eax
call dword [sym.imp.kernel32.dll_Sleep]
cmp ebx, 0x11
jb 0x47fda0
xor ebx, ebx
cmp dword [0x51b2c4], ebx
ja 0x47fdd9
test ebx, 3
je 0x47fded
test ebx, ebx
je 0x47fdeb
push 0x8000
push 0
push ebx
call dword [sym.imp.kernel32.dll_VirtualFree]
xor ebx, ebx
push dword [ebp - 0x70]
call dword [sym.imp.kernel32.dll_SetLastError]
test ebx, ebx
je 0x47fcf9
mov eax, ebx
mov ecx, dword [ebp - 0x78]
test ecx, ecx
je 0x47fe0e
mov byte [eax], 0
inc eax
dec ecx
jne 0x47fe07
mov eax, 0x7385bd5c
mov eax, dword [esi]
shr eax, 1
and eax, 7
lea eax, [eax + esi + 8]
mov esi, dword [esi + 4]
and esi, edi
lea ecx, [esi + eax]
mov edi, 0x400000
mov dword [ebp - 0x7c], eax
mov dword [ebp - 0x6c], eax
mov eax, dword [0x4c7398]
sub eax, esi
mov dword [ebp - 0x70], ecx
sub dword [ebp - 0x7c], edi
mov dword [ebp - 0xc8], esi
lea ecx, [eax + 1]
xor eax, eax
mov dword [ebp - 0x68], ecx
test ecx, ecx
je 0x47fe76
mov edx, dword [0x51b214]
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [0x51b214], edx
shr edx, 0x10
shl eax, 0x10
or eax, edx
shr dword [ebp - 0x68], 0x10
jne 0x47fe50
xor edx, edx
div ecx
add ebx, edx
push ebx
push esi
push dword [ebp - 0x7c]
mov dword [ebp - 0xc0], ebx
mov eax, 0xebab4ec6
mov eax, dword [ebp - 0x70]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0xec], eax
mov eax, dword [ebp - 0x6c]
add esp, 0xc
test esi, esi
mov dword [ebp - 0x68], ebx
mov ebx, 0xfffff000
mov dword [ebp - 0xf0], ecx
mov byte [ebp - 0x55], 0
mov dword [ebp - 0xc4], esi
mov dword [ebp - 0x78], eax
je 0x480570
lea eax, [ebp - 0xf0]
push eax
mov eax, 0x63c8a404
mov esi, dword [ebp - 0xf0]
mov eax, 0xfffffff
and dword [ebp - 0x60], 0
and dword [ebp - 0x5c], 0
pop ecx
mov ecx, dword [ebp - 0xec]
and ecx, eax
and esi, eax
add esi, edi
mov dword [ebp - 0x64], ecx
mov eax, edi
mov ecx, dword [0x402600]
sub eax, ecx
mov dword [ebp - 0xf4], eax
jne 0x47ff6b
xor edi, edi
cmp dword [ebp - 0x64], edi
jbe 0x48017f
mov ecx, 0x48863bd6
mov edx, ecx
movzx eax, byte [edi + esi]
add eax, ecx
add dword [ebp - 0x60], eax
add eax, dword [ebp - 0x5c]
imul eax, eax, 0x48863bd6
ror eax, 9
mul edx
add eax, edx
mov edx, eax
imul edx, edx, 0xede9
rol edx, 6
ror eax, 6
xor edx, eax
add dword [ebp - 0x60], edx
inc edi
cmp edi, dword [ebp - 0x64]
mov dword [ebp - 0x5c], edx
jb 0x47ff14
jmp 0x48017f
mov ebx, dword [0x4c7398]
imul ebx, edx
lea ebx, [ebx + section..data]
jmp 0x47fd91
mov ebx, eax
jmp 0x47fdc9
mov edx, dword [0x40003c]
mov ecx, esi
mov eax, dword [ebp - 0x64]
add eax, esi
mov dword [ebp - 0x74], eax
lea edx, [edx + 0x4000a0]
mov eax, dword [edx]
add eax, edi
mov edx, dword [edx + 4]
sub ecx, edi
mov edi, ecx
mov dword [ebp - 0xcc], edx
mov edx, ecx
and edx, ebx
sub edi, edx
mov dword [ebp - 0xd0], edi
mov edi, dword [ebp - 0x64]
add ecx, edi
mov edi, ecx
and edi, ebx
sub ecx, edi
mov dword [ebp - 0xe4], ecx
mov ecx, dword [ebp - 0xcc]
add ecx, eax
cmp eax, ecx
mov dword [ebp - 0xe8], edi
mov edi, eax
mov dword [ebp - 0xe0], ecx
je 0x47ffd8
cmp dword [edi], edx
jae 0x47ffd8
add edi, dword [edi + 4]
cmp edi, dword [ebp - 0xe0]
jne 0x47ffc9
xor ebx, ebx
cmp edi, dword [ebp - 0xe0]
je 0x480008
cmp dword [edi], edx
jne 0x480008
mov eax, dword [edi + 4]
sub eax, 8
shr eax, 1
je 0x480008
movzx ecx, word [edi + ebx*2 + 8]
and ecx, 0xfff
cmp ecx, dword [ebp - 0xd0]
jae 0x480008
inc ebx
cmp ebx, eax
jne 0x47fff0
mov ecx, 0x48863bd6
cmp edi, dword [ebp - 0xe0]
je 0x480140
mov eax, dword [ebp - 0xe8]
cmp dword [edi], eax
ja 0x480140
mov eax, dword [edi + 4]
lea edx, [eax - 8]
shr edx, 1
cmp ebx, edx
jne 0x480053
add edi, eax
cmp edi, dword [ebp - 0xe0]
je 0x480140
mov eax, dword [ebp - 0xe8]
cmp dword [edi], eax
ja 0x480140
xor ebx, ebx
jmp 0x480027
mov eax, dword [edi]
cmp eax, dword [ebp - 0xe8]
jne 0x480073
movzx eax, word [edi + ebx*2 + 8]
and eax, 0xfff
cmp eax, dword [ebp - 0xe4]
jae 0x480140
mov eax, ebx
inc ebx
test word [edi + eax*2 + 8], 0xf000
mov dword [ebp - 0xd8], ebx
je 0x48000d
mov edx, dword [edi]
movzx eax, word [edi + eax*2 + 8]
and eax, 0xfff
lea eax, [eax + edx + 0x400000]
mov dword [ebp - 0x64], eax
xor ebx, ebx
sub dword [ebp - 0x64], esi
mov dword [ebp - 0xd0], eax
je 0x4800e1
movzx eax, byte [ebx + esi]
mov edx, ecx
add eax, ecx
add dword [ebp - 0x60], eax
add eax, dword [ebp - 0x5c]
imul eax, eax, 0x48863bd6
ror eax, 9
mul edx
add eax, edx
mov edx, eax
imul edx, edx, 0xede9
rol edx, 6
ror eax, 6
xor edx, eax
mov eax, edx
add dword [ebp - 0x60], eax
inc ebx
cmp ebx, dword [ebp - 0x64]
mov dword [ebp - 0x5c], edx
jb 0x4800a8
mov esi, dword [ebp - 0xd0]
mov eax, dword [esi]
sub eax, dword [ebp - 0xf4]
xor ebx, ebx
mov dword [ebp - 0xf8], eax
mov edx, ecx
movzx eax, byte [ebp + ebx - 0xf8]
add eax, ecx
add dword [ebp - 0x60], eax
add eax, dword [ebp - 0x5c]
imul eax, eax, 0x48863bd6
ror eax, 9
mul edx
add eax, edx
mov edx, eax
imul edx, edx, 0xede9
rol edx, 6
ror eax, 6
xor edx, eax
add dword [ebp - 0x60], edx
inc ebx
cmp ebx, 4
mov dword [ebp - 0x5c], edx
jb 0x4800f7
add esi, 4
mov ebx, dword [ebp - 0xd8]
jmp 0x48000d
mov ebx, dword [ebp - 0x74]
xor edi, edi
sub ebx, esi
je 0x48017f
movzx eax, byte [edi + esi]
mov edx, ecx
add eax, ecx
add dword [ebp - 0x60], eax
add eax, dword [ebp - 0x5c]
imul eax, eax, 0x48863bd6
ror eax, 9
mul edx
add eax, edx
mov edx, eax
imul edx, edx, 0xede9
rol edx, 6
ror eax, 6
xor edx, eax
add dword [ebp - 0x60], edx
mov dword [ebp - 0x5c], edx
inc edi
cmp edi, ebx
jb 0x480149
xor edi, edi
xor eax, eax
mov ecx, eax
and ecx, 7
mov cl, byte [ebp + ecx - 0x60]
mov byte [ebp + eax - 0x54], cl
inc eax
cmp eax, 0x10
jb 0x480183
mov eax, 0x3f7b45c2
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 [0x5294e0]
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 - 0xc0]
mov dword [ebp - 0x110], ecx
lea ecx, [ebp - 0x44]
sub eax, ecx
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp - 0x6c]
sub eax, dword [ebp - 0xc0]
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 - 0x74], eax
push 0x10
pop ecx
lea edi, [ebp - 0xbc]
lea esi, [ebp - 0x138]
rep movsd dword es:[edi], dword [esi]
mov edx, dword [ebp - 0x8c]
mov esi, dword [ebp - 0xbc]
mov ecx, dword [ebp - 0x9c]
mov eax, dword [ebp - 0xac]
mov dword [ebp - 0x64], 2
mov ebx, dword [ebp - 0xa8]
lea edi, [edx + esi]
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 - 0xb8]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x98], edi
mov edi, 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
rol ebx, 0xd
xor eax, ebx
mov ebx, dword [ebp - 0x98]
mov edi, dword [ebp - 0xa0]
add edi, eax
ror edi, 0xe
xor dword [ebp - 0xa8], edi
mov edi, dword [ebp - 0x94]
add edi, ebx
rol edi, 7
xor dword [ebp - 0x90], edi
mov edi, dword [ebp - 0x94]
mov ebx, dword [ebp - 0x90]
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 edi, dword [ebp - 0x88]
mov ebx, dword [ebp - 0x84]
add ebx, edi
ror ebx, 0xe
xor dword [ebp - 0x80], ebx
dec dword [ebp - 0x64]
jne 0x480264
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 0x4804c9
lea edi, [ebp - 0x44]
lea esi, [ebp - 0xbc]
inc dword [ebp - 0x118]
cmp dword [ebp - 0xc4], ebx
push 0x10
pop ecx
rep movsd dword es:[edi], dword [esi]
jbe 0x480533
mov eax, dword [ebp - 0x74]
mov esi, dword [ebp - 0xcc]
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 0x480506
sub dword [ebp - 0xc4], ebx
add dword [ebp - 0x68], ebx
add esi, ebx
add dword [ebp - 0x78], ebx
mov dword [ebp - 0xcc], esi
jmp 0x480234
cmp dword [ebp - 0xc4], edx
jbe 0x480560
lea eax, [ebp - 0x44]
mov esi, dword [ebp - 0x78]
mov edi, dword [ebp - 0x68]
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
cmp edx, dword [ebp - 0xc4]
mov byte [ecx + edi], al
jb 0x480548
mov edi, 0x400000
mov ebx, 0xfffff000
mov esi, dword [ebp - 0xc8]
mov eax, dword [ebp - 0x70]
mov al, byte [eax + 8]
xor al, byte [ebp - 0x55]
je 0x480608
call fcn.004a46e1
mov edi, eax
mov eax, dword [ebp - 0xd4]
mov dword [eax + 8], 0x4b3c5b
mov edx, 0xffff
lea ecx, [eax + 0xc]
and ecx, 0xfffffffc
lea esi, [ecx + 0xfff]
and edi, ebx
and esi, ebx
xor eax, eax
mov ebx, dword [0x51b214]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x51b214], ebx
shr ebx, 0x10
shl eax, 0x10
or eax, ebx
shr edx, 0x10
jne 0x4805aa
xor edx, edx
mov ebx, 0xffff
div ebx
inc edx
mov dword [ebp - 0x150], edi
cmp ecx, esi
mov dword [ebp - 0x144], edx
mov eax, ecx
mov dword [ebp - 0x74], 0
jae 0x4805fe
mov ecx, dword [ebp - 0x74]
mov dword [eax], ecx
add eax, 4
cmp eax, esi
jb 0x4805f2
mov eax, 0x4b3c5b
jmp 0x4806e4
mov ecx, dword [0x402600]
mov eax, dword [ebp - 0x6c]
sub eax, dword [ebp - 0xc0]
sub edi, ecx
mov dword [ebp - 0xc8], eax
mov dword [ebp - 0x70], edi
jne 0x48062c
test eax, eax
je 0x4806d4
mov edi, dword [ebp - 0xc0]
sub edi, dword [ebp - 0x6c]
mov eax, dword [ebp - 0x7c]
add eax, esi
mov ecx, dword [0x4bebb0]
xor esi, esi
dec ecx
mov dword [ebp - 0x74], eax
js 0x480670
lea eax, [esi + ecx]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [eax*4 + 0x4bebb4]
and edx, 0xfffffff
cmp dword [ebp - 0x7c], edx
jae 0x480667
lea ecx, [eax - 1]
jmp 0x48066c
jbe 0x480674
lea esi, [eax + 1]
cmp ecx, esi
jge 0x480648
mov ebx, esi
jmp 0x4806cc
mov ebx, eax
jmp 0x4806cc
mov eax, dword [ebx*4 + 0x4bebb4]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0x74]
jae 0x4806d4
lea esi, [ecx + edi + 0x400000]
mov ecx, eax
shl ecx, 2
sar ecx, 0x1e
sar eax, 0x1e
and ecx, 3
and eax, 3
xor edx, edx
dec ecx
je 0x4806bc
dec ecx
je 0x4806b4
dec ecx
jne 0x4806c5
mov edx, dword [ebp - 0x70]
jmp 0x4806c5
mov edx, dword [ebp - 0xc8]
jmp 0x4806c5
mov edx, dword [ebp - 0x70]
sub edx, dword [ebp - 0xc8]
dec eax
dec eax
jne 0x4806cb
add dword [esi], edx
inc ebx
cmp ebx, dword [0x4bebb0]
jb 0x480678
mov eax, dword [0x4c7398]
mov eax, 0x9c163c71
mov eax, dword [ebp - 0xc0]
mov ecx, dword [ebp - 0xd4]
mov dword [ecx + 8], eax
mov edi, dword [ebp - 0x140]
mov ebx, dword [ebp - 0x148]
mov edx, dword [ebp - 0x150]
mov eax, dword [ebp - 0x14c]
mov esi, dword [ebp - 0x13c]
mov ecx, dword [ebp - 0x144]
mov esp, ebp
pop ebp
popfd
ret