Function at 0x4020f0
Capabilities:
Access peb ldr_data
Get ntdll base address
Get process heap flags
Get process heap force flags
Terminate process

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, 1
push ebx
sub esp, 0x2c
mov dword [ebp - 0x24], edx
mov dword [esp + 4], eax
mov dword [esp], 0x40d1d4
call dbg.heap_wprintf
mov dword [ebp - 0x28], eax
mov dword [esp + 4], 0x40d1f0
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wfopen]
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x40223b
mov eax, 0x1000
mov esi, 0x1000
call dbg.xmalloc
mov edi, eax
test edi, edi
je 0x402268
nop
xor ebx, ebx
jmp 0x4021b0
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_strlen]
mov dword [esp + 4], 0xa
mov dword [esp], edi
mov ebx, eax
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
jne 0x402278
add esi, esi
mov dword [esp + 8], edi
mov dword [esp + 0xc], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
sub esp, 0x10
mov edi, eax
test eax, eax
je 0x4022e2
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], eax
mov eax, esi
sub eax, ebx
add ebx, edi
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_fgets]
test eax, eax
jne 0x402158
mov edx, dword fs:[0x18]
mov dword [esp + 8], edi
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x1c]
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_feof]
test eax, eax
setne al
movzx eax, al
mov esi, eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x1c]
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_fclose]
mov ecx, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], ecx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov eax, esi
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
xor esi, esi
jmp 0x40220b
mov byte [eax], 0
cmp byte [edi], 0x23
je 0x402150
mov dword [esp + 4], 0x3a
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_strchr]
mov ebx, eax
test eax, eax
je 0x402150
mov eax, 0x10
call dbg.xmalloc
mov byte [ebx], 0
mov dword [ebp - 0x20], eax
mov eax, edi
call dbg.utf8_chars_to_wchars
mov edx, dword [ebp - 0x20]
mov dword [edx], eax
lea eax, [ebx + 1]
call dbg.utf8_chars_to_wchars
mov ebx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x20]
mov ecx, dword [ebx + 4]
mov dword [edx + 4], eax
lea eax, [edx + 8]
mov dword [edx + 8], ebx
mov dword [edx + 0xc], ecx
mov dword [ecx], eax
mov dword [ebx + 4], eax
jmp 0x402147
test byte [0x40c000], 2
jne 0x4022f8
mov dword [esp], 1
call dword [sym.imp.kernel32.dll_ExitProcess]
mov dword [esp + 0xc], str.out_of_memory_n
mov dword [esp + 8], str.xrealloc
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x4022eb