Function at 0x4f4ab4
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 - 0x150], eax
lea eax, [ebp + 4]
sub eax, 4
mov dword [ebp - 0x148], ecx
mov ecx, 0xfffffff
mov dword [ebp - 0x154], edx
mov dword [ebp - 0x14c], ebx
mov dword [ebp - 0x140], esi
lea esi, [eax + 0xc]
mov dword [ebp - 0x144], edi
mov dword [ebp - 0xd8], eax
mov eax, dword [esi]
mov ebx, dword [eax + 4]
mov dword [ebp - 0x78], eax
mov eax, dword [eax]
and eax, ecx
and ebx, ecx
xor edx, edx
mov ecx, dword [0x4c7398]
mov dword [ebp - 0x6c], ecx
lea ecx, [ecx + eax - 1]
mov eax, ecx
div dword [ebp - 0x6c]
mov eax, dword [0x4c7398]
mov edi, 0x400000
mov dword [ebp - 0xc4], esi
add ebx, edi
sub ecx, edx
mov dword [ebp - 0xcc], ebx
mov dword [ebp - 0x70], ecx
mov eax, dword [0x403ef8]
mov dword [ebp - 0x80], eax
mov eax, dword [0x4c7398]
mov eax, dword [0x403ef8]
test eax, eax
je 0x4f4be3
and dword [ebp - 0x5c], 0
mov eax, dword [0x403ef8]
dec eax
lea ecx, [eax + 1]
mov dword [ebp - 0x7c], ecx
xor eax, eax
test ecx, ecx
je 0x4f4b8c
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 - 0x7c], 0x10
jne 0x4f4b66
xor edx, edx
div ecx
cmp dword [ebp - 0x80], 0
mov dword [ebp - 0x74], edx
jbe 0x4f4bd5
mov ecx, 0xffffc390
lea edx, [edx*4 + 0x529524]
inc dword [ebp - 0x5c]
mov eax, 0x3c6f
lock cmpxchg dword [edx], ecx
cmp eax, 0x3c6f
je 0x4f4da0
mov ecx, dword [0x403ef8]
mov eax, dword [ebp - 0x74]
inc eax
xor edx, edx
div ecx
mov eax, dword [ebp - 0x5c]
cmp eax, dword [ebp - 0x80]
mov dword [ebp - 0x74], edx
jb 0x4f4b99
and dword [ebp - 0x60], 0
cmp dword [ebp - 0x60], 0
jne 0x4f4c69
call dword [sym.imp.kernel32.dll_GetLastError]
and dword [ebp - 0x5c], 0
mov dword [ebp - 0x6c], eax
inc dword [ebp - 0x5c]
push 0x40
push 0x1000
push dword [ebp - 0x70]
push 0
call dword [sym.imp.kernel32.dll_VirtualAlloc]
test eax, eax
jne 0x4f4db7
push eax
call dword [sym.imp.kernel32.dll_Sleep]
cmp dword [ebp - 0x5c], 0x11
jb 0x4f4bf0
and dword [ebp - 0x60], 0
mov eax, dword [ebp - 0x60]
cmp dword [0x51b2c4], eax
ja 0x4f4c2d
test al, 3
je 0x4f4c45
test eax, eax
je 0x4f4c41
push 0x8000
push 0
push dword [ebp - 0x60]
call dword [sym.imp.kernel32.dll_VirtualFree]
and dword [ebp - 0x60], 0
push dword [ebp - 0x6c]
call dword [sym.imp.kernel32.dll_SetLastError]
cmp dword [ebp - 0x60], 0
je 0x4f4b36
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x70]
test ecx, ecx
je 0x4f4c69
mov byte [eax], 0
inc eax
dec ecx
jne 0x4f4c62
mov eax, 0xbb4d6a5
add dword [esi], 8
mov eax, dword [ebp - 0x78]
mov esi, dword [eax]
and esi, 0xfffffff
lea eax, [esi + ebx]
mov dword [ebp - 0x6c], eax
mov eax, dword [0x4c7398]
sub eax, esi
lea ecx, [eax + 1]
mov edx, ecx
mov dword [ebp - 0x70], ebx
sub dword [ebp - 0x70], edi
mov dword [ebp - 0x78], esi
xor eax, eax
test ecx, ecx
je 0x4f4cc2
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 0x4f4c9d
xor edx, edx
div ecx
mov eax, dword [ebp - 0x60]
lea ebx, [edx + eax]
push ebx
push esi
push dword [ebp - 0x70]
mov dword [ebp - 0x74], ebx
mov eax, 0x72838e39
mov eax, dword [ebp - 0x6c]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0xf0], eax
mov eax, dword [ebp - 0xcc]
add esp, 0xc
mov dword [ebp - 0x7c], ebx
mov dword [ebp - 0xf4], ecx
mov byte [ebp - 0x55], 0
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x80], eax
test esi, esi
mov ebx, 0xfffff000
je 0x4f53d2
lea eax, [ebp - 0xf4]
push eax
mov eax, 0x23d38d8b
mov esi, dword [ebp - 0xf4]
mov eax, 0xfffffff
and dword [ebp - 0x68], 0
and dword [ebp - 0x64], 0
pop ecx
mov ecx, dword [ebp - 0xf0]
and ecx, eax
and esi, eax
add esi, edi
mov eax, edi
mov dword [ebp - 0x5c], ecx
mov ecx, dword [0x402600]
sub eax, ecx
mov dword [ebp - 0xf8], eax
jne 0x4f4dbf
xor edx, edx
cmp dword [ebp - 0x5c], edx
jbe 0x4f4fe0
mov edi, 0x2aa66c86
movzx eax, byte [edx + esi]
add eax, edi
add dword [ebp - 0x68], eax
add eax, dword [ebp - 0x64]
imul eax, eax, 0x2aa66c86
ror eax, 0x14
imul eax, eax, 0x2aa66c86
ror eax, 0x14
mov ecx, eax
imul eax, eax, 0x2434
rol eax, 6
ror ecx, 6
xor eax, ecx
add dword [ebp - 0x68], eax
inc edx
cmp edx, dword [ebp - 0x5c]
mov dword [ebp - 0x64], eax
jb 0x4f4d61
jmp 0x4f4fe0
mov eax, dword [0x4c7398]
imul eax, dword [ebp - 0x74]
lea eax, [eax + section..data]
mov dword [ebp - 0x60], eax
jmp 0x4f4bd9
mov dword [ebp - 0x60], eax
jmp 0x4f4c1e
mov eax, dword [ebp - 0x5c]
mov ecx, esi
add eax, esi
mov edx, dword [0x40003c]
mov dword [ebp - 0xd4], eax
lea edx, [edx + 0x4000a0]
mov eax, dword [edx]
mov edx, dword [edx + 4]
mov dword [ebp - 0xc8], edx
add eax, edi
sub ecx, edi
mov edi, ecx
mov edx, ecx
and edi, ebx
sub edx, edi
mov dword [ebp - 0xd0], edx
mov edx, dword [ebp - 0x5c]
add ecx, edx
mov edx, ecx
and edx, ebx
sub ecx, edx
mov dword [ebp - 0xe8], ecx
mov ecx, dword [ebp - 0xc8]
mov dword [ebp - 0xec], edx
add ecx, eax
cmp eax, ecx
mov dword [ebp - 0xe4], ecx
je 0x4f4e2d
cmp dword [eax], edi
jae 0x4f4e2d
add eax, dword [eax + 4]
cmp eax, dword [ebp - 0xe4]
jne 0x4f4e1e
xor edx, edx
cmp eax, dword [ebp - 0xe4]
je 0x4f4e5d
cmp dword [eax], edi
jne 0x4f4e5d
mov ecx, dword [eax + 4]
sub ecx, 8
shr ecx, 1
je 0x4f4e5d
movzx edi, word [eax + edx*2 + 8]
and edi, 0xfff
cmp edi, dword [ebp - 0xd0]
jae 0x4f4e5d
inc edx
cmp edx, ecx
jne 0x4f4e45
mov edi, 0x2aa66c86
cmp eax, dword [ebp - 0xe4]
je 0x4f4f9b
mov ecx, dword [ebp - 0xec]
cmp dword [eax], ecx
ja 0x4f4f9b
mov ecx, dword [eax + 4]
lea ebx, [ecx - 8]
shr ebx, 1
cmp edx, ebx
jne 0x4f4ea8
add eax, ecx
cmp eax, dword [ebp - 0xe4]
je 0x4f4f9b
mov ecx, dword [ebp - 0xec]
cmp dword [eax], ecx
ja 0x4f4f9b
xor edx, edx
jmp 0x4f4e7c
mov ecx, dword [eax]
cmp ecx, dword [ebp - 0xec]
jne 0x4f4ec9
movzx ecx, word [eax + edx*2 + 8]
and ecx, 0xfff
cmp ecx, dword [ebp - 0xe8]
jae 0x4f4f9b
mov ecx, edx
inc edx
test word [eax + ecx*2 + 8], 0xf000
mov dword [ebp - 0xdc], edx
je 0x4f4e62
movzx edx, word [eax + ecx*2 + 8]
mov ecx, dword [eax]
and edx, 0xfff
lea ecx, [ecx + edx + 0x400000]
mov dword [ebp - 0x5c], ecx
xor ebx, ebx
sub dword [ebp - 0x5c], esi
mov dword [ebp - 0xd0], ecx
je 0x4f4f3f
movzx edx, byte [ebx + esi]
add edx, edi
add dword [ebp - 0x68], edx
add edx, dword [ebp - 0x64]
imul edx, edx, 0x2aa66c86
ror edx, 0x14
imul edx, edx, 0x2aa66c86
ror edx, 0x14
mov ecx, edx
imul ecx, ecx, 0x2434
rol ecx, 6
ror edx, 6
xor ecx, edx
add dword [ebp - 0x68], ecx
inc ebx
cmp ebx, dword [ebp - 0x5c]
mov dword [ebp - 0x64], ecx
jb 0x4f4eff
mov ecx, dword [ebp - 0xd0]
mov edx, dword [ecx]
sub edx, dword [ebp - 0xf8]
mov dword [ebp - 0xfc], edx
xor ebx, ebx
movzx edx, byte [ebp + ebx - 0xfc]
add edx, edi
add dword [ebp - 0x68], edx
add edx, dword [ebp - 0x64]
imul edx, edx, 0x2aa66c86
ror edx, 0x14
imul edx, edx, 0x2aa66c86
ror edx, 0x14
mov esi, edx
imul edx, edx, 0x2434
rol edx, 6
ror esi, 6
xor edx, esi
add dword [ebp - 0x68], edx
inc ebx
cmp ebx, 4
mov dword [ebp - 0x64], edx
jb 0x4f4f4f
mov edx, dword [ebp - 0xdc]
lea esi, [ecx + 4]
jmp 0x4f4e62
xor edx, edx
mov ebx, dword [ebp - 0xd4]
sub ebx, esi
je 0x4f4fe0
movzx eax, byte [edx + esi]
add eax, edi
add dword [ebp - 0x68], eax
add eax, dword [ebp - 0x64]
imul eax, eax, 0x2aa66c86
ror eax, 0x14
imul eax, eax, 0x2aa66c86
ror eax, 0x14
mov ecx, eax
imul eax, eax, 0x2434
rol eax, 6
ror ecx, 6
xor eax, ecx
add dword [ebp - 0x68], eax
inc edx
cmp edx, ebx
mov dword [ebp - 0x64], eax
jb 0x4f4fa7
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 0x4f4fe4
mov eax, 0x36160edf
mov esi, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x50]
mov dword [ebp - 0x138], eax
mov dword [ebp - 0x110], eax
mov eax, dword [0x5294e0]
mov dword [ebp - 0x134], ecx
mov dword [ebp - 0x10c], ecx
mov ecx, dword [eax]
mov dword [ebp - 0x13c], ecx
mov ecx, dword [eax + 4]
mov dword [ebp - 0x128], ecx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x100], eax
mov eax, dword [ebp - 0x74]
mov dword [ebp - 0x114], ecx
lea ecx, [ebp - 0x44]
sub eax, ecx
mov dword [ebp - 0xc8], eax
mov eax, dword [ebp - 0xcc]
sub eax, dword [ebp - 0x74]
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]
push 0x10
lea edi, [ebp - 0xc0]
pop ecx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0xb0]
mov esi, dword [ebp - 0xc0]
mov ecx, dword [ebp - 0xa0]
mov edx, dword [ebp - 0x90]
mov dword [ebp - 0x5c], 2
mov ebx, dword [ebp - 0xbc]
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 - 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
ror edi, 0xe
mov ebx, dword [ebp - 0x98]
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
mov ebx, dword [ebp - 0x84]
ror edi, 0xe
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
rol ebx, 0xd
mov edi, dword [ebp - 0xa4]
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 edi, dword [ebp - 0xbc]
mov ebx, dword [ebp - 0xb8]
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
mov edi, dword [ebp - 0xa8]
rol ebx, 9
xor dword [ebp - 0xa4], ebx
mov ebx, dword [ebp - 0xa4]
add ebx, edi
rol ebx, 0xd
xor eax, ebx
mov edi, dword [ebp - 0xa4]
add edi, eax
mov ebx, dword [ebp - 0x9c]
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
mov edi, dword [ebp - 0x94]
rol ebx, 9
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 edi, dword [ebp - 0x8c]
mov ebx, dword [ebp - 0x88]
add ebx, edi
ror ebx, 0xe
xor dword [ebp - 0x84], ebx
dec dword [ebp - 0x5c]
jne 0x4f50c5
mov dword [ebp - 0x90], edx
xor edx, edx
push 0x40
mov dword [ebp - 0xb0], eax
xor eax, eax
mov dword [ebp - 0xa0], ecx
mov dword [ebp - 0xc0], esi
pop ebx
mov ecx, dword [ebp + eax - 0x13c]
add dword [ebp + eax - 0xc0], ecx
add eax, 4
cmp eax, ebx
jl 0x4f5337
lea edi, [ebp - 0x44]
inc dword [ebp - 0x11c]
cmp dword [ebp - 0x60], ebx
push 0x10
lea esi, [ebp - 0xc0]
pop ecx
rep movsd dword es:[edi], dword [esi]
jbe 0x4f539e
mov esi, dword [ebp - 0xc8]
mov eax, dword [ebp - 0xd4]
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 0x4f5374
sub dword [ebp - 0x60], ebx
add dword [ebp - 0x7c], ebx
add esi, ebx
add dword [ebp - 0x80], ebx
mov dword [ebp - 0xc8], esi
jmp 0x4f5095
cmp dword [ebp - 0x60], edx
jbe 0x4f53c5
mov esi, dword [ebp - 0x80]
lea eax, [ebp - 0x44]
sub esi, eax
mov edi, dword [ebp - 0x7c]
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 - 0x60]
mov byte [ecx + edi], al
jb 0x4f53b0
mov edi, 0x400000
mov ebx, 0xfffff000
mov esi, dword [ebp - 0x78]
mov eax, dword [ebp - 0x6c]
mov al, byte [eax + 8]
xor al, byte [ebp - 0x55]
je 0x4f5473
call fcn.004fdc7b
mov esi, eax
mov edi, dword [ebp - 0xc4]
mov edx, 0xffff
mov eax, dword [ebp - 0xd8]
mov dword [eax + 8], 0x4b3c5b
and edi, 0xfffffffc
lea ecx, [edi + 0xfff]
and esi, ebx
and ecx, 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 0x4f540f
mov ebx, 0xffff
xor edx, edx
div ebx
inc edx
mov dword [ebp - 0x154], esi
cmp edi, ecx
mov dword [ebp - 0x148], edx
mov dword [ebp - 0xc4], 0
mov eax, edi
jae 0x4f5469
mov edx, dword [ebp - 0xc4]
mov dword [eax], edx
add eax, 4
cmp eax, ecx
jb 0x4f545a
mov eax, 0x4b3c5b
jmp 0x4f5549
mov eax, dword [ebp - 0xcc]
sub eax, dword [ebp - 0x74]
mov ecx, dword [0x402600]
mov dword [ebp - 0x78], eax
sub edi, ecx
mov dword [ebp - 0x6c], edi
jne 0x4f5494
test eax, eax
je 0x4f553c
mov ecx, dword [0x4bebb0]
mov eax, dword [ebp - 0x70]
mov edi, dword [ebp - 0x74]
sub edi, dword [ebp - 0xcc]
add eax, esi
xor esi, esi
mov dword [ebp - 0xc4], eax
dec ecx
js 0x4f54db
lea eax, [esi + ecx]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [eax*4 + 0x4bebb4]
and edx, 0xfffffff
cmp dword [ebp - 0x70], edx
jae 0x4f54d2
lea ecx, [eax - 1]
jmp 0x4f54d7
jbe 0x4f54df
lea esi, [eax + 1]
cmp ecx, esi
jge 0x4f54b3
mov ebx, esi
jmp 0x4f5534
mov ebx, eax
jmp 0x4f5534
mov eax, dword [ebx*4 + 0x4bebb4]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0xc4]
jae 0x4f553c
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 0x4f5527
dec ecx
je 0x4f5522
dec ecx
jne 0x4f552d
mov edx, dword [ebp - 0x6c]
jmp 0x4f552d
mov edx, dword [ebp - 0x78]
jmp 0x4f552d
mov edx, dword [ebp - 0x6c]
sub edx, dword [ebp - 0x78]
dec eax
dec eax
jne 0x4f5533
add dword [esi], edx
inc ebx
cmp ebx, dword [0x4bebb0]
jb 0x4f54e3
mov eax, dword [0x4c7398]
mov eax, 0xa146df89
mov eax, dword [ebp - 0x74]
mov ecx, dword [ebp - 0xd8]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x150]
mov edx, dword [ebp - 0x154]
mov edi, dword [ebp - 0x144]
mov esi, dword [ebp - 0x140]
mov ecx, dword [ebp - 0x148]
mov ebx, dword [ebp - 0x14c]
mov esp, ebp
pop ebp
popfd
ret