Function at 0x66422370
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, 0x58
mov eax, dword [ecx + 8]
mov edi, dword [ecx]
mov esi, dword [ecx + 4]
mov dword [ebp - 0x20], eax
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x10c]
mov dword [esp], eax
call sym.krnl386.exe16_MapSL
movzx ebx, word [eax + 0x10]
sub esp, 4
mov eax, ebx
shl eax, 0x10
mov dword [esp], eax
mov dword [ebp - 0x28], eax
call sym.krnl386.exe16_MapSL
sub esp, 4
mov dword [ebp - 0x1c], eax
test di, di
je 0x664224e0
movzx eax, di
mov dword [ebp - 0x2c], eax
mov eax, edi
and eax, 3
mov word [ebp - 0x22], ax
cmp ax, 2
je 0x664224f8
test byte [0x664448d4], 8
jne 0x66422512
mov eax, ebx
call fcn.66420420
test eax, eax
je 0x664224e0
cmp word [ebp - 0x22], 0
jne 0x66422480
mov eax, dword [ebp - 0x20]
test al, 0x80
jne 0x66422613
movzx eax, ax
mov word [ebp - 0x24], di
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], 0
test si, si
jne 0x66422628
test byte [ebp - 0x20], 2
je 0x66422978
cmp word [ebp - 0x22], 0
je 0x66422a20
mov esi, dword [ebp - 0x1c]
add esi, dword [ebp - 0x2c]
cmp byte [esi + 3], 0
jne 0x664224e0
test byte [0x664448d4], 8
jne 0x66422c18
movzx eax, word [esi]
lea edx, [eax - 6]
mov eax, ebx
movzx edx, dx
call fcn.66420af0
xor eax, eax
mov byte [esi + 2], 0x40
mov ecx, edi
mov word [esi], ax
jmp 0x664224e2
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x2c]
cmp byte [eax + 2], 0x40
mov dword [ebp - 0x30], eax
movzx edx, word [eax]
jne 0x66422558
movzx eax, byte [0x664448d4]
test dx, dx
jne 0x664229b0
test al, 8
jne 0x66422ab0
mov eax, 5
movzx ecx, word [ebp - 0x20]
cmp si, ax
cmovae eax, esi
mov edx, eax
mov eax, ebx
add edx, 2
movzx edx, dx
call fcn.66421430
movzx ebx, ax
test bx, bx
jne 0x664229f0
lea esi, [esi]
nop
xor ecx, ecx
lea esp, [ebp - 0x10]
mov eax, ecx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0xc
mov eax, dword [ebp - 0x1c]
movzx edx, di
cmp byte [eax + edx + 3], 0xff
je 0x664224e0
test byte [0x664448d4], 8
je 0x664223ef
movzx eax, word [ebp - 0x20]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0xc], str._04x__d__04x_ds_04x_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp + 0x18], eax
movzx eax, si
mov dword [esp + 0x14], eax
movzx eax, di
mov dword [esp + 0x10], eax
mov dword [esp], 3
call fcn.66420390
jmp 0x664223ef
lea eax, [edx - 2]
mov ecx, eax
mov word [ebp - 0x24], ax
and cx, 3
jne 0x66422930
movzx eax, word [ebp - 0x24]
mov edx, dword [ebp - 0x1c]
cmp word [edx + eax], di
je 0x664225b8
test byte [0x664448d4], 2
je 0x664224e0
mov dword [ebp - 0x1c], ecx
mov dword [esp + 0xc], str.Back_ptr_to_handle_is_invalid_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 1
call fcn.66420390
mov ecx, dword [ebp - 0x1c]
jmp 0x664224e2
mov eax, dword [ebp - 0x20]
movzx edx, ax
mov dword [ebp - 0x34], edx
test al, 0x80
je 0x66422421
cmp word [ebp - 0x22], 2
jne 0x66422613
mov eax, dword [ebp - 0x34]
mov edx, dword [ebp - 0x30]
sar eax, 8
and eax, 0xf
mov byte [edx + 2], al
test byte [0x664448d4], 8
je 0x66422613
movzx eax, al
mov dword [esp + 0xc], str.Changing_flags_to__x._n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
call fcn.66420390
mov ecx, edi
lea esp, [ebp - 0x10]
mov eax, ecx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0xc
movzx eax, word [ebp - 0x24]
sub eax, 4
mov word [ebp - 0x36], ax
movzx eax, ax
mov dword [ebp - 0x2c], eax
test byte [0x664448d4], 8
jne 0x66422a80
mov eax, 5
mov ecx, dword [ebp - 0x1c]
add ecx, dword [ebp - 0x2c]
cmp si, ax
cmovae eax, esi
cmp word [ebp - 0x22], 2
mov esi, eax
lea eax, [esi + 2]
mov dword [ebp - 0x44], ecx
movzx ecx, word [ecx + 2]
cmovne eax, esi
mov word [ebp - 0x38], ax
movzx eax, ax
mov esi, eax
mov dword [ebp - 0x40], eax
movzx eax, word [ebp - 0x24]
lea eax, [esi + eax + 3]
and eax, 0xfffffffc
mov edx, eax
mov dword [ebp - 0x3c], eax
movzx eax, cx
cmp eax, edx
jge 0x66422a48
sub cx, word [ebp - 0x24]
add eax, dword [ebp - 0x1c]
mov word [ebp - 0x24], cx
test byte [eax], 3
jne 0x66422770
movzx eax, word [eax + 2]
cmp eax, dword [ebp - 0x3c]
jl 0x66422770
test byte [0x664448d4], 8
jne 0x66422c41
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sym.krnl386.exe16_MapSL
mov ecx, eax
mov eax, dword [ebp - 0x2c]
sub esp, 4
mov dword [ebp - 0x28], ecx
movzx esi, word [ecx + eax + 2]
mov eax, ebx
mov word [ebp - 0x22], si
call fcn.66420420
mov esi, eax
test eax, eax
je 0x66422712
movzx edx, word [ebp - 0x22]
mov eax, dword [ebp - 0x28]
call fcn.66420860
mov edx, dword [ebp - 0x2c]
mov eax, ebx
sub word [esi + 4], 1
movzx esi, word [ebp - 0x3c]
sub si, word [ebp - 0x36]
movzx ecx, si
call fcn.66420ce0
test byte [ebp - 0x20], 0x40
je 0x6642274d
mov edx, dword [ebp - 0x44]
movzx eax, word [ebp - 0x24]
movzx ebx, word [edx + 2]
lea esi, [edx + eax + 4]
add ebx, dword [ebp - 0x1c]
test byte [0x664448d4], 8
jne 0x66422cd4
sub ebx, esi
mov dword [esp + 4], 0
mov dword [esp + 8], ebx
mov dword [esp], esi
call sub.ucrtbase.dll_memset
test byte [0x664448d4], 8
je 0x66422613
movzx eax, di
mov dword [esp + 0xc], str.returning__04x_n
mov dword [esp + 0x10], eax
jmp 0x664225f7
movzx ecx, word [ebp - 0x20]
and cx, 2
jne 0x66422796
cmp word [ebp - 0x22], 0
je 0x66422b20
mov eax, dword [ebp - 0x1c]
movzx edx, di
cmp byte [eax + edx + 3], 0
jne 0x66422bd2
mov ecx, dword [ebp - 0x34]
mov eax, ebx
mov edx, dword [ebp - 0x40]
call fcn.66421430
mov ecx, eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x20], ecx
mov dword [esp], eax
call sym.krnl386.exe16_MapSL
mov ecx, dword [ebp - 0x20]
sub esp, 4
cmp word [ebp - 0x22], 2
mov dword [ebp - 0x1c], eax
jne 0x664227d0
mov eax, dword [ebp - 0x30]
movzx eax, word [eax]
sub eax, 6
mov word [ebp - 0x36], ax
movzx esi, word [ebp - 0x24]
mov dword [ebp - 0x20], esi
test cx, cx
jne 0x66422ae0
mov dword [esp + 8], 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_HeapAlloc]
sub esp, 0xc
mov ecx, eax
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x664224e0
movzx edx, word [ebp - 0x36]
mov dword [esp], ecx
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], esi
mov dword [ebp - 0x1c], edx
lea eax, [eax + edx + 4]
mov dword [esp + 4], eax
call sub.ucrtbase.dll_memcpy
mov edx, dword [ebp - 0x1c]
mov eax, ebx
call fcn.66420af0
mov ecx, dword [ebp - 0x34]
mov eax, ebx
mov edx, dword [ebp - 0x40]
call fcn.66421430
mov ecx, eax
test ax, ax
jne 0x6642286c
mov ecx, dword [ebp - 0x34]
mov edx, esi
mov eax, ebx
call fcn.66421430
mov ecx, eax
movzx eax, word [ebp - 0x24]
mov word [ebp - 0x38], ax
test cx, cx
je 0x66422c99
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x30], ecx
mov dword [esp], eax
call sym.krnl386.exe16_MapSL
mov ecx, dword [ebp - 0x30]
mov esi, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], eax
sub esp, 4
movzx edx, cx
add eax, edx
mov dword [ebp - 0x28], edx
mov edx, dword [ebp - 0x20]
mov dword [esp + 4], esi
mov dword [esp], eax
mov dword [esp + 8], edx
call sub.ucrtbase.dll_memcpy
mov dword [esp + 8], 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_HeapFree]
mov ecx, dword [ebp - 0x30]
sub esp, 0xc
cmp word [ebp - 0x22], 2
movzx eax, byte [0x664448d4]
je 0x66422b69
movzx edx, word [ebp - 0x24]
cmp word [ebp - 0x38], dx
mov edx, 0
cmove ecx, edx
test al, 8
je 0x664224e2
movzx eax, cx
mov dword [esp + 0xc], str.returning__04x_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
mov dword [ebp - 0x1c], ecx
call fcn.66420390
mov ecx, dword [ebp - 0x1c]
jmp 0x664224e2
test byte [0x664448d4], 2
je 0x664224e0
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.__04x__04x_:_invalid_handle_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp + 0x14], eax
mov dword [esp], 1
call fcn.66420390
jmp 0x664224e0
cmp word [ebp - 0x20], 0
jne 0x664224e0
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x2c]
cmp byte [eax + edx + 3], 0
jne 0x664224e0
mov dword [esp], edx
call sym.krnl386.exe16_LocalFree16
sub esp, 4
mov ecx, eax
jmp 0x664224e2
test al, 4
je 0x664224a6
mov dword [esp + 0xc], str.Dicarded_block_has_non_zero_addr._n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 2
call fcn.66420390
movzx eax, byte [0x664448d4]
jmp 0x664224a6
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sym.krnl386.exe16_MapSL
lea ecx, [ebx + 2]
movzx edx, di
add edx, eax
sub esp, 4
mov word [edx], cx
xor ecx, ecx
mov word [edx + 2], cx
mov ecx, edi
mov word [eax + ebx], di
jmp 0x664224e2
test byte [0x664448d4], 8
jne 0x66422bef
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym.krnl386.exe16_LocalFree16
sub esp, 4
mov ecx, eax
jmp 0x664224e2
test byte [0x664448d4], 8
jne 0x66422b40
movzx ecx, word [ebp - 0x3c]
mov eax, ebx
sub cx, word [ebp - 0x36]
mov edx, dword [ebp - 0x2c]
movzx ecx, cx
call fcn.66420ce0
test byte [0x664448d4], 8
jne 0x6642275a
mov ecx, edi
jmp 0x66422615
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.arena_is__04x_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
call fcn.66420390
jmp 0x66422646
mov dword [esp + 0xc], str.ReAllocating_discarded_block_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
call fcn.66420390
jmp 0x664224ae
movzx eax, cx
mov dword [ebp - 0x2c], ecx
mov ecx, dword [ebp - 0x20]
mov esi, eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], ecx
mov edx, eax
add edx, esi
movzx esi, word [ebp - 0x36]
mov dword [esp], edx
lea eax, [eax + esi + 4]
mov dword [esp + 4], eax
call sub.ucrtbase.dll_memcpy
mov edx, esi
mov eax, ebx
call fcn.66420af0
mov ecx, dword [ebp - 0x2c]
jmp 0x664228c8
test byte [0x664448d4], 2
je 0x664224e0
mov dword [ebp - 0x1c], ecx
mov dword [esp + 0xc], str.Needed_to_move_fixed_block__but_LMEM_MOVEABLE_not_specified._n
jmp 0x66422590
mov dword [esp + 0xc], str.size_reduction__making_new_free_block_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
call fcn.66420390
jmp 0x66422a55
test al, 8
jne 0x66422c6a
mov eax, dword [ebp - 0x1c]
add ecx, 2
movzx edx, di
mov word [eax + edx], cx
mov edx, dword [ebp - 0x28]
mov ecx, edi
cmp word [eax + edx], di
movzx eax, byte [0x664448d4]
je 0x664228da
test al, 2
je 0x664228da
mov dword [esp + 0xc], str.back_ptr_is_invalid._n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 1
mov dword [ebp - 0x1c], ecx
call fcn.66420390
movzx eax, byte [0x664448d4]
mov ecx, dword [ebp - 0x1c]
jmp 0x664228da
test byte [0x664448d4], 2
je 0x664224e0
mov dword [ebp - 0x1c], ecx
mov dword [esp + 0xc], str.Needed_to_move_locked_block__but_LMEM_MOVEABLE_not_specified._n
jmp 0x66422590
mov dword [esp + 0xc], str.Freeing_fixed_block._n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
call fcn.66420390
jmp 0x66422a2d
mov dword [esp + 0xc], str.Discarding_block_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
call fcn.66420390
jmp 0x6642245c
mov dword [esp + 0xc], str.size_increase__making_new_free_block_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
call fcn.66420390
jmp 0x664226c0
mov dword [esp + 0xc], str.fixing_handle_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
mov dword [ebp - 0x20], ecx
call fcn.66420390
mov ecx, dword [ebp - 0x20]
jmp 0x66422b71
test byte [0x664448d4], 2
jne 0x66422d0c
mov edx, dword [ebp - 0x2c]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [ebp - 0x1c], ecx
mov dword [esp + 8], edx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov ecx, dword [ebp - 0x1c]
sub esp, 0xc
jmp 0x664224e2
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.Clearing_memory_from__p_to__p__DS_____p__n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 0x18], eax
mov dword [esp + 4], 0x664448d4
mov dword [esp], 3
call fcn.66420390
jmp 0x66422737
mov dword [esp + 0xc], str.Cant_restore_saved_block_n
mov dword [esp + 8], str.LocalReAlloc16
mov dword [esp + 4], 0x664448d4
mov dword [esp], 1
mov dword [ebp - 0x1c], ecx
call fcn.66420390
mov ecx, dword [ebp - 0x1c]
jmp 0x66422ca2