Function at 0x589f60
Capabilities:
Check if file exists
Enumerate files on windows
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b29f6
mov eax, dword fs:[0]
push eax
sub esp, 0x338
mov eax, dword [0x616040]
xor eax, ebp
mov dword [ebp - 0x18], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x2fc], edx
mov eax, ecx
mov dword [ebp - 0x314], eax
mov dword [ebp - 0x320], eax
mov dword [ebp - 0x33c], 0
push 0x5e9af0
push str._Network
lea ecx, [ebp + 8]
mov dword [ebp - 4], 0
call fcn.00403990
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
lea eax, [ebp - 0x2f4]
push eax
push str.SOFTWARECanonScanGearDevices
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x2f4], 0
call esi
xor edi, edi
or ebx, 0xffffffff
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x30c]
mov dword [ebp - 0x30c], 0x40
push eax
lea eax, [ebp - 0x9c]
push eax
push edi
push dword [ebp - 0x2f4]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x58a1cc
mov dword [ebp - 0x2f0], eax
lea eax, [ebp - 0x2f0]
push eax
lea eax, [ebp - 0x9c]
push eax
push dword [ebp - 0x2f4]
call esi
call fcn.0041505f
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
je 0x58a1ea
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x2f8], eax
lea eax, [ebp - 0x2f8]
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x2f0]
mov edx, 0x5ecdbc
push eax
call fcn.0058b990
add esp, 4
push dword [ebp - 0x2f0]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp + 8]
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
je 0x58a1ea
mov esi, dword [ebp - 0x2f8]
mov ecx, esi
lea esp, [esp]
mov dx, word [ecx]
cmp dx, word [eax]
jne 0x58a0d6
test dx, dx
je 0x58a0d2
mov dx, word [ecx + 2]
cmp dx, word [eax + 2]
jne 0x58a0d6
add ecx, 4
add eax, 4
test dx, dx
jne 0x58a0b0
xor eax, eax
jmp 0x58a0db
sbb eax, eax
or eax, 1
test eax, eax
sete al
test al, al
jne 0x58a118
add esi, 0xfffffff0
mov byte [ebp - 4], al
mov ecx, ebx
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58a100
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
inc edi
cmp edi, 0x100
jb 0x589ff0
jmp 0x58a1cc
lea eax, [ebp - 0x9c]
push eax
lea ecx, [ebp - 0x300]
call fcn.00402f60
mov byte [ebp - 4], 2
mov ecx, dword [eax]
mov edi, dword [ebp + 8]
add edi, 0xfffffff0
lea edx, [ecx - 0x10]
cmp edx, edi
je 0x58a18c
cmp dword [edi + 0xc], 0
lea ebx, [edi + 0xc]
jl 0x58a17d
mov eax, dword [edx]
cmp eax, dword [edi]
jne 0x58a17d
push edx
call fcn.00403660
mov dword [ebp - 0x310], eax
add esp, 4
or eax, 0xffffffff
lock xadd dword [ebx], eax
dec eax
test eax, eax
jg 0x58a16f
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x310]
add eax, 0x10
mov dword [ebp + 8], eax
jmp 0x58a189
push dword [ecx - 0xc]
push ecx
lea ecx, [ebp + 8]
call fcn.004035a0
or ebx, 0xffffffff
mov byte [ebp - 4], 1
mov ecx, ebx
mov edx, dword [ebp - 0x300]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58a1af
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 0xfffffff0
mov byte [ebp - 4], 0
mov ecx, ebx
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58a1cc
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x2f4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call fcn.0041505f
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x58a1f4
push 0x80004005
call fcn.00402740
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x2f0], esi
mov byte [ebp - 4], 3
mov eax, dword [ebp + 8]
cmp dword [eax - 0xc], 0
jne 0x58a2c6
mov ecx, dword [esi - 0x10]
add esi, 0xfffffff0
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi + 0xc], 0
lea edx, [esi + 0xc]
mov ecx, eax
jl 0x58a23a
cmp ecx, dword [esi]
jne 0x58a23a
mov edi, esi
mov eax, 1
lock xadd dword [edx], eax
jmp 0x58a277
mov eax, dword [ecx]
push 2
push dword [esi + 4]
call dword [eax]
mov edi, eax
test edi, edi
jne 0x58a24e
call fcn.00402c80
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
mov ecx, dword [esi + 4]
lea eax, [ecx*2 + 2]
push eax
lea eax, [esi + 0x10]
push eax
lea eax, [ecx*2 + 2]
push eax
lea eax, [edi + 0x10]
push eax
call fcn.00528d25
add esp, 0x10
lea eax, [edi + 0x10]
mov byte [ebp - 4], 0
mov edi, dword [ebp - 0x314]
mov ecx, ebx
mov dword [edi], eax
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58a29c
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov esi, dword [ebp + 8]
add esi, 0xfffffff0
lea eax, [esi + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x58ab12
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
jmp 0x58ab12
mov dword [ebp - 0x308], 0
mov dword [ebp - 0x304], 0
mov byte [ebp - 4], 4
call fcn.0041505f
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x58a2fa
push 0x80004005
call fcn.00402740
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
mov dword [ebp - 0x334], eax
add eax, 0x10
mov dword [ebp - 0x340], eax
lea eax, [ebp - 0x308]
mov byte [ebp - 4], 5
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
push eax
push str.SOFTWARECanonScanGearDevices
push reloc.OLEAUT32.dll_SysReAllocString
call edi
test eax, eax
je 0x58a34c
push 0x60baf4
lea eax, [ebp - 0x328]
mov dword [ebp - 0x328], 0
push eax
call fcn.0052d7c1
lea eax, [ebp - 0x304]
push eax
push dword [ebp + 8]
push dword [ebp - 0x308]
call edi
test eax, eax
je 0x58a37d
push 0x60baf4
lea eax, [ebp - 0x324]
mov dword [ebp - 0x324], 0
push eax
call fcn.0052d7c1
call fcn.0041505f
xor ecx, ecx
mov edx, eax
cmp dword [ebp - 0x2fc], ecx
jne 0x58a490
test edx, edx
setne cl
test ecx, ecx
jne 0x58a3a5
push 0x80004005
call fcn.00402740
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x2f8], eax
lea eax, [ebp - 0x2f8]
mov byte [ebp - 4], 6
mov ecx, dword [ebp - 0x304]
mov edx, str.CaddisLLDPath
push eax
call fcn.0058b990
mov edi, dword [ebp - 0x2f8]
add esp, 4
cmp dword [edi - 0xc], 0
jne 0x58a3fa
push 0x60baf4
lea eax, [ebp - 0x338]
mov dword [ebp - 0x338], 0
push eax
call fcn.0052d7c1
lea edx, [ebp - 0x2f0]
mov ecx, 0x5e74b8
call fcn.005876a0
mov esi, dword [ebp - 0x2f0]
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a43a
push 0x104
lea ecx, [ebp - 0x2f0]
call fcn.00402c20
mov esi, dword [ebp - 0x2f0]
push edi
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [esi - 8]
jg 0x58a486
add edi, 0xfffffff0
mov dword [esi - 0xc], eax
xor ecx, ecx
mov byte [ebp - 4], 5
mov word [esi + eax*2], cx
mov ecx, ebx
lea eax, [edi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58aa41
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x58aa41
push 0x80070057
call fcn.00402740
test edx, edx
setne cl
test ecx, ecx
jne 0x58a4a3
push 0x80004005
call fcn.00402740
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x300], eax
lea eax, [ebp - 0x300]
mov byte [ebp - 4], 7
mov ecx, dword [ebp - 0x304]
mov edx, str.CaddisUIPath
push eax
call fcn.0058b990
mov ebx, dword [ebp - 0x300]
add esp, 4
cmp dword [ebx - 0xc], 0
jne 0x58a4f8
push 0x60baf4
lea eax, [ebp - 0x32c]
mov dword [ebp - 0x32c], 0
push eax
call fcn.0052d7c1
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a522
push 0x104
lea ecx, [ebp - 0x2f0]
call fcn.00402c20
mov esi, dword [ebp - 0x2f0]
call fcn.00416d27
push 0x104
push esi
push dword [eax + 8]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [esi - 8]
jg 0x58a486
mov dword [esi - 0xc], eax
xor ecx, ecx
mov word [esi + eax*2], cx
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a586
push 0x104
lea ecx, [ebp - 0x2f0]
call fcn.00402c20
mov esi, dword [ebp - 0x2f0]
push esi
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [esi - 8]
jg 0x58a486
mov dword [esi - 0xc], eax
xor ecx, ecx
mov word [esi + eax*2], cx
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a5dd
push 0x104
lea ecx, [ebp - 0x2f0]
call fcn.00402c20
mov esi, dword [ebp - 0x2f0]
push ebx
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [esi - 8]
jg 0x58a486
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
xor ecx, ecx
mov dword [esi - 0xc], eax
push esi
mov word [esi + eax*2], cx
call edi
test eax, eax
jne 0x58a6e6
lea edx, [ebp - 0x2f0]
mov ecx, 0x5e74d8
call fcn.005876a0
mov esi, dword [ebp - 0x2f0]
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a65c
push 0x104
lea ecx, [ebp - 0x2f0]
call fcn.00402c20
mov esi, dword [ebp - 0x2f0]
push str.CanonIJ_Scan_Utility
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [esi - 8]
jg 0x58a486
mov dword [esi - 0xc], eax
xor ecx, ecx
mov word [esi + eax*2], cx
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a6b8
push 0x104
lea ecx, [ebp - 0x2f0]
call fcn.00402c20
mov esi, dword [ebp - 0x2f0]
push ebx
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [esi - 8]
jg 0x58a486
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
push esi
call edi
test eax, eax
jne 0x58aa20
push 3
push 4
lea eax, [ebp - 0x2fc]
push eax
lea ecx, [ebp - 0x300]
call fcn.004056e0
push dword [eax]
call fcn.0052a76a
mov edi, dword [ebp - 0x2fc]
add esp, 4
add edi, 0xfffffff0
mov dword [ebp - 0x330], eax
or edx, 0xffffffff
lea ecx, [edi + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x58a737
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
call fcn.0041505f
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x58a753
push 0x80004005
call fcn.00402740
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x2f4], eax
lea edx, [ebp - 0x2f4]
mov byte [ebp - 4], 8
mov ecx, 0x5e74d8
call fcn.005876a0
mov edi, dword [ebp - 0x2f4]
mov ecx, 1
mov eax, dword [edi - 8]
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a7a7
push 0x104
lea ecx, [ebp - 0x2f4]
call fcn.00402c20
mov edi, dword [ebp - 0x2f4]
push str.CanonIJ_Scan_Utility
push edi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push dword [edi - 8]
push edi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [edi - 8]
jg 0x58a486
mov dword [edi - 0xc], eax
xor ecx, ecx
mov word [edi + eax*2], cx
mov ecx, 1
mov eax, dword [edi - 8]
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a803
push 0x104
lea ecx, [ebp - 0x2f4]
call fcn.00402c20
mov edi, dword [ebp - 0x2f4]
push str.CNUI.TBL
push edi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push 0x250
lea eax, [ebp - 0x2ec]
mov dword [ebp - 0x310], SysReAllocString
push 0
push eax
call fcn.0052d150
add esp, 0xc
lea eax, [ebp - 0x2ec]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [ebp - 0x30c], eax
cmp eax, 0xffffffff
je 0x58aa02
lea esp, [esp]
lea eax, [ebp - 0x2c0]
push eax
lea ecx, [ebp - 0x2f8]
call fcn.00402f60
push 3
push 4
lea eax, [ebp - 0x2fc]
mov byte [ebp - 4], 9
push eax
lea ecx, [ebp - 0x2f8]
call fcn.004056e0
push dword [eax]
call fcn.0052a76a
mov ecx, dword [ebp - 0x2fc]
add esp, 4
add ecx, 0xfffffff0
mov dword [ebp - 0x318], eax
mov dword [ebp - 0x31c], ecx
or edx, 0xffffffff
add ecx, 0xc
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x58a8be
mov edx, dword [ebp - 0x31c]
push edx
mov ecx, dword [edx]
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x318]
cmp dword [ebp - 0x330], eax
jge 0x58a9b7
cmp eax, dword [ebp - 0x310]
jge 0x58a9b7
lea edx, [ebp - 0x2f0]
mov dword [ebp - 0x310], eax
mov ecx, 0x5e74d8
call fcn.005876a0
mov esi, dword [ebp - 0x2f0]
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58a91c
push 0x104
lea ecx, [ebp - 0x2f0]
call fcn.00402c20
mov esi, dword [ebp - 0x2f0]
push str.CanonIJ_Scan_Utility
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [esi - 8]
jg 0x58a486
mov dword [esi - 0xc], eax
xor ecx, ecx
mov word [esi + eax*2], cx
mov ecx, 1
mov eax, dword [ebp - 0x2f8]
sub ecx, dword [esi - 4]
mov dword [ebp - 0x318], eax
mov eax, dword [esi - 8]
sub eax, 0x104
or eax, ecx
jge 0x58a984
push 0x104
lea ecx, [ebp - 0x2f0]
call fcn.00402c20
mov esi, dword [ebp - 0x2f0]
push dword [ebp - 0x318]
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58a486
cmp eax, dword [esi - 8]
jg 0x58a486
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
mov byte [ebp - 4], 8
or ecx, 0xffffffff
mov edx, dword [ebp - 0x2f8]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58a9db
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea eax, [ebp - 0x2ec]
push eax
push dword [ebp - 0x30c]
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x58a850
push dword [ebp - 0x30c]
call dword [sym.imp.KERNEL32.dll_FindClose]
add edi, 0xfffffff0
mov byte [ebp - 4], 7
or ecx, 0xffffffff
lea eax, [edi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58aa20
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
add ebx, 0xfffffff0
mov byte [ebp - 4], 5
or ecx, 0xffffffff
lea eax, [ebx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58aa3e
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
call dword [eax + 4]
or ebx, 0xffffffff
mov edx, dword [ebp - 0x334]
mov ecx, ebx
mov byte [ebp - 4], 4
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58aa61
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 3
jmp 0x58aa8c
mov eax, dword [ebp - 0x304]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
je 0x58aaa9
push eax
call edi
mov dword [ebp - 0x304], 0
mov eax, dword [ebp - 0x308]
test eax, eax
je 0x58aac0
push eax
call edi
mov dword [ebp - 0x308], 0
add esi, 0xfffffff0
push esi
call fcn.00403660
mov edi, dword [ebp - 0x314]
add eax, 0x10
add esp, 4
mov byte [ebp - 4], 0
mov ecx, ebx
mov dword [edi], eax
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58aaf1
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x58ab12
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.00527e5c
mov esp, ebp
pop ebp
ret