Function at 0x405840
Capabilities:
Delete file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x422996
mov eax, dword fs:[0]
push eax
sub esp, 0x18c
push ebx
push esi
push edi
mov eax, dword [0x42e6dc]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, edx
mov eax, ecx
mov dword [ebp - 0x14], eax
sub esp, 8
lea ecx, [ebp - 0xd8]
push 0x20
push eax
call fcn.00402020
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0xd8]
mov eax, dword [ecx + 4]
test byte [ebp + eax - 0xcc], 6
je 0x4058a4
xor bl, bl
jmp 0x405b0b
push 2
sub esp, 8
lea ecx, [ebp - 0xd8]
call fcn.00401e30
lea eax, [ebp - 0x198]
push eax
lea ecx, [ebp - 0xd8]
call fcn.00401f50
mov esi, dword [eax + 8]
add esi, dword [eax]
push 0
sub esp, 8
lea ecx, [ebp - 0xd8]
mov dword [ebp - 0x10], esi
call fcn.00401e30
push esi
call fcn.0040a3df
mov ebx, eax
mov eax, esi
cdq
mov ecx, eax
add esp, 4
mov eax, edx
push eax
push ecx
mov dword [ebp - 0x18], ecx
push ebx
lea ecx, [ebp - 0xd8]
mov dword [ebp - 0x1c], eax
call fcn.00401cf0
lea ecx, [ebp - 0xc8]
call fcn.00402ea0
test eax, eax
jne 0x405945
mov eax, dword [ebp - 0xd8]
lea ecx, [ebp - 0xd8]
mov eax, dword [eax + 4]
add ecx, eax
mov eax, dword [ecx + 0xc]
or eax, 2
cmp dword [ecx + 0x38], 0
jne 0x405933
or eax, 4
and eax, 0x17
mov dword [ecx + 0xc], eax
test dword [ecx + 0x10], eax
je 0x405945
push 0
call fcn.00404aa0
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
xor esi, esi
cmp dword [ebp - 0x10], esi
jbe 0x40597c
mov ecx, edi
lea edx, [ecx + 1]
lea ebx, [ebx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405960
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 - 0x10]
jb 0x405955
sub esp, 0xc
lea ecx, [ebp - 0x180]
push dword [ebp - 0x14]
call fcn.00402a50
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x180]
mov eax, dword [eax + 4]
test byte [ebp + eax - 0x174], 6
je 0x4059b1
push ebx
call fcn.0040b0a1
add esp, 4
xor bl, bl
jmp 0x405a0f
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x180]
push dword [ebp - 0x18]
push ebx
call fcn.00401b90
lea ecx, [ebp - 0x17c]
call fcn.00402ea0
test eax, eax
jne 0x405a04
mov eax, dword [ebp - 0x180]
lea ecx, [ebp - 0x180]
mov eax, dword [eax + 4]
add ecx, eax
mov eax, dword [ecx + 0xc]
or eax, 2
cmp dword [ecx + 0x38], 0
jne 0x4059f2
or eax, 4
and eax, 0x17
mov dword [ecx + 0xc], eax
test dword [ecx + 0x10], eax
je 0x405a04
push 0
call fcn.00404aa0
push ebx
call fcn.0040b0a1
add esp, 4
mov bl, 1
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x180]
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 - 0x180]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x60]
mov dword [ebp + ecx - 0x184], eax
cmp dword [ebp - 0x12c], 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 0x405a7d
mov edx, dword [ebp - 0x170]
lea eax, [ebp - 0x138]
cmp dword [edx], eax
jne 0x405a7d
mov eax, dword [ebp - 0x144]
mov ecx, dword [ebp - 0x140]
mov dword [edx], eax
mov eax, dword [ebp - 0x160]
mov dword [eax], ecx
mov eax, dword [ebp - 0x150]
sub ecx, ecx
mov dword [eax], ecx
cmp byte [ebp - 0x130], 0
je 0x405a91
lea ecx, [ebp - 0x17c]
call fcn.00402ea0
mov esi, dword [ebp - 0x148]
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 0x405ac5
mov ecx, dword [esi]
test ecx, ecx
je 0x405abc
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x405abc
mov edx, dword [eax]
push 1
mov ecx, eax
call dword [edx]
push esi
call fcn.0040b289
add esp, 4
mov eax, dword [ebp - 0x180]
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 - 0x180]
mov ecx, dword [eax + 4]
lea eax, [ecx - 8]
mov dword [ebp + ecx - 0x184], eax
lea eax, [ebp - 0x120]
push eax
mov dword [ebp - method.std::basic_ios_char__struct_std::char_traits_char__.virtual_0], vtable.std::ios_base.0
call fcn.0040a360
mov ecx, dword [ebp - 0xd8]
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ecx + 4]
mov dword [ebp + eax - 0xd8], vtable.std::basic_ifstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0xd8]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x70]
mov dword [ebp + ecx - 0xdc], eax
cmp dword [ebp - 0x78], 0
mov dword [ebp - 0xc8], vtable.std::basic_filebuf_char__struct_std::char_traits_char__.0
je 0x405b73
mov edx, dword [ebp - 0xbc]
lea eax, [ebp - 0x84]
cmp dword [edx], eax
jne 0x405b73
mov eax, dword [ebp - 0x90]
mov ecx, dword [ebp - 0x8c]
mov dword [edx], eax
mov eax, dword [ebp - 0xac]
mov dword [eax], ecx
mov eax, dword [ebp - 0x9c]
sub ecx, ecx
mov dword [eax], ecx
cmp byte [ebp - 0x7c], 0
je 0x405b84
lea ecx, [ebp - 0xc8]
call fcn.00402ea0
mov esi, dword [ebp - 0x94]
mov dword [ebp - 0xc8], vtable.std::basic_streambuf_char__struct_std::char_traits_char__.0
test esi, esi
je 0x405bb8
mov ecx, dword [esi]
test ecx, ecx
je 0x405baf
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x405baf
mov edx, dword [eax]
push 1
mov ecx, eax
call dword [edx]
push esi
call fcn.0040b289
add esp, 4
mov eax, dword [ebp - 0xd8]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xd8], vtable.std::basic_istream_char__struct_std::char_traits_char__.0
mov ecx, dword [ebp - 0xd8]
lea eax, [ebp - 0x68]
mov edx, dword [ecx + 4]
push eax
lea ecx, [edx - 0x18]
mov dword [ebp + edx - 0xdc], ecx
mov dword [ebp - 0x68], vtable.std::ios_base.0
call fcn.0040a360
add esp, 4
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret