Function at 0x406040
Capabilities:
Access peb ldr_data
Get common file path

Disassembly:
push 0xffffffffffffffff
push 0x40771d
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14c
push ebx
push ebp
lea ecx, [esp + 0x30]
call sub.MFC42.DLL_CStdioFile::CStdioFile
lea ecx, [esp + 8]
mov dword [esp + 0x15c], 0
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0xc]
mov byte [esp + 0x15c], 1
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x10]
mov byte [esp + 0x15c], 2
call sub.MFC42.DLL_CString::CString_2
mov eax, dword [0x40ca64]
mov ebx, 3
push str.CommDecode
push eax
mov byte [esp + 0x164], bl
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebp, eax
test ebp, ebp
jne 0x4060d2
push eax
push str._LoadU8CodeMappingTable_
call fcn.00406af0
add esp, 8
jmp 0x406281
push edi
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x50]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x50]
push 0x105
push ecx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea edx, [esp + 0x50]
push str.U8Service.cfg
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0
lea eax, [esp + 0x54]
push 0x7040
push eax
lea ecx, [esp + 0x40]
call sub.MFC42.DLL_CStdioFile::Open
test eax, eax
pop edi
je 0x406281
lea ecx, [esp + 0x18]
push 0xf
push ecx
lea ecx, [esp + 0x38]
call sub.MFC42.DLL_CStdioFile::ReadString
test eax, eax
je 0x406278
push esi
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea edx, [esp + 0x1c]
mov byte [esp + 0x2b], 0
push edx
call esi
test eax, eax
je 0x40625f
lea eax, [esp + 0x1c]
push eax
call esi
cmp byte [esp + eax + 0x1b], 0xd
je 0x40616e
lea ecx, [esp + 0x1c]
push ecx
call esi
cmp byte [esp + eax + 0x1b], 0xa
jne 0x40617c
lea edx, [esp + 0x1c]
push edx
call esi
mov byte [esp + eax + 0x1b], 0
jmp 0x406152
lea eax, [esp + 0x48]
lea ecx, [esp + 0x1c]
push eax
push ecx
call ebp
lea edx, [esp + 0x48]
lea ecx, [esp + 0xc]
push edx
call sub.MFC42.DLL_CString::operator_1
lea eax, [esp + 0x2c]
push 2
push eax
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::Left
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x164], 4
call fcn.00406d64
lea ecx, [esp + 0x2c]
mov byte [esp + 0x160], bl
call sub.MFC42.DLL_CString::CString
push 2
lea ecx, [esp + 0x34]
push ebx
push ecx
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::Mid
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x164], 5
call fcn.00406d64
lea ecx, [esp + 0x30]
mov byte [esp + 0x160], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString_2
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push edx
push eax
lea ecx, [esp + 0x20]
push 0x40c378
push ecx
mov byte [esp + 0x170], 6
call sub.MFC42.DLL_CString::Format
mov edx, dword [esp + 0x28]
push 0
push edx
call fcn.00406af0
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
add esp, 0x18
push eax
push ecx
mov ecx, 0x40c988
call sub.MFC42.DLL_CMapStringToString::operator__
mov ecx, eax
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x18]
mov byte [esp + 0x160], bl
call sub.MFC42.DLL_CString::CString
lea edx, [esp + 0x1c]
push 0xf
push edx
lea ecx, [esp + 0x3c]
call sub.MFC42.DLL_CStdioFile::ReadString
test eax, eax
jne 0x40613e
pop esi
lea ecx, [esp + 0x30]
call sub.MFC42.DLL_CStdioFile::Close
lea ecx, [esp + 0x10]
mov byte [esp + 0x15c], 2
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0xc]
mov byte [esp + 0x15c], 1
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 8]
mov byte [esp + 0x15c], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x30]
mov dword [esp + 0x15c], 0xffffffff
call fcn.00406de2
mov ecx, dword [esp + 0x154]
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x158
ret