Function at 0x413640
Capabilities:
Access peb ldr_data
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x419ffc
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x240
mov eax, dword [0x422538]
push ebx
push esi
mov dword [esp + 0x240], eax
mov eax, dword [0x4776f8]
xor esi, esi
push edi
mov ecx, 0x4776f8
mov dword [esp + 0x14], esi
mov dword [esp + 0x28], 1
call dword [eax + 0xc]
lea ebx, [eax + 0x10]
mov dword [esp + 0x2c], ebx
mov edx, dword [0x4776f8]
mov ecx, 0x4776f8
mov dword [esp + 0x254], esi
call dword [edx + 0xc]
lea esi, [eax + 0x10]
mov dword [esp + 0xc], esi
push str.HARDWAREDEVICEMAPSERIALCOMM_
lea ecx, [esp + 0x14]
mov byte [esp + 0x258], 1
call fcn.00406d10
mov edx, dword [esp + 0x10]
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x30]
rep stosd dword es:[edi], eax
mov ecx, 0x41
lea edi, [esp + 0x138]
rep stosd dword es:[edi], eax
mov eax, dword [edx - 4]
mov ecx, 1
sub ecx, eax
mov eax, dword [edx - 8]
sub eax, 0x400
or eax, ecx
mov byte [esp + 0x254], 2
jge 0x413713
push 0x400
lea ecx, [esp + 0x14]
call fcn.00401650
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x1c]
push eax
push 0x20019
push 0
push edx
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x41378a
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
mov byte [esp + 0x254], 1
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x413760
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
lea eax, [esi - 0x10]
mov byte [esp + 0x254], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x413782
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
lea eax, [ebx - 0x10]
jmp 0x4139e1
mov eax, dword [0x4776f8]
mov ecx, 0x4776f8
call dword [eax + 0xc]
lea ebx, [eax + 0x10]
mov dword [esp + 0x18], ebx
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x30]
push eax
mov eax, dword [esp + 0x28]
push 0
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x14c]
push edx
push 0
mov esi, 0x104
push eax
mov byte [esp + 0x274], 3
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], esi
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
cmp eax, 0x103
je 0x413961
lea esp, [esp]
lea ecx, [esp + 0x138]
push ecx
lea edx, [esp + 0x1c]
push 0x41cb08
push edx
call fcn.004019e0
mov ebx, dword [esp + 0x24]
mov eax, dword [ebx - 4]
mov edi, dword [ebx - 0xc]
mov ecx, 1
sub ecx, eax
mov eax, dword [ebx - 8]
sub eax, edi
add esp, 0xc
or eax, ecx
jge 0x413832
push edi
lea ecx, [esp + 0x1c]
call fcn.00401650
mov ebx, dword [esp + 0x18]
push ebx
call dword [sym.imp.MSLUR71.dll__mbsupr]
add esp, 4
test edi, edi
jl 0x413a26
cmp edi, dword [ebx - 8]
jg 0x413a26
mov dword [ebx - 0xc], edi
mov byte [edi + ebx], 0
mov eax, dword [ebx - 0xc]
test eax, eax
jl 0x413879
push str.PORTE
push ebx
call dword [sym.imp.MSLUR71.dll__mbsstr]
add esp, 8
test eax, eax
je 0x413879
sub eax, ebx
cmp eax, 0xffffffff
jne 0x41391c
lea eax, [esp + 0x30]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x413880
sub eax, edx
push eax
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x14]
call fcn.00404d10
mov esi, dword [esp + 0xc]
mov eax, dword [esi - 4]
mov edi, dword [esi - 0xc]
mov ecx, 1
sub ecx, eax
mov eax, dword [esi - 8]
sub eax, edi
or eax, ecx
jge 0x4138c0
push edi
lea ecx, [esp + 0x10]
call fcn.00401650
mov esi, dword [esp + 0xc]
push esi
call dword [sym.imp.MSLUR71.dll__mbsupr]
add esp, 4
test edi, edi
jl 0x413a26
cmp edi, dword [esi - 8]
jg 0x413a26
push 0x41d26a
mov dword [esi - 0xc], edi
push 0x41d8f4
lea ecx, [esp + 0x14]
mov byte [edi + esi], 0
call fcn.0040edc0
mov ecx, dword [esp + 0xc]
push ecx
call dword [sym.imp.MSLUR71.dll_atoi]
mov ecx, dword [0x427cc8]
add esp, 4
mov dword [ecx*4 + 0x427cd0], eax
inc ecx
mov dword [0x427cc8], ecx
mov esi, 0x104
inc dword [esp + 0x14]
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x20]
push 0
lea edx, [esp + 0x34]
push edx
mov edx, dword [esp + 0x30]
lea eax, [esp + 0x14c]
push eax
push ecx
push edx
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], esi
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
cmp eax, 0x103
jne 0x4137f0
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
add ebx, 0xfffffff0
mov byte [esp + 0x254], 2
lea ecx, [ebx + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41398e
mov ecx, dword [ebx]
mov eax, dword [ecx]
push ebx
call dword [eax + 4]
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
mov byte [esp + 0x254], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4139b4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, dword [esp + 0xc]
add eax, 0xfffffff0
mov byte [esp + 0x254], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4139da
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
mov dword [esp + 0x254], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x413a03
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov ecx, dword [esp + 0x24c]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x244]
xor eax, eax
call fcn.0041937d
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.00401100
int3