Function at 0x402daf
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5ec
mov eax, dword [0x407014]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor edi, edi
mov ebx, ecx
push edi
push edi
push 3
push edi
push 2
push 0xc0000000
push 0x401724
mov dword [ebp - 0x5d4], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x5dc], esi
cmp esi, 0xffffffff
jne 0x402e07
push 0x88
push 0x401658
push 0x40a
call fcn.00406024
mov ecx, dword [ebx + 0xc]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, di
jne 0x402e0d
push edi
push edi
mov edi, 0x104
lea eax, [ebp - 0x108]
push edi
push eax
sub ecx, edx
sar ecx, 1
push ecx
push dword [ebx + 0xc]
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea eax, [ebp - 0x108]
push edi
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__strupr_s]
lea ecx, [edi - 4]
push ecx
lea eax, [ebp - 0x408]
push eax
push 0x200
lea eax, [ebp - 0x308]
push eax
push ecx
lea eax, [ebp - 0x508]
push eax
push 3
lea eax, [ebp - 0x5ec]
push eax
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__splitpath_s]
lea ecx, [ebp - 0x308]
add esp, 0x2c
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402e8b
mov edi, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
lea eax, [ebp - 0x5d8]
push 0
push eax
push 4
sub ecx, edx
lea eax, [ebp - 0x5d4]
push eax
lea eax, [ecx + 1]
push eax
lea eax, [ebp - 0x308]
push eax
push 0x15600a
push esi
call edi
test eax, eax
jne 0x402eec
mov ecx, dword [ebx + 0xc]
call fcn.00402c9f
mov dword [ebp - 0x5d4], eax
test eax, eax
jne 0x402eec
push dword [ebx + 0xc]
push 0xbc
push 0x401658
push 0x408
call fcn.00405fc5
push 0
lea eax, [ebp - 0x5d8]
push eax
push 0xc4
lea eax, [ebp - 0x5cc]
push eax
push 4
lea eax, [ebp - 0x5d4]
push eax
push 0x156002
push esi
call edi
test eax, eax
jne 0x402f33
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebx + 0xc]
push 0xcf
push 0x401658
push 0x408
call fcn.00405fc5
push 0x10
push 0x40174c
push dword [ebx + 0x10]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfsopen]
mov edi, eax
add esp, 0xc
mov dword [ebp - 0x5e0], edi
test edi, edi
jne 0x402f66
push dword [ebx + 0x10]
push 0xda
push 0x401658
push 0x57
call fcn.00405fc5
mov dword [ebp - 0x5e4], 0x32
push 4
push 0x1000
push dword [ebp - 0x5c0]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
mov dword [ebp - 0x5e8], esi
test esi, esi
jne 0x402faa
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
pop ecx
push 0xea
push 0x401658
push 2
call fcn.00406024
push 0
lea eax, [ebp - 0x5d8]
push eax
push dword [ebp - 0x5c0]
lea eax, [ebp - 0x5d4]
push esi
push 4
push eax
push 0x156002
push dword [ebp - 0x5dc]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov eax, dword [ebp - 0x5c0]
cmp dword [esi + 0x64], 0
je 0x402ffa
push dword [ebx + 0x10]
push 0x41d
push 0x3a99
call fcn.00405a4d
push eax
call fcn.004046d8
jmp 0x403073
mov eax, dword [esi + 0xc]
cmp eax, dword [ebp - 0x5c0]
je 0x40302b
push 0x31
pop ecx
push 0x8000
push 0
push dword [ebp - 0x5e8]
lea edi, [ebp - 0x5cc]
rep movsd dword es:[edi], dword [esi]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov edi, dword [ebp - 0x5e0]
jmp 0x403073
cmp byte [esi + 0x51], 0
jne 0x403048
push dword [ebx + 0xc]
push 0x11d
push 0x401658
push 0x423
call fcn.00405fc5
cmp dword [esi + 0xc], 0
je 0x403073
lea eax, [esi + 0x40]
push eax
call dword [sym.imp.ole32.dll_CoCreateGuid]
test eax, eax
je 0x40308a
push dword [ebx + 0x10]
push 0x128
push 0x401658
push 0x40b
call fcn.00405fc5
mov eax, dword [ebp - 0x5e4]
dec eax
mov dword [ebp - 0x5e4], eax
test eax, eax
jg 0x402f70
jmp 0x4030f4
xor eax, eax
inc eax
push edi
push eax
push dword [esi + 0xc]
mov word [esi + 0x60], ax
push esi
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov byte [ebp - 0x5cd], al
call esi
add esp, 0x10
cmp eax, 1
jne 0x4030e0
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fflush]
pop ecx
test eax, eax
jne 0x4030e0
push eax
push 0x52
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
add esp, 0xc
test eax, eax
jne 0x4030e0
push edi
push 1
lea eax, [ebp - 0x5cd]
push 1
push eax
call esi
add esp, 0x10
cmp eax, 1
je 0x4030f4
push dword [ebx + 0x10]
push 0x137
push 0x401658
push 0x5b
call fcn.00405fc5
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
neg eax
pop ecx
sbb al, al
inc al
cmp byte [ebx + 1], 0
mov dword [ebp - 0x5e0], eax
je 0x40314b
xor ecx, ecx
lea eax, [ebp - 0x5d8]
push ecx
push eax
push ecx
push ecx
push 4
lea eax, [ebp - 0x5d4]
push eax
push 0x156006
push dword [ebp - 0x5dc]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x40314b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebx + 0xc]
push 0x158
jmp 0x402f24
push dword [ebp - 0x5dc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp - 0x5e0], 0
jne 0x403174
push dword [ebx + 0x10]
push 0x164
push 0x401658
push 0x5b
call fcn.00405fc5
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00403865
leave
ret