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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x1cc
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x4046f0
mov ebx, ecx
lea eax, [ebp - 0x18]
mov ecx, dword fs:[0]
lea esi, [ebx + 0xc4]
lea edi, [ebx + 0xc8]
mov dword [ebp - 0x18], ecx
mov dword fs:[0], eax
push 8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebx + 0x14]
mov ecx, dword [eax]
push esi
push edi
push 0x21
push eax
call dword [ecx + 0x20]
cmp eax, 0x887a0027
mov dword [ebx + 0xbc], eax
jne 0x401d4a
push 8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebx + 0x14]
mov ecx, dword [eax]
push esi
push edi
push 0x21
push eax
call dword [ecx + 0x20]
cmp eax, 0x887a0027
mov dword [ebx + 0xbc], eax
jne 0x401d4a
push 8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebx + 0x14]
mov ecx, dword [eax]
push esi
push edi
push 0x21
push eax
call dword [ecx + 0x20]
cmp eax, 0x887a0027
mov dword [ebx + 0xbc], eax
jne 0x401d4a
push 8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebx + 0x14]
mov ecx, dword [eax]
push esi
push edi
push 0x21
push eax
call dword [ecx + 0x20]
cmp eax, 0x887a0027
mov dword [ebx + 0xbc], eax
je 0x401f95
test eax, eax
js 0x401f95
mov dword [ebp - 0x20], ebx
mov eax, dword [ebp - 0x20]
mov ebx, dword [eax + 0xc4]
mov eax, dword [ebp - 0x20]
lea edi, [eax + 0x1c]
push edi
call fcn.00403cf0
add esp, 4
mov ecx, dword [ebx]
push eax
push 0x40688c
push ebx
mov ebx, dword [ebp - 0x20]
call dword [ecx]
test eax, eax
mov dword [ebx + 0xbc], eax
js 0x401f95
mov eax, dword [esi]
test eax, eax
je 0x401d9b
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov dword [esi], 0
mov eax, dword [edi]
test eax, eax
je 0x401f95
mov ecx, dword [ebx + 0xc]
mov edx, dword [ecx]
push eax
push dword [ebx + 0x24]
push ecx
call dword [edx + 0xbc]
mov dword [ebp - 0x30], vtable.CComPtrCustom_struct_IDXGISurface1_.0
mov dword [ebp - 0x2c], 0
lea eax, [ebp - 0x2c]
mov esi, dword [ebx + 0x24]
push eax
call fcn.00403d00
add esp, 4
mov ecx, dword [esi]
mov ecx, dword [ecx]
mov dword [ebp - 0x10], 1
push eax
push 0x40689c
push esi
call ecx
mov ecx, dword [ebp - 0x20]
test eax, eax
mov dword [ecx + 0xbc], eax
js 0x4021a4
mov esi, ecx
lea eax, [ebp - 0x84]
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x84], 0x14
push eax
call dword [sym.imp.USER32.dll_GetCursorInfo]
cmp eax, 1
jne 0x401e82
cmp dword [ebp - 0x80], 1
jne 0x401e82
mov eax, dword [ebp - 0x78]
lea edx, [ebp - 0x1d8]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x74]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax]
push edx
push 0
push eax
call dword [ecx + 0x2c]
push 0xb
push 0
push 0
push 0
push 0
push dword [ebp - 0x7c]
push dword [ebp - 0x24]
push dword [ebp - 0x3c]
push dword [ebp - 0x1d8]
call dword [sym.imp.USER32.dll_DrawIconEx]
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x30]
mov esi, dword [ebp - 0x20]
mov eax, dword [esi + 0xc]
mov ecx, dword [eax]
push dword [esi + 0x24]
push dword [esi + 0x2c]
push eax
call dword [ecx + 0xbc]
mov esi, dword [ebp - 0x20]
lea edx, [ebp - 0xbc]
mov eax, dword [esi + 0xc]
mov ecx, dword [eax]
push edx
push 0
push 3
push 0
push dword [esi + 0x2c]
push eax
call dword [ecx + 0x38]
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0x94], 0
mov dword [ebp - 0x98], 0
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x88], 0
mov dword [ebp - 0xb0], 0x28
mov word [ebp - 0xa2], 0x20
mov dword [ebp - 0xa0], 0
mov eax, dword [ecx + 0x8c]
mov dword [ebp - 0xac], eax
mov dword [ebp - 0x38], eax
lea eax, [eax*4]
mov ecx, dword [ecx + 0x90]
mov dword [ebp - 0x24], eax
imul eax, ecx
mov dword [ebp - 0xa8], ecx
mov word [ebp - 0xa4], 1
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x9c], eax
push eax
call fcn.00404863
add esp, 4
mov dword [ebp - 0x34], eax
mov edx, dword [ebp - 0xb8]
mov ecx, dword [ebp - 0x24]
mov edi, dword [ebp - 0x28]
cmp edx, ecx
cmovae edx, ecx
test edi, edi
je 0x40200c
mov esi, dword [ebp - 0x38]
mov eax, ecx
mov ebx, dword [ebp - 0xbc]
mov dword [ebp - 0x28], edx
neg eax
mov dword [ebp - 0x3c], eax
mov eax, esi
imul eax, edi
shl eax, 2
neg eax
mov dword [ebp - 0x70], eax
lea eax, [edi*4 - 4]
xor edi, edi
imul eax, esi
mov esi, dword [ebp - 0x34]
mov dword [ebp - 0x38], eax
jmp 0x401fe6
xor ebx, ebx
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
mov eax, ebx
add esp, 0x1cc
pop esi
pop edi
pop ebx
pop ebp
ret
push ecx
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x20]
inc edi
add ebx, dword [ebp - 0xb8]
add esi, dword [ebp - 0x3c]
cmp edi, dword [eax + 0x90]
jae 0x40200c
test edx, edx
je 0x401fd1
cmp dword [ebp - 0x70], esi
je 0x401fb9
mov eax, dword [ebp - 0x38]
test ebx, ebx
lea eax, [esi + eax]
je 0x401fad
push edx
push ebx
push eax
call sub.VCRUNTIME140.dll_memcpy
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
add esp, 0xc
jmp 0x401fd1
lea eax, [ebp - 0x1d8]
push eax
push 0
push 0
push 5
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
mov ecx, dword [ebp - 0x20]
test eax, eax
mov dword [ecx + 0xbc], eax
js 0x4021a8
mov eax, dword [ecx + 0xb0]
mov dword [ebp - 0x10], 2
lea ecx, [ebp - 0x6c]
push eax
push ecx
call fcn.004042b0
add esp, 8
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x10], 3
lea eax, [ebp - 0x54]
push ecx
push str.image2
push eax
call fcn.00403de0
add esp, 0xc
mov dword [ebp - 0x10], 4
lea eax, [ebp - 0xd4]
push str..bmp
lea ecx, [ebp - 0x54]
push ecx
push eax
call fcn.00403d10
add esp, 0xc
mov eax, dword [ebp - 0x40]
mov edi, dword [ebp - 0x20]
cmp eax, 8
jb 0x4020a2
lea eax, [eax + eax + 2]
push eax
push dword [ebp - 0x54]
call fcn.00403540
add esp, 8
mov eax, dword [ebp - 0x58]
lea ebx, [ebp - 0x54]
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 7
mov word [ebp - 0x54], 0
cmp eax, 8
jb 0x4020d1
lea eax, [eax + eax + 2]
push eax
push dword [ebp - 0x6c]
call fcn.00403540
add esp, 8
cmp dword [ebp - 0xc0], 7
lea eax, [ebp - 0x6c]
lea ecx, [ebp - 0xd4]
mov dword [ebp - 0x6c], 0
jbe 0x4020f0
mov ecx, dword [ebp - 0xd4]
push 0x4068c4
push ecx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen_s]
add esp, 0xc
test eax, eax
jne 0x402182
mov eax, dword [ebp - 0x6c]
test eax, eax
je 0x4021e8
mov ecx, dword [ebp - 0x9c]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov dword [ebp - 0x4e], 0
add ecx, 0x36
mov dword [ebp - 0x52], ecx
mov word [ebp - 0x54], 0x4d42
mov dword [ebp - 0x4a], 0x36
push eax
push 1
push 0xe
push ebx
call esi
add esp, 0x10
lea eax, [ebp - 0xb0]
push dword [ebp - 0x6c]
push 1
push 0x28
push eax
call esi
add esp, 0x10
push dword [ebp - 0x6c]
push 1
push dword [ebp - 0x9c]
push dword [ebp - 0x34]
call esi
add esp, 0x10
push dword [ebp - 0x6c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov dword [edi + 0xb4], 0
inc dword [edi + 0xb0]
xor ebx, ebx
mov eax, dword [ebp - 0xc0]
cmp eax, 8
jb 0x4021aa
lea eax, [eax + eax + 2]
push eax
push dword [ebp - 0xd4]
call fcn.00403540
add esp, 8
jmp 0x4021aa
xor ebx, ebx
jmp 0x4021b5
xor ebx, ebx
push dword [ebp - 0x34]
call fcn.00404826
add esp, 4
mov dword [ebp - 0x30], vtable.CComPtrCustom_struct_IDXGISurface1_.0
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x401f97
mov ecx, dword [eax]
mov dword [ebp - 0x20], ebx
mov ecx, dword [ecx + 8]
mov dword [ebp - 0x10], 0
push eax
call ecx
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 0x2c], 0
jmp 0x401f97
cmp dword [edi + 0xb4], 0
setne bl
jmp 0x402184