Function at 0x6640f3b0
Capabilities:
Get common file path
Get disk information
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0x37c
mov eax, dword [eax + 0xa0]
mov dword [ebp - 0x35c], edx
mov dword [esp + 4], eax
movzx eax, word [esi + 0x98]
mov dword [esp], eax
call fcn.6642fb90
mov ebx, dword [esi + 0xa8]
mov dword [ebp - 0x360], eax
test bl, bl
je 0x6640f530
mov dword [ebp - 0x21e], 0x3a
movzx eax, bl
sub ebx, 1
add eax, 0x40
mov word [ebp - 0x220], ax
lea eax, [ebp - 0x220]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetDriveTypeW]
sub esp, 4
cmp eax, 1
mov eax, 0x1a
cmovbe ebx, eax
test byte [0x664447b0], 8
jne 0x6640f544
cmp bl, 0x1a
je 0x6640f57c
lea edi, [ebp - 0x220]
mov dword [esp], 0x104
mov dword [esp + 4], edi
call dword [sym.imp.kernel32.dll_GetCurrentDirectoryW]
sub esp, 8
test eax, eax
je 0x6640f520
movzx eax, word [ebp - 0x220]
lea edx, [eax - 0x41]
cmp dx, 0x19
jbe 0x6640f600
lea edx, [eax - 0x61]
cmp dx, 0x19
jbe 0x6640f598
movzx eax, bl
mov ecx, 0x3d
mov dword [esp + 4], edi
add eax, 0x41
mov word [ebp - 0x34c], cx
mov word [ebp - 0x34a], ax
lea eax, [ebp - 0x34c]
mov dword [ebp - 0x348], 0x3a
mov dword [esp + 8], 0x104
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
sub esp, 0xc
test eax, eax
je 0x6640f608
mov edx, dword [ebp - 0x35c]
test edx, edx
je 0x6640f620
movzx eax, word [ebp - 0x220]
cmp ax, 0x5c
je 0x6640f5c0
test ax, ax
je 0x6640f506
cmp word [ebp - 0x21e], 0x3a
jne 0x6640f506
cmp word [ebp - 0x21c], 0x5c
je 0x6640f770
test byte [0x664447b0], 4
jne 0x6640f688
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 0x36
xor edx, edx
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.6640e720
mov ebx, eax
test byte [0x664447b0], 8
je 0x6640f435
movzx eax, byte [esi + 0xa8]
mov dword [esp + 0xc], str.drive__d_n
mov dword [esp + 8], str.INT21_GetCurrentDirectory
mov dword [esp + 4], 0x664447b0
mov dword [esp], 3
mov dword [esp + 0x10], eax
call fcn.6640d110
cmp bl, 0x1a
jne 0x6640f43e
mov eax, dword fs:[0x18]
xor edx, edx
mov dword [eax + 0x34], 0xf
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
sub eax, 0x61
cmp bl, al
jne 0x6640f481
cmp word [ebp - 0x21e], 0x3a
jne 0x6640f481
jmp 0x6640f4ca
test byte [0x664447b0], 1
je 0x6640f513
mov dword [esp + 0xc], str.UNC_names_are_not_supported._n
mov dword [esp + 8], str.INT21_GetCurrentDirectory
mov dword [esp + 4], 0x664447b0
mov dword [esp], 0
call fcn.6640d110
jmp 0x6640f513
sub eax, 0x41
jmp 0x6640f59b
mov eax, dword [ebp - 0x360]
mov edx, 1
mov byte [eax], 0
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], 0x104
mov dword [esp + 4], edi
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_GetShortPathNameW]
sub esp, 0xc
test eax, eax
je 0x6640f520
cmp eax, 0x104
jbe 0x6640f4d8
test byte [0x664447b0], 4
je 0x6640f513
mov dword [esp + 0xc], str.Short_path_too_long__n
mov dword [esp + 8], str.INT21_GetCurrentDirectory
mov dword [esp + 4], 0x664447b0
mov dword [esp], 2
call fcn.6640d110
jmp 0x6640f513
mov eax, edi
shr eax, 0x10
test eax, eax
je 0x6640f810
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ebx, eax
sub esp, 8
mov eax, 0x66448283
test ebx, ebx
jne 0x6640f823
movzx edx, word [ebp - 0x220]
test dx, dx
je 0x6640f92a
lea esi, [esi]
nop
mov ecx, ebx
cmp word [edi + ecx*2 + 2], 0
lea ebx, [ebx + 1]
jne 0x6640f6d0
lea ebx, [ebp - 0x34a]
mov eax, 0x224c
mov word [ebp - 0x34c], ax
lea esi, [ebp - 0x22a]
jmp 0x6640f738
cmp dx, 9
je 0x6640f8d8
cmp dx, 0xa
jne 0x6640f86e
mov eax, 0x6e5c
add ebx, 2
mov word [ebx - 2], ax
lea eax, [ecx - 1]
cmp ebx, esi
ja 0x6640f8f0
test ecx, ecx
jle 0x6640f8f0
movzx edx, word [edi]
mov ecx, eax
add edi, 2
cmp dx, 0xd
je 0x6640f850
jbe 0x6640f700
cmp dx, 0x22
je 0x6640f8c0
cmp dx, 0x5c
jne 0x6640f861
mov eax, 0x5c5c
add ebx, 2
mov word [ebx - 2], ax
jmp 0x6640f720
lea eax, [ebp - 0x21a]
mov dword [esp + 0x1c], 0
lea edi, [ebp - 0x34c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x104
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 1
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
sub esp, 0x20
mov edx, eax
test eax, eax
je 0x6640f948
mov eax, dword [ebp - 0x35c]
test eax, eax
jne 0x6640f7e3
mov ecx, 0x100
mov byte [ebp - 0x30d], 0
mov word [esi + 0xb0], cx
test byte [0x664447b0], 8
jne 0x6640f963
mov eax, dword [ebp - 0x360]
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strcpy]
mov edx, 1
jmp 0x6640f522
movzx edi, di
mov dword [esp], 0x66448294
mov dword [esp + 4], edi
call fcn.6640e6c0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Path_is_neither_UNC_nor_DOS_path:__s_n
mov dword [esp + 8], str.INT21_GetCurrentDirectory
mov dword [esp + 4], 0x664447b0
mov dword [esp], 2
call fcn.6640d110
jmp 0x6640f513
mov eax, 0x725c
add ebx, 2
mov word [ebx - 2], ax
jmp 0x6640f720
lea eax, [edx - 0x20]
cmp ax, 0x5e
jbe 0x6640f920
mov eax, edx
mov byte [ebx], 0x5c
add ebx, 5
shr ax, 0xc
movzx eax, ax
movzx eax, byte [eax + str.0123456789abcdefINT21_NetworkFunc]
mov byte [ebx - 4], al
mov eax, edx
shr ax, 8
and eax, 0xf
movzx eax, byte [eax + str.0123456789abcdefINT21_NetworkFunc]
mov byte [ebx - 3], al
mov eax, edx
and edx, 0xf
shr ax, 4
and eax, 0xf
movzx eax, byte [eax + str.0123456789abcdefINT21_NetworkFunc]
mov byte [ebx - 2], al
movzx eax, byte [edx + str.0123456789abcdefINT21_NetworkFunc]
mov byte [ebx - 1], al
jmp 0x6640f720
mov eax, 0x225c
add ebx, 2
mov word [ebx - 2], ax
jmp 0x6640f720
mov eax, 0x745c
add ebx, 2
mov word [ebx - 2], ax
jmp 0x6640f720
test eax, eax
mov byte [ebx], 0x22
jle 0x6640f943
lea eax, [ebx + 4]
mov edx, 0x2e2e
mov byte [ebx + 3], 0x2e
mov word [ebx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x34c]
mov dword [esp], eax
call fcn.6643f6c0
jmp 0x6640f823
mov byte [ebx], dl
add ebx, 1
jmp 0x6640f720
mov edx, 0x224c
mov byte [ebp - 0x34a], 0x22
mov word [ebp - 0x34c], dx
lea ebx, [ebp - 0x34a]
lea eax, [ebx + 1]
jmp 0x6640f907
test byte [0x664447b0], 4
jne 0x6640f99a
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 0x36
jmp 0x6640f522
movzx eax, bl
mov dword [esp + 0x14], edi
add eax, 0x41
mov dword [esp + 0xc], str._c:_s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.INT21_GetCurrentDirectory
mov dword [esp + 4], 0x664447b0
mov dword [esp], 3
call fcn.6640d110
jmp 0x6640f7f0
mov dword [esp + 0xc], str.Cannot_convert_path__n
mov dword [esp + 8], str.INT21_GetCurrentDirectory
mov dword [esp + 4], 0x664447b0
mov dword [esp], 2
mov dword [ebp - 0x35c], eax
call fcn.6640d110
mov edx, dword [ebp - 0x35c]
jmp 0x6640f951