Function at 0x4068a0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x84
mov eax, dword [esp + 0x88]
push ebx
push ebp
push esi
push edi
push 0x41045c
push eax
mov byte [esp + 0x1b], 1
call dword [sym.imp.MSVCRT.dll_fopen]
mov ecx, eax
add esp, 8
test ecx, ecx
mov dword [esp + 0x18], ecx
jne 0x406935
mov ebp, dword [esp + 0xa0]
test ebp, ebp
je 0x406928
call dword [sym.imp.MSVCRT.dll__errno]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.MSVCRT.dll_strerror]
mov esi, eax
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov ebx, ecx
mov ecx, ebp
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 0x406928
mov edi, dword [ebp + 4]
mov ecx, ebx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 4]
mov dword [ebp + 8], ebx
mov byte [eax + ebx], 0
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x84
ret
mov eax, dword [esp + 0xa4]
test eax, eax
je 0x406948
mov edx, dword [eax]
mov dword [esp + 0x14], edx
jmp 0x406950
mov dword [esp + 0x14], 0
xor eax, eax
mov byte [esp + 0x1c], 0
mov dword [esp + 0x1d], eax
mov dword [esp + 0x21], eax
mov dword [esp + 0x25], eax
mov dword [esp + 0x29], eax
mov word [esp + 0x2d], ax
mov byte [esp + 0x2f], al
mov eax, dword [esp + 0x9c]
mov edi, dword [eax + 8]
test edi, edi
je 0x4069a0
mov eax, dword [eax + 4]
test eax, eax
jne 0x40698a
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 ecx
push 1
push edi
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
cmp eax, 1
sete byte [esp + 0x13]
lea ecx, [esp + 0x1c]
push edi
push ecx
lea edx, [esp + 0x38]
push str._s_d_bytes
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
mov ebp, dword [esp + 0xb0]
add esp, 0x10
test ebp, ebp
je 0x406a60
lea edi, [esp + 0x30]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
mov ecx, ebp
call dword [sym.imp.MSVCP60.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::max_size_void_const]
cmp eax, ebx
jae 0x4069ea
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x406a10
mov al, byte [ecx - 1]
test al, al
je 0x406a10
cmp al, 0xff
je 0x406a10
test ebx, ebx
jne 0x406a36
dec al
push ebx
mov byte [ecx - 1], al
mov ecx, ebp
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 0x406a60
test ebx, ebx
jne 0x406a20
push 1
mov ecx, ebp
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 0x406a60
mov eax, dword [ebp + 0xc]
cmp eax, 0x1f
ja 0x406a2c
cmp eax, ebx
jae 0x406a3f
push 1
mov ecx, ebp
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
push ebx
mov ecx, ebp
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Copy_unsigned_int_]
mov edi, dword [ebp + 4]
mov ecx, ebx
mov eax, ecx
lea esi, [esp + 0x30]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 4]
mov dword [ebp + 8], ebx
mov byte [ecx + ebx], 0
mov al, byte [esp + 0x13]
test al, al
jne 0x406b1a
test ebp, ebp
je 0x406b1a
call dword [sym.imp.MSVCRT.dll__errno]
mov edx, dword [eax]
push edx
call dword [sym.imp.MSVCRT.dll_strerror]
mov esi, eax
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
mov ecx, ebp
call dword [sym.imp.MSVCP60.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::max_size_void_const]
cmp eax, ebx
jae 0x406aa8
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x406ace
mov al, byte [ecx - 1]
test al, al
je 0x406ace
cmp al, 0xff
je 0x406ace
test ebx, ebx
jne 0x406af4
dec al
push ebx
mov byte [ecx - 1], al
mov ecx, ebp
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 0x406b1a
test ebx, ebx
jne 0x406ade
push 1
mov ecx, ebp
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 0x406b1a
mov eax, dword [ebp + 0xc]
cmp eax, 0x1f
ja 0x406aea
cmp eax, ebx
jae 0x406afd
push 1
mov ecx, ebp
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
push ebx
mov ecx, ebp
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Copy_unsigned_int_]
mov edi, dword [ebp + 4]
mov ecx, ebx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 4]
mov dword [ebp + 8], ebx
mov byte [ecx + ebx], 0
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0xa8]
add esp, 4
test eax, eax
je 0x406b39
mov ecx, dword [esp + 0x14]
mov dword [eax], ecx
mov al, byte [esp + 0x13]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x84
ret