Function at 0x522e70
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5743cd
mov eax, dword fs:[0]
push eax
sub esp, 0x6f0
mov eax, dword [0x5c3678]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
push 0x206
xor edi, edi
lea ecx, [ebp - 0x21a]
xor eax, eax
push edi
push ecx
mov word [ebp - 0x21c], ax
call fcn.00544310
add esp, 0xc
push edi
push 0x10
lea edx, [ebp - 0x21c]
push edx
push edi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push edi
lea eax, [ebx + 0x54]
mov ecx, str.PROFILE_PICKER_FILTER
lea esi, [ebp - 0x6fc]
call fcn.004acda0
mov esi, 8
mov dword [ebp - 4], edi
cmp dword [eax + 0x18], esi
jb 0x522ef8
mov eax, dword [eax + 4]
jmp 0x522efb
add eax, 4
lea ecx, [ebp - 0x6b4]
push ecx
mov ecx, eax
call fcn.00423950
mov byte [ebp - 4], 2
cmp dword [ebp - 0x6e4], esi
jb 0x522f24
mov edx, dword [ebp - 0x6f8]
push edx
call fcn.0053c152
add esp, 4
push edi
push 0x7c
lea ecx, [ebp - 0x6b4]
xor eax, eax
push ecx
mov dword [ebp - 0x6e4], 7
mov dword [ebp - 0x6e8], edi
mov word [ebp - 0x6f8], ax
call fcn.00510830
mov edx, dword [ebp - 0x6b4]
push edx
lea esi, [ebp - 0x6a4]
call fcn.0047a8c0
or dword [ebp - 0x650], 0x20
mov esi, vtable.CFileDialogEx.0
mov dword [ebp - 0x6a4], esi
mov dword [ebp - 0x640], 0x47a6d0
lea eax, [ebp - 0x21c]
mov byte [ebp - 4], 3
mov dword [ebp - 0x658], eax
call dword [sym.imp.USER32.dll_GetActiveWindow]
lea edi, [ebp - 0x6a4]
call fcn.00526550
cmp eax, 1
je 0x522faf
mov byte [ebp - 4], 2
mov dword [ebp - 0x6a4], esi
jmp 0x523307
lea ecx, [ebp - 0x6ac]
push ecx
lea ecx, [ebp - 0x428]
mov byte [ebx + 0x1dc], 0
call fcn.00423950
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x6ac]
mov eax, dword [ecx - 0xc]
test eax, eax
je 0x52338a
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x52338a
mov edx, dword [ebp - 0x6ac]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionW]
mov esi, eax
test esi, esi
je 0x523379
mov edi, dword [sym.imp.SHLWAPI.dll_StrCmpIW]
push str..jpg
push esi
call edi
test eax, eax
je 0x523025
push str..png
push esi
call edi
test eax, eax
jne 0x523379
mov ecx, dword [ebp - 0x6ac]
xor eax, eax
mov dword [ebp - 0x6dc], eax
mov dword [ebp - 0x6d8], eax
mov dword [ebp - 0x6d4], eax
mov dword [ebp - 0x6d0], eax
mov dword [ebp - 0x6cc], eax
mov dword [ebp - 0x6c8], eax
mov dword [ebp - 0x6c4], eax
mov dword [ebp - 0x6c0], eax
lea eax, [ebp - 0x6e0]
push eax
push 0
push ecx
mov dword [ebp - 0x6e0], 0
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
test eax, eax
je 0x5230a1
cmp dword [ebp - 0x6c4], 0
ja 0x523090
cmp dword [ebp - 0x6c0], 0x200000
jbe 0x5230a1
push str.IDS_ITEM_OTHER_PIC_FILE_TOOBIG
mov edi, ebx
call fcn.00525440
jmp 0x5232d3
mov edi, dword [ebp - 0x6ac]
push 0x10
call sub.gdiplus.dll_GdipAlloc
mov esi, eax
test esi, esi
je 0x523368
lea edx, [ebp - 0x6a8]
push edx
push edi
mov dword [esi], vtable.Gdiplus::Bitmap.0
mov dword [ebp - 0x6a8], 0
call sub.gdiplus.dll_GdipCreateBitmapFromFile
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x6a8]
mov dword [esi + 4], eax
mov eax, dword [esi + 8]
xor edi, edi
mov dword [esi + 8], edi
cmp eax, edi
jne 0x52335e
mov edx, dword [esi + 4]
lea ecx, [ebp - 0x6a8]
push ecx
push edx
mov dword [ebp - 0x6a8], edi
call sub.gdiplus.dll_GdipGetImageHeight
cmp eax, edi
je 0x52310e
mov dword [esi + 8], eax
mov ecx, dword [esi + 4]
lea eax, [ebp - 0x6b0]
push eax
push ecx
mov dword [ebp - 0x6b0], edi
call sub.gdiplus.dll_GdipGetImageWidth
cmp eax, edi
je 0x52312b
mov dword [esi + 8], eax
mov eax, 0x1f4
cmp dword [ebp - 0x6a8], eax
ja 0x523179
cmp dword [ebp - 0x6b0], eax
ja 0x523179
lea edx, [ebp - 0x6a8]
push esi
push edx
call fcn.00522da0
add esp, 8
mov byte [ebp - 4], 6
mov eax, dword [ebp - 0x6a8]
cmp dword [eax - 0xc], edi
je 0x5231dd
lea eax, [ebp - 0x6a8]
lea edi, [ebp - 0x6ac]
call fcn.00423c70
mov byte [ebx + 0x1dc], 1
jmp 0x5231dd
push edi
push 1
push 1
push eax
push eax
push esi
call fcn.004d1870
mov edi, eax
add esp, 0x18
mov dword [ebp - 0x6b0], edi
test edi, edi
je 0x523203
lea ecx, [ebp - 0x6a8]
push edi
push ecx
call fcn.00522da0
add esp, 8
mov byte [ebp - 4], 5
mov edx, dword [ebp - 0x6a8]
cmp dword [edx - 0xc], 0
je 0x5231d3
lea eax, [ebp - 0x6a8]
lea edi, [ebp - 0x6ac]
call fcn.00423c70
mov edi, dword [ebp - 0x6b0]
mov byte [ebx + 0x1dc], 1
mov eax, dword [edi]
mov edx, dword [eax]
push 1
mov ecx, edi
call edx
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x6a8]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x523203
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
lea edi, [ebx + 0x1d8]
lea eax, [ebp - 0x6ac]
call fcn.00423c70
mov ecx, dword [ebx + 0x1a8]
mov edx, dword [ecx]
mov edx, dword [edx + 0xc]
lea eax, [ebp - 0x6ac]
push eax
call edx
test al, al
sete al
mov byte [ebx + 0x1e5], al
mov edx, dword [0x5cc90c]
mov eax, dword [edx + 0xc]
mov ecx, 0x5cc90c
mov dword [ebp - 0x6a8], 5
mov dword [ebp - 0x6b8], 6
mov dword [ebp - 0x6bc], 2
call eax
add eax, 0x10
mov dword [ebp - 0x6b0], eax
lea ecx, [ebp - 0x6a8]
push ecx
lea edx, [ebp - 0x6b8]
push edx
lea eax, [ebp - 0x6bc]
push eax
lea ecx, [ebp - 0x6b0]
push ecx
mov byte [ebp - 4], 7
call fcn.004de840
push eax
call fcn.004de8c0
push eax
call fcn.004de940
push eax
xor esi, esi
call fcn.004de9c0
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x6b0]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x5232d3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x6ac]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x5232f9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 2
mov dword [ebp - method.CFileDialogEx.virtual_0], vtable.CFileDialogEx.0
mov eax, dword [ebp - 0x690]
test eax, eax
je 0x523317
push eax
call fcn.0053a54b
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x6b4]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x523340
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0053c15d
mov esp, ebp
pop ebp
ret 4
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
push str.IDS_ITEM_OTHER_PIC_FILE_CONTENTERR
mov edi, ebx
call fcn.00525440
jmp 0x5232d3
push str.IDS_ITEM_OTHER_PIC_FILE_FORMATERR
mov edi, ebx
call fcn.00525440
jmp 0x5232d3
push str.IDS_FILE_NOT_FOUND
mov edi, ebx
call fcn.00525440
jmp 0x5232d3