Function at 0x4020f0
Capabilities:
Get common file path
Query environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x228
mov esi, dword [ebp + 8]
test esi, esi
jle 0x402140
mov ebx, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
xor eax, eax
jmp 0x402115
inc eax
cmp ebx, eax
je 0x402160
mov edx, dword [ecx + eax*4]
cmp word [edx], 0x2f
jne 0x402110
test byte [0x403030], 1
jne 0x40235f
lea esp, [ebp - 0xc]
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [0x403048]
test ebx, ebx
je 0x402325
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [ebp + 8], 1
jle 0x402140
mov dword [ebp - 0x218], 1
jmp 0x402189
inc dword [ebp - 0x218]
mov eax, dword [ebp - 0x218]
cmp dword [ebp + 8], eax
je 0x402140
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x218]
mov eax, dword [eax + ecx*4]
mov dword [esp + 4], 0x3a
mov dword [ebp - 0x21c], eax
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov esi, eax
test eax, eax
je 0x402260
xor ecx, ecx
lea eax, [eax + 2]
mov word [eax - 2], cx
mov dword [ebp - 0x220], eax
mov dword [esp + 4], str.__r_n
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcspbrk]
test eax, eax
jne 0x402178
mov edi, dword [ebp - 0x21c]
mov dword [esp + 4], 0x3b
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_wcschr]
test eax, eax
je 0x402228
xor edx, edx
lea ebx, [eax + 2]
mov word [eax], dx
cmp word [edi], 0
jne 0x402210
mov edi, ebx
jmp 0x4021e0
mov edx, dword [ebp - 0x220]
mov eax, edi
mov edi, ebx
call sym._search
jmp 0x4021e0
cmp word [edi], 0
je 0x402240
mov edx, dword [ebp - 0x220]
mov eax, edi
call sym._search
lea esi, cs:[esi]
test esi, esi
jne 0x402178
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_free]
jmp 0x402178
mov dword [esp + 8], 0
mov edi, dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
mov dword [esp + 4], 0
mov dword [esp], str.PATH
call edi
sub esp, 0xc
mov ebx, eax
add eax, eax
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_malloc]
test eax, eax
je 0x4023b2
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [ebp - 0x220], eax
mov dword [esp], str.PATH
call edi
mov eax, dword [ebp - 0x21c]
sub esp, 0xc
mov dword [esp + 4], str.__r_n
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcspbrk]
mov ecx, dword [ebp - 0x220]
test eax, eax
je 0x4022e0
mov dword [esp], ecx
call dword [sym.imp.ucrtbase.dll_free]
jmp 0x402178
lea ebx, [ebp - 0x214]
mov dword [ebp - 0x220], ecx
mov dword [esp + 4], ebx
mov dword [esp], 0x104
call dword [sym.imp.kernel32.dll_GetCurrentDirectoryW]
mov ecx, dword [ebp - 0x220]
sub esp, 8
test eax, eax
jne 0x402394
mov eax, dword [ebp - 0x21c]
mov dword [ebp - 0x21c], ecx
mov dword [ebp - 0x220], eax
jmp 0x4021da
mov dword [esp], 2
call dword [sym.imp.ucrtbase.dll___acrt_iob_func]
mov dword [esp + 8], 0xf
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], str.File_not_found_n
call sym._fwrite
lea esp, [ebp - 0xc]
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.Unsupported_option__ls_n
mov dword [esp + 8], str.wmain
mov dword [esp + 4], 0x403030
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
lea esp, [ebp - 0xc]
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [ebp - 0x21c]
mov eax, ebx
mov dword [ebp - 0x220], ecx
call sym._search
mov ecx, dword [ebp - 0x220]
jmp 0x40230e
test byte [0x403030], 2
je 0x40212b
mov dword [esp + 0xc], str.Out_of_memory_n
mov dword [esp + 8], str.wmain
mov dword [esp + 4], 0x403030
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x40212b