Function at 0x40a5fb
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6a0
mov eax, dword [ecx]
push ebx
xor ebx, ebx
mov dword [ebp - 8], ecx
cmp eax, ebx
jne 0x40a618
push 6
pop eax
jmp 0x40a8aa
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x44], 0x40a50f
mov dword [ebp - 0x40], 0x40a4ce
mov dword [ebp - 0x20], 0x407b8a
mov dword [ebp - 0x1c], 0x407ba0
mov dword [ebp - 0x38], 0x407b8a
mov dword [ebp - 0x34], 0x407ba0
call fcn.00407bf9
lea eax, [ebp - 0x84]
push eax
call fcn.00408451
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x84]
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.00409f01
add esp, 0x14
cmp eax, ebx
mov dword [ebp - 4], eax
jne 0x40a8aa
or dword [ebp - 0x2c], 0xffffffff
cmp dword [ebp - 0x6c], ebx
push esi
push edi
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0xc], ebx
jbe 0x40a88d
mov dword [ebp - 0x10], ebx
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp - 0x10]
lea esi, [ecx + eax]
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x84]
push dword [ebp - 0xc]
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.00408288
add esp, 0x28
cmp eax, ebx
mov dword [ebp - 4], eax
jne 0x40a88d
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x492]
mov word [ebp - 0x494], bx
rep stosd dword es:[edi], eax
mov ecx, dword [ebp - 8]
push 0x104
stosw word es:[edi], ax
lea eax, [ebp - 0x494]
push eax
push dword [esi + 0x14]
call fcn.0040a969
test eax, eax
je 0x40a869
mov ecx, dword [ebp - 8]
lea eax, [ebp - 0x494]
push eax
call fcn.0040a9c5
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x28a]
mov word [ebp - 0x28c], bx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
cmp eax, ebx
jne 0x40a74a
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_short_int_const__private:_static_unsigned_short_int_const____cdecl_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Nullstr_void_::_2::_C]
lea ecx, [ebp - 0x494]
push ecx
push eax
lea eax, [ebp - 0x28c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
cmp dword [ebp + 0xc], ebx
je 0x40a783
lea eax, [ebp - 0x28c]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
mov ecx, dword [ebp + 0xc]
push eax
lea eax, [ebp - 0x28c]
push eax
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
cmp byte [esi + 0x1a], bl
je 0x40a79c
mov ecx, dword [ebp - 8]
lea eax, [ebp - 0x28c]
push eax
call fcn.0040a8c4
jmp 0x40a854
mov ecx, 0x82
xor eax, eax
lea edi, [ebp - 0x69e]
mov word [ebp - 0x6a0], bx
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x28c]
push eax
push 0x4280b8
lea eax, [ebp - 0x6a0]
push 0x104
push eax
call dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0x10
lea eax, [ebp - 0x6a0]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
mov ecx, dword [ebp - 8]
lea eax, [ebp - 0x6a0]
push eax
call fcn.0040a8c4
push ebx
push 0x80
push 2
push ebx
push ebx
lea eax, [ebp - 0x28c]
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x40a872
mov ecx, dword [ebp - 0x24]
lea eax, [ebp - 0x28]
push ebx
push eax
mov eax, dword [ebp - 0x14]
push dword [ebp - 0x18]
add ecx, eax
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a87d
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x18]
jne 0x40a87d
cmp byte [esi + 0x1c], bl
je 0x40a849
push esi
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
test eax, eax
je 0x40a87d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40a872
inc dword [ebp - 0xc]
add dword [ebp - 0x10], 0x20
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x6c]
jb 0x40a697
jmp 0x40a88d
mov dword [ebp - 4], 1
jmp 0x40a88d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x40a88d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x14]
call dword [ebp - 0x1c]
push dword [ebp - 0x1c]
lea eax, [ebp - 0x84]
push eax
call fcn.0040846d
mov eax, dword [ebp - 4]
add esp, 0xc
pop edi
pop esi
pop ebx
leave
ret 8