Function at 0x401740
Capabilities:
Query or enumerate registry key
Query or enumerate registry value
Set registry value

Disassembly:
mov eax, 0x1124
call fcn.00401dc0
push ebx
push ebp
push esi
push edi
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0xd34]
xor ebp, ebp
rep stosd dword es:[edi], eax
mov ecx, 0x100
lea edi, [esp + 0x134]
rep stosd dword es:[edi], eax
mov ecx, 0x100
lea edi, [esp + 0x534]
rep stosd dword es:[edi], eax
mov ecx, 0x100
lea edi, [esp + 0x934]
rep stosd dword es:[edi], eax
mov ecx, 0x3f
lea edi, [esp + 0x34]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, str.SYSTEMCurrentControlSetEnumUSB_
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x134]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x18], 0xff
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x934]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
mov dword [esp + 0x14], ebp
rep movsb byte es:[edi], byte [esi]
mov edi, str.MACHINESYSTEMCurrentControlSetEnumUSB_
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x28], ebp
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x14]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [esp + 0x934]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
push ecx
push ebp
push edx
push ebp
push ebp
push 4
push 4
push eax
call dword [sym.imp.ADVAPI32.dll_GetNamedSecurityInfoA]
test eax, eax
jne 0x401881
mov edx, dword [esp + 0x14]
xor ecx, ecx
cmp word [edx + 4], bp
lea eax, [edx + 8]
jbe 0x40184f
mov bl, 2
xor edx, edx
mov byte [eax + 1], bl
mov dx, word [eax + 2]
mov dword [eax + 4], 0xf003f
add eax, edx
mov edx, dword [esp + 0x14]
xor esi, esi
inc ecx
mov si, word [edx + 4]
cmp ecx, esi
jl 0x40182e
push ebp
push edx
push ebp
push ebp
push 4
lea eax, [esp + 0x948]
push 4
push eax
call dword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoA]
mov eax, dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
cmp eax, ebp
je 0x401876
push eax
call esi
mov eax, dword [esp + 0x14]
cmp eax, ebp
je 0x401881
push eax
call esi
mov eax, dword [0x407f98]
mov dword [esp + 0x24], ebp
cmp eax, ebp
jle 0x401b4f
mov dword [esp + 0x20], 0x4079fc
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x134]
lea edx, [esp + 0x134]
rep stosd dword es:[edi], eax
mov edi, str.SYSTEMCurrentControlSetEnumUSB_
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x134]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x20]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x1c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [0x407f90]
lea edx, [esp + 0x138]
or ecx, 0x20019
push ecx
push 0
push edx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x401b1e
xor ebp, ebp
lea ecx, [esp + 0x2c]
push 0
push ecx
push 0
lea edx, [esp + 0x3c]
push 0
lea ecx, [esp + 0xd44]
mov eax, ebp
push edx
mov edx, dword [esp + 0x30]
push ecx
mov ebx, 0xff
push eax
push edx
mov dword [esp + 0x50], 0x100
mov byte [esp + 0xd54], 0
mov dword [esp + 0x38], ebx
mov dword [esp + 0x4c], 0x400
inc ebp
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
cmp eax, 0x103
je 0x401b0f
test eax, eax
jne 0x401b04
or ecx, 0xffffffff
lea edi, [esp + 0x134]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x34], al
mov eax, ecx
lea edx, [esp + 0x534]
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
lea edx, [esp + 0x534]
rep movsb byte es:[edi], byte [esi]
mov edi, 0x407118
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x534]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0xd34]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x10]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [0x407f90]
lea edx, [esp + 0x538]
or ecx, 0xf003f
push ecx
push 0
push edx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x401af5
mov edx, dword [esp + 0x10]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea eax, [esp + 0x18]
lea ecx, [esp + 0x34]
push eax
push ecx
push 0
push 0
push str.Class
push edx
call esi
test eax, eax
jne 0x401af5
lea eax, [esp + 0x34]
push str.Image
push eax
call fcn.00401d30
add esp, 8
test eax, eax
jne 0x401af5
mov ecx, 0x3f
lea edi, [esp + 0x34]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x18]
lea edx, [esp + 0x34]
push ecx
push edx
stosb byte es:[edi], al
mov eax, dword [esp + 0x18]
push 0
push 0
push str.CompatibleIDs
push eax
mov dword [esp + 0x30], ebx
call esi
test eax, eax
jne 0x401af5
mov ecx, 0x12
mov edi, str.USBClass_0eSubClass_03Prot_00
lea esi, [esp + 0x34]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
je 0x401aeb
mov eax, dword [esp + 0x10]
push 0x48
push str.USBClass_0eSubClass_03Prot_00
push 7
push edx
push str.CompatibleIDs
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
jne 0x401af5
mov dword [0x4079f4], 1
mov eax, dword [esp + 0x10]
test eax, eax
je 0x401b04
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp ebp, 0xa
jl 0x401932
jmp 0x401b1e
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x401b2d
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x401b2d
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
mov ecx, dword [0x407f98]
inc eax
add edx, 0x20
cmp eax, ecx
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], edx
jl 0x40189a
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1124
ret