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

Disassembly:
push ebp
mov ebp, esp
push edi
xor edi, edi
push esi
push ebx
sub esp, 0x30
mov edx, dword [0x41d4b8]
test edx, edx
je 0x402150
lea esi, [esi]
lea eax, [ebp - 0x10]
mov dword [ebp - 0x18], 0xdeadbeef
xor ecx, ecx
mov edx, edi
mov dword [ebp - 0x10], 0xdeadbeef
mov ebx, dword fs:[0x18]
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 8], eax
lea eax, [ebp - 0x18]
mov dword [esp + 4], eax
xor eax, eax
mov dword [esp], 0
call fcn.00401030
mov esi, eax
lea eax, [edi - 1]
cmp eax, 1
ja 0x402028
call fcn.00406970
mov dword [eax], 0x40a123
mov ecx, dword [ebp - 0x18]
mov dword [eax + 4], 0x295
mov eax, dword [ebp - 0x10]
mov edx, dword [ebx + 0x34]
mov dword [ebp - 0x1c], eax
xor eax, eax
test esi, esi
jne 0x401d26
xor eax, eax
cmp edx, 0x7a
sete al
mov ebx, dword [ebp - 0x1c]
mov dword [esp + 0x14], ecx
mov dword [esp], eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], esi
mov dword [esp + 8], edi
mov dword [esp + 4], str.__ld__returned__ld_with__lu_and__ld___ld__expected_0_with_ERROR_INSUFFICIENT_BUFFER__n
mov ebx, dword fs:[0x18]
call fcn.00401a30
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], 0
add eax, eax
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x1c], eax
sub esp, 0xc
mov ecx, eax
test eax, eax
je 0x402169
lea eax, [ebp - 0x10]
mov dword [ebp - 0x14], 0xdeadbeef
mov edx, edi
mov dword [ebp - 0x10], 0xdeadbeef
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 8], eax
lea eax, [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
xor eax, eax
call fcn.00401030
mov esi, eax
call fcn.00406970
mov dword [eax], 0x40a123
mov dword [eax + 4], 0x2a1
mov eax, dword [ebp - 0x10]
mov dword [esp + 0x18], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x34]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], eax
mov dword [esp], esi
mov dword [esp + 8], edi
mov dword [esp + 4], str.__ld__returned__ld_with__lu_and__ld___ld__expected___0__n
call fcn.00401a30
lea eax, [ebp - 0x10]
mov edx, edi
mov dword [ebp - 0x14], 0xdeadbeef
mov dword [ebp - 0x10], 0xdeadbeef
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 8], eax
lea eax, [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [esp], eax
mov ecx, dword [ebp - 0x1c]
xor eax, eax
call fcn.00401030
mov esi, eax
call fcn.00406970
mov dword [eax], 0x40a123
mov dword [eax + 4], 0x2a9
mov eax, dword [ebp - 0x10]
mov dword [esp + 0x18], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x34]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], eax
mov dword [esp], esi
mov dword [esp + 8], edi
mov dword [esp + 4], str.__ld__returned__ld_with__lu_and__ld___ld__expected___0__n
call fcn.00401a30
lea eax, [ebp - 0x10]
mov edx, edi
mov dword [ebp - 0x14], 0xdeadbeef
mov dword [ebp - 0x10], 0xdeadbeef
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 8], eax
lea eax, [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
sub eax, 1
mov dword [esp], eax
mov ecx, dword [ebp - 0x1c]
xor eax, eax
call fcn.00401030
mov esi, eax
call fcn.00406970
mov dword [eax], 0x40a123
mov ecx, dword [ebp - 0x14]
mov dword [eax + 4], 0x2b0
mov eax, dword [ebp - 0x10]
mov edx, dword [ebx + 0x34]
mov dword [ebp - 0x20], eax
xor eax, eax
test esi, esi
jne 0x401ed6
xor eax, eax
cmp edx, 0x7a
sete al
mov ebx, dword [ebp - 0x20]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], ebx
mov dword [esp + 0xc], esi
mov dword [esp + 8], edi
mov dword [esp], eax
mov dword [esp + 4], str.__ld__returned__ld_with__lu_and__ld___ld__expected_0_with_ERROR_INSUFFICIENT_BUFFER__n
mov ebx, dword fs:[0x18]
call fcn.00401a30
lea eax, [ebp - 0x10]
mov edx, edi
mov dword [ebp - 0x14], 0xdeadbeef
mov dword [ebp - 0x10], 0xdeadbeef
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 8], eax
lea eax, [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [esp], eax
mov ecx, dword [ebp - 0x1c]
mov eax, 0x41d468
call fcn.00401030
mov esi, eax
call fcn.00406970
mov dword [eax], 0x40a123
mov dword [eax + 4], 0x2c2
mov eax, dword [ebp - 0x10]
mov dword [esp + 0x18], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x34]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], eax
mov dword [esp + 8], edi
mov dword [esp], esi
lea esi, [ebp - 0x10]
mov dword [esp + 4], str.__ld__returned__ld_with__lu_and__ld___ld__expected___0__n
call fcn.00401a30
mov dword [ebp - 0x14], 0xdeadbeef
mov dword [ebp - 0x10], 0xdeadbeef
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 8], esi
lea esi, [ebp - 0x14]
mov dword [esp + 4], esi
mov edx, dword [ebp - 0x18]
lea eax, [edx + 1]
mov edx, edi
mov dword [esp], eax
mov ecx, dword [ebp - 0x1c]
mov eax, 0x408040
call fcn.00401030
mov esi, eax
call fcn.00406970
mov dword [eax], 0x40a123
mov dword [eax + 4], 0x2c9
mov eax, dword [ebp - 0x10]
mov dword [esp + 0x18], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x34]
mov dword [esp + 8], edi
add edi, 1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], esi
mov dword [esp + 4], str.__ld__returned__ld_with__lu_and__ld___ld__expected___0__n
mov dword [esp], esi
call fcn.00401a30
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x401cb0
mov ecx, dword [0x41d510]
mov dword [ebp - 0x1c], ecx
call fcn.00406970
mov ecx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
lea edx, [ecx + ecx]
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
setne cl
movzx ecx, cl
or edx, ecx
mov dword [eax + 0x10], edx
jmp 0x40209e
call fcn.00406970
mov dword [eax], 0x40a123
mov dword [eax + 4], 0x28e
mov eax, 1
test esi, esi
je 0x402082
mov eax, dword [ebx + 0x34]
or eax, dword [0x41d510]
sete al
movzx eax, al
mov dword [esp], eax
mov dword [esp + 8], edi
mov dword [esp + 4], str.EnumPorts_succeeded_with_level__ld_n
call fcn.00401a30
call fcn.00406970
shr dword [eax + 0x10], 1
call fcn.00406970
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x402058
mov ebx, dword [0x41d510]
call fcn.00406970
mov ecx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
lea edx, [ecx + ecx]
xor ecx, ecx
test ebx, ebx
setne cl
or edx, ecx
mov dword [eax + 0x10], edx
mov ebx, dword fs:[0x18]
jmp 0x40212f
call fcn.00406970
mov dword [eax], 0x40a123
mov dword [eax + 4], 0x290
mov edx, dword [ebx + 0x34]
mov eax, 1
cmp edx, 0x7c
je 0x402113
xor eax, eax
test esi, esi
je 0x402113
mov eax, edx
or eax, dword [0x41d510]
sete al
movzx eax, al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.GetLastError_____ld_n
call fcn.00401a30
call fcn.00406970
shr dword [eax + 0x10], 1
call fcn.00406970
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x4020e0
cmp edi, 3
jne 0x40215f
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [0x41d4b4]
test eax, eax
jne 0x401cb0
jmp 0x402147
mov edi, 1
jmp 0x401cb0
add edi, 1
jmp 0x401cb0