Function at 0x40d140
Capabilities:
Get common file path
Read .ini file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x490c58
mov eax, dword fs:[0]
push eax
sub esp, 0x430
mov eax, dword [0x4b81bc]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x434], esi
mov dword [ebp - 0x430], esi
lea eax, [esi + 0x10]
mov dword [ebp - 0x43c], esi
mov dword [esi], vtable.CxLogger.0
mov dword [ebp - 0x42c], eax
call fcn.00403f70
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x40d1ac
push 0x80004005
call fcn.00404990
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [esi + 0x10], eax
lea eax, [esi + 0x14]
mov dword [ebp - 4], 0
xorps xmm0, xmm0
push 0
movups xmmword [eax], xmm0
push eax
movq qword [eax + 0x10], xmm0
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
jne 0x40d1f7
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x40d1ef
movzx eax, ax
or eax, 0x80070000
test eax, eax
jns 0x40d1f7
push eax
call fcn.00404990
push 0x208
lea eax, [ebp - 0x420]
mov byte [ebp - 4], 1
push 0
push eax
call fcn.0046ce30
add esp, 0xc
lea eax, [ebp - 0x420]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push eax
lea ecx, [ebp - 0x428]
call fcn.004038a0
mov byte [ebp - 4], 2
call fcn.00403f70
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x40d25e
push 0x80004005
call fcn.00404990
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [ebp - 0x438], esi
mov byte [ebp - 4], 3
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x40d29c
push 0x104
lea ecx, [ebp - 0x438]
call fcn.004048e0
mov esi, dword [ebp - 0x438]
push str...xLogConfig.ini
lea eax, [ebp - 0x420]
push eax
push esi
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
push dword [esi - 8]
push esi
call fcn.00473092
add esp, 8
test eax, eax
js 0x40d6f8
cmp eax, dword [esi - 8]
jg 0x40d6f8
mov edi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
xor ecx, ecx
push esi
push ecx
mov dword [esi - 0xc], eax
push 0x4a95e8
mov word [esi + eax*2], cx
push dword [ebp - 0x428]
call edi
push esi
push eax
push 0x4a95e8
push 0x4a95f0
call edi
mov edi, dword [ebp - 0x42c]
mov ecx, 1
mov dword [ebp - 0x430], eax
mov eax, dword [edi]
sub ecx, dword [eax - 4]
mov eax, dword [eax - 8]
sub eax, 0x104
or eax, ecx
jge 0x40d326
push 0x104
mov ecx, edi
call fcn.004048e0
push esi
push 0x104
push dword [edi]
push 0x4a78a8
push 0x4a95f4
push dword [ebp - 0x428]
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov eax, dword [edi]
test eax, eax
jne 0x40d34e
xor ecx, ecx
jmp 0x40d364
push dword [eax - 8]
push eax
call fcn.00473092
mov ecx, eax
add esp, 8
test ecx, ecx
js 0x40d6f8
mov eax, dword [edi]
cmp ecx, dword [eax - 8]
jg 0x40d6f8
mov dword [eax - 0xc], ecx
xor edx, edx
mov eax, dword [edi]
mov word [eax + ecx*2], dx
call fcn.00403f70
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x40d396
push 0x80004005
call fcn.00404990
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [ebp - 0x42c], edi
mov byte [ebp - 4], 4
call fcn.00403f70
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x40d3c6
push 0x80004005
call fcn.00404990
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x424], eax
mov byte [ebp - 4], 5
mov edx, 1
mov ecx, dword [eax - 8]
sub edx, dword [eax - 4]
sub ecx, 0x104
or ecx, edx
jge 0x40d405
push 0x104
lea ecx, [ebp - 0x424]
call fcn.004048e0
mov eax, dword [ebp - 0x424]
push esi
push 0x104
push eax
push dword [ebp - 0x428]
push str.LogDirName
push 0x4a95f0
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov eax, dword [ebp - 0x424]
push dword [eax - 8]
push eax
call fcn.00473092
mov ecx, eax
add esp, 8
test ecx, ecx
js 0x40d6f8
mov eax, dword [ebp - 0x424]
cmp ecx, dword [eax - 8]
jg 0x40d6f8
mov dword [eax - 0xc], ecx
xor edx, edx
mov word [eax + ecx*2], dx
mov edx, 1
mov ecx, dword [edi - 8]
sub edx, dword [edi - 4]
sub ecx, 0x104
or ecx, edx
jge 0x40d487
push 0x104
lea ecx, [ebp - 0x42c]
call fcn.004048e0
mov edi, dword [ebp - 0x42c]
mov eax, dword [ebp - 0x424]
push esi
push 0x104
push edi
push eax
push str.LogDirName
push dword [ebp - 0x428]
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
push dword [edi - 8]
push edi
call fcn.00473092
add esp, 8
test eax, eax
js 0x40d6f8
cmp eax, dword [edi - 8]
jg 0x40d6f8
mov edx, dword [ebp - 0x430]
xor ecx, ecx
mov dword [edi - 0xc], eax
mov word [edi + eax*2], cx
mov eax, edx
mov ecx, dword [ebp - 0x434]
and eax, 2
and edx, 1
mov dword [ecx + 4], eax
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], 0
or ecx, 0xffffffff
test eax, eax
je 0x40d65e
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.0046ce30
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
push 0
push 0
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
push edi
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push str.Logs
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push str..log
lea edx, [ebp - 0x428]
lea ecx, [ebp - 0x430]
call fcn.00411010
add esp, 4
push dword [eax]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov edx, dword [ebp - 0x430]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40d592
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0
push 0x80
push 4
push 0
push 7
push 0x40000000
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, eax
mov eax, dword [ebp - 0x434]
mov dword [eax + 0xc], ecx
cmp ecx, 0xffffffff
jne 0x40d64e
mov byte [ebp - 4], 4
mov edx, dword [ebp - 0x424]
mov dword [eax + 4], 0
add edx, 0xfffffff0
or eax, ecx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40d5ed
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea edx, [edi - 0x10]
mov byte [ebp - 4], 3
or edi, 0xffffffff
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40d60b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x40d626
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x428]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x40d6d7
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40d6d7
push 2
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
or ecx, 0xffffffff
mov byte [ebp - 4], 4
mov eax, ecx
mov edx, dword [ebp - 0x424]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40d67f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea edx, [edi - 0x10]
mov byte [ebp - 4], 3
or edi, 0xffffffff
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40d69d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x40d6b8
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x428]
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], edi
dec edi
test edi, edi
jg 0x40d6d7
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x434]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00439921
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.00404990
int3