Function at 0x404040
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
mov eax, 0x2018
call sym.__alloca
mov dword [ebp - 0x10], edx
mov ebx, ecx
mov edi, dword [ebp + 0xc]
test byte [0x41d010], 8
je 0x4040a0
mov ecx, ebx
call dbg.wine_dbgstr_wn
mov esi, eax
mov ecx, dword [ebp - 0x10]
call dbg.wine_dbgstr_wn
sub esp, 0x1c
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.Manual_Copying__s_to__s__append__d__n
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp], 3
call sym._wine_dbg_log_1
add esp, 0x1c
sub esp, 0x1c
movaps xmm0, xmmword [0x416330]
movups xmmword [esp + 4], xmm0
mov dword [esp], ebx
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x80
call dword [sym.imp.kernel32.dll_CreateFileW]
mov dword [ebp - 0x1c], eax
cmp eax, 0xffffffff
je 0x4041ef
cmp edi, 1
mov eax, 3
sbb eax, 0
push 0
push 0x80
push eax
push 0
push 0
push 0x40000000
push dword [ebp - 0x10]
call dword [sym.imp.kernel32.dll_CreateFileW]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x40423e
mov dword [ebp - 0x20], ebx
test edi, edi
je 0x40411b
push 2
push 0
push 0
push dword [ebp - 0x18]
call dword [sym.imp.kernel32.dll_SetFilePointer]
lea edi, [ebp - 0x2024]
nop word cs:[eax + eax]
push 0
lea eax, [ebp - 0x14]
push eax
push 0x2000
push edi
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_ReadFile]
test eax, eax
je 0x404290
mov ebx, eax
mov esi, dword [ebp - 0x14]
cmp dword [ebp + 8], 0
je 0x404170
push esi
push 0x1a
push edi
call dword [sym.imp.ucrtbase.dll_memchr]
add esp, 0xc
test eax, eax
je 0x404170
sub eax, edi
mov dword [ebp - 0x14], eax
mov esi, eax
test esi, esi
je 0x4041d8
push 0
lea eax, [ebp - 0x24]
push eax
push esi
push edi
push dword [ebp - 0x18]
call dword [sym.imp.kernel32.dll_WriteFile]
mov ebx, eax
test eax, eax
je 0x404193
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x14]
je 0x4041d8
test byte [0x41d010], 2
je 0x4041d8
mov ecx, dword [ebp - 0x10]
call dbg.wine_dbgstr_wn
mov ecx, dword fs:[0x18]
mov ecx, dword [ecx + 0x34]
sub esp, 0x18
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unexpected_failure_writing_to__s__rc_ld_n
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp], 1
call sym._wine_dbg_log_1
add esp, 0x18
test ebx, ebx
je 0x4042d7
cmp dword [ebp - 0x14], 0
jne 0x404130
jmp 0x4042d7
mov ecx, ebx
xor ebx, ebx
test byte [0x41d010], 2
je 0x4042e7
call dbg.wine_dbgstr_wn
mov ecx, dword fs:[0x18]
mov ecx, dword [ecx + 0x34]
sub esp, 0x18
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Failed_to_open__s___ld__n
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp], 1
call sym._wine_dbg_log_1
add esp, 0x18
jmp 0x4042e7
test byte [0x41d010], 2
je 0x404283
mov ecx, dword [ebp - 0x10]
call dbg.wine_dbgstr_wn
mov ecx, dword fs:[0x18]
mov ecx, dword [ecx + 0x34]
sub esp, 0x18
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Failed_to_open__s___ld__n
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp], 1
call sym._wine_dbg_log_1
add esp, 0x18
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_CloseHandle]
xor ebx, ebx
jmp 0x4042e7
test byte [0x41d010], 2
je 0x4042d5
mov ecx, dword [ebp - 0x20]
call dbg.wine_dbgstr_wn
mov ecx, dword fs:[0x18]
mov ecx, dword [ecx + 0x34]
sub esp, 0x18
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unexpected_failure_reading_from__s__rc_ld_n
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp], 1
call sym._wine_dbg_log_1
add esp, 0x18
xor ebx, ebx
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
push dword [ebp - 0x18]
call esi
push dword [ebp - 0x1c]
call esi
mov eax, ebx
add esp, 0x2018
pop esi
pop edi
pop ebx
pop ebp
ret