Function at 0x459580
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x463541
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x30
mov al, byte [esp + 0x40]
push ebx
push ebp
push esi
mov ebp, ecx
push edi
push 0
lea ecx, [esp + 0x14]
mov byte [esp + 0x14], al
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 esi, dword [esp + 0x50]
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov ebx, ecx
lea ecx, [esp + 0x14]
push ebx
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 0x4595f4
mov edi, dword [esp + 0x14]
mov ecx, ebx
mov edx, ecx
push ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x14]
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 [ebp + 0x18]
xor ebx, ebx
test eax, eax
mov dword [esp + 0x48], ebx
jle 0x459628
mov edi, dword [sym.imp.MSVCP60.dll_bool___cdecl_std::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
xor esi, esi
mov eax, dword [ebp + 8]
lea ecx, [esp + 0x10]
add eax, esi
push ecx
push eax
call edi
add esp, 8
test al, al
jne 0x459628
mov eax, dword [ebp + 0x18]
inc ebx
add esi, 0x20
cmp ebx, eax
jl 0x459609
mov eax, dword [ebp + 0x18]
cmp ebx, eax
jne 0x4596c2
mov dl, byte [esp + 0x50]
inc eax
push 0
lea ecx, [esp + 0x24]
mov dword [ebp + 0x18], 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 eax, dword [ebp + 8]
mov esi, dword [ebp + 0x18]
lea edi, [ebp + 4]
mov byte [esp + 0x48], 1
test eax, eax
jne 0x459661
xor ecx, ecx
jmp 0x459669
mov ecx, dword [edi + 8]
sub ecx, eax
sar ecx, 5
cmp ecx, esi
jae 0x459692
test eax, eax
jne 0x459675
xor ecx, ecx
jmp 0x45967d
mov ecx, dword [edi + 8]
sub ecx, eax
sar ecx, 5
mov eax, dword [edi + 8]
lea edx, [esp + 0x20]
sub esi, ecx
push edx
push esi
push eax
mov ecx, edi
call fcn.0045a130
jmp 0x4596b1
mov ecx, edi
call fcn.0045a110
cmp esi, eax
jae 0x4596b1
mov ecx, dword [edi + 4]
mov eax, dword [edi + 8]
shl esi, 5
add esi, ecx
push eax
push esi
mov ecx, edi
call fcn.0045a570
push 1
lea ecx, [esp + 0x24]
mov byte [esp + 0x4c], 0
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 [ebp + 8]
lea edx, [esp + 0x10]
shl ebx, 5
add ebx, eax
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 esi, ebx
mov ecx, dword [eax]
push ecx
push 0
push edx
mov ecx, esi
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 eax, dword [esp + 0x60]
mov edx, dword [esp + 0x58]
mov edi, dword [esp + 0x5c]
mov dword [esi + 0x10], eax
mov ecx, dword [ebp + 0x1c]
mov dword [esi + 0x18], edx
mov dword [esi + 0x14], ecx
mov dword [esi + 0x1c], edi
mov eax, ecx
mov ecx, dword [ebp]
push 0
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
mov edx, dword [ebp]
mov eax, dword [esp + 0x60]
push edx
push 1
push edi
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x1c
cmp eax, 1
je 0x459751
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x45974d
mov al, byte [ecx - 1]
test al, al
je 0x459743
cmp al, 0xff
je 0x459743
dec al
mov byte [ecx - 1], al
xor al, al
jmp 0x45977f
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
xor al, al
jmp 0x45977f
mov ecx, dword [ebp + 0x1c]
add ecx, edi
mov dword [ebp + 0x1c], ecx
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x45977d
mov al, byte [ecx - 1]
test al, al
je 0x459773
cmp al, 0xff
je 0x459773
dec al
mov byte [ecx - 1], al
jmp 0x45977d
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x40]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x3c
ret 0x14