Function at 0x4040d0
Capabilities:
Delete file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18c
push ebx
push esi
push edi
sub esp, 8
mov eax, ecx
push 0x20
push eax
lea ecx, [ebp - 0xc8]
mov edi, edx
mov dword [ebp - 8], eax
call fcn.00402ac0
mov edx, dword [ebp - 0xc8]
mov eax, dword [edx + 4]
test byte [ebp + eax - 0xbc], 6
je 0x40410e
xor bl, bl
jmp 0x404359
push 2
sub esp, 8
lea ecx, [ebp - 0xc8]
call fcn.00401c80
lea eax, [ebp - 0x188]
push eax
lea ecx, [ebp - 0xc8]
call fcn.00401d40
mov esi, dword [eax + 8]
add esi, dword [eax]
push 0
sub esp, 8
lea ecx, [ebp - 0xc8]
mov dword [ebp - 4], esi
call fcn.00401c80
push esi
call fcn.00407d32
mov ebx, eax
mov eax, esi
cdq
mov ecx, eax
add esp, 4
mov eax, edx
push eax
push ecx
mov dword [ebp - 0xc], ecx
push ebx
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0x10], eax
call fcn.00401b60
lea ecx, [ebp - 0xb8]
call fcn.00403090
test eax, eax
jne 0x4041a5
mov eax, dword [ebp - 0xc8]
lea ecx, [ebp - 0xc8]
mov eax, dword [eax + 4]
add ecx, eax
mov eax, dword [ecx + 0xc]
or eax, 2
cmp dword [ecx + 0x38], 0
jne 0x40419d
or eax, 4
push 0
push eax
call fcn.00401720
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
xor esi, esi
cmp dword [ebp - 4], esi
jbe 0x4041dc
mov ecx, edi
lea edx, [ecx + 1]
lea ebx, [ebx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4041c0
sub ecx, edx
mov eax, esi
xor edx, edx
div ecx
inc esi
mov al, byte [edx + edi]
xor byte [esi + ebx - 1], al
cmp esi, dword [ebp - 4]
jb 0x4041b5
sub esp, 0xc
lea ecx, [ebp - 0x170]
push dword [ebp - 8]
call fcn.004020e0
mov eax, dword [ebp - 0x170]
mov eax, dword [eax + 4]
test byte [ebp + eax - 0x164], 6
je 0x40420d
push ebx
call fcn.00409564
add esp, 4
xor bl, bl
jmp 0x404261
push dword [ebp - 0x10]
lea ecx, [ebp - 0x170]
push dword [ebp - 0xc]
push ebx
call fcn.00401980
lea ecx, [ebp - 0x16c]
call fcn.00403090
test eax, eax
jne 0x404256
mov eax, dword [ebp - 0x170]
lea ecx, [ebp - 0x170]
mov eax, dword [eax + 4]
add ecx, eax
mov eax, dword [ecx + 0xc]
or eax, 2
cmp dword [ecx + 0x38], 0
jne 0x40424e
or eax, 4
push 0
push eax
call fcn.00401720
push ebx
call fcn.00409564
add esp, 4
mov bl, 1
mov eax, dword [ebp - 0x170]
mov eax, dword [eax + 4]
mov dword [ebp + eax - method.std::basic_ofstream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0x170]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x60]
mov dword [ebp + ecx - 0x174], eax
cmp dword [ebp - 0x11c], 0
mov dword [ebp - method.std::basic_filebuf_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_filebuf_char__struct_std::char_traits_char__.0
je 0x4042cb
mov edx, dword [ebp - 0x160]
lea eax, [ebp - 0x128]
cmp dword [edx], eax
jne 0x4042cb
mov eax, dword [ebp - 0x134]
mov ecx, dword [ebp - 0x130]
mov dword [edx], eax
mov eax, dword [ebp - 0x150]
mov dword [eax], ecx
mov eax, dword [ebp - 0x140]
sub ecx, ecx
mov dword [eax], ecx
cmp byte [ebp - 0x120], 0
je 0x4042df
lea ecx, [ebp - 0x16c]
call fcn.00403090
mov esi, dword [ebp - 0x138]
mov dword [ebp - method.std::basic_streambuf_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_streambuf_char__struct_std::char_traits_char__.0
test esi, esi
je 0x404313
mov ecx, dword [esi]
test ecx, ecx
je 0x40430a
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40430a
mov edx, dword [eax]
push 1
mov ecx, eax
call dword [edx]
push esi
call fcn.004095e8
add esp, 4
mov eax, dword [ebp - 0x170]
mov eax, dword [eax + 4]
mov dword [ebp + eax - method.std::basic_ostream_char__struct_std::char_traits_char__.virtual_0], vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0x170]
mov ecx, dword [eax + 4]
lea eax, [ecx - 8]
mov dword [ebp + ecx - 0x174], eax
lea eax, [ebp - 0x110]
push eax
mov dword [ebp - method.std::basic_ios_char__struct_std::char_traits_char__.virtual_0], vtable.std::ios_base.0
call fcn.004079ea
mov edx, dword [ebp - 0xc8]
add esp, 4
mov eax, dword [edx + 4]
mov dword [ebp + eax - 0xc8], vtable.std::basic_ifstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0xc8]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x70]
mov dword [ebp + ecx - 0xcc], eax
cmp dword [ebp - 0x68], 0
mov dword [ebp - 0xb8], vtable.std::basic_filebuf_char__struct_std::char_traits_char__.0
je 0x4043b1
mov edx, dword [ebp - 0xac]
lea eax, [ebp - 0x74]
cmp dword [edx], eax
jne 0x4043b1
mov eax, dword [ebp - 0x80]
mov ecx, dword [ebp - 0x7c]
mov dword [edx], eax
mov eax, dword [ebp - 0x9c]
mov dword [eax], ecx
mov eax, dword [ebp - 0x8c]
sub ecx, ecx
mov dword [eax], ecx
cmp byte [ebp - 0x6c], 0
je 0x4043c2
lea ecx, [ebp - 0xb8]
call fcn.00403090
mov esi, dword [ebp - 0x84]
mov dword [ebp - 0xb8], vtable.std::basic_streambuf_char__struct_std::char_traits_char__.0
test esi, esi
je 0x4043f6
mov ecx, dword [esi]
test ecx, ecx
je 0x4043ed
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x4043ed
mov edx, dword [eax]
push 1
mov ecx, eax
call dword [edx]
push esi
call fcn.004095e8
add esp, 4
mov eax, dword [ebp - 0xc8]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xc8], vtable.std::basic_istream_char__struct_std::char_traits_char__.0
mov ecx, dword [ebp - 0xc8]
lea eax, [ebp - 0x58]
mov edx, dword [ecx + 4]
push eax
lea ecx, [edx - 0x18]
mov dword [ebp + edx - 0xcc], ecx
mov dword [ebp - 0x58], vtable.std::ios_base.0
call fcn.004079ea
add esp, 4
mov al, bl
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret