Function at 0x402120
Capabilities:
Access peb ldr_data
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, 0x38
mov eax, dword [ecx + 8]
mov ebx, dword [ecx + 4]
mov esi, dword [ecx + 0x10]
mov dword [ebp - 0x1c], eax
mov eax, dword [ecx + 0xc]
mov dword [ebp - 0x20], eax
test byte [global___dbch.0], 8
jne 0x4022b0
mov dword [esp], 0x4090a0
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [0x4090b8]
sub esp, 4
jmp 0x40217b
mov edx, dword [eax + 0x14]
mov edi, eax
mov eax, dword [eax]
cmp edx, ebx
je 0x4021a8
cmp eax, 0x4090b8
jne 0x402170
mov dword [esp], 0x4090a0
mov esi, 0x80070057
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov eax, esi
sub esp, 4
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov edx, dword [edi + 4]
mov dword [eax + 4], edx
mov eax, dword [edi]
mov dword [edx], eax
mov dword [esp], 0x4090a0
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov eax, dword [edi + 8]
mov edx, dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 4
mov eax, dword [eax]
mov dword [esp + 4], 0
mov ecx, dword fs:[0x18]
add eax, 4
mov dword [esp + 8], eax
mov eax, dword [ecx + 0x30]
mov dword [ebp - 0x28], ecx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov dword [ebp - 0x24], edx
call edx
mov ebx, dword [ebp - 0x20]
sub esp, 0xc
mov dword [ebx], eax
mov eax, dword [edi + 0xc]
mov eax, dword [eax]
mov dword [esp + 4], 0
add eax, 4
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov edx, dword [ebp - 0x24]
call edx
mov dword [esi], eax
sub esp, 0xc
mov edx, dword [ebx]
test eax, eax
je 0x4022e0
test edx, edx
je 0x4022e0
mov eax, dword [edi + 8]
mov eax, dword [eax]
mov dword [edx], eax
mov edx, dword [ebx]
mov eax, dword [edi + 8]
lea ecx, [edx + 4]
mov edx, dword [edx]
add eax, 4
mov dword [esp], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
call sym._memcpy
mov edx, dword [edi + 0xc]
mov eax, dword [esi]
mov edx, dword [edx]
mov dword [eax], edx
mov edx, dword [esi]
xor esi, esi
mov eax, dword [edi + 0xc]
lea ecx, [edx + 4]
mov edx, dword [edx]
add eax, 4
mov dword [esp], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
call sym._memcpy
lock sub dword [edi + 0x20], 1
je 0x402338
mov eax, dword [ebp - 0x1c]
mov dword [eax], 0
lea esp, [ebp - 0x10]
mov eax, esi
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str._ld_n
mov dword [esp + 8], global___FUNCTION__.2
mov dword [esp + 4], global___dbch.0
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x402153
mov dword [esp + 8], edx
mov edx, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [esp + 4], 0
mov ebx, dword fs:[0x18]
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov dword [ebp - 0x20], edx
call edx
mov eax, dword [esi]
mov esi, 0x8007000e
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov edx, dword [ebp - 0x20]
call edx
sub esp, 0xc
jmp 0x402284
mov eax, dword [edi + 8]
mov dword [esp + 4], 0
mov ebx, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x20], eax
call eax
mov eax, dword [edi + 0xc]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x20]
call eax
mov eax, dword [edi + 0x10]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x20]
call eax
sub esp, 0xc
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x20]
call eax
sub esp, 0xc
jmp 0x40228f