Function at 0x4d056f
Capabilities:
Check if file exists
Get disk information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2ac
mov eax, dword [0x654b34]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
mov eax, ebx
push esi
push 8
pop esi
cmp dword [ebx + 0x14], esi
jb 0x4d0593
mov eax, dword [ebx]
lea ecx, [ebp - 0x58]
push ecx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
test eax, eax
jne 0x4d05c7
cmp dword [ebx + 0x14], esi
jb 0x4d05ab
mov ebx, dword [ebx]
push ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CFileSystem::IsFolderWritable__GetFileAttributesEx_failed__err___d_path___s
call fcn.004d15b8
add esp, 0xc
xor eax, eax
jmp 0x4d0835
test byte [ebp - 0x58], 0x10
jne 0x4d05e2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CFileSystem::IsFolderWritable__dwFileAttributes___FILE_ATTRIBUTE_DIRECTORY__err___d
call fcn.004d157e
pop ecx
pop ecx
jmp 0x4d05c0
test dword [ebp - 0x58], 0x10000
je 0x4d05fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CFileSystem::IsFolderWritable__dwFileAttributes__FILE_ATTRIBUTE_VIRTUAL__err___d
call fcn.004d15b8
jmp 0x4d05de
mov eax, ebx
cmp dword [ebx + 0x14], esi
jb 0x4d0607
mov eax, dword [ebx]
push eax
call dword [sym.imp.SHLWAPI.dll_PathGetDriveNumberW]
test eax, eax
jns 0x4d0620
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CFileSystem::IsFolderWritable__PathGetDriveNumber_failed__err___d
jmp 0x4d05d9
push eax
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.SHLWAPI.dll_PathBuildRootW]
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeW]
cmp eax, 3
je 0x4d0656
cmp dword [ebp + 0xc], 0
je 0x4d067c
mov eax, ebx
cmp dword [ebx + 0x14], esi
jb 0x4d0649
mov eax, dword [ebx]
push eax
push str.CFileSystem::IsFolderWritable__Path__s_not_in_fixed_drive_but_it_is_OK_for_TC
call fcn.004d15b8
pop ecx
pop ecx
mov eax, ebx
cmp dword [ebx + 0x14], esi
jb 0x4d065f
mov eax, dword [ebx]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4d068e
cmp dword [ebx + 0x14], esi
jb 0x4d0671
mov ebx, dword [ebx]
push ebx
push str.CFileSystem::IsFolderWritable__Path_not_Exists__s
jmp 0x4d05d9
cmp dword [ebx + 0x14], esi
jb 0x4d0683
mov ebx, dword [ebx]
push ebx
push str.CFileSystem::IsFolderWritable__Path__s_not_in_fixed_drive
jmp 0x4d05d9
lea eax, [ebp - 0x2ac]
push edi
push eax
call fcn.004cdc1b
pop ecx
push 0x47
pop ecx
mov esi, eax
lea edi, [ebp - 0x190]
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x180], 2
je 0x4d06ba
xor eax, eax
inc eax
jmp 0x4d0834
xor edx, edx
mov eax, ebx
cmp dword [ebx + 0x14], 8
mov dword [ebp - 0x70], edx
jb 0x4d06c9
mov eax, dword [ebx]
lea ecx, [ebp - 0x70]
push ecx
push edx
push edx
push 7
push eax
call dword [sym.imp.ADVAPI32.dll_GetFileSecurityW]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 0x7a
je 0x4d06f8
call edi
push eax
push str.CFileSystem::IsFolderWritable__first_GetFileSecurity_err___d
call fcn.004d157e
pop ecx
jmp 0x4d0831
push dword [ebp - 0x70]
call fcn.0057c5fc
mov esi, eax
pop ecx
test esi, esi
je 0x4d0832
mov eax, dword [ebp - 0x70]
mov ecx, esi
test eax, eax
je 0x4d0720
mov byte [ecx], 0
inc ecx
sub eax, 1
jne 0x4d0714
mov eax, dword [ebp - 0x70]
cmp dword [ebx + 0x14], 8
jb 0x4d0728
mov ebx, dword [ebx]
lea ecx, [ebp - 0x70]
push ecx
push eax
push esi
push 7
push ebx
call dword [sym.imp.ADVAPI32.dll_GetFileSecurityW]
test eax, eax
jne 0x4d0756
call edi
push eax
push str.CFileSystem::IsFolderWritable__second_GetFileSecurity_err___d
call fcn.004d157e
push esi
call fcn.0057647e
add esp, 0xc
jmp 0x4d0832
xor ebx, ebx
push 2
mov dword [ebp - 0x74], ebx
call dword [sym.imp.ADVAPI32.dll_ImpersonateSelf]
test eax, eax
je 0x4d0816
lea eax, [ebp - 0x74]
push eax
push ebx
push 0xa
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenThreadToken]
test eax, eax
je 0x4d0816
push 0x10
mov dword [ebp - 0x1c], 6
lea eax, [ebp - 0x34]
pop ecx
mov byte [eax], bl
inc eax
sub ecx, 1
jne 0x4d0794
lea eax, [ebp - 0x34]
mov dword [ebp - 0x30], 0x120116
push eax
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.ADVAPI32.dll_MapGenericMask]
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 1
push eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x24], 0x14
push eax
lea eax, [ebp - 0x24]
mov dword [ebp - 0x20], ebx
push eax
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x34]
push eax
push dword [ebp - 0x1c]
push dword [ebp - 0x74]
push esi
call dword [sym.imp.ADVAPI32.dll_AccessCheck]
neg eax
sbb eax, eax
and dword [ebp - 0x18], eax
jne 0x4d07fb
call edi
push eax
push str.CFileSystem::IsFolderWritable__AccessCheck_failed__err___d
call fcn.004d157e
pop ecx
pop ecx
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push esi
call fcn.0057647e
pop ecx
push dword [ebp - 0x74]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x18]
jmp 0x4d0834
call edi
push eax
push str.CFileSystem::IsFolderWritable__ImpersonateSelf_err___d
call fcn.004d157e
pop ecx
pop ecx
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push esi
call fcn.0057647e
pop ecx
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.0056ac5f
leave
ret