Function at 0x50482a
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Generate random numbers via rtlgenrandom

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0xe4
mov eax, dword [0x597010]
xor eax, ebp
mov dword [ebp - 0x10], eax
cmp dword [ecx + 0xc], 0
je 0x504d13
lea eax, [ebp - 0x5c]
xor edx, edx
mov dword [eax], edx
mov dword [eax + 4], edx
mov dword [eax - 4], eax
lea edi, [ecx + 4]
mov dword [ebp - 0xdc], ecx
mov ebx, dword [ecx + 8]
mov eax, 0
cmp ebx, edi
mov dword [ebp - 0xc8], edi
je 0x5048f7
xor esi, esi
lea ecx, [ebx + 8]
call fcn.0050520c
test al, al
je 0x5048e2
lea edi, [ebx + 0x10]
lea ecx, [ebp - 0x60]
push edi
call fcn.004e597a
test eax, eax
jne 0x5048bc
movzx eax, byte [ebx + 0x1b]
test al, al
jns 0x50489f
mov eax, dword [ebx + 0x14]
lea eax, [eax*2 + 0x13]
and eax, 0xfffffffc
add esi, eax
lea ecx, [ebp - 0x60]
push edi
push edi
lea eax, [ebp - 0xac]
push eax
call fcn.005041a4
movzx eax, byte [ebx + 0x27]
test al, al
mov edi, dword [ebp - 0xc8]
jns 0x5048cd
mov eax, dword [ebx + 0x20]
movzx ecx, byte [ebx + 0x33]
test cl, cl
jns 0x5048d8
mov ecx, dword [ebx + 0x2c]
add eax, ecx
add eax, 0x15
and eax, 0xfffffffc
add esi, eax
mov ebx, dword [ebx + 4]
cmp ebx, edi
jne 0x504878
mov eax, dword [ebp - 0x5c]
test esi, esi
je 0x5048f7
add esi, 8
mov ebx, esi
jmp 0x5048f9
xor ebx, ebx
lea ecx, [ebp - 0x60]
push eax
call fcn.004d91ea
push ebx
call fcn.00528453
add esp, 4
mov edx, eax
mov dword [ebp - 0xf0], ebx
test ebx, ebx
mov ebx, dword [ebp - 0xdc]
mov dword [ebp - 0xe4], eax
je 0x504ca2
cmp byte [ebx + 0x10], 0
mov eax, 0
je 0x50493f
mov eax, dword [ebx]
test eax, eax
je 0x505200
mov eax, dword [eax + 0x24]
lea esi, [edx + 8]
mov dword [edx + 4], eax
mov eax, dword [ebp - 0xf0]
add eax, 0xfffffff8
mov dword [ebp - 0xc0], eax
mov ebx, dword [ebx + 8]
mov dword [ebp - 0xd8], esi
mov dword [ebp - 0xec], 0
cmp ebx, edi
je 0x504c8e
lea ecx, [ebx + 8]
call fcn.0050520c
test al, al
jne 0x504980
mov ebx, dword [ebx + 4]
jmp 0x504967
xor eax, eax
dec eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], eax
lea edi, [ebx + 0x10]
mov al, byte [ebx + 0x1b]
test al, al
js 0x5049a7
mov ecx, dword [edi + 8]
mov dword [ebp - 0x58], ecx
movq xmm0, qword [edi]
movq qword [ebp - 0x60], xmm0
jmp 0x5049b8
lea ecx, [ebp - 0x60]
push dword [ebx + 0x14]
push dword [ebx + 0x10]
call fcn.0044e310
mov al, byte [ebx + 0x1b]
test al, al
jns 0x5049c1
mov eax, dword [ebx + 0x14]
jmp 0x5049c4
movzx eax, al
lea eax, [eax*2 + 0x13]
and eax, 0xfffffffc
mov ecx, dword [ebp - 0xc0]
sub ecx, eax
mov dword [ebp - 0xd4], ecx
jae 0x5049eb
xor edx, edx
mov edi, dword [ebp - 0xc8]
jmp 0x504c57
cmp dword [ebx + 8], 3
sete byte [esi + 0xc]
mov dword [esi], eax
mov dword [ebp - 0xd0], eax
mov dword [esi + 4], eax
xor eax, eax
mov dword [esi + 8], eax
movzx eax, byte [ebx + 0x1b]
test al, al
jns 0x504a0e
mov eax, dword [ebx + 0x14]
lea edx, [esi + 0xe]
mov ecx, edi
xor edi, edi
push edi
push eax
push edx
call fcn.0044e750
movzx eax, byte [ebx + 0x1b]
test al, al
jns 0x504a28
mov eax, dword [ebx + 0x14]
add dword [ebp - 0xd0], esi
mov word [esi + eax*2 + 0xe], 0
mov edi, dword [ebp - 0xc8]
cmp ebx, edi
je 0x504c33
mov edx, ebx
movzx eax, byte [ebp - 0x55]
test al, al
js 0x504a52
lea edi, [ebp - 0x60]
jmp 0x504a64
mov edi, dword [ebp - 0x60]
mov eax, dword [ebp - 0x5c]
test eax, eax
je 0x504a64
test edi, edi
je 0x5051e8
movzx ecx, byte [edx + 0x1b]
test cl, cl
mov dword [ebp - 0xc0], edx
js 0x504a77
add edx, 0x10
jmp 0x504a7f
mov ecx, edx
mov edx, dword [edx + 0x10]
mov ecx, dword [ecx + 0x14]
test ecx, ecx
je 0x504a8b
test edx, edx
je 0x5051e2
cmp ecx, eax
jne 0x504ac6
test eax, eax
je 0x504aa4
xor ecx, ecx
movzx esi, word [edx + ecx*2]
cmp si, word [edi + ecx*2]
jne 0x504ac6
inc ecx
cmp eax, ecx
jne 0x504a95
mov eax, dword [ebp - 0xd8]
cmp byte [eax + 0xc], 0
mov edx, dword [ebp - 0xc0]
je 0x504af6
movzx eax, byte [edx + 0x27]
test al, al
jns 0x504ad4
mov eax, dword [edx + 0x20]
mov ecx, dword [edx + 0x1c]
jmp 0x504ad7
mov edx, dword [ebp - 0xc0]
mov edx, dword [edx + 4]
jmp 0x504c23
lea ecx, [edx + 0x1c]
test eax, eax
je 0x504ae3
test ecx, ecx
je 0x5051eb
cmp eax, 1
jne 0x504aed
cmp byte [ecx], 0x40
je 0x504af6
mov esi, edx
call fcn.0047b030
mov edx, esi
movzx ecx, byte [edx + 0x27]
test cl, cl
jns 0x504b01
mov ecx, dword [edx + 0x20]
movzx eax, byte [edx + 0x33]
mov dword [ebp - 0xc4], eax
test al, al
mov esi, dword [ebp - 0xd0]
mov eax, dword [ebp - 0xd4]
jns 0x504b24
mov edi, dword [edx + 0x2c]
mov dword [ebp - 0xc4], edi
mov edi, dword [ebp - 0xc4]
add edi, ecx
add edi, 0x15
and edi, 0xfffffffc
mov dword [ebp - 0xcc], ecx
mov ecx, eax
sub ecx, edi
jb 0x504c81
mov dword [ebp - 0xd4], ecx
lea eax, [edx + 0x28]
mov dword [ebp - 0xe8], eax
lea ecx, [edx + 0x1c]
mov dword [esi], edi
mov eax, dword [edx + 8]
mov dword [esi + 4], eax
mov eax, dword [edx + 0xc]
mov dword [esi + 8], eax
mov eax, dword [edx + 0x34]
mov dword [esi + 0xc], eax
lea eax, [esi + 0x10]
mov dword [ebp - 0xe0], eax
xor eax, eax
push eax
push dword [ebp - 0xcc]
push dword [ebp - 0xe0]
call fcn.0044db50
mov ecx, dword [ebp - 0xcc]
lea eax, [esi + ecx]
add eax, 0x10
mov dword [ebp - 0xe0], eax
lea eax, [esi + ecx]
add eax, 0x11
xor edx, edx
mov byte [eax - 1], dl
mov ecx, dword [ebp - 0xe8]
push edx
mov esi, dword [ebp - 0xc4]
push esi
push eax
call fcn.0044db50
mov edx, dword [ebp - 0xc0]
mov eax, dword [ebp - 0xe0]
xor ecx, ecx
mov byte [esi + eax + 1], cl
mov eax, dword [ebp - 0xd8]
inc dword [eax + 8]
add dword [eax], edi
cmp ebx, edx
jne 0x504bda
mov ebx, dword [ebx + 4]
cmp edx, dword [ebp - 0xc8]
je 0x5051ee
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [ebp - 0xc4], ecx
mov dword [eax + 4], ecx
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [ecx], eax
add dword [ebp - 0xd0], edi
lea ecx, [edx + 8]
mov eax, dword [ebp - 0xdc]
dec dword [eax + 0xc]
mov esi, edx
call fcn.005045fa
push esi
call fcn.00528424
add esp, 4
mov edx, dword [ebp - 0xc4]
mov edi, dword [ebp - 0xc8]
cmp edx, edi
jne 0x504a45
jmp 0x504c35
mov ebx, edi
inc dword [ebp - 0xec]
mov dl, 1
mov eax, dword [ebp - 0xd0]
mov esi, eax
mov ecx, dword [ebp - 0xd4]
mov dword [ebp - 0xc0], ecx
mov dword [ebp - 0xd8], eax
cmp byte [ebp - 0x55], 0
jns 0x504c74
push dword [ebp - 0x60]
mov dword [ebp - 0xc4], edx
call fcn.00528424
mov edx, dword [ebp - 0xc4]
add esp, 4
test dl, dl
jne 0x504967
jmp 0x5051db
xor edx, edx
mov dword [ebp - 0xc0], eax
jmp 0x5049e0
mov edx, dword [ebp - 0xe4]
mov eax, dword [ebp - 0xec]
mov dword [edx], eax
mov ebx, dword [ebp - 0xdc]
mov dword [ebp - 0xbc], 0xffffffff
mov eax, dword [ebx]
test eax, eax
je 0x5051f1
lea ecx, [ebp - 0xbc]
mov esi, 0x27
push ecx
mov edi, dword [ebp - 0xf0]
push edi
push edx
push dword [eax]
call fcn.0050127e
add esp, 0x10
test al, al
je 0x5051b1
test edi, edi
je 0x504d1a
xor edi, edi
inc edi
mov esi, 0x58e1d0
mov ecx, ebx
push 0
push 0x518490
push edi
push str.NtMapViewOfSection
push esi
call fcn.005046c4
mov ecx, ebx
push edi
push 0x518700
push edi
push str.NtUnmapViewOfSection
push esi
call fcn.005046c4
jmp 0x504d24
xor esi, esi
jmp 0x5051c4
cmp dword [ebx + 0xc], 0
je 0x50518d
mov eax, dword [ebx]
test eax, eax
je 0x5051f7
mov eax, dword [eax]
sub esp, 0x14
movdqa xmm0, xmmword [0x58e1b0]
movdqu xmmword [esp + 4], xmm0
mov dword [ebp - 0xd4], eax
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edx, dword [ebx + 0xc]
shl edx, 6
lea ecx, [edx + 0x50]
mov dword [ebp - 0xc4], ecx
cmp ecx, 0x10001
jae 0x5051fa
mov dword [ebp - 0xc0], eax
lea ebx, [ebp - 0x60]
mov dword [ebx], 0xffffffff
mov edi, 0xffb0
mov dword [ebp - 0xcc], edx
sub edi, edx
push 4
push ebx
call sub.ADVAPI32.dll_SystemFunction036
movzx esi, word [ebp - 0x60]
mov dword [ebp - 0x60], esi
cmp esi, edi
ja 0x504d87
mov eax, 0x800
mov edi, 0x1000
mov edx, 0x800
mov ebx, dword [ebp - 0xc4]
mov ecx, edi
shr edx, 1
mov edi, eax
cmp eax, ebx
mov eax, edx
jae 0x504daf
neg ecx
and esi, ecx
mov eax, esi
and eax, 0xf000
mov ecx, dword [ebp - 0xc0]
add ecx, eax
mov eax, dword [ebp - 0xcc]
add eax, 0x104f
and eax, 0xfffff000
push 0x40
push 0x1000
push eax
push ecx
push dword [ebp - 0xd4]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebp - 0xcc], eax
test eax, eax
je 0x5051fd
pcmpeqd xmm0, xmm0
movdqu xmmword [ebp - 0x58], xmm0
xor eax, eax
dec eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], eax
movdqu xmmword [ebp - 0x28], xmm0
movdqu xmmword [ebp - 0x38], xmm0
movdqu xmmword [ebp - 0x48], xmm0
mov eax, dword [ebp - 0xc4]
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x5c], 0x10
pxor xmm0, xmm0
movdqu xmmword [0x5abbf0], xmm0
movdqu xmmword [0x5abc00], xmm0
movdqu xmmword [0x5abc10], xmm0
movdqu xmmword [0x5abc20], xmm0
movdqu xmmword [0x5abc30], xmm0
movdqu xmmword [0x5abc40], xmm0
movdqu xmmword [0x5abc4c], xmm0
push 0x58e1d0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [ebp - 0xe0], eax
test eax, eax
mov ebx, dword [ebp - 0xdc]
mov edi, dword [ebp - 0xc8]
je 0x505174
pcmpeqd xmm0, xmm0
movdqu xmmword [ebp - 0x78], xmm0
mov dword [ebp - 0x68], 0xffffffff
mov eax, dword [ebx]
test eax, eax
je 0x505203
and esi, 0xfff
add dword [ebp - 0xcc], esi
mov eax, dword [eax]
mov dword [ebp - 0x7c], 0x57b980
xor ecx, ecx
mov dword [ebp - 0x70], ecx
mov dword [ebp - 0x6c], eax
mov byte [ebp - 0x68], 1
mov dword [ebp - 0x64], ecx
mov esi, dword [ebx + 8]
cmp esi, edi
je 0x5050fa
mov dword [ebp - 0xd8], 0x10
mov dword [ebp - 0xd0], 0
pcmpeqd xmm0, xmm0
movdqu xmmword [ebp - 0x8c], xmm0
movdqu xmmword [ebp - 0x9c], xmm0
movdqu xmmword [ebp - 0xac], xmm0
lea eax, [esi + 8]
lea ecx, [ebp - 0xac]
push eax
call fcn.00504564
xor eax, eax
dec eax
mov dword [ebp - 0xb8], eax
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xb0], eax
lea ebx, [ebp - 0xb8]
mov ecx, ebx
push 0x58e1d0
call fcn.0042d4b2
movzx eax, byte [ebp - 0xad]
test al, al
js 0x504f58
mov ecx, ebx
jmp 0x504f70
mov ecx, dword [ebp - 0xb8]
mov eax, dword [ebp - 0xb4]
test eax, eax
je 0x504f70
test ecx, ecx
je 0x5051f4
movzx ebx, byte [ebp - 0x99]
lea edx, [ebp - 0xa4]
test bl, bl
jns 0x504f8d
mov ebx, dword [ebp - 0xa0]
mov edx, dword [ebp - 0xa4]
test ebx, ebx
je 0x504f99
test edx, edx
je 0x5051e5
cmp ebx, eax
jne 0x505072
test ebx, ebx
je 0x504fba
xor edi, edi
movzx ebx, word [edx + edi*2]
cmp bx, word [ecx + edi*2]
jne 0x505080
inc edi
cmp eax, edi
jne 0x504fa7
cmp dword [ebp - 0xac], 1
jne 0x505080
cmp byte [ebp - 0x81], 0
lea eax, [ebp - 0x8c]
mov edx, dword [ebp - 0xc4]
jns 0x504fe2
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0xe8], eax
mov ecx, dword [ebp - 0xd0]
shl ecx, 6
sub edx, dword [ebp - 0xd8]
cmp byte [ebp - 0x8d], 0
lea edi, [ebp - 0x98]
jns 0x50500c
mov edi, dword [ebp - 0x98]
mov ebx, dword [ebp - 0xcc]
add ebx, ecx
add ebx, 0x10
lea ecx, [ebp - 0x7c]
xor eax, eax
push eax
xor eax, eax
push edx
push ebx
push dword [ebp - 0x80]
push dword [ebp - 0xe8]
push edi
push eax
push dword [ebp - 0xe0]
call fcn.00518750
test eax, eax
js 0x5050cf
mov eax, dword [ebp - 0xa8]
mov dword [eax*4 + 0x5abbf0], ebx
mov eax, dword [ebp - 0xd0]
inc eax
mov dword [ebp - 0xd0], eax
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0xd8]
add eax, 0x40
mov dword [ebp - 0xd8], eax
mov dword [ebp - 0x5c], eax
mov bl, 1
jmp 0x50508c
xor ebx, ebx
mov dword [ebp - 0xc0], 2
jmp 0x505092
xor ebx, ebx
mov dword [ebp - 0xc0], 2
mov edi, dword [ebp - 0xc8]
cmp byte [ebp - 0xad], 0
jns 0x5050a9
push dword [ebp - 0xb8]
call fcn.00528424
add esp, 4
lea ecx, [ebp - 0xac]
call fcn.005045fa
test bl, bl
je 0x50517b
mov esi, dword [esi + 4]
cmp esi, edi
mov ebx, dword [ebp - 0xdc]
jne 0x504ef7
jmp 0x5050fa
mov edi, eax
call fcn.004e3d4a
mov ecx, dword [eax + 0x80]
call dword [section..00cfg]
push edi
call ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [ebp - 0xc0], 0x28
xor ebx, ebx
jmp 0x50508c
lea eax, [ebp - 0xac]
mov dword [eax], 0xffffffff
push eax
push 0x10
lea eax, [ebp - 0x60]
push eax
push dword [ebp - 0xcc]
push dword [ebp - 0xd4]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov ecx, 0x2a
test eax, eax
je 0x505187
cmp dword [ebp - 0xac], 0x10
jne 0x505187
lea eax, [ebp - 0x7c]
mov dword [eax], 0xffffffff
push eax
push 0x20
push dword [ebp - 0xc4]
push dword [ebp - 0xcc]
push dword [ebp - 0xd4]
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov ecx, dword [ebx]
test ecx, ecx
je 0x505209
push 0x6c
push 0x5abbf0
push str.g_originals
call fcn.004e7db0
mov ecx, eax
jmp 0x505187
mov esi, 7
jmp 0x5051b1
mov ebx, dword [ebp - 0xdc]
mov ecx, dword [ebp - 0xc0]
mov esi, ecx
test ecx, ecx
jne 0x5051b1
mov eax, dword [ebp - 0xbc]
mov dword [0x5abc7c], eax
mov ecx, dword [ebx]
test ecx, ecx
je 0x505206
push 4
push 0x5abc7c
push str.g_interceptions
call fcn.004e7db0
mov esi, eax
mov eax, dword [ebp - 0xe4]
test eax, eax
je 0x5051c4
push eax
call fcn.0052845c
add esp, 4
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00528e13
mov eax, esi
add esp, 0xe4
pop esi
pop edi
pop ebx
pop ebp
ret
mov esi, 0x26
jmp 0x5051b1
int3
int3
int3
int3
int3
int3
int3
int3
int3
int3
int3
int3
int3
int3