Function at 0x40c300
Capabilities:
Check if file exists
Create directory
Get common file path
Get file attributes
Read .ini file
Set environment variable

Disassembly:
mov eax, 0x412a85
call fcn.004114d0
sub esp, 0x954
mov eax, dword [0x4211a4]
push ebx
push esi
push edi
xor eax, ebp
xor ebx, ebx
push ebx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x834], eax
mov eax, dword [ebp + 0xc]
xor edi, edi
inc edi
push edi
push ebx
mov dword [ebp - 0x840], eax
mov eax, str.class_ATL::CComBSTR___cdecl_XMP::GetUserDataPath_const_wchar_t__
push eax
push 0x417d9c
push eax
lea ecx, [ebp - 0x85c]
mov dword [ebp - 0x838], ebx
call fcn.00406666
mov dword [ebp - 4], edi
cmp word [0x422100], bx
mov esi, 0x422100
jne 0x40c669
xor eax, eax
mov word [ebp - 0x830], bx
mov ecx, 0x81
lea edi, [ebp - 0x82e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x104
lea eax, [ebp - 0x830]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor eax, eax
mov word [ebp - 0x628], bx
mov ecx, 0x81
lea edi, [ebp - 0x626]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x628]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40c593
push str.shell32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push str.SHGetKnownFolderPath
push eax
mov dword [ebp - 0x844], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x40c4da
lea ecx, [ebp - 0x83c]
push ecx
push ebx
push ebx
push 0x4176bc
mov dword [ebp - 0x83c], ebx
call eax
cmp eax, ebx
jge 0x40c434
push dword [ebp - 0x844]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov esi, dword [ebp - 0x834]
mov dword [esi], ebx
mov dword [ebp - 0x838], 1
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x85c]
call fcn.004068e0
mov eax, esi
jmp 0x40c6eb
push dword [ebp - 0x83c]
lea eax, [ebp - 0x95c]
lea ecx, [ebp - 0x960]
mov dword [ebp - 0x960], eax
call fcn.0040a352
mov byte [ebp - 4], 2
push dword [ebp - 0x960]
push esi
call dword [sym.imp.MSVCR71.dll_wcscpy]
pop ecx
pop ecx
mov byte [ebp - 4], 1
lea eax, [ebp - 0x95c]
cmp dword [ebp - 0x960], eax
je 0x40c483
push dword [ebp - 0x960]
call dword [sym.imp.MSVCR71.dll_free]
pop ecx
push dword [ebp - 0x83c]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
push esi
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov edi, 0x417d40
push edi
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40c4cc
push 1
push esi
push str.vista_PersistFileDir_:
push ebx
push edi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bce8
push dword [ebp - 0x844]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x40c526
push esi
push ebx
push ebx
push 0x23
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
push esi
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
push 0x417d40
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40c526
push 1
push esi
push str.xp_PersistFileDir_:
push ebx
push 0x417d40
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bce8
push str.Thunder_Network_
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push esi
call edi
cmp eax, 0xffffffff
je 0x40c544
test al, 0x10
jne 0x40c550
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x40c574
push str.XMP4_
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push esi
call edi
cmp eax, 0xffffffff
je 0x40c568
test al, 0x10
jne 0x40c593
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40c593
mov ecx, dword [ebp - 0x834]
push 0x41568c
call fcn.004099d4
mov dword [ebp - 0x838], 1
jmp 0x40c6d7
mov edx, 0x81
xor eax, eax
mov word [ebp - 0x218], bx
mov ecx, edx
lea edi, [ebp - 0x216]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [ebp - 0x420], bx
mov ecx, edx
lea edi, [ebp - 0x41e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov edi, 0x104
push edi
lea eax, [ebp - 0x218]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push str...xmp.ini
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
push edi
lea eax, [ebp - 0x420]
push eax
push esi
push str.UserDataDir
push 0x417ca8
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40c63b
lea eax, [ebp - 0x218]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
push edi
lea eax, [ebp - 0x218]
push eax
push esi
call dword [sym.imp.MSVCR71.dll_wcsncpy]
add esp, 0xc
push esi
push str.userdata
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
xor edi, edi
inc edi
push esi
mov esi, 0x421ef8
push esi
call dword [sym.imp.MSVCR71.dll_wcscpy]
cmp dword [ebp - 0x840], ebx
pop ecx
pop ecx
je 0x40c68d
push dword [ebp - 0x840]
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push 0x417d40
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40c6c5
push edi
push esi
push str.Path_:
push ebx
push 0x417d40
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bce8
mov ecx, dword [ebp - 0x834]
push esi
call fcn.004099d4
mov dword [ebp - 0x838], edi
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x85c]
call fcn.004068e0
mov eax, dword [ebp - 0x834]
mov ecx, dword [ebp - 0xc]
pop edi
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop esi
xor ecx, ebp
pop ebx
call fcn.004113e5
leave
ret