Function at 0x4038c0
Capabilities:
Get file size
Write file on windows

Disassembly:
mov eax, 0x2728
call fcn.00459460
mov al, byte [esp + 0x13]
push ebx
push esi
push edi
push 0
lea ecx, [esp + 0x10]
mov byte [esp + 0x10], 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 + 0x2738]
mov ecx, 0x9c4
xor eax, eax
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
mov edi, esi
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov ebx, ecx
lea ecx, [esp + 0x10]
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 0x403932
mov edi, dword [esp + 0x10]
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 [esp + 0x10]
mov dword [esp + 0x14], ebx
mov byte [eax + ebx], 0
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov ebx, dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x14]
sub edx, ecx
cmp edx, 1
ja 0x40394d
call ebx
mov eax, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x10]
lea esi, [eax + 1]
push esi
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 0x40397e
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
add edx, ecx
mov byte [edx], 0x5c
mov eax, dword [esp + 0x10]
mov dword [esp + 0x14], esi
mov byte [eax + esi], 0
mov esi, dword [esp + 0x273c]
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x14]
sub edx, ecx
cmp edx, edi
ja 0x4039a7
call ebx
test edi, edi
jbe 0x4039ea
mov eax, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x10]
lea ebx, [eax + edi]
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 0x4039ea
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
mov ecx, edi
lea edi, [eax + edx]
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 [esp + 0x10]
mov dword [esp + 0x14], ebx
mov byte [eax + ebx], 0
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4039f7
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 0
push 0x80
push 3
push 0
push 3
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x403a51
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x403a45
mov al, byte [ecx - 1]
test al, al
je 0x403a3b
cmp al, 0xff
je 0x403a3b
dec al
pop edi
mov byte [ecx - 1], al
pop esi
xor eax, eax
pop ebx
add esp, 0x2728
ret
dec ecx
push ecx
call fcn.00459410
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x2728
ret
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0
mov esi, eax
push 0x40
push edi
sub esi, 0x40
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test esi, esi
jbe 0x403aaa
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
cmp esi, 0x2710
push 0
jbe 0x403a9c
lea ecx, [esp + 0x24]
lea edx, [esp + 0x28]
push ecx
push 0x2710
push edx
push edi
call ebx
sub esi, 0x2710
jne 0x403a76
jmp 0x403aaa
lea eax, [esp + 0x24]
lea ecx, [esp + 0x28]
push eax
push esi
push ecx
push edi
call ebx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x403ae2
mov al, byte [ecx - 1]
test al, al
je 0x403ad8
cmp al, 0xff
je 0x403ad8
dec al
pop edi
mov byte [ecx - 1], al
pop esi
mov eax, 1
pop ebx
add esp, 0x2728
ret
dec ecx
push ecx
call fcn.00459410
add esp, 4
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0x2728
ret