Function at 0x4d3478
Capabilities:
Resolve function by parsing pe exports

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xb8
and dword [ebp - 0x14], 0
push ebx
mov ebx, dword [ebp + 0x2c]
test ebx, ebx
push esi
push edi
mov edi, dword [ebp + 0x30]
mov byte [ebp - 1], 0
jbe 0x4d34c2
lea esi, [edi + 4]
mov eax, dword [esi]
test al, 1
je 0x4d34a6
or eax, 6
mov dword [esi], eax
push dword [esi - 4]
push dword [0x5b67fc]
call sym.ntoskrnl.exe_RtlEqualSid
test al, al
jne 0x4d5ebf
add esi, 8
dec ebx
jne 0x4d349b
mov ebx, dword [ebp + 0x38]
test ebx, ebx
jbe 0x4d34f2
mov eax, dword [ebp + 0x3c]
add eax, 8
mov ecx, ebx
mov esi, dword [eax - 8]
cmp esi, dword [0x5b6990]
je 0x4d383c
cmp esi, dword [0x5b69c0]
je 0x4d385d
add eax, 0xc
dec ecx
jne 0x4d34d1
lea eax, [ebp - 0x28]
push eax
call fcn.0040c42a
xor esi, esi
cmp dword [ebp + 0x40], esi
jne 0x4fc8f9
mov dword [ebp - 0x14], esi
mov esi, dword [ebp + 0x20]
push esi
call fcn.004a03f1
test eax, eax
jl 0x4d3835
push 0x64546553
push 0x38
push 0
call sym.ntoskrnl.exe_ExAllocatePoolWithTag
mov edi, eax
test edi, edi
je 0x52ba02
mov ecx, dword [ebp + 0x2c]
mov edx, dword [ebp + 0x34]
lea eax, [ebx + ebx*2]
shl eax, 2
mov dword [ebp - 0x1c], eax
add eax, 3
push 0xfffffffffffffffc
pop ebx
and eax, ebx
lea ecx, [ecx*8 + 3]
add edx, 3
mov dword [ebp - 0x20], eax
and ecx, ebx
add ecx, eax
mov eax, dword [ebp + 0x28]
mov eax, dword [eax]
and edx, ebx
add edx, ecx
mov dword [ebp - 8], edx
movzx eax, byte [eax + 1]
push eax
call sym.ntoskrnl.exe_RtlLengthRequiredSid
mov ecx, dword [ebp - 8]
add eax, 3
and eax, ebx
lea eax, [eax + ecx + 8]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0x44]
movzx eax, byte [eax + 1]
push eax
call sym.ntoskrnl.exe_RtlLengthRequiredSid
mov ecx, dword [ebp + 0x48]
add eax, 3
and eax, ebx
test ecx, ecx
mov dword [ebp + 0x20], eax
je 0x4d35a9
movzx ecx, word [ecx + 2]
add ecx, 3
and ecx, ebx
add eax, ecx
mov dword [ebp + 0x20], eax
mov ecx, dword [ebp - 8]
add ecx, 0xa0
cmp eax, 0x1f4
mov dword [ebp - 0x18], ecx
jae 0x4d5ec8
lea eax, [ecx + 0x1f4]
mov dword [ebp + 0x40], eax
lea eax, [ebp + 0x34]
push eax
push 0
push dword [ebp + 0x40]
push ecx
push 0
push 1
push dword [ebp + 0x14]
push dword [sym.ntoskrnl.exe_SeTokenObjectType]
push dword [ebp + 0xc]
call sym.ntoskrnl.exe_ObCreateObject
test eax, eax
mov ebx, dword [ebp + 0x34]
mov dword [ebp + 0x14], eax
jl 0x52ba1d
lea eax, [ebx + 0x30]
push edi
mov dword [eax], edi
call sym.ntoskrnl.exe_ExInitializeResourceLite
lea eax, [ebx + 0x10]
push eax
call fcn.0040c42a
xor eax, eax
mov dword [ebx + 0x20], eax
mov dword [ebx + 0x98], eax
xor ecx, ecx
mov dword [ebx + 0x24], ecx
mov dword [ebx + 0x9c], ecx
mov eax, dword [esi]
mov dword [ebx + 0x18], eax
mov eax, dword [esi + 4]
mov dword [ebx + 0x1c], eax
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp + 0x4c]
mov dword [ebx + 0x40], eax
mov eax, dword [ebp - 0x24]
mov dword [ebx + 0x44], eax
mov eax, dword [ebp + 0x24]
mov byte [ebx + 0x8c], cl
mov ecx, dword [eax]
mov dword [ebx + 0x28], ecx
mov eax, dword [eax + 4]
mov dword [ebx + 0x2c], eax
mov eax, dword [ebp + 0x18]
mov dword [ebx + 0x80], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebx + 0x84], eax
movzx eax, byte [ebp - 1]
mov edi, ebx
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov dword [ebx + 0x88], eax
mov eax, dword [ebp + 0x40]
sub eax, dword [ebp - 0x18]
xor esi, esi
cmp dword [ebp + 0x54], esi
mov dword [ebx + 0x5c], eax
mov eax, dword [ebp - 0x14]
mov dword [ebx + 0x64], eax
mov dword [ebx + 0x48], esi
mov dword [ebx + 0x60], esi
mov dword [ebx + 0x7c], esi
mov eax, dword [ebp - 8]
mov dword [ebx + 0x58], eax
lea eax, [ebx + 0x90]
mov dword [ebx + 0x38], esi
mov dword [ebx + 0x3c], esi
mov dword [eax], esi
mov dword [ebx + 0x94], esi
mov dword [ebx + 0x78], esi
jne 0x52ba35
mov dword [eax], esi
cmp dword [ebp + 0x58], esi
jne 0x52ba48
mov dword [ebx + 0x94], esi
mov ecx, dword [ebp + 0x38]
mov esi, dword [ebp + 0x3c]
mov dword [ebx + 0x54], ecx
mov ecx, dword [ebp - 0x1c]
mov edx, ecx
shr ecx, 2
lea eax, [ebx + 0xa0]
mov dword [ebx + 0x74], eax
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x20]
sub dword [ebp - 8], ecx
mov esi, dword [ebp + 0x2c]
add eax, ecx
lea ecx, [eax + esi*8 + 8]
mov dword [ebp - 0x10], ecx
lea ecx, [esi + 1]
mov dword [ebx + 0x4c], ecx
mov dword [ebx + 0x68], eax
mov edx, dword [ebp - 8]
mov ecx, 0x1fffffff
sub ecx, esi
lea ecx, [edx + ecx*8]
lea edx, [ebp - 8]
push edx
lea edx, [ebp - 0x10]
push edx
push dword [ebp - 0x10]
mov dword [ebp + 0x40], eax
push eax
push ecx
push dword [ebp + 0x28]
mov dword [ebp - 8], ecx
push 1
call fcn.00495a61
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x10]
mov eax, dword [ebp + 0x40]
add eax, 8
push eax
push dword [ebp - 8]
push dword [ebp + 0x30]
push esi
call fcn.00495a61
push 0x64546553
push dword [ebp + 0x20]
xor esi, esi
push 1
mov dword [ebp + 0x2c], eax
mov dword [ebx + 0x6c], esi
mov dword [ebx + 0x50], esi
call sym.ntoskrnl.exe_ExAllocatePoolWithTag
cmp eax, esi
mov dword [ebx + 0x78], eax
je 0x52ba6d
mov edi, eax
mov eax, dword [ebp + 0x44]
mov dword [ebx + 0x70], edi
movzx eax, byte [eax + 1]
push eax
call sym.ntoskrnl.exe_RtlLengthRequiredSid
push dword [ebp + 0x44]
mov dword [ebp + 0x40], eax
push edi
push eax
call sym.ntoskrnl.exe_RtlCopySid
mov eax, dword [ebp + 0x40]
add eax, 3
and eax, 0xfffffffc
add edi, eax
mov eax, dword [ebp + 0x48]
cmp eax, esi
je 0x4d37b8
mov dword [ebx + 0x7c], edi
movzx ecx, word [eax + 2]
mov esi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor esi, esi
cmp byte [ebp + 0x50], 0
jne 0x4f6e17
mov eax, dword [sym.ntoskrnl.exe_SeTokenObjectType]
add eax, 0x68
push eax
push dword [ebp + 0x10]
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0xb8]
push eax
call sym.ntoskrnl.exe_SeCreateAccessState
cmp eax, esi
mov dword [ebp + 0x2c], eax
jl 0x4d5ecf
mov eax, dword fs:[0x124]
movsx eax, byte [eax + 0x140]
push eax
push dword [0x5b68ec]
push dword [0x5b68e8]
call sym.ntoskrnl.exe_SeSinglePrivilegeCheck
test al, al
je 0x52ba7e
push dword [ebp + 8]
lea eax, [ebp - 0xb8]
push esi
push esi
push esi
push eax
push ebx
call sym.ntoskrnl.exe_ObInsertObject
mov dword [ebp + 0x2c], eax
lea eax, [ebp - 0xb8]
push eax
call sym.ntoskrnl.exe_SeDeleteAccessState
mov eax, dword [ebp + 0x2c]
pop edi
pop esi
pop ebx
leave
ret 0x54
mov edx, dword [eax - 4]
cmp edx, dword [0x5b6994]
jne 0x4d34e0
test byte [eax], 2
je 0x4d34e0
or byte [ebp - 1], 1
jmp 0x4d34e0
mov edx, dword [eax - 4]
cmp edx, dword [0x5b69c4]
jne 0x4d34ec
test byte [eax], 2
je 0x4d34ec
or byte [ebp - 1], 0x80
jmp 0x4d34ec
or byte [ebp - 1], 8
jmp 0x4d34bc
add eax, ecx
jmp 0x4d35c6
mov ecx, ebx
call sym.ntoskrnl.exe_ObfDereferenceObject
jmp 0x4d3832
mov dword [eax], esi
jmp 0x4d3832
mov eax, dword fs:[0x124]
mov eax, dword [eax + 0x44]
cmp dword [eax + 0xc8], esi
je 0x4f6e36
push esi
push esi
push esi
push esi
push esi
push ebx
call sym.ntoskrnl.exe_ObInsertObject
mov dword [ebp + 0x2c], eax
cmp dword [ebp + 0x2c], esi
mov eax, dword [ebp + 8]
jl 0x4d5edb
mov dword [eax], ebx
jmp 0x4d3832
mov eax, dword [ebp + 0x28]
push dword [eax]
push dword [ebp + 0x40]
call sym.ntoskrnl.exe_RtlEqualSid
test al, al
jne 0x4d3506
cmp dword [ebp + 0x2c], 0
mov byte [ebp - 9], al
jbe 0x52ba13
cmp byte [ebp - 9], 0
jne 0x4d3509
push dword [edi + esi*8]
push dword [ebp + 0x40]
call sym.ntoskrnl.exe_RtlEqualSid
test al, al
je 0x4fc949
test byte [edi + esi*8 + 4], 8
je 0x52ba13
lea eax, [esi + 1]
mov dword [ebp - 0x14], eax
mov byte [ebp - 9], 1
inc esi
cmp esi, dword [ebp + 0x2c]
jae 0x52ba09
jmp 0x4fc91b
mov edi, 0xc000009a
jmp 0x52ba28
cmp byte [ebp - 9], 0
jne 0x4d3509
mov eax, 0xc000005a
jmp 0x4d3835
push 0
push edi
call sym.ntoskrnl.exe_ExFreePoolWithTag
mov edi, dword [ebp + 0x14]
push esi
call fcn.004a02d3
mov eax, edi
jmp 0x4d3835
push dword [ebp + 0x54]
push eax
call fcn.00562193
test eax, eax
jge 0x4d36b2
jmp 0x52ba6d
push 0x20206553
push 0xc
push 1
call sym.ntoskrnl.exe_ExAllocatePoolWithTag
cmp eax, esi
mov dword [ebx + 0x94], eax
je 0x52ba6d
mov esi, dword [ebp + 0x58]
mov edi, eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
jmp 0x4d36c1
mov ecx, ebx
call sym.ntoskrnl.exe_ObfDereferenceObject
mov eax, 0xc0000017
jmp 0x4d3835
mov ecx, ebx
mov dword [ebp + 0x2c], 0xc0000061
call sym.ntoskrnl.exe_ObfDereferenceObject
jmp 0x4d3826