Function at 0x404510
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, 0x2170
call fcn.004246d8
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x214c], edx
mov edi, eax
mov dword [ebp - 0x2148], ecx
test byte [0x425010], 8
jne 0x404b50
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 - 0x2144], eax
cmp eax, 0xffffffff
je 0x404ed0
mov edx, dword [ebp + 8]
test edx, edx
jne 0x4046b0
mov eax, dword [ebp - 0x214c]
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 - 0x2154], eax
cmp eax, 0xffffffff
je 0x404e93
mov eax, dword [ebp - 0x214c]
mov dword [ebp - 0x2158], edi
lea esi, [ebp - 0x200c]
shr eax, 0x10
mov dword [ebp - 0x2160], eax
lea eax, [ebp - 0x2140]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2144]
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 0x404730
mov eax, dword [ebp - 0x2148]
mov edi, dword [ebp - 0x2140]
test eax, eax
je 0x40466e
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 0x40466e
sub eax, esi
mov dword [ebp - 0x2140], eax
mov edi, eax
test edi, edi
jne 0x4048a0
mov dword [ebp - 0x2148], ebx
mov eax, dword [ebp - 0x2154]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x2144]
sub esp, 4
mov dword [esp], eax
call ebx
sub esp, 4
mov eax, dword [ebp - 0x2148]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x214c]
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 - 0x2154], eax
cmp eax, 0xffffffff
je 0x404e93
mov eax, dword [ebp - 0x2154]
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 0x4045e6
mov dword [ebp - 0x2148], eax
mov edi, dword [ebp - 0x2158]
test byte [0x425010], 2
je 0x404900
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x2150], eax
mov eax, edi
shr eax, 0x10
je 0x404b23
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov esi, eax
sub esp, 8
mov eax, 0x427175
test esi, esi
jne 0x404836
cmp word [edi], 0
je 0x40479a
lea esi, [esi]
add esi, 1
cmp word [edi + esi*2], 0
jne 0x404790
mov eax, 0x224c
lea edx, [ebp - 0x2136]
lea ecx, [esi - 1]
mov word [ebp - 0x2138], ax
lea eax, [ebp - 0x2016]
mov dword [ebp - 0x214c], eax
cmp edx, dword [ebp - 0x214c]
ja 0x40480b
test esi, esi
jle 0x40480b
add edi, 2
movzx eax, word [edi - 2]
cmp ax, 0xd
je 0x404af3
ja 0x404870
cmp ax, 9
je 0x404ae0
cmp ax, 0xa
jne 0x404a80
mov eax, 0x6e5c
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
lea ecx, [esi - 1]
cmp edx, dword [ebp - 0x214c]
jbe 0x4047c3
mov byte [edx], 0x22
lea eax, [edx + 1]
test ecx, ecx
jle 0x404825
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x2138]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov ecx, dword [ebp - 0x2150]
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.6
jmp 0x40467c
cmp ax, 0x22
je 0x404b10
cmp ax, 0x5c
jne 0x404a80
mov ebx, 0x5c5c
add edx, 2
mov esi, ecx
mov word [edx - 2], bx
jmp 0x404800
lea eax, [ebp - 0x213c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2154]
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 0x404910
mov eax, dword [ebp - 0x2140]
cmp dword [ebp - 0x213c], eax
je 0x4048e9
test byte [0x425010], 2
jne 0x404919
test eax, eax
jne 0x404601
jmp 0x404676
mov dword [ebp - 0x2148], 0
jmp 0x40467c
test byte [0x425010], 2
je 0x404900
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x215c], eax
mov eax, dword [ebp - 0x2160]
test eax, eax
je 0x4050c0
mov eax, dword [ebp - 0x214c]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edi, eax
sub esp, 8
mov eax, 0x427175
test edi, edi
jne 0x404a34
mov eax, dword [ebp - 0x214c]
cmp word [eax], 0
je 0x40497a
lea esi, [esi]
nop
add edi, 1
cmp word [eax + edi*2], 0
jne 0x404970
mov ecx, dword [ebp - 0x214c]
mov eax, 0x224c
mov dword [ebp - 0x2164], ebx
lea edx, [ebp - 0x2136]
mov word [ebp - 0x2138], ax
mov dword [ebp - 0x2150], ecx
nop
lea ebx, [edi - 1]
test edi, edi
jle 0x404a00
lea eax, [ebp - 0x2016]
cmp edx, eax
ja 0x404a00
add dword [ebp - 0x2150], 2
mov eax, dword [ebp - 0x2150]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x404e03
ja 0x404cf5
cmp ax, 9
je 0x404df0
cmp ax, 0xa
jne 0x404e33
mov eax, 0x6e5c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x4049a0
mov eax, ebx
mov byte [edx], 0x22
mov ebx, dword [ebp - 0x2164]
test eax, eax
jle 0x40512c
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x2138]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov ecx, dword [ebp - 0x215c]
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.6
test ebx, ebx
je 0x404676
mov eax, dword [ebp - 0x2140]
jmp 0x4048e9
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x404b40
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 0x404800
mov eax, 0x745c
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
jmp 0x404800
mov eax, 0x725c
add edx, 2
mov esi, ecx
mov word [edx - 2], ax
jmp 0x404800
mov esi, 0x225c
add edx, 2
mov word [edx - 2], si
mov esi, ecx
jmp 0x404800
movzx eax, di
mov dword [esp], 0x427168
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.9
jmp 0x404836
mov byte [edx], al
mov esi, ecx
add edx, 1
jmp 0x404800
mov eax, edx
shr eax, 0x10
je 0x404c20
mov ebx, dword [ebp - 0x214c]
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x2150], 0x427175
sub esp, 8
test eax, eax
jne 0x404c3d
cmp word [ebx], 0
mov edx, ebx
je 0x404b9a
nop
add eax, 1
cmp word [edx + eax*2], 0
jne 0x404b90
mov ecx, dword [ebp - 0x214c]
mov dword [ebp - 0x2150], edi
mov edx, 0x224c
lea esi, [ebp - 0x1eea]
mov word [ebp - 0x200c], dx
lea edx, [ebp - 0x200a]
mov dword [ebp - 0x2144], ecx
lea ebx, [eax - 1]
cmp edx, esi
ja 0x405080
test eax, eax
jle 0x405080
add dword [ebp - 0x2144], 2
mov eax, dword [ebp - 0x2144]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x404fd3
ja 0x404d50
cmp ax, 9
je 0x405050
cmp ax, 0xa
jne 0x404ff0
mov eax, 0x6e5c
add edx, 2
mov word [edx - 2], ax
mov eax, ebx
jmp 0x404bc4
movzx eax, word [ebp - 0x214c]
mov dword [esp], 0x427168
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.9
mov dword [ebp - 0x2150], eax
mov eax, edi
shr eax, 0x10
je 0x4050f0
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov esi, eax
sub esp, 8
mov eax, 0x427175
test esi, esi
jne 0x404db1
cmp word [edi], 0
je 0x404c7b
add esi, 1
cmp word [edi + esi*2], 0
jne 0x404c71
mov eax, 0x224c
mov dword [ebp - 0x2144], edi
lea edx, [ebp - 0x200a]
mov word [ebp - 0x200c], ax
lea eax, [ebp - 0x1eea]
mov dword [ebp - 0x2154], edi
mov edi, eax
lea ebx, [esi - 1]
cmp edx, edi
ja 0x404d80
test esi, esi
jle 0x404d80
add dword [ebp - 0x2144], 2
mov eax, dword [ebp - 0x2144]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x404f43
ja 0x404d20
cmp ax, 9
je 0x404fc0
cmp ax, 0xa
jne 0x404f60
mov eax, 0x6e5c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x404ca1
cmp ax, 0x22
je 0x404e20
cmp ax, 0x5c
jne 0x404e33
mov edi, 0x5c5c
add edx, 2
mov word [edx - 2], di
mov edi, ebx
jmp 0x4049a0
cmp ax, 0x22
je 0x405063
cmp ax, 0x5c
jne 0x404f60
mov esi, 0x5c5c
add edx, 2
mov word [edx - 2], si
mov esi, ebx
jmp 0x404ca1
cmp ax, 0x22
je 0x404f30
cmp ax, 0x5c
jne 0x404ff0
mov edi, 0x5c5c
add edx, 2
mov eax, ebx
mov word [edx - 2], di
jmp 0x404bc4
mov edi, dword [ebp - 0x2154]
mov byte [edx], 0x22
lea eax, [edx + 1]
test ebx, ebx
jle 0x404da0
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
lea esi, [ebp - 0x200c]
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 - 0x2150]
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.6
jmp 0x404541
mov eax, 0x745c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x4049a0
mov eax, 0x725c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x4049a0
mov eax, 0x225c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x4049a0
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x4050e0
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 0x4049a0
test byte [0x425010], 2
jne 0x405134
mov eax, dword [ebp - 0x2144]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [ebp - 0x2148], 0
mov eax, dword [ebp - 0x2148]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x2148], 0
test byte [0x425010], 2
je 0x40469e
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.6
jmp 0x40469e
mov eax, 0x225c
add edx, 2
mov word [edx - 2], ax
mov eax, ebx
jmp 0x404bc4
mov eax, 0x725c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x404ca1
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x405120
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 0x404ca1
mov eax, 0x745c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x404ca1
mov eax, 0x725c
add edx, 2
mov word [edx - 2], ax
mov eax, ebx
jmp 0x404bc4
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x405110
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 0x404bc4
mov eax, 0x745c
add edx, 2
mov word [edx - 2], ax
mov eax, ebx
jmp 0x404bc4
mov eax, 0x225c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x404ca1
mov edi, dword [ebp - 0x2150]
mov byte [edx], 0x22
lea eax, [edx + 1]
test ebx, ebx
jle 0x4050a0
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
lea esi, [ebp - 0x200c]
mov byte [eax], 0
mov dword [esp], esi
call dbg.__wine_dbg_strdup
mov dword [ebp - 0x2150], eax
jmp 0x404c3d
movzx eax, word [ebp - 0x214c]
mov dword [esp], 0x427168
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.9
jmp 0x404a34
mov byte [edx], al
mov edi, ebx
add edx, 1
jmp 0x4049a0
movzx eax, di
mov dword [esp], 0x427168
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.9
jmp 0x404db1
mov byte [edx], al
add edx, 1
mov eax, ebx
jmp 0x404bc4
mov byte [edx], al
mov esi, ebx
add edx, 1
jmp 0x404ca1
lea eax, [edx + 1]
jmp 0x404a23
mov eax, dword fs:[0x18]
mov ebx, dword [eax + 0x34]
mov eax, dword [ebp - 0x214c]
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.6
jmp 0x404ea0