Function at 0x50fb70
Capabilities:
Access peb ldr_data
Create directory
Get common file path
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x596656
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x234
push ebx
push esi
mov ebx, ecx
push edi
xor esi, esi
push esi
lea ecx, [ebx + 8]
mov dword [ebp - 0x1c], ebx
mov dword [ebx], vtable.CRPCClient.0
call fcn.004fbd90
mov dword [ebp - 4], esi
mov eax, dword [0x5f5774]
mov edx, dword [eax + 0xc]
lea edi, [ebx + 0xc]
mov ecx, 0x5f5774
mov dword [ebp - 0x14], edi
call edx
add eax, 0x10
mov dword [edi], eax
mov byte [ebp - 4], 2
mov eax, dword [0x5f5774]
mov edx, dword [eax + 0xc]
lea edi, [ebx + 0x10]
mov ecx, 0x5f5774
mov dword [ebp - 0x14], edi
call edx
add eax, 0x10
mov dword [edi], eax
mov byte [ebp - 4], 4
mov eax, dword [0x5f5774]
mov edx, dword [eax + 0xc]
lea edi, [ebx + 0x1c]
mov ecx, 0x5f5774
mov dword [ebp - 0x14], edi
call edx
add eax, 0x10
mov dword [edi], eax
mov byte [ebp - 4], 6
mov dword [ebx + 0x20], esi
mov dword [ebx + 0x24], esi
mov dword [ebx + 0x28], esi
mov dword [ebx + 0x2c], esi
mov dword [ebx + 0x30], esi
mov byte [ebp - 4], 7
mov eax, dword [0x5f5774]
mov edx, dword [eax + 0xc]
lea edi, [ebx + 0x38]
mov ecx, 0x5f5774
mov dword [ebp - 0x14], edi
call edx
add eax, 0x10
mov dword [edi], eax
mov byte [ebp - 4], 9
mov eax, 0x443
lea edi, [ebx + 0x2b00]
mov dword [ebx + 0x3c], 0xffffffff
mov word [ebx + 0x2af8], ax
mov byte [ebx + 0x2afa], 0
mov dword [ebx + 0x2afc], 0x10
push 0x18
mov dword [ebp - 0x10], edi
mov dword [edi + 8], esi
call fcn.0055549a
add esp, 4
cmp eax, esi
je 0x51004d
mov dword [edi + 4], eax
mov dword [eax], eax
mov eax, dword [edi + 4]
mov dword [eax + 4], eax
mov eax, dword [edi + 4]
mov dword [eax + 8], eax
mov ecx, dword [edi + 4]
mov byte [ecx + 0x14], 1
mov edx, dword [edi + 4]
mov byte [edx + 0x15], 1
mov byte [ebp - 4], 0xd
lea edi, [ebx + 0x2b10]
push 0x18
mov dword [ebp - 0x38], edi
mov dword [edi + 8], esi
call fcn.0055549a
add esp, 4
cmp eax, esi
je 0x510021
mov dword [edi + 4], eax
mov dword [eax], eax
mov eax, dword [edi + 4]
mov dword [eax + 4], eax
mov eax, dword [edi + 4]
mov dword [eax + 8], eax
mov eax, dword [edi + 4]
mov byte [eax + 0x14], 1
mov ecx, dword [edi + 4]
mov byte [ecx + 0x15], 1
mov byte [ebp - 4], 0x11
push 0x204
lea edx, [ebp - 0x23c]
push esi
push edx
mov dword [ebp - 0x240], esi
call fcn.00555020
add esp, 0xc
push 1
push 0x1a
lea eax, [ebp - 0x240]
push eax
push esi
mov dword [ebx + 4], esi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea edi, [ebp - 0x240]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x50fd14
mov ecx, dword [0x59e4c4]
mov eax, str.StaffCop
mov dword [edi], ecx
mov edi, eax
nop
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x50fd30
sub eax, edi
mov edx, edi
lea edi, [ebp - 0x240]
add edi, 0xfffffffe
jmp 0x50fd50
mov cx, word [edi + 2]
add edi, 2
cmp cx, si
jne 0x50fd50
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x240]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x50fd75
mov edx, dword [0x59e4c4]
mov eax, 0x5a9458
mov dword [edi], edx
mov edx, eax
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x50fd90
lea edi, [ebp - 0x240]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x50fda6
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0
lea eax, [ebp - 0x240]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea edi, [ebp - 0x240]
add edi, 0xfffffffe
lea ebx, [ebx]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x50fde0
mov ecx, dword [0x59e4c4]
mov eax, str.CRPCClient.log
mov dword [edi], ecx
mov edx, eax
jmp 0x50fe00
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x50fe00
lea edi, [ebp - 0x240]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x50fe16
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
lea eax, [ebp - 0x240]
rep movsb byte es:[edi], byte [esi]
lea edx, [eax + 2]
jmp 0x50fe40
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x50fe40
sub eax, edx
sar eax, 1
push eax
lea edx, [ebp - 0x240]
push edx
lea ecx, [ebx + 0x38]
call fcn.00405e50
push 0x208
lea edi, [ebx + 0x50]
push 0
push edi
call fcn.00555020
mov eax, dword [0x5f5774]
mov edx, dword [eax + 0xc]
add esp, 0xc
mov ecx, 0x5f5774
call edx
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
mov byte [ebp - 4], 0x13
lea eax, [ebp - 0x18]
push eax
call fcn.0050a4d0
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
add esp, 4
or eax, ecx
jge 0x50febb
push 0x104
lea ecx, [ebp - 0x10]
call fcn.00403ca0
mov esi, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x18]
push 0x104
push esi
push str.LogsDir
push ecx
call fcn.0050a330
add esp, 0x10
test eax, eax
jne 0x50ff31
push edi
push eax
push eax
push 0x1a
push eax
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x50fee5
mov edx, dword [0x59e4c4]
mov eax, str.StaffCop
mov dword [edi], edx
mov edx, eax
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x50ff00
sub eax, edx
lea edi, [ebx + 0x4e]
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x50ff10
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x10]
jmp 0x50ff7f
test esi, esi
jne 0x50ff39
xor eax, eax
jmp 0x50ff55
mov eax, esi
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x50ff40
sub eax, edx
sar eax, 1
js 0x510017
cmp eax, dword [esi - 8]
jg 0x510017
xor ecx, ecx
mov dword [esi - 0xc], eax
lea edx, [ebx + 0x50]
mov word [esi + eax*2], cx
mov eax, esi
sub edx, esi
mov edi, edi
movzx ecx, word [eax]
mov word [eax + edx], cx
add eax, 2
test cx, cx
jne 0x50ff70
push 0
lea edi, [ebx + 0x50]
push edi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [edi - 2]
mov edi, edi
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x50ff90
mov edx, dword [0x59e4c8]
mov dword [eax], edx
mov ecx, dword [str.ata_]
mov dword [eax + 4], ecx
mov edx, dword [0x59e4d0]
mov dword [eax + 8], edx
mov cx, word [0x59e4d4]
mov word [eax + 0xc], cx
push 0
lea eax, [ebx + 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [0x5f8edc], ebx
mov byte [ebp - 4], 0x11
add esi, 0xfffffff0
lea eax, [esi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x50fffd
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov eax, ebx
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.00401150
lea ecx, [ebp - 0x10]
push ecx
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x10], esi
call fcn.00553e83
mov byte [ebp - 4], 0xe
mov dword [ebp - 0x28], vtable.std::bad_alloc.0
mov byte [ebp - 4], 0xd
push 0x5c69bc
lea edx, [ebp - 0x28]
push edx
call fcn.00554cbc
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x14], esi
call fcn.00553e83
mov byte [ebp - 4], 0xa
mov dword [ebp - 0x34], vtable.std::bad_alloc.0
mov byte [ebp - 4], 9
push 0x5c69bc
lea ecx, [ebp - 0x34]
push ecx
call fcn.00554cbc
int3