Function at 0x401470
Capabilities:
Copy file

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
lea esi, [ebp - 0x220]
sub esp, 0x27c
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp + 4], 0x104
mov dword [esp], 0x73
call sym._SystemParametersInfoW_16
sub esp, 0x10
test eax, eax
je 0x4015f5
lea eax, [ebp - 0x248]
mov dword [esp], esi
mov dword [ebp - 0x250], eax
call sym._wcslen
lea edi, [eax + eax]
sar edi, 1
cmp edi, 7
mov dword [ebp - 0x238], edi
ja 0x4017a3
cmp edi, 1
mov ebx, dword [ebp - 0x250]
je 0x401875
test edi, edi
lea edx, [ebp - 0x238]
jne 0x4017e2
lea edx, [ebp - 0x238]
xor ecx, ecx
mov dword [ebp - 0x24c], ecx
add ecx, ecx
lea edi, [ebp - 0x230]
lea esi, [ebx + ecx]
sar ecx, 1
xor eax, eax
cmp ecx, 0xf
mov word [esi], ax
mov dword [ebp - 0x238], edi
mov eax, edi
mov dword [ebp - 0x254], ecx
ja 0x401843
cmp ebx, esi
je 0x401546
lea esi, [esi]
movzx edx, word [ebx]
add ebx, 2
add eax, 1
mov byte [eax - 1], dl
cmp esi, ebx
jne 0x401530
mov eax, dword [ebp - 0x238]
mov edx, dword [ebp - 0x254]
mov dword [ebp - 0x234], edx
mov byte [eax + edx], 0
mov eax, dword [ebp + 8]
mov dword [esp + 8], 0
mov eax, dword [eax]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x238]
mov dword [esp], eax
call sym._CopyFileA_12
sub esp, 0xc
test eax, eax
je 0x401654
mov dword [esp + 8], 0x14
mov dword [esp + 4], str.Wallpaper_saved_to:
mov dword [esp], sym.imp.libstdc_6.dll_std::cout
call sym.std::basic_ostream_char__std::char_traits_char____std::__ostream_insert_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const__int_
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp], sym.imp.libstdc_6.dll_std::cout
mov dword [esp + 4], eax
call sym.std::basic_ostream_char__std::char_traits_char____std::__ostream_insert_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const__int_
mov esi, eax
mov eax, dword [eax]
mov eax, dword [eax - 0xc]
mov ebx, dword [esi + eax + 0x7c]
test ebx, ebx
je 0x40193f
cmp byte [ebx + 0x1c], 0
je 0x401810
movsx eax, byte [ebx + 0x27]
mov dword [esp], eax
mov ecx, esi
call sym.std::ostream::put_char_
sub esp, 4
mov ecx, eax
call sym.std::ostream::flush__
jmp 0x40173a
mov dword [esp + 8], 0x1d
mov dword [esp + 4], str.Failed_to_get_wallpaper_path.
mov dword [esp], sym.imp.libstdc_6.dll_std::cerr
call sym.std::basic_ostream_char__std::char_traits_char____std::__ostream_insert_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const__int_
mov eax, dword [sym.imp.libstdc_6.dll_std::cerr]
mov eax, dword [eax - 0xc]
mov ebx, dword [eax + 0x409364]
test ebx, ebx
je 0x401944
cmp byte [ebx + 0x1c], 0
je 0x401770
movsx eax, byte [ebx + 0x27]
mov ecx, sym.imp.libstdc_6.dll_std::cerr
mov dword [esp], eax
call sym.std::ostream::put_char_
sub esp, 4
mov ecx, eax
call sym.std::ostream::flush__
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call sym._GetLastError_0
lea edx, [ebp - 0x254]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0xc], 0x400
mov dword [esp + 8], eax
mov dword [esp + 0x10], edx
mov dword [esp + 4], 0
mov dword [esp], 0x1300
mov dword [ebp - 0x254], 0
call sym._FormatMessageA_28
sub esp, 0x1c
test eax, eax
je 0x401729
mov dword [esp + 8], 0x21
mov dword [esp + 4], str.Failed_to_save_wallpaper._Error:
mov dword [esp], sym.imp.libstdc_6.dll_std::cerr
mov ebx, dword [ebp - 0x254]
call sym.std::basic_ostream_char__std::char_traits_char____std::__ostream_insert_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const__int_
test ebx, ebx
je 0x4018e2
mov dword [esp], ebx
call sym._strlen
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov dword [esp], sym.imp.libstdc_6.dll_std::cerr
call sym.std::basic_ostream_char__std::char_traits_char____std::__ostream_insert_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const__int_
mov eax, dword [sym.imp.libstdc_6.dll_std::cerr]
mov eax, dword [eax - 0xc]
mov ebx, dword [eax + 0x409364]
test ebx, ebx
je 0x401906
cmp byte [ebx + 0x1c], 0
je 0x4018af
movsx eax, byte [ebx + 0x27]
mov dword [esp], eax
mov ecx, sym.imp.libstdc_6.dll_std::cerr
call sym.std::ostream::put_char_
sub esp, 4
mov ecx, eax
call sym.std::ostream::flush__
mov eax, dword [ebp - 0x254]
mov dword [esp], eax
call sym._LocalFree_4
sub esp, 4
mov eax, dword [ebp - 0x238]
cmp eax, edi
je 0x40174c
mov dword [esp], eax
call sym.operator_delete_void_
mov eax, dword [ebp - 0x250]
lea ecx, [ebp - 0x248]
cmp eax, ecx
je 0x40164c
mov dword [esp], eax
call sym.operator_delete_void_
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, ebx
call sym.std::ctype_char_::_M_widen_init___const
mov eax, dword [ebx]
mov edx, dword [eax + 0x18]
mov eax, 0xa
cmp edx, method.std::ctype_char_.do_widen_char__const
je 0x401635
mov dword [esp], 0xa
mov ecx, ebx
call edx
sub esp, 4
movsx eax, al
jmp 0x401635
lea edx, [ebp - 0x238]
lea ecx, [ebp - 0x250]
mov dword [esp + 4], 0
mov dword [esp], edx
mov dword [ebp - 0x25c], edx
call sym.std::__cxx11::basic_string_wchar_t__std::char_traits_wchar_t___std::allocator_wchar_t___::_M_create_unsigned_int__unsigned_int_
mov ebx, eax
mov dword [ebp - 0x250], eax
mov eax, dword [ebp - 0x238]
mov edx, dword [ebp - 0x25c]
sub esp, 8
mov dword [ebp - 0x248], eax
mov dword [esp], ebx
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [ebp - 0x25c], edx
call sym._wmemcpy
mov ecx, dword [ebp - 0x238]
mov ebx, dword [ebp - 0x250]
mov edx, dword [ebp - 0x25c]
jmp 0x4014fa
mov ecx, ebx
call sym.std::ctype_char_::_M_widen_init___const
mov eax, dword [ebx]
mov edx, dword [eax + 0x18]
mov eax, 0xa
cmp edx, method.std::ctype_char_.do_widen_char__const
je 0x4015dc
mov dword [esp], 0xa
mov ecx, ebx
call edx
sub esp, 4
movsx eax, al
jmp 0x4015dc
lea eax, [ebp - 0x254]
mov dword [esp + 4], 0
mov ecx, edx
mov dword [esp], eax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::_M_create_unsigned_int__unsigned_int_
mov edx, dword [ebp - 0x254]
sub esp, 8
mov dword [ebp - 0x238], eax
mov dword [ebp - 0x230], edx
jmp 0x401529
movzx eax, word [ebp - 0x220]
lea edi, [ebp - 0x230]
xor edx, edx
lea esi, [ebx + 2]
mov word [ebx], ax
mov dword [ebp - 0x24c], 1
mov eax, edi
mov word [ebx + 2], dx
mov dword [ebp - 0x238], edi
mov dword [ebp - 0x254], 1
jmp 0x401529
mov ecx, ebx
call sym.std::ctype_char_::_M_widen_init___const
mov eax, dword [ebx]
mov edx, dword [eax + 0x18]
mov eax, 0xa
cmp edx, method.std::ctype_char_.do_widen_char__const
je 0x401712
mov dword [esp], 0xa
mov ecx, ebx
call edx
sub esp, 4
movsx eax, al
jmp 0x401712
mov eax, dword [sym.imp.libstdc_6.dll_std::cerr]
mov ecx, dword [eax - 0xc]
add ecx, sym.imp.libstdc_6.dll_std::cerr
mov eax, dword [ecx + 0x14]
or eax, 1
mov dword [esp], eax
call sym.std::basic_ios_char__std::char_traits_char___::clear_std::_Ios_Iostate_
sub esp, 4
jmp 0x4016ee
call sym.std::__throw_bad_cast__
mov ebx, eax
mov eax, dword [ebp - 0x238]
cmp eax, edi
je 0x40191f
mov dword [esp], eax
call sym.operator_delete_void_
mov eax, dword [ebp - 0x250]
lea edi, [ebp - 0x248]
cmp eax, edi
je 0x401937
mov dword [esp], eax
call sym.operator_delete_void_
mov dword [esp], ebx
call sym.__Unwind_Resume
call sym.std::__throw_bad_cast__
call sym.std::__throw_bad_cast__
mov ebx, eax
jmp 0x40191f