Function at 0x402a90
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.00401050
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x214c], edx
mov dword [ebp - 0x2148], ecx
mov edi, eax
test byte [0x423010], 8
jne 0x4030e0
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 - 0x2144], eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x403450
mov eax, dword [ebp + 8]
test eax, eax
jne 0x402c30
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
mov dword [ebp - 0x2150], eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x403420
mov eax, dword [ebp - 0x214c]
mov dword [ebp - 0x2154], edi
lea ebx, [ebp - 0x200c]
shr eax, 0x10
mov dword [ebp - 0x215c], eax
lea esi, [esi]
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], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
mov esi, eax
test eax, eax
je 0x402cb0
mov eax, dword [ebp - 0x2148]
mov edi, dword [ebp - 0x2140]
test eax, eax
je 0x402bf5
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 0x402bf5
sub eax, ebx
mov dword [ebp - 0x2140], eax
mov edi, eax
test edi, edi
jne 0x402e18
mov eax, dword [ebp - 0x2150]
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
lea esp, [ebp - 0xc]
mov eax, esi
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
mov dword [ebp - 0x2150], eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x403420
mov eax, dword [ebp - 0x2150]
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 0x402b66
mov edi, dword [ebp - 0x2154]
test byte [0x423010], 2
je 0x402e70
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x2148], eax
mov eax, edi
shr eax, 0x10
je 0x4030b8
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 0x402ddc
movzx eax, word [edi]
test ax, ax
je 0x4031d9
lea esi, [esi]
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x402d10
mov ecx, 0x224c
mov word [ebp - 0x2138], cx
lea ecx, [ebp - 0x2136]
jmp 0x402d6e
cmp ax, 9
je 0x403028
cmp ax, 0xa
jne 0x403046
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [ebp - 0x2016]
lea ebx, [edx - 1]
cmp ecx, eax
ja 0x402db0
test edx, edx
jle 0x402db0
movzx eax, word [edi]
mov edx, ebx
add edi, 2
cmp ax, 0xd
je 0x403010
jbe 0x402d38
cmp ax, 0x22
je 0x4030a0
cmp ax, 0x5c
jne 0x403039
mov ebx, 0x5c5c
add ecx, 2
lea eax, [ebp - 0x2016]
mov word [ecx - 2], bx
lea ebx, [edx - 1]
cmp ecx, eax
jbe 0x402d65
lea esi, [esi]
mov byte [ecx], 0x22
test ebx, ebx
jle 0x4031f2
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x2138]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov ebx, dword [ebp - 0x2148]
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 0x402bfd
lea eax, [ebp - 0x213c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2150]
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 0x402e80
mov eax, dword [ebp - 0x2140]
cmp dword [ebp - 0x213c], eax
je 0x402e61
test byte [0x423010], 2
jne 0x402e89
test eax, eax
jne 0x402b88
jmp 0x402bfd
xor esi, esi
jmp 0x402bfd
test byte [0x423010], 2
je 0x402e70
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x2158], eax
mov eax, dword [ebp - 0x215c]
test eax, eax
je 0x4035e8
mov edi, dword [ebp - 0x214c]
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 0x402fc8
movzx eax, word [edi]
test ax, ax
je 0x403688
lea esi, [esi]
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x402ee0
mov edi, 0x224c
mov dword [ebp - 0x2160], esi
lea ecx, [ebp - 0x2136]
mov word [ebp - 0x2138], di
mov edi, dword [ebp - 0x214c]
mov dword [ebp - 0x2164], ebx
mov esi, edi
jmp 0x402f56
cmp ax, 9
je 0x403408
cmp ax, 0xa
jne 0x403396
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
nop
lea edi, [edx - 1]
test edx, edx
jle 0x402f90
lea eax, [ebp - 0x2016]
cmp ecx, eax
ja 0x402f90
movzx eax, word [esi]
mov edx, edi
add esi, 2
cmp ax, 0xd
je 0x403378
jbe 0x402f18
cmp ax, 0x22
je 0x4033f0
cmp ax, 0x5c
jne 0x403389
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x402f40
mov esi, dword [ebp - 0x2160]
mov ebx, dword [ebp - 0x2164]
mov byte [ecx], 0x22
test edi, edi
jle 0x4036a1
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x2138]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov edi, dword [ebp - 0x2158]
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 0x402bfd
mov eax, dword [ebp - 0x2140]
jmp 0x402e61
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402d58
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402d58
lea ebx, [eax - 0x20]
cmp bx, 0x5e
jbe 0x4030d0
mov ebx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr bx, 0xc
movzx ebx, bx
movzx ebx, byte [ebx + 0x438310]
mov byte [ecx - 4], bl
mov ebx, eax
shr bx, 8
and ebx, 0xf
movzx ebx, byte [ebx + 0x438310]
mov byte [ecx - 3], bl
mov ebx, eax
and eax, 0xf
shr bx, 4
movzx eax, byte [eax + 0x438310]
and ebx, 0xf
movzx ebx, byte [ebx + 0x438310]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x402d58
mov eax, 0x225c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402d58
movzx eax, di
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x402ddc
mov byte [ecx], al
inc ecx
jmp 0x402d58
mov eax, edx
shr eax, 0x10
je 0x403200
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], 0x4350cb
sub esp, 8
mov ecx, eax
test eax, eax
jne 0x40321d
movzx eax, word [ebx]
test ax, ax
je 0x40370f
lea esi, [esi]
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x403128
mov ebx, dword [ebp - 0x214c]
mov ecx, 0x224c
mov word [ebp - 0x200c], cx
lea ecx, [ebp - 0x200a]
mov dword [ebp - 0x2144], ebx
jmp 0x4031a4
cmp ax, 9
je 0x403548
cmp ax, 0xa
jne 0x4034ad
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
nop
lea esi, [edx - 1]
test edx, edx
jle 0x403608
lea eax, [ebp - 0x1eea]
cmp ecx, eax
ja 0x403608
mov eax, dword [ebp - 0x2144]
mov edx, esi
movzx eax, word [eax]
add dword [ebp - 0x2144], 2
cmp ax, 0xd
je 0x403530
jbe 0x403158
cmp ax, 0x22
je 0x403500
cmp ax, 0x5c
jne 0x4034a0
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x403180
mov edi, 0x224c
mov byte [ebp - 0x2136], 0x22
lea ecx, [ebp - 0x2136]
mov word [ebp - 0x2138], di
lea eax, [ecx + 1]
jmp 0x402dcb
movzx eax, word [ebp - 0x214c]
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
mov dword [ebp - 0x2150], eax
mov eax, edi
shr eax, 0x10
je 0x403650
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 0x403334
movzx eax, word [edi]
test ax, ax
je 0x4036ee
lea esi, [esi]
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x403260
mov ebx, 0x224c
mov dword [ebp - 0x2144], edi
lea ecx, [ebp - 0x200a]
mov word [ebp - 0x200c], bx
jmp 0x4032cc
cmp ax, 9
je 0x403560
cmp ax, 0xa
jne 0x40357e
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [edx - 1]
test edx, edx
jle 0x403308
lea eax, [ebp - 0x1eea]
cmp ecx, eax
ja 0x403308
mov eax, dword [ebp - 0x2144]
mov edx, esi
movzx eax, word [eax]
add dword [ebp - 0x2144], 2
cmp ax, 0xd
je 0x403518
jbe 0x403290
cmp ax, 0x22
je 0x4035d0
cmp ax, 0x5c
jne 0x403571
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x4032b0
mov byte [ecx], 0x22
test esi, esi
jle 0x403707
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x200c]
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 - 0x2150]
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 0x402ac1
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402f40
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x403640
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + 0x438310]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + 0x438310]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + 0x438310]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + 0x438310]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x402f40
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x402f40
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x402f40
test byte [0x423010], 2
jne 0x4036a9
mov eax, dword [ebp - 0x2144]
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 0x402c1f
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 0x402c1f
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 + 0x438310]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + 0x438310]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + 0x438310]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + 0x438310]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x403180
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x403180
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4032b0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x403180
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x403180
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4032b0
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x403670
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + 0x438310]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + 0x438310]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + 0x438310]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + 0x438310]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x4032b0
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x4032b0
movzx eax, word [ebp - 0x214c]
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x402fc8
mov byte [ecx], 0x22
test esi, esi
jle 0x403728
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x200c]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov dword [ebp - 0x2150], eax
jmp 0x40321d
mov byte [ecx], al
inc ecx
jmp 0x402f40
movzx eax, di
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x403334
mov byte [ecx], al
inc ecx
jmp 0x4032b0
mov byte [ecx], al
inc ecx
jmp 0x403180
mov eax, 0x224c
mov byte [ebp - 0x2136], 0x22
lea ecx, [ebp - 0x2136]
mov word [ebp - 0x2138], ax
lea eax, [ecx + 1]
jmp 0x402fb7
mov eax, dword fs:[0x18]
mov ebx, dword [eax + 0x34]
mov eax, dword [ebp - 0x214c]
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 0x40342d
mov esi, 0x224c
mov byte [ebp - 0x200a], 0x22
lea ecx, [ebp - 0x200a]
mov word [ebp - 0x200c], si
lea eax, [ecx + 1]
jmp 0x403323
mov eax, 0x224c
mov byte [ebp - 0x200a], 0x22
lea ecx, [ebp - 0x200a]
mov word [ebp - 0x200c], ax
lea eax, [ecx + 1]
jmp 0x403623