Function at 0x405080
Capabilities:
Get common file path
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x408848
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x64
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 0x10], esp
xor edi, edi
lea ecx, [ebp - 0x14]
mov dword [ebp - 4], edi
mov dword [ebp - 0x1c], edi
call sub.MFC42.DLL_CString::CString_2
push 0x100
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call sub.MFC42.DLL_CString::GetBufferSetLength
push eax
push 0xff
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push 0xffffffffffffffff
lea ecx, [ebp - 0x14]
call sub.MFC42.DLL_CString::ReleaseBuffer
push 0x1f2c
mov byte [ebp - 4], 2
call sub.MFC42.DLL_operatornew
add esp, 4
mov ebx, eax
lea eax, [ebp + 8]
mov dword [ebp - 0x34], ebx
push ecx
mov ecx, esp
mov dword [ebp - 0x30], esp
push eax
call fcn.004078ec
mov ecx, esi
call fcn.00404ce0
cmp eax, edi
je 0x405447
push ecx
lea edx, [ebp - 0x14]
mov ecx, esp
mov dword [ebp - 0x30], esp
push str._prvw.bmp
push edx
push ecx
call sub.MFC42.DLL_operator
mov ecx, esi
call fcn.00404e90
cmp ebx, edi
je 0x405447
lea eax, [ebp - 0x14]
push str._prvw.jpg
lea ecx, [ebp - 0x30]
push eax
push ecx
call sub.MFC42.DLL_operator
mov edx, dword [eax]
lea eax, [ebp - 0x14]
push str._prvw.bmp
lea ecx, [ebp - 0x2c]
push eax
push ecx
mov byte [ebp - 4], 3
mov dword [ebp - 0x28], edx
call sub.MFC42.DLL_operator
mov eax, dword [eax]
push 0x40c06c
push eax
mov byte [ebp - 4], 4
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
cmp esi, edi
mov dword [ebp - 0x18], esi
jne 0x405185
mov dword [ebp - 0x1c], edi
jmp 0x40542f
push edi
push edi
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov edi, dword [sym.imp.MSVCRT.dll_fread]
push esi
push 1
lea edx, [ebp - 0x44]
push 0xe
push edx
call edi
push esi
push 1
lea eax, [ebp - 0x70]
push 0x28
push eax
call edi
mov edx, dword [ebp - 0x6c]
add esp, 0x2c
mov eax, edx
and eax, 0x80000007
jns 0x4051be
dec eax
or eax, 0xfffffff8
inc eax
jne 0x4051c4
mov ecx, edx
jmp 0x4051da
mov ecx, 8
sub ecx, eax
and ecx, 0x80000007
jns 0x4051d8
dec ecx
or ecx, 0xfffffff8
inc ecx
add ecx, edx
mov esi, dword [ebp - 0x68]
mov eax, esi
and eax, 0x80000007
jns 0x4051eb
dec eax
or eax, 0xfffffff8
inc eax
jne 0x4051f1
mov eax, esi
jmp 0x405208
mov edi, 8
sub edi, eax
mov eax, edi
and eax, 0x80000007
jns 0x405206
dec eax
or eax, 0xfffffff8
inc eax
add eax, esi
mov dword [ebp - 0x3c], eax
mov dword [ebx + 0xc], eax
imul eax, ecx
mov word [ebp - 0x38], 0x18
mov dword [ebp - 0x40], ecx
lea eax, [eax + eax*2]
mov dword [ebp - 0x44], esi
push eax
mov dword [ebp - 0x48], edx
mov dword [ebx + 0x10], edx
mov dword [ebx + 0x14], esi
mov dword [ebx + 8], ecx
call sub.MFC42.DLL_operatornew
add esp, 4
mov ecx, 5
sub esp, 0x14
lea esi, [ebp - 0x48]
mov edi, esp
mov dword [ebp - 0x20], eax
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x18]
push eax
push esi
mov ecx, ebx
call fcn.00401610
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov esi, dword [ebx + 8]
mov byte [ebx], 0
imul esi, dword [ebx + 0xc]
push esi
mov byte [ebx + 1], 7
call sub.MFC42.DLL_operatornew
add esp, 8
mov edi, eax
push esi
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [ebp - 0x24], eax
push esi
call sub.MFC42.DLL_operatornew
mov esi, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x20]
add esp, 4
mov dword [ebp - 0x18], eax
push eax
push esi
push edi
push ecx
mov ecx, ebx
call fcn.004016e0
mov edx, dword [ebx + 0xc]
mov eax, dword [ebx + 8]
push 8
push 8
push edx
push eax
push edi
mov ecx, ebx
call fcn.00401800
mov ecx, dword [ebx + 0xc]
mov edx, dword [ebx + 8]
push 8
push 8
push ecx
push edx
push esi
mov ecx, ebx
call fcn.00401800
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebx + 8]
mov edx, dword [ebp - 0x18]
push 8
push 8
push eax
push ecx
push edx
mov ecx, ebx
call fcn.00401800
push 0x3c
lea eax, [ebx + 0x101c]
push eax
push 0x409a08
mov ecx, ebx
call fcn.00401930
lea ecx, [ebx + 0x105c]
push 0x3c
push ecx
push 0x409a48
mov ecx, ebx
call fcn.00401930
mov ecx, ebx
call fcn.004019e0
lea edx, [ebx + 0x817]
mov ecx, ebx
mov dword [ebx + 0x1018], edx
call fcn.00402f60
mov eax, dword [ebp - 0x28]
push 0x40c068
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [ebx + 4], eax
test eax, eax
je 0x4053ff
push eax
push 1
push 2
push 0x409c76
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
mov ecx, ebx
call fcn.00401aa0
mov ecx, ebx
call fcn.00401b10
mov ecx, ebx
call fcn.00401b90
mov ecx, ebx
call fcn.00401c60
mov ecx, ebx
call fcn.00401e20
lea ecx, [ebx + 0x129c]
push ecx
push 0x409adc
push 0x409ac8
mov ecx, ebx
call fcn.00401e80
lea edx, [ebx + 0x132c]
mov ecx, ebx
push edx
push 0x409b1c
push 0x409b08
call fcn.00401e80
lea eax, [ebx + 0x12e4]
mov ecx, ebx
push eax
push 0x409afc
push 0x409ae8
call fcn.00401e80
lea ecx, [ebx + 0x192c]
push ecx
push 0x409bd4
push 0x409bc0
mov ecx, ebx
call fcn.00401e80
mov edx, dword [ebp - 0x18]
mov ecx, ebx
push edx
push esi
push edi
call fcn.00401f30
mov eax, dword [ebx + 4]
push eax
push 1
push 2
push 0x409c78
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [ebx + 4]
push ecx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
mov edx, dword [ebp - 0x20]
push edx
call sub.MFC42.DLL_operatordelete
push edi
call sub.MFC42.DLL_operatordelete
push esi
call sub.MFC42.DLL_operatordelete
mov eax, dword [ebp - 0x18]
push eax
call sub.MFC42.DLL_operatordelete
mov eax, dword [ebx + 4]
add esp, 0x10
xor ecx, ecx
test eax, eax
setne cl
mov dword [ebp - 0x1c], ecx
xor edi, edi
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 3
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 2
call sub.MFC42.DLL_CString::CString
lea edx, [ebp - 0x14]
push str._prvw.jpg
lea eax, [ebp - 0x30]
push edx
push eax
call sub.MFC42.DLL_operator
mov ecx, dword [ebp + 0xc]
push eax
mov byte [ebp - 4], 5
call sub.MFC42.DLL_CString::operator_1
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 2
call sub.MFC42.DLL_CString::CString
jmp 0x40548c
lea ecx, [ebp - 0x14]
mov dword [ebp - 4], edi
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp + 8]
mov dword [ebp - 4], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x1c]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 8