Function at 0x402aa0
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.00401050
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x2164], edx
mov dword [ebp - 0x2160], ecx
mov edi, eax
test byte [0x423010], 8
jne 0x4030f0
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
mov dword [ebp - 0x215c], eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x403460
mov eax, dword [ebp + 8]
test eax, eax
jne 0x402c40
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
mov dword [ebp - 0x2168], eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x403430
mov eax, dword [ebp - 0x2164]
mov dword [ebp - 0x216c], edi
lea ebx, [ebp - 0x2018]
shr eax, 0x10
mov dword [ebp - 0x2174], eax
lea esi, [esi]
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], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
mov esi, eax
test eax, eax
je 0x402cc0
mov eax, dword [ebp - 0x2160]
mov edi, dword [ebp - 0x214c]
test eax, eax
je 0x402c05
mov dword [esp + 8], edi
mov dword [esp + 4], 0x1a
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_memchr]
test eax, eax
je 0x402c05
sub eax, ebx
mov dword [ebp - 0x214c], eax
mov edi, eax
test edi, edi
jne 0x402e28
mov eax, dword [ebp - 0x2168]
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
lea esp, [ebp - 0xc]
mov eax, esi
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
mov dword [ebp - 0x2168], eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x403430
mov eax, dword [ebp - 0x2168]
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 0x402b76
mov edi, dword [ebp - 0x216c]
test byte [0x423010], 2
je 0x402e80
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x2160], eax
mov eax, edi
shr eax, 0x10
je 0x4030c8
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, 0x4350cb
test ecx, ecx
jne 0x402dec
movzx eax, word [edi]
test ax, ax
je 0x4031e9
lea esi, [esi]
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x402d20
mov ecx, 0x224c
mov word [ebp - 0x2144], cx
lea ecx, [ebp - 0x2142]
jmp 0x402d7e
cmp ax, 9
je 0x403038
cmp ax, 0xa
jne 0x403056
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [ebp - 0x2022]
lea ebx, [edx - 1]
cmp ecx, eax
ja 0x402dc0
test edx, edx
jle 0x402dc0
movzx eax, word [edi]
mov edx, ebx
add edi, 2
cmp ax, 0xd
je 0x403020
jbe 0x402d48
cmp ax, 0x22
je 0x4030b0
cmp ax, 0x5c
jne 0x403049
mov ebx, 0x5c5c
add ecx, 2
lea eax, [ebp - 0x2022]
mov word [ecx - 2], bx
lea ebx, [edx - 1]
cmp ecx, eax
jbe 0x402d75
lea esi, [esi]
mov byte [ecx], 0x22
test ebx, ebx
jle 0x403202
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x2144]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov ebx, dword [ebp - 0x2160]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unexpected_failure_reading_from__s__rc_ld_n
mov dword [esp + 0x14], ebx
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp + 4], 0x423010
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x402c0d
lea eax, [ebp - 0x2148]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2168]
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
mov esi, eax
test eax, eax
je 0x402e90
mov eax, dword [ebp - 0x214c]
cmp dword [ebp - 0x2148], eax
je 0x402e71
test byte [0x423010], 2
jne 0x402e99
test eax, eax
jne 0x402b98
jmp 0x402c0d
xor esi, esi
jmp 0x402c0d
test byte [0x423010], 2
je 0x402e80
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x2170], eax
mov eax, dword [ebp - 0x2174]
test eax, eax
je 0x4035f8
mov edi, dword [ebp - 0x2164]
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, 0x4350cb
test ecx, ecx
jne 0x402fd8
movzx eax, word [edi]
test ax, ax
je 0x403698
lea esi, [esi]
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x402ef0
mov edi, 0x224c
mov dword [ebp - 0x2178], esi
lea ecx, [ebp - 0x2142]
mov word [ebp - 0x2144], di
mov edi, dword [ebp - 0x2164]
mov dword [ebp - 0x217c], ebx
mov esi, edi
jmp 0x402f66
cmp ax, 9
je 0x403418
cmp ax, 0xa
jne 0x4033a6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
nop
lea edi, [edx - 1]
test edx, edx
jle 0x402fa0
lea eax, [ebp - 0x2022]
cmp ecx, eax
ja 0x402fa0
movzx eax, word [esi]
mov edx, edi
add esi, 2
cmp ax, 0xd
je 0x403388
jbe 0x402f28
cmp ax, 0x22
je 0x403400
cmp ax, 0x5c
jne 0x403399
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x402f50
mov esi, dword [ebp - 0x2178]
mov ebx, dword [ebp - 0x217c]
mov byte [ecx], 0x22
test edi, edi
jle 0x4036b1
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x2144]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov edi, dword [ebp - 0x2170]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unexpected_failure_writing_to__s__rc_ld_n
mov dword [esp + 0x14], edi
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp + 4], 0x423010
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
test esi, esi
je 0x402c0d
mov eax, dword [ebp - 0x214c]
jmp 0x402e71
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402d68
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402d68
lea ebx, [eax - 0x20]
cmp bx, 0x5e
jbe 0x4030e0
mov ebx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr bx, 0xc
movzx ebx, bx
movzx ebx, byte [ebx + 0x438130]
mov byte [ecx - 4], bl
mov ebx, eax
shr bx, 8
and ebx, 0xf
movzx ebx, byte [ebx + 0x438130]
mov byte [ecx - 3], bl
mov ebx, eax
and eax, 0xf
shr bx, 4
movzx eax, byte [eax + 0x438130]
and ebx, 0xf
movzx ebx, byte [ebx + 0x438130]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x402d68
mov eax, 0x225c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402d68
movzx eax, di
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x402dec
mov byte [ecx], al
inc ecx
jmp 0x402d68
mov eax, edx
shr eax, 0x10
je 0x403210
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], 0x4350cb
sub esp, 8
mov ecx, eax
test eax, eax
jne 0x40322d
movzx eax, word [ebx]
test ax, ax
je 0x40371f
lea esi, [esi]
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x403138
mov ebx, dword [ebp - 0x2164]
mov ecx, 0x224c
mov word [ebp - 0x2018], cx
lea ecx, [ebp - 0x2016]
mov dword [ebp - 0x215c], ebx
jmp 0x4031b4
cmp ax, 9
je 0x403558
cmp ax, 0xa
jne 0x4034bd
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
nop
lea esi, [edx - 1]
test edx, edx
jle 0x403618
lea eax, [ebp - 0x1ef6]
cmp ecx, eax
ja 0x403618
mov eax, dword [ebp - 0x215c]
mov edx, esi
movzx eax, word [eax]
add dword [ebp - 0x215c], 2
cmp ax, 0xd
je 0x403540
jbe 0x403168
cmp ax, 0x22
je 0x403510
cmp ax, 0x5c
jne 0x4034b0
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x403190
mov edi, 0x224c
mov byte [ebp - 0x2142], 0x22
lea ecx, [ebp - 0x2142]
mov word [ebp - 0x2144], di
lea eax, [ecx + 1]
jmp 0x402ddb
movzx eax, word [ebp - 0x2164]
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
mov dword [ebp - 0x2168], eax
mov eax, edi
shr eax, 0x10
je 0x403660
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, 0x4350cb
test ecx, ecx
jne 0x403344
movzx eax, word [edi]
test ax, ax
je 0x4036fe
lea esi, [esi]
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x403270
mov ebx, 0x224c
mov dword [ebp - 0x215c], edi
lea ecx, [ebp - 0x2016]
mov word [ebp - 0x2018], bx
jmp 0x4032dc
cmp ax, 9
je 0x403570
cmp ax, 0xa
jne 0x40358e
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [edx - 1]
test edx, edx
jle 0x403318
lea eax, [ebp - 0x1ef6]
cmp ecx, eax
ja 0x403318
mov eax, dword [ebp - 0x215c]
mov edx, esi
movzx eax, word [eax]
add dword [ebp - 0x215c], 2
cmp ax, 0xd
je 0x403528
jbe 0x4032a0
cmp ax, 0x22
je 0x4035e0
cmp ax, 0x5c
jne 0x403581
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x4032c0
mov byte [ecx], 0x22
test esi, esi
jle 0x403717
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x2018]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov esi, 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], esi
mov esi, dword [ebp - 0x2168]
mov dword [esp + 8], str.WCMD_ManualCopy
mov dword [esp + 0x14], esi
mov dword [esp + 4], 0x423010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x402ad1
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402f50
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x403650
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + 0x438130]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + 0x438130]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + 0x438130]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + 0x438130]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x402f50
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x402f50
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402f50
test byte [0x423010], 2
jne 0x4036b9
mov eax, dword [ebp - 0x215c]
xor esi, esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, esi
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
xor esi, esi
test byte [0x423010], 2
je 0x402c2f
mov eax, dword fs:[0x18]
mov ebx, dword [eax + 0x34]
mov eax, edi
call sym._wine_dbgstr_wn.constprop.0
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], 0x423010
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x402c2f
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x403690
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + 0x438130]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + 0x438130]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + 0x438130]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + 0x438130]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x403190
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x403190
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4032c0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x403190
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x403190
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4032c0
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x403680
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + 0x438130]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + 0x438130]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + 0x438130]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + 0x438130]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x4032c0
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x4032c0
movzx eax, word [ebp - 0x2164]
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x402fd8
mov byte [ecx], 0x22
test esi, esi
jle 0x403738
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x2018]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov dword [ebp - 0x2168], eax
jmp 0x40322d
mov byte [ecx], al
inc ecx
jmp 0x402f50
movzx eax, di
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x403344
mov byte [ecx], al
inc ecx
jmp 0x4032c0
mov byte [ecx], al
inc ecx
jmp 0x403190
mov eax, 0x224c
mov byte [ebp - 0x2142], 0x22
lea ecx, [ebp - 0x2142]
mov word [ebp - 0x2144], ax
lea eax, [ecx + 1]
jmp 0x402fc7
mov eax, dword fs:[0x18]
mov ebx, dword [eax + 0x34]
mov eax, dword [ebp - 0x2164]
call sym._wine_dbgstr_wn.constprop.0
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], 0x423010
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x40343d
mov esi, 0x224c
mov byte [ebp - 0x2016], 0x22
lea ecx, [ebp - 0x2016]
mov word [ebp - 0x2018], si
lea eax, [ecx + 1]
jmp 0x403333
mov eax, 0x224c
mov byte [ebp - 0x2016], 0x22
lea ecx, [ebp - 0x2016]
mov word [ebp - 0x2018], ax
lea eax, [ecx + 1]
jmp 0x403633