Function at 0x409ecb
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 0x409ee8
push 6
pop eax
jmp 0x40a17a
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x44], 0x409ddf
mov dword [ebp - 0x40], 0x409d9e
mov dword [ebp - 0x20], 0x40745a
mov dword [ebp - 0x1c], 0x407470
mov dword [ebp - 0x38], 0x40745a
mov dword [ebp - 0x34], 0x407470
call fcn.004074c9
lea eax, [ebp - 0x84]
push eax
call fcn.00407d21
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.004097d1
add esp, 0x14
cmp eax, ebx
mov dword [ebp - 4], eax
jne 0x40a17a
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 0x40a15d
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.00407b58
add esp, 0x28
cmp eax, ebx
mov dword [ebp - 4], eax
jne 0x40a15d
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.0040a239
test eax, eax
je 0x40a139
mov ecx, dword [ebp - 8]
lea eax, [ebp - 0x494]
push eax
call fcn.0040a295
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 0x40a01a
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 0x40a053
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 0x40a06c
mov ecx, dword [ebp - 8]
lea eax, [ebp - 0x28c]
push eax
call fcn.0040a194
jmp 0x40a124
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 0x4260b8
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.0040a194
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 0x40a142
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 0x40a14d
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x18]
jne 0x40a14d
cmp byte [esi + 0x1c], bl
je 0x40a119
push esi
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
test eax, eax
je 0x40a14d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40a142
inc dword [ebp - 0xc]
add dword [ebp - 0x10], 0x20
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x6c]
jb 0x409f67
jmp 0x40a15d
mov dword [ebp - 4], 1
jmp 0x40a15d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x40a15d
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.00407d3d
mov eax, dword [ebp - 4]
add esp, 0xc
pop edi
pop esi
pop ebx
leave
ret 8