Function at 0x418210
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47053e
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
mov eax, dword [0x4a5010]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x2c], esi
mov ecx, dword [esi + 0x494]
lea eax, [ebp - 0x24]
xorps xmm0, xmm0
push eax
movq qword [ebp - 0x24], xmm0
call fcn.00406ce0
mov dword [ebp - 4], 0
mov ebx, dword [ebp - 0x24]
test ebx, ebx
sete al
mov dl, al
mov byte [ebp - 0x26], al
xor dl, 1
mov byte [ebp - 0x25], dl
je 0x41829f
cmp dword [ebx + 0x14], 8
jb 0x41828c
mov eax, dword [ebx]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov dl, byte [ebp - 0x25]
mov edi, eax
mov al, byte [ebp - 0x26]
jmp 0x4182a1
mov eax, ebx
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov dl, byte [ebp - 0x25]
mov edi, eax
mov al, byte [ebp - 0x26]
jmp 0x4182a1
xor edi, edi
test al, al
jne 0x418595
test edi, edi
je 0x418595
cmp dword [ebx + 0x1c], 0
je 0x418595
mov eax, dword [esi + 0x494]
mov ecx, dword [eax + 4]
sub ecx, dword [eax]
sar ecx, 3
test ecx, ecx
je 0x418595
mov dword [ebp - 0x1c], 0
cmp dword [ebx + 0x14], 8
jb 0x4182e2
mov edx, dword [ebx]
jmp 0x4182e4
mov edx, ebx
lea ecx, [ebp - 0x1c]
call fcn.0043a540
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 2
mov ecx, dword [esi + 0x460]
push eax
call dword [sym.imp.soui.dll_public:_class_SOUI::CRect___thiscall_SOUI::SWindow::GetWindowRect_void_]
movups xmm1, xmmword [eax]
mov dword [ebp - 0x14], 0
movaps xmm0, xmm1
movd eax, xmm1
psrldq xmm0, 8
movd ecx, xmm0
sub ecx, eax
mov eax, 0x88888889
sub ecx, 0x1c2
imul ecx
mov eax, 0x1e
add edx, ecx
sar edx, 3
mov esi, edx
shr esi, 0x1f
add esi, edx
cmp esi, eax
cmovl esi, eax
cmp dword [ebx + 0x14], 8
jb 0x418347
mov ebx, dword [ebx]
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push eax
lea ecx, [ebp - 0x14]
call fcn.00401980
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x14]
cmp dword [eax - 0xc], esi
jle 0x418396
push esi
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x14]
call fcn.0041b0a0
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.0041bc30
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 3
call fcn.00401960
push 0x48cd10
lea ecx, [ebp - 0x14]
call fcn.0041b3f0
call fcn.004035d0
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
push str.dlg_main
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 5
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::constructor_wchar_t_const__]
push 0x48c24c
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 6
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::constructor_wchar_t_const__]
push 0x48c2c0
lea ecx, [ebp - 0x38]
mov byte [ebp - 4], 7
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::constructor_wchar_t_const__]
push str.TitleText
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 8
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::constructor_wchar_t_const__]
mov byte [ebp - 4], 9
call dword [sym.imp.soui.dll_public:_static_class_SOUI::SApplication____cdecl_SOUI::SSingleton_class_SOUI::SApplication_::getSingleton_void_]
mov esi, dword [sym.imp.soui.dll_public:_struct_SOUI::ITranslatorMgr____thiscall_SOUI::SApplication::GetTranslator_void_]
mov ecx, eax
call esi
mov edi, eax
call dword [sym.imp.soui.dll_public:_static_class_SOUI::SApplication____cdecl_SOUI::SSingleton_class_SOUI::SApplication_::getSingleton_void_]
mov ecx, eax
call esi
mov edx, dword [edi]
mov ebx, eax
lea eax, [ebp - 0x30]
mov ecx, edi
push eax
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x58]
push eax
call dword [edx + 0x20]
push 0
push eax
lea eax, [ebp - 0x54]
mov byte [ebp - 4], 0xa
mov esi, dword [sym.imp.utilities.dll_public:_static_class_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits____cdecl_SOUI::SStrCpCvt::CvtW2W_class_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits__const___unsigned_int_]
push eax
call esi
add esp, 0xc
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x38]
mov byte [ebp - 4], 0xb
mov edx, dword [ebx]
mov ecx, ebx
push eax
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x50]
push eax
call dword [edx + 0x20]
push 0
push eax
lea eax, [ebp - 0x4c]
mov byte [ebp - 4], 0xc
push eax
call esi
add esp, 0xc
mov esi, eax
mov ebx, dword [ebp - 0x2c]
mov byte [ebp - 4], 0xd
mov ecx, dword [ebx + 0x494]
mov eax, dword [ecx + 4]
sub eax, dword [ecx]
mov edi, dword [ebp - 0x24]
sar eax, 3
mov dword [ebp - 0x44], eax
mov eax, dword [edi + 0x1c]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
cmp dword [eax - 4], 1
jle 0x4184a5
push dword [eax - 0xc]
lea ecx, [ebp - 0x14]
call fcn.004024e0
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x40]
mov esi, dword [esi]
push dword [eax]
push ecx
mov ecx, dword [ebx + 0x40c]
call fcn.0042fb10
add esp, 4
push eax
push dword [ebp - 0x44]
mov eax, dword [edi + 0x40]
mov edi, dword [ebp - 0x48]
inc eax
push eax
push dword [ebp - 0x1c]
push edi
call dword [sym.imp.FreeImage.dll__FreeImage_GetHeight_4]
push eax
push edi
call dword [sym.imp.FreeImage.dll__FreeImage_GetWidth_4]
push eax
push dword [ebp - 0x2c]
lea eax, [ebp - 0x18]
push esi
push eax
call fcn.0041c920
add esp, 0x28
lea ecx, [ebp - 0x4c]
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::destructor_void_]
lea ecx, [ebp - 0x50]
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::destructor_void_]
lea ecx, [ebp - 0x54]
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::destructor_void_]
lea ecx, [ebp - 0x58]
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::destructor_void_]
lea ecx, [ebp - 0x34]
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::destructor_void_]
lea ecx, [ebp - 0x38]
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::destructor_void_]
lea ecx, [ebp - 0x3c]
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::destructor_void_]
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 5
call dword [sym.imp.utilities.dll_public:_void___thiscall_SOUI::TStringT_wchar_t__struct_SOUI::wchar_traits_::destructor_void_]
sub esp, 8
lea ecx, [ebp - 0x18]
call fcn.0041b140
mov ecx, dword [ebx + 0x460]
mov esi, dword [ebp - 0x18]
push esi
mov eax, dword [ecx]
call dword [eax + 0x3c]
lea edx, [esi - 0x10]
mov byte [ebp - 4], 3
or esi, 0xffffffff
mov eax, esi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41856e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
mov eax, esi
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41858c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x1c]
jmp 0x4185e8
mov dword [ebp - 0x18], 0
test dl, dl
je 0x4185aa
cmp dword [ebx + 0x14], 8
jb 0x4185af
mov ebx, dword [ebx]
jmp 0x4185af
mov ebx, 0x48c2c0
push ebx
lea ecx, [ebp - 0x18]
call fcn.00401980
mov byte [ebp - 4], 1
test edi, edi
je 0x4185cd
push dword [ebp - 0x18]
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
mov edx, eax
jmp 0x4185d2
mov edx, 0x48c2c0
mov ecx, dword [esi + 0x460]
push edx
mov eax, dword [ecx]
call dword [eax + 0x3c]
mov byte [ebp - 4], 0
or esi, 0xffffffff
mov edx, dword [ebp - 0x18]
mov eax, esi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4185ff
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xe
mov edi, dword [ebp - 0x20]
test edi, edi
je 0x41862b
mov eax, esi
lock xadd dword [edi + 4], eax
jne 0x41862b
mov eax, dword [edi]
mov ecx, edi
call dword [eax]
lock xadd dword [edi + 8], esi
dec esi
jne 0x41862b
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0043f53f
mov esp, ebp
pop ebp
ret