Function at 0x401530
Capabilities:
Get process heap flags

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x528
mov eax, dword [ecx + 4]
mov esi, dword [ecx]
mov dword [ebp - 0x504], eax
movzx eax, byte [section..data]
test al, 8
jne 0x401b40
test esi, esi
jle 0x401b9b
xor edi, edi
jmp 0x40157d
lea ebx, [edi + 1]
cmp esi, ebx
je 0x4016fd
mov edi, ebx
mov edx, eax
and edx, 8
je 0x401570
mov eax, dword [ebp - 0x504]
mov ebx, dword [eax + edi*4]
test ebx, ebx
je 0x401ad0
mov eax, ebx
shr eax, 0x10
je 0x4019f8
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x4016be
cmp word [ebx], 0
je 0x401c83
lea esi, [esi]
mov eax, edx
lea edx, [edx + 1]
cmp word [ebx + eax*2 + 2], 0
jne 0x4015d0
mov edx, 0x224c
mov dword [ebp - 0x500], edi
mov word [ebp - 0x270], dx
lea edx, [ebp - 0x26e]
mov dword [ebp - 0x4fc], ebx
jmp 0x40162f
cmp cx, 9
je 0x401978
cmp cx, 0xa
jne 0x401a28
mov ebx, 0x6e5c
add edx, 2
mov word [edx - 2], bx
sub eax, 1
jb 0x401678
lea ecx, [ebp - 0x14e]
cmp ecx, edx
jb 0x401690
add dword [ebp - 0x4fc], 2
mov ecx, dword [ebp - 0x4fc]
movzx ecx, word [ecx - 2]
cmp cx, 0xd
je 0x401960
jbe 0x401600
cmp cx, 0x22
je 0x401990
cmp cx, 0x5c
jne 0x401a10
movzx ecx, word [0x404092]
add edx, 2
mov word [edx - 2], cx
sub eax, 1
jae 0x401625
lea esi, [esi]
nop
mov byte [edx], 0x22
mov edi, dword [ebp - 0x500]
lea eax, [edx + 1]
jmp 0x4016ad
mov byte [edx], 0x22
mov edi, dword [ebp - 0x500]
test eax, eax
je 0x401681
mov byte [edx + 3], 0x2e
mov eax, 0x2e2e
mov word [edx + 1], ax
lea eax, [edx + 4]
mov byte [eax], 0
lea eax, [ebp - 0x270]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov dword [esp + 0x10], eax
lea ebx, [edi + 1]
mov dword [esp + 0xc], 0x404043
mov dword [esp + 8], global___FUNCTION__
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
movzx eax, byte [section..data]
mov edx, eax
and edx, 8
cmp esi, ebx
jne 0x40157b
test dl, dl
jne 0x401bd0
cmp ebx, 1
je 0x401b9b
xor ecx, ecx
mov dword [ebp - 0x500], edi
xor edx, edx
xor esi, esi
mov edi, ecx
mov ebx, 1
mov ecx, dword [ebp - 0x504]
mov dword [ebp - 0x4fc], 0
mov eax, dword fs:[0x18]
mov dword [ebp - 0x508], eax
jmp 0x4017a9
cmp edi, esi
jl 0x401796
test esi, esi
je 0x4019a8
add esi, esi
mov dword [ebp - 0x504], ecx
lea eax, [esi*4]
test edx, edx
je 0x4019c0
mov dword [esp + 8], edx
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x508]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
mov ecx, dword [ebp - 0x504]
mov edx, eax
sub esp, 0x10
mov eax, dword [ecx + ebx*4]
mov dword [edx + edi*4], eax
add edi, 1
lea eax, [ebx + 1]
cmp dword [ebp - 0x500], ebx
je 0x4017d0
mov ebx, eax
mov eax, dword [ecx + ebx*4]
cmp word [eax], 0x2f
je 0x401a80
cmp dword [ebp - 0x4fc], 0
jne 0x401740
mov dword [ebp - 0x4fc], eax
lea eax, [ebx + 1]
cmp dword [ebp - 0x500], ebx
jne 0x4017a7
test edi, edi
jle 0x401bf9
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x510], edi
mov ebx, 1
mov dword [ebp - 0x508], 0
mov dword [ebp - 0x504], eax
mov dword [ebp - 0x50c], edx
nop
mov edi, dword [ebp - 0x50c]
mov esi, dword [ebp - 0x508]
mov eax, dword [edi + esi*4]
mov dword [esp + 4], eax
lea eax, [ebp - 0x478]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcscpy]
lea eax, [ebp - 0x478]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsupr]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov eax, dword [edi + esi*4]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileW]
mov dword [ebp - 0x500], eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x401ae0
mov eax, str._r_n__________
call dbg.write_to_stdout
lea eax, [ebp - 0x478]
call dbg.write_to_stdout
mov eax, 0x40401e
call dbg.write_to_stdout
mov edi, dword fs:[0x18]
jmp 0x4018e7
mov edx, dword [ebp - 0x4fc]
mov eax, esi
call sym._run_find_for_line
mov dword [esp + 8], esi
test eax, eax
mov eax, 0
mov dword [esp + 4], 0
cmovne ebx, eax
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x504]
call eax
sub esp, 0xc
mov eax, dword [ebp - 0x500]
call dbg.read_line_from_handle
mov esi, eax
test eax, eax
jne 0x4018b0
mov eax, dword [ebp - 0x500]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
add dword [ebp - 0x508], 1
mov eax, dword [ebp - 0x508]
cmp dword [ebp - 0x510], eax
jne 0x401800
mov edx, dword [ebp - 0x50c]
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x504]
call eax
mov eax, ebx
sub esp, 0xc
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
movzx ecx, word [str._r_WINEDEBUG]
add edx, 2
mov word [edx - 2], cx
jmp 0x401620
mov ecx, 0x745c
add edx, 2
mov word [edx - 2], cx
jmp 0x401620
movzx ecx, word [0x404090]
add edx, 2
mov word [edx - 2], cx
jmp 0x401620
mov dword [ebp - 0x504], ecx
mov eax, 8
mov esi, 2
test edx, edx
jne 0x401763
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov ecx, dword [ebp - 0x504]
mov edx, eax
sub esp, 0xc
mov eax, dword [ecx + ebx*4]
jmp 0x401796
mov dword [esp + 4], ebx
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0
jmp 0x4016be
lea edi, [ecx - 0x20]
cmp di, 0x5e
ja 0x401a28
mov byte [edx], cl
add edx, 1
jmp 0x401620
mov edi, ecx
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefwmain]
mov edi, ecx
shr di, 8
and edi, 0xf
mov byte [edx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefwmain]
mov edi, ecx
and ecx, 0xf
shr di, 4
movzx ecx, byte [ecx + str.0123456789abcdefwmain]
and edi, 0xf
mov byte [edx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefwmain]
mov byte [edx - 1], cl
mov byte [edx - 2], bl
jmp 0x401620
mov dword [esp], 0
lea ebx, [ebp - 0x270]
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
sub esp, 4
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x3e9
mov dword [esp], eax
call sym._LoadStringW_16
mov eax, ebx
mov ebx, 2
sub esp, 0x10
call dbg.write_to_stdout
lea esp, [ebp - 0x10]
mov eax, ebx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov eax, str._null_
jmp 0x4016be
mov dword [esp], 0
lea esi, [ebp - 0x4f8]
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
sub esp, 4
mov dword [esp + 8], esi
mov dword [esp + 0xc], 0x40
mov dword [esp + 4], 0x3ea
mov dword [esp], eax
call sym._LoadStringW_16
lea eax, [ebp - 0x478]
sub esp, 0x10
mov dword [esp + 4], esi
lea esi, [ebp - 0x270]
mov dword [esp + 8], eax
mov dword [esp], esi
call sym._wsprintfW
mov eax, esi
call dbg.write_to_stdout
jmp 0x40190a
mov dword [esp + 0xc], str.running_find:
mov dword [esp + 8], global___FUNCTION__
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
movzx eax, byte [section..data]
test esi, esi
jg 0x401569
test al, 8
je 0x401b9b
mov dword [esp + 0xc], 0x404047
mov dword [esp + 8], global___FUNCTION__
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
mov dword [esp], 0
lea ebx, [ebp - 0x270]
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
sub esp, 4
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x3e8
jmp 0x401aaa
mov dword [esp + 0xc], 0x404047
mov dword [esp + 8], global___FUNCTION__
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x401705
mov dword [ebp - 0x508], edx
mov ebx, 1
mov dword [esp], 0xfffffff6
call dword [sym.imp.kernel32.dll_GetStdHandle]
mov dword [ebp - 0x500], eax
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 4
mov edi, dword fs:[0x18]
mov dword [ebp - 0x504], eax
jmp 0x401c67
mov edx, dword [ebp - 0x4fc]
mov eax, esi
call sym._run_find_for_line
mov dword [esp + 8], esi
test eax, eax
mov eax, 0
mov dword [esp + 4], 0
cmovne ebx, eax
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x504]
call eax
sub esp, 0xc
mov eax, dword [ebp - 0x500]
call dbg.read_line_from_handle
mov esi, eax
test eax, eax
jne 0x401c30
mov edx, dword [ebp - 0x508]
jmp 0x401929
mov ecx, 0x224c
mov byte [ebp - 0x26e], 0x22
lea eax, [ebp - 0x26d]
mov word [ebp - 0x270], cx
jmp 0x4016ad