Function at 0x40d260
Capabilities:
Delete file
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x47314a
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x54
push ebx
push ebp
push esi
mov esi, ecx
push edi
lea ecx, [esp + 0x30]
mov dword [esp + 0x18], esi
call fcn.00466240
mov ebp, dword [esp + 0x78]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
xor ebx, ebx
push eax
push ecx
mov dword [esp + 0x74], ebx
push ebp
mov ecx, esi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
call fcn.0040cf70
test eax, eax
je 0x40d51e
mov dl, byte [esi + 4]
add esi, 4
push ebx
lea ecx, [esp + 0x24]
mov byte [esp + 0x24], dl
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov ecx, dword [eax]
push ecx
push ebx
push esi
lea ecx, [esp + 0x2c]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
mov byte [esp + 0x6c], 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push ebp
lea ecx, [esp + 0x28]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_char_const___unsigned_int_]
mov eax, dword [esp + 0x24]
cmp eax, ebx
jne 0x40d30a
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push 0x48c39c
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x40d33c
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push esi
push 1
push edx
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
mov eax, dword [esp + 0x24]
cmp eax, ebx
jne 0x40d349
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
lea ecx, [esp + 0x34]
call fcn.00466f30
test al, al
mov eax, dword [esp + 0x24]
jne 0x40d391
cmp eax, ebx
jne 0x40d364
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov ecx, dword [esp + 0x10]
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov dword [esp + 0x14], ebx
lea ecx, [esp + 0x20]
mov byte [esp + 0x6c], bl
push 1
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
jmp 0x40d51e
cmp eax, ebx
jne 0x40d39a
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov edx, dword [esp + 0x10]
push edx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov dword [esp + 0x14], ebx
lea ecx, [esp + 0x20]
mov byte [esp + 0x6c], bl
push 1
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov ecx, dword [esp + 0x74]
mov eax, dword [ecx]
call dword [eax + 0x60]
cmp eax, ebx
mov dword [esp + 0x74], eax
je 0x40d51e
lea ecx, [esp + 0x30]
call fcn.004499b0
cmp eax, ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x78], ebx
jle 0x40d51e
mov ecx, dword [esp + 0x78]
push ecx
lea ecx, [esp + 0x34]
call fcn.00466f50
mov dl, byte [esp + 0x78]
push ebx
lea ecx, [esp + 0x24]
mov esi, eax
mov byte [esp + 0x24], dl
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
lea ecx, [esp + 0x24]
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x40d451
mov edi, dword [esp + 0x24]
mov ecx, ebp
mov eax, ecx
push ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x24]
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
mov eax, dword [esp + 0x28]
mov byte [esp + 0x6c], 2
cmp eax, ebx
jne 0x40d473
push 1
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
jmp 0x40d509
mov eax, dword [esp + 0x24]
cmp eax, ebx
jne 0x40d480
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
call dword [sym.imp.MSVCRT.dll_atoi]
mov esi, eax
add esp, 4
cmp esi, 0x3e8
jb 0x40d4be
mov eax, dword [esp + 0x24]
cmp eax, ebx
jne 0x40d4a1
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push str.type
push eax
lea ecx, [esp + 0x38]
call fcn.00467120
mov ecx, dword [esp + 0x74]
push esi
push eax
mov edx, dword [ecx]
call dword [edx]
cmp eax, ebx
jne 0x40d4de
mov eax, dword [esp + 0x24]
mov byte [esp + 0x6c], bl
cmp eax, ebx
je 0x40d4fd
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x40d4f4
cmp al, 0xff
je 0x40d4f4
dec al
mov byte [ecx], al
jmp 0x40d4fd
mov ecx, dword [esp + 0x78]
lea edx, [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x1c]
push edx
push eax
call fcn.00413110
jmp 0x40d4be
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov eax, dword [esp + 0x78]
mov ecx, dword [esp + 0x1c]
inc eax
cmp eax, ecx
mov dword [esp + 0x78], eax
jl 0x40d3f0
lea ecx, [esp + 0x30]
mov dword [esp + 0x6c], 0xffffffff
call fcn.00466500
mov ecx, dword [esp + 0x64]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x60
ret 8