Function at 0x407960
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x54f84b
mov eax, dword fs:[0]
push eax
sub esp, 0x88
mov eax, dword [0x5a5784]
xor eax, esp
mov dword [esp + 0x80], eax
push ebx
push esi
push edi
mov eax, dword [0x5a5784]
xor eax, esp
push eax
lea eax, [esp + 0x98]
mov dword fs:[0], eax
mov esi, ecx
push str._SEARCH_CDeviceSearchOperation::ReadSetting__._n
push 0x40000
mov dword [esp + 0x40], esi
call fcn.0041abf0
xor edi, edi
add esp, 8
mov dword [esp + 0x18], edi
call fcn.00431a74
xor ecx, ecx
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x4079d8
push 0x80004005
call fcn.00401cd0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x24], eax
push str.255.255.255.255
lea ecx, [esp + 0x18]
mov dword [esp + 0xa4], edi
mov dword [esp + 0x20], edi
call fcn.00401e60
add esi, 0x50
lea ecx, [esp + 0x14]
mov byte [esp + 0xa0], 1
call fcn.00404590
mov byte [esp + 0xa0], 0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407a3d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x28]
push ecx
push 1
push edi
push str.SOFTWAREBrotherDevConnectSNMP
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
cmp eax, edi
jne 0x407b91
lea edx, [esp + 0x20]
push edx
mov edx, dword [esp + 0x2c]
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x1c]
push ecx
push edi
push str.AddBroadCastIPNum
mov ebx, 4
push edx
mov dword [esp + 0x48], edi
mov dword [esp + 0x38], ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
cmp eax, edi
jne 0x407aad
cmp dword [esp + 0x14], ebx
jne 0x407aad
mov eax, dword [esp + 0x30]
cmp eax, edi
jbe 0x407aad
mov dword [esp + 0x18], 5
cmp eax, 5
ja 0x407aad
mov dword [esp + 0x18], eax
xor ebx, ebx
cmp dword [esp + 0x18], edi
jle 0x407b91
lea esp, [esp]
push ebx
lea eax, [esp + 0x28]
push str.AddBroadCastIP_d
push eax
mov dword [esp + 0x2c], 0x28
call fcn.0040b630
add esp, 0xc
lea ecx, [esp + 0x20]
push ecx
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x6c]
push edx
mov edx, dword [esp + 0x30]
lea eax, [esp + 0x1c]
push eax
push edi
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
cmp eax, edi
jne 0x407b86
cmp dword [esp + 0x14], 1
jne 0x407b86
lea eax, [esp + 0x68]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x407b11
sub eax, edx
sar eax, 1
je 0x407b86
push ecx
lea eax, [esp + 0x6c]
mov ecx, esp
mov dword [esp + 0x30], esp
push eax
call fcn.00401e60
call fcn.0041b090
add esp, 4
test al, al
je 0x407b86
lea ecx, [esp + 0x68]
push ecx
lea ecx, [esp + 0x38]
call fcn.00401e60
lea ecx, [esp + 0x34]
mov byte [esp + 0xa0], 2
call fcn.00404590
mov byte [esp + 0xa0], 0
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x407b86
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
inc ebx
cmp ebx, dword [esp + 0x18]
jl 0x407ac0
lea ecx, [esp + 0x4c]
call fcn.00433c65
mov byte [esp + 0xa0], 3
call fcn.00431a74
xor ecx, ecx
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x407bbc
push 0x80004005
call fcn.00401cd0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x64], eax
push 0x4000
push ecx
mov ecx, esp
mov dword [esp + 0x34], esp
push str.agentoid.dat
mov byte [esp + 0xac], 4
call fcn.00401e60
lea ecx, [esp + 0x54]
push ecx
call fcn.0040b680
cmp eax, edi
jne 0x407c82
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], edi
lea edx, [esp + 0x3c]
push edx
lea eax, [esp + 0x50]
push eax
mov byte [esp + 0xa8], 5
call fcn.0040ba20
test eax, eax
jne 0x407c35
lea ecx, [esp + 0x3c]
push ecx
mov ecx, dword [esp + 0x3c]
call fcn.004089d0
test eax, eax
jne 0x407c3d
mov dword [esp + 0x1c], 0xca
push str.CFileWrapper::FileClose__._n
push 0x80000
call fcn.0041abf0
add esp, 8
cmp dword [esp + 0x60], edi
je 0x407c6b
mov edx, dword [esp + 0x4c]
mov eax, dword [edx + 0x50]
lea ecx, [esp + 0x4c]
call eax
lea ecx, [esp + 0x64]
call fcn.00401ac0
lea ebx, [esp + 0x3c]
mov byte [esp + 0xa0], 4
call fcn.00402d80
mov esi, dword [esp + 0x1c]
jmp 0x407c87
mov esi, 0xc9
push esi
push str._SEARCH_CDeviceSearchOperation::ReadSetting___end._return_value:__d._n
push 0x80000
call fcn.0041abf0
add esp, 0xc
mov byte [esp + 0xa0], 6
mov eax, dword [esp + 0x64]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407cc2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x4c]
mov byte [esp + 0xa0], 0
call fcn.00433f44
mov dword [esp + 0xa0], 0xffffffff
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407cfe
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x98]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x80]
xor ecx, esp
call fcn.0052442d
mov esp, ebp
pop ebp
ret