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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x2198
call fcn.004240d8
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x2164], edx
mov edi, eax
mov dword [ebp - 0x2160], ecx
test byte [0x425010], 8
jne 0x4061c0
mov dword [esp + 0x18], 0
mov ebx, dword [sym.imp.kernel32.dll_CreateFileW]
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov dword [esp], edi
call ebx
sub esp, 0x1c
mov dword [ebp - 0x215c], eax
cmp eax, 0xffffffff
je 0x406540
mov edx, dword [ebp + 8]
test edx, edx
jne 0x405d20
mov eax, dword [ebp - 0x2164]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
mov dword [esp], eax
call ebx
sub esp, 0x1c
mov dword [ebp - 0x216c], eax
cmp eax, 0xffffffff
je 0x406503
mov eax, dword [ebp - 0x2164]
mov dword [ebp - 0x2170], edi
lea esi, [ebp - 0x2018]
shr eax, 0x10
mov dword [ebp - 0x2178], eax
lea eax, [ebp - 0x214c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x215c]
mov dword [esp + 8], 0x2000
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
mov ebx, eax
test eax, eax
je 0x405da0
mov eax, dword [ebp - 0x2160]
mov edi, dword [ebp - 0x214c]
test eax, eax
je 0x405cde
mov dword [esp + 8], edi
mov dword [esp + 4], 0x1a
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_memchr]
test eax, eax
je 0x405cde
sub eax, esi
mov dword [ebp - 0x214c], eax
mov edi, eax
test edi, edi
jne 0x405f10
mov dword [ebp - 0x2160], ebx
mov eax, dword [ebp - 0x216c]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x215c]
sub esp, 4
mov dword [esp], eax
call ebx
sub esp, 4
mov eax, dword [ebp - 0x2160]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x2164]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
mov dword [esp], eax
call ebx
sub esp, 0x1c
mov dword [ebp - 0x216c], eax
cmp eax, 0xffffffff
je 0x406503
mov eax, dword [ebp - 0x216c]
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
sub esp, 0x10
jmp 0x405c56
mov dword [ebp - 0x2160], eax
mov edi, dword [ebp - 0x2170]
test byte [0x425010], 2
je 0x405f70
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x2168], eax
mov eax, edi
shr eax, 0x10
je 0x406193
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov esi, eax
sub esp, 8
mov eax, 0x42613d
test esi, esi
jne 0x405ea6
cmp word [edi], 0
je 0x405e0a
lea esi, [esi]
add esi, 1
cmp word [edi + esi*2], 0
jne 0x405e00
mov eax, 0x224c
lea edx, [ebp - 0x2142]
lea ecx, [esi - 1]
mov word [ebp - 0x2144], ax
lea eax, [ebp - 0x2022]
mov dword [ebp - 0x2164], eax
cmp edx, dword [ebp - 0x2164]
ja 0x405e7b
test esi, esi
jle 0x405e7b
add edi, 2
movzx eax, word [edi - 2]
cmp ax, 0xd
je 0x406163
ja 0x405ee0
cmp ax, 9
je 0x406150
cmp ax, 0xa
jne 0x4060f0
mov eax, 0x6e5c
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
lea ecx, [esi - 1]
cmp edx, dword [ebp - 0x2164]
jbe 0x405e33
mov byte [edx], 0x22
lea eax, [edx + 1]
test ecx, ecx
jle 0x405e95
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x2144]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov ecx, dword [ebp - 0x2168]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unexpected_failure_reading_from__s__rc_ld_n
mov dword [esp + 0x14], ecx
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp + 4], 0x425010
mov dword [esp], 1
call sym._wine_dbg_log.constprop.9
jmp 0x405cec
cmp ax, 0x22
je 0x406180
cmp ax, 0x5c
jne 0x4060f0
mov ebx, 0x5c5c
add edx, 2
mov esi, ecx
mov word [edx - 2], bx
jmp 0x405e70
lea eax, [ebp - 0x2148]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x216c]
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
mov ebx, eax
test eax, eax
je 0x405f80
mov eax, dword [ebp - 0x214c]
cmp dword [ebp - 0x2148], eax
je 0x405f59
test byte [0x425010], 2
jne 0x405f89
test eax, eax
jne 0x405c71
jmp 0x405ce6
mov dword [ebp - 0x2160], 0
jmp 0x405cec
test byte [0x425010], 2
je 0x405f70
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x2174], eax
mov eax, dword [ebp - 0x2178]
test eax, eax
je 0x406730
mov eax, dword [ebp - 0x2164]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edi, eax
sub esp, 8
mov eax, 0x42613d
test edi, edi
jne 0x4060a4
mov eax, dword [ebp - 0x2164]
cmp word [eax], 0
je 0x405fea
lea esi, [esi]
nop
add edi, 1
cmp word [eax + edi*2], 0
jne 0x405fe0
mov ecx, dword [ebp - 0x2164]
mov eax, 0x224c
mov dword [ebp - 0x217c], ebx
lea edx, [ebp - 0x2142]
mov word [ebp - 0x2144], ax
mov dword [ebp - 0x2168], ecx
nop
lea ebx, [edi - 1]
test edi, edi
jle 0x406070
lea eax, [ebp - 0x2022]
cmp edx, eax
ja 0x406070
add dword [ebp - 0x2168], 2
mov eax, dword [ebp - 0x2168]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x406473
ja 0x406365
cmp ax, 9
je 0x406460
cmp ax, 0xa
jne 0x4064a3
mov eax, 0x6e5c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x406010
mov eax, ebx
mov byte [edx], 0x22
mov ebx, dword [ebp - 0x217c]
test eax, eax
jle 0x40679c
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x2144]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov ecx, dword [ebp - 0x2174]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unexpected_failure_writing_to__s__rc_ld_n
mov dword [esp + 0x14], ecx
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp + 4], 0x425010
mov dword [esp], 1
call sym._wine_dbg_log.constprop.9
test ebx, ebx
je 0x405ce6
mov eax, dword [ebp - 0x214c]
jmp 0x405f59
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x4061b0
mov esi, eax
mov byte [edx], 0x5c
add edx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefWCMD_choice]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [edx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefWCMD_choice]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefWCMD_choice]
and esi, 0xf
mov byte [edx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefWCMD_choice]
mov byte [edx - 1], al
mov esi, ecx
mov byte [edx - 2], bl
jmp 0x405e70
mov eax, 0x745c
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
jmp 0x405e70
mov eax, 0x725c
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
jmp 0x405e70
mov esi, 0x225c
add edx, 2
mov word [edx - 2], si
mov esi, ecx
jmp 0x405e70
movzx eax, di
mov dword [esp], 0x426130
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.7
jmp 0x405ea6
mov byte [edx], al
mov esi, ecx
add edx, 1
jmp 0x405e70
mov eax, edx
shr eax, 0x10
je 0x406290
mov ebx, dword [ebp - 0x2164]
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x2168], 0x42613d
sub esp, 8
test eax, eax
jne 0x4062ad
cmp word [ebx], 0
mov edx, ebx
je 0x40620a
nop
add eax, 1
cmp word [edx + eax*2], 0
jne 0x406200
mov ecx, dword [ebp - 0x2164]
mov dword [ebp - 0x2168], edi
mov edx, 0x224c
lea esi, [ebp - 0x1ef6]
mov word [ebp - 0x2018], dx
lea edx, [ebp - 0x2016]
mov dword [ebp - 0x215c], ecx
lea ebx, [eax - 1]
cmp edx, esi
ja 0x4066f0
test eax, eax
jle 0x4066f0
add dword [ebp - 0x215c], 2
mov eax, dword [ebp - 0x215c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x406643
ja 0x4063c0
cmp ax, 9
je 0x4066c0
cmp ax, 0xa
jne 0x406660
mov eax, 0x6e5c
add edx, 2
mov word [edx - 2], ax
mov eax, ebx
jmp 0x406234
movzx eax, word [ebp - 0x2164]
mov dword [esp], 0x426130
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.7
mov dword [ebp - 0x2168], eax
mov eax, edi
shr eax, 0x10
je 0x406760
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov esi, eax
sub esp, 8
mov eax, 0x42613d
test esi, esi
jne 0x406421
cmp word [edi], 0
je 0x4062eb
add esi, 1
cmp word [edi + esi*2], 0
jne 0x4062e1
mov eax, 0x224c
mov dword [ebp - 0x215c], edi
lea edx, [ebp - 0x2016]
mov word [ebp - 0x2018], ax
lea eax, [ebp - 0x1ef6]
mov dword [ebp - 0x216c], edi
mov edi, eax
lea ebx, [esi - 1]
cmp edx, edi
ja 0x4063f0
test esi, esi
jle 0x4063f0
add dword [ebp - 0x215c], 2
mov eax, dword [ebp - 0x215c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x4065b3
ja 0x406390
cmp ax, 9
je 0x406630
cmp ax, 0xa
jne 0x4065d0
mov eax, 0x6e5c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x406311
cmp ax, 0x22
je 0x406490
cmp ax, 0x5c
jne 0x4064a3
mov edi, 0x5c5c
add edx, 2
mov word [edx - 2], di
mov edi, ebx
jmp 0x406010
cmp ax, 0x22
je 0x4066d3
cmp ax, 0x5c
jne 0x4065d0
mov esi, 0x5c5c
add edx, 2
mov word [edx - 2], si
mov esi, ebx
jmp 0x406311
cmp ax, 0x22
je 0x4065a0
cmp ax, 0x5c
jne 0x406660
mov edi, 0x5c5c
add edx, 2
mov eax, ebx
mov word [edx - 2], di
jmp 0x406234
mov edi, dword [ebp - 0x216c]
mov byte [edx], 0x22
lea eax, [edx + 1]
test ebx, ebx
jle 0x406410
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
lea esi, [ebp - 0x2018]
mov byte [eax], 0
mov dword [esp], esi
call dbg.__wine_dbg_strdup
mov ecx, dword [ebp + 8]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Manual_Copying__s_to__s__append__d__n
mov dword [esp + 0x18], ecx
mov ecx, dword [ebp - 0x2168]
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp + 0x14], ecx
mov dword [esp + 4], 0x425010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.9
jmp 0x405bb1
mov eax, 0x745c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x406010
mov eax, 0x725c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x406010
mov eax, 0x225c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x406010
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x406750
mov edi, eax
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefWCMD_choice]
and edi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov byte [edx - 1], al
mov edi, ebx
mov byte [edx - 2], cl
jmp 0x406010
test byte [0x425010], 2
jne 0x4067a4
mov eax, dword [ebp - 0x215c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [ebp - 0x2160], 0
mov eax, dword [ebp - 0x2160]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x2160], 0
test byte [0x425010], 2
je 0x405d0e
mov eax, dword fs:[0x18]
mov ebx, dword [eax + 0x34]
mov eax, edi
call sym._wine_dbgstr_wn.constprop.5
mov dword [esp + 0xc], str.Failed_to_open__s___ld__n
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp + 4], 0x425010
mov dword [esp], 1
call sym._wine_dbg_log.constprop.9
jmp 0x405d0e
mov eax, 0x225c
add edx, 2
mov word [edx - 2], ax
mov eax, ebx
jmp 0x406234
mov eax, 0x725c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x406311
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x406790
mov esi, eax
mov byte [edx], 0x5c
add edx, 5
shr si, 0xc
movzx esi, si
movzx ecx, byte [esi + str.0123456789abcdefWCMD_choice]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [esi + str.0123456789abcdefWCMD_choice]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefWCMD_choice]
and esi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [esi + str.0123456789abcdefWCMD_choice]
mov byte [edx - 1], al
mov esi, ebx
mov byte [edx - 2], cl
jmp 0x406311
mov eax, 0x745c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x406311
mov eax, 0x725c
add edx, 2
mov word [edx - 2], ax
mov eax, ebx
jmp 0x406234
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x406780
mov edi, eax
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefWCMD_choice]
and edi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov byte [edx - 1], al
mov eax, ebx
mov byte [edx - 2], cl
jmp 0x406234
mov eax, 0x745c
add edx, 2
mov word [edx - 2], ax
mov eax, ebx
jmp 0x406234
mov eax, 0x225c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x406311
mov edi, dword [ebp - 0x2168]
mov byte [edx], 0x22
lea eax, [edx + 1]
test ebx, ebx
jle 0x406710
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
lea esi, [ebp - 0x2018]
mov byte [eax], 0
mov dword [esp], esi
call dbg.__wine_dbg_strdup
mov dword [ebp - 0x2168], eax
jmp 0x4062ad
movzx eax, word [ebp - 0x2164]
mov dword [esp], 0x426130
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.7
jmp 0x4060a4
mov byte [edx], al
mov edi, ebx
add edx, 1
jmp 0x406010
movzx eax, di
mov dword [esp], 0x426130
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.7
jmp 0x406421
mov byte [edx], al
add edx, 1
mov eax, ebx
jmp 0x406234
mov byte [edx], al
mov esi, ebx
add edx, 1
jmp 0x406311
lea eax, [edx + 1]
jmp 0x406093
mov eax, dword fs:[0x18]
mov ebx, dword [eax + 0x34]
mov eax, dword [ebp - 0x2164]
call sym._wine_dbgstr_wn.constprop.5
mov dword [esp + 0x14], ebx
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 + 4], 0x425010
mov dword [esp], 1
call sym._wine_dbg_log.constprop.9
jmp 0x406510