Function at 0x401350
Capabilities:
Access peb ldr_data
Get kernel32 base address
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 0x10]
mov edi, dword [ebp + 8]
cmp word [eax], 0
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], esi
je 0x4015e0
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x401378
sub eax, dword [ebp - 0x30]
mov ecx, eax
mov dword [ebp - 0x38], eax
sar ecx, 1
setne al
mov esi, eax
mov eax, dword [ebp - 0x2c]
cmp word [eax], 0
je 0x401600
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x4013a0
sub eax, dword [ebp - 0x2c]
mov ebx, eax
mov dword [ebp - 0x3c], eax
sar ebx, 1
cmp word [edi], 0
je 0x401618
mov eax, edi
nop
add eax, 2
cmp word [eax], 0
jne 0x4013c0
sub eax, edi
mov edx, eax
add eax, 2
sar edx, 1
mov dword [ebp - 0x24], eax
add edx, 1
mov dword [ebp - 0x1c], edx
sub ebx, ecx
mov dword [ebp - 0x34], ebx
je 0x401540
mov eax, esi
test al, al
je 0x401540
mov ecx, dword [ebp - 0x24]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
lea edx, [ecx + 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_HeapAlloc]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x4015bc
mov eax, dword fs:[0x18]
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x40], eax
jmp 0x4014be
mov ecx, dword [ebp - 0x34]
add dword [ebp - 0x1c], ecx
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x24], eax
jae 0x401484
shl eax, 2
mov dword [esp + 4], 0
mov dword [esp + 0xc], eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x40]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
sub esp, 0x10
test eax, eax
je 0x401588
sub ebx, dword [ebp - 0x28]
mov dword [ebp - 0x28], eax
add ebx, eax
mov edx, esi
mov dword [esp + 4], edi
sub edx, edi
mov dword [esp], ebx
mov dword [esp + 8], edx
mov dword [ebp - 0x20], edx
call sym._memcpy
mov edx, dword [ebp - 0x20]
mov edi, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x2c]
add ebx, edx
mov dword [esp + 8], edi
mov dword [esp], ebx
add ebx, edi
mov dword [esp + 4], eax
call sym._memcpy
mov eax, dword [ebp - 0x38]
lea edi, [esi + eax]
mov eax, dword [ebp - 0x30]
mov dword [esp], edi
mov dword [esp + 4], eax
call dword [sym.imp.ucrtbase.dll_wcsstr]
mov esi, eax
test eax, eax
jne 0x401438
mov esi, dword [ebp - 0x1c]
mov edx, ebx
sub edx, dword [ebp - 0x28]
mov dword [esp + 4], edi
sar edx, 1
mov dword [esp], ebx
mov eax, esi
sub eax, edx
add eax, eax
mov dword [esp + 8], eax
call sym._memcpy
mov eax, esi
mov esi, dword [ebp - 0x28]
mov dword [esp + 4], 0
add eax, eax
mov edx, dword fs:[0x18]
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
sub esp, 0x10
mov edx, eax
test eax, eax
cmove edx, esi
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [ebp - 0x24]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], esi
mov eax, dword [eax + 0x30]
mov dword [ebp - 0x20], ecx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x4015bc
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x4015c8
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], eax
jmp 0x401424
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x40]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov edx, dword [ebp - 0x1c]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
mov eax, edx
pop esi
pop edi
pop ebp
ret
xor edx, edx
jmp 0x40152f
mov dword [ebp + 0x10], esi
mov dword [ebp + 0xc], edi
mov dword [ebp + 8], eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
jmp sym._memcpy
mov eax, dword [ebp - 0x2c]
xor esi, esi
xor ecx, ecx
mov dword [ebp - 0x38], 0
cmp word [eax], 0
jne 0x4013a0
lea esi, [esi]
nop
xor ebx, ebx
cmp word [edi], 0
mov dword [ebp - 0x3c], 0
jne 0x4013bd
lea esi, [esi]
nop
mov dword [ebp - 0x24], 2
mov dword [ebp - 0x1c], 1
jmp 0x4013db