Function at 0x41d220
Capabilities:
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x430
push ebx
push esi
mov esi, dword [0x4257f0]
push edi
lea eax, [ebp - 0x42c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push 0x104
lea ecx, [ebp - 0x224]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [ebp - 0x224]
push 0x5c
push edx
call dword [sym.imp.MSVCRT.dll_wcsrchr]
add eax, 2
xor ecx, ecx
mov word [eax], cx
mov dword [ebp - 8], eax
add esp, 8
mov ebx, 0x104
mov ecx, str.ngsapp.ini
lea eax, [ebp - 0x224]
call fcn.00406540
xor ebx, ebx
lea edi, [ebp - 0xc]
lea eax, [ebp - 0x224]
lea esi, [ebp - 0x18]
mov dword [ebp - 0x18], 0xffffffff
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x10], ebx
call fcn.0041e0e0
mov esi, eax
cmp esi, ebx
jne 0x41d2d8
mov edi, dword [ebp - 0x10]
cmp edi, ebx
je 0x41d2cf
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [ebp - 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
push edi
call esi
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
lea ebx, [eax + esi]
xor ecx, ecx
mov word [edx], cx
mov dword [ebp - 8], ebx
cmp esi, ebx
jae 0x41d412
mov al, byte [esi]
cmp al, 0x5b
jne 0x41d33d
cmp byte [esi + 1], 0x5d
lea ecx, [esi + 1]
mov eax, ecx
je 0x41d308
inc eax
cmp byte [eax], 0x5d
jne 0x41d302
lea esi, [eax + 1]
sub eax, ecx
cmp eax, 5
jne 0x41d333
push eax
push str.Paths
push ecx
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x41d333
mov ecx, dword [ebp + 8]
mov eax, 1
mov word [ecx], ax
jmp 0x41d3a3
mov ecx, dword [ebp + 8]
xor eax, eax
mov word [ecx], ax
jmp 0x41d3a3
cmp al, 0x3b
je 0x41d3a3
push 0x3d
push esi
mov dword [ebp - 0x1c], esi
call dword [sym.imp.MSVCRT.dll_strchr]
mov edi, eax
add esp, 8
test edi, edi
je 0x41d3a3
mov eax, dword [ebp - 8]
lea ebx, [edi + 1]
mov esi, ebx
cmp ebx, eax
jae 0x41d36c
cmp byte [esi], 0x20
jb 0x41d36c
inc esi
cmp esi, eax
jb 0x41d362
lea edx, [ebp - 0x224]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov eax, dword [ebp + 8]
cmp word [eax], 1
jne 0x41d3a0
mov eax, dword [ebp - 0x1c]
sub edi, eax
cmp edi, 4
jne 0x41d3a0
push edi
push str.Host
push eax
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
je 0x41d3db
mov ebx, dword [ebp - 8]
cmp esi, ebx
jae 0x41d412
mov al, byte [esi]
cmp al, 0xd
je 0x41d3b8
cmp al, 0xa
je 0x41d3b8
inc esi
cmp esi, ebx
jb 0x41d3a7
jmp 0x41d412
cmp esi, ebx
jae 0x41d412
lea esp, [esp]
mov al, byte [esi]
cmp al, 0xd
je 0x41d3ca
cmp al, 0xa
jne 0x41d3d1
inc esi
cmp esi, ebx
jb 0x41d3c0
jmp 0x41d412
cmp esi, ebx
jb 0x41d2f1
jmp 0x41d412
mov edi, dword [ebp + 8]
push 0x104
push edi
sub esi, ebx
push esi
push ebx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
xor ecx, ecx
push edi
mov word [edi + eax*2], cx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push edi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov eax, edi
call fcn.0041db00
lea edx, [ebp - 0x42c]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov esi, dword [ebp - 0x10]
test esi, esi
je 0x41d43f
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x18]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call edi
push esi
call edi
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret