Function at 0x402180
Capabilities:
Get process heap flags

Disassembly:
xor eax, eax
mov word [0x41d028], ax
xor eax, eax
mov word [0x41d014], ax
xor eax, eax
mov word [0x41d000], ax
mov eax, dword [0x41d4b8]
test eax, eax
je 0x402338
push ebp
xor ecx, ecx
mov edx, 1
xor eax, eax
mov ebp, esp
push edi
xor edi, edi
push esi
lea esi, [ebp - 0x24]
push ebx
lea ebx, [ebp - 0x28]
sub esp, 0x2c
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], 0
call fcn.00401030
test eax, eax
je 0x402300
mov dword [esp + 8], esi
mov ecx, edi
mov edx, 1
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
xor eax, eax
call fcn.00401030
test eax, eax
je 0x4023e5
mov edx, dword [ebp - 0x24]
xor ebx, ebx
test edx, edx
je 0x402248
lea esi, [esi]
nop
mov edx, dword [edi + ebx*4]
cmp word [edx], 0
mov eax, edx
je 0x402240
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x402220
mov esi, eax
sub esi, edx
mov ecx, esi
sar ecx, 1
sub ecx, 5
cmp ecx, 4
ja 0x402240
cmp word [eax - 2], 0x3a
je 0x402278
add ebx, 1
cmp ebx, dword [ebp - 0x24]
jb 0x402210
mov dword [esp + 8], edi
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]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [edx]
mov dword [ebp - 0x20], eax
movzx eax, word [edx + 4]
mov word [ebp - 0x1c], ax
xor eax, eax
cmp word [0x41d028], 0
mov word [ebp - 0x1a], ax
je 0x402347
cmp word [0x41d014], 0
je 0x402396
cmp word [0x41d000], 0
jne 0x402240
mov dword [esp + 4], 0x40807c
mov eax, dword [edi + ebx*4]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_lstrcmpiW]
sub esp, 8
test eax, eax
jne 0x402240
mov edx, dword [edi + ebx*4]
lea eax, [esi + 1]
and eax, 0xfffffffc
mov ecx, dword [edx + esi - 2]
mov dword [esi + 0x41cffe], ecx
xor ecx, ecx
mov esi, dword [edx + ecx]
add ecx, 4
mov dword [ecx + 0x41cffc], esi
cmp ecx, eax
jb 0x4022e5
jmp 0x402240
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x7a
jne 0x4021db
mov edx, dword [ebp - 0x28]
mov dword [esp + 4], 0
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 edi, eax
jmp 0x4021db
mov ecx, dword [0x41d4b4]
test ecx, ecx
jne 0x4021a5
ret
lea eax, [ebp - 0x20]
mov dword [esp + 4], 0x40af1c
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_lstrcmpiW]
sub esp, 8
test eax, eax
jne 0x402299
mov ecx, dword [edi + ebx*4]
xor eax, eax
mov edx, dword [ecx + esi - 2]
mov dword [esi + 0x41d026], edx
lea edx, [esi + 1]
mov dword [ebp - 0x2c], ebx
and edx, 0xfffffffc
mov ebx, dword [ecx + eax]
add eax, 4
mov dword [eax + 0x41d024], ebx
cmp eax, edx
jb 0x40237e
mov ebx, dword [ebp - 0x2c]
jmp 0x402299
lea eax, [ebp - 0x20]
mov dword [esp + 4], 0x40af14
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_lstrcmpiW]
sub esp, 8
test eax, eax
jne 0x4022a7
mov ecx, dword [edi + ebx*4]
xor eax, eax
mov edx, dword [ecx + esi - 2]
mov dword [esi + 0x41d012], edx
lea edx, [esi + 1]
mov dword [ebp - 0x2c], ebx
and edx, 0xfffffffc
mov ebx, dword [ecx + eax]
add eax, 4
mov dword [eax + 0x41d010], ebx
cmp eax, edx
jb 0x4023cd
mov ebx, dword [ebp - 0x2c]
jmp 0x4022a7
call fcn.00406970
mov dword [eax], 0x40a123
mov dword [eax + 4], 0x120
mov dword [esp], str.no_ports_found_n
call fcn.00401480
jmp 0x402248