Function at 0x403700
Capabilities:
Get windows directory from kuser_shared_data

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov dword [ebp - 0xc], 0x7ffe0030
mov eax, dword [ebp + 0xc]
push eax
push 0
call dword [sym.imp.ntoskrnl.exe_ExAllocatePool]
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
jne 0x403729
xor eax, eax
jmp 0x4038e6
mov ecx, dword [ebp + 0xc]
push ecx
push 0
mov edx, dword [ebp - 0x38]
push edx
call sub.ntoskrnl.exe_memset
add esp, 0xc
push 0x411704
lea eax, [ebp - 8]
push eax
call dword [sym.imp.ntoskrnl.exe_RtlInitUnicodeString]
mov dword [ebp - 0x28], 0x18
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x1c], 0x240
lea ecx, [ebp - 8]
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
lea edx, [ebp - 0x28]
push edx
push 1
lea eax, [ebp - 0x10]
push eax
call dword [sym.imp.ntoskrnl.exe_ZwOpenSymbolicLinkObject]
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jl 0x403862
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x2c], ecx
xor edx, edx
mov word [ebp - 0x30], dx
mov ax, word [ebp + 0xc]
mov word [ebp - 0x2e], ax
push 0
lea ecx, [ebp - 0x30]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.ntoskrnl.exe_ZwQuerySymbolicLinkObject]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.ntoskrnl.exe_ZwClose]
cmp dword [ebp - 0x34], 0
jge 0x4037da
push 0
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
xor eax, eax
jmp 0x4038e6
movzx eax, word [ebp - 0x30]
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x40], eax
mov edx, dword [ebp - 0x40]
sub edx, 1
mov dword [ebp - 0x3c], edx
jmp 0x4037fa
mov eax, dword [ebp - 0x3c]
sub eax, 1
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jle 0x403862
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x38]
movzx eax, word [edx + ecx*2]
cmp eax, 0x5c
jne 0x403860
mov ecx, dword [ebp - 0x40]
sub ecx, dword [ebp - 0x3c]
mov edx, dword [ebp + 8]
lea eax, [edx + ecx*2]
push eax
call dword [sym.imp.ntoskrnl.exe_MmIsAddressValid]
movzx ecx, al
test ecx, ecx
jne 0x40382b
jmp 0x403862
mov edx, dword [ebp - 0x40]
sub edx, dword [ebp - 0x3c]
shl edx, 1
push edx
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x38]
lea edx, [ecx + eax*2]
push edx
mov eax, dword [ebp + 8]
push eax
call sub.ntoskrnl.exe_memcpy
add esp, 0xc
push 0
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov eax, 1
jmp 0x4038e6
jmp 0x4037f1
push 0
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.ntoskrnl.exe_MmIsAddressValid]
movzx ecx, al
test ecx, ecx
jne 0x403883
xor eax, eax
jmp 0x4038e6
mov edx, dword [ebp - 0xc]
movzx eax, word [edx + 2]
cmp eax, 0x3a
jne 0x40389b
mov ecx, dword [ebp - 0xc]
movzx edx, word [ecx + 4]
cmp edx, 0x5c
je 0x40389f
xor eax, eax
jmp 0x4038e6
mov eax, dword [ebp - 0xc]
add eax, 4
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x48]
mov dword [ebp - 0x4c], edx
mov eax, dword [ebp - 0x44]
mov cx, word [eax]
mov word [ebp - 0x4e], cx
mov edx, dword [ebp - 0x48]
mov ax, word [ebp - 0x4e]
mov word [edx], ax
mov ecx, dword [ebp - 0x44]
add ecx, 2
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x48]
add edx, 2
mov dword [ebp - 0x48], edx
cmp word [ebp - 0x4e], 0
jne 0x4038b4
mov eax, 1
mov esp, ebp
pop ebp
ret 8