Function at 0x406520
Capabilities:
Check if process is running under wine
Get disk information
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x47c
mov dword [ebp - 0x420], 0x3a0041
mov dword [ebp - 0x41c], 0x5c
call fcn.00405de0
mov dword [ebp - 0x444], eax
cmp eax, 0xffffffff
je 0x406bd2
movzx ebx, word [ebp - 0x420]
cmp bx, 0x5a
ja 0x406761
lea eax, [ebp - 0x418]
mov esi, 0x400
shr eax, 0x10
mov dword [ebp - 0x450], eax
lea eax, [ebp - 0x3ec]
shr eax, 0x10
mov dword [ebp - 0x44c], eax
lea esi, [esi]
nop
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_malloc]
mov edi, eax
test eax, eax
je 0x406761
xor ecx, ecx
xor eax, eax
mov dword [ebp + eax - 0x410], ecx
add eax, 4
cmp eax, 0x20
jb 0x4065a7
lea eax, [ebp - 0x410]
mov word [ebp - 0x3f8], bx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x444]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0x20
mov dword [esp + 4], 0x6d4084
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_DeviceIoControl]
sub esp, 0x20
test eax, eax
je 0x4067a0
movzx eax, word [edi + 0x1a]
xor ecx, ecx
mov ebx, eax
add eax, edi
test bx, bx
cmove eax, ecx
mov dword [ebp - 0x43c], eax
movzx eax, word [edi + 0x1c]
mov dword [esp + 0x1c], 0
mov ebx, eax
add eax, edi
mov dword [esp + 0x18], 0
test bx, bx
lea ebx, [ebp - 0x220]
mov dword [esp + 0x14], 0
cmovne ecx, eax
lea eax, [ebp - 0x42c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x420]
mov dword [ebp - 0x440], ecx
mov dword [esp + 8], 0x104
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetVolumeInformationW]
sub esp, 0x20
test eax, eax
jne 0x406698
mov dword [ebp - 0x42c], 0
xor ecx, ecx
mov word [ebp - 0x220], cx
mov edx, dword [ebp - 0x43c]
test edx, edx
je 0x40673d
movsx eax, byte [ebp - 0x420]
mov dword [esp + 8], 0x41815c
mov dword [esp + 4], 4
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x418]
mov dword [esp], eax
call fcn.00405ce0
lea eax, [ebp - 0x428]
mov dword [esp + 4], str.SoftwareWineDrives
mov dword [esp + 8], eax
mov dword [esp], reloc.uxtheme.dll_Ordinal_2
call dword [sym.imp.advapi32.dll_RegOpenKeyW]
sub esp, 0xc
test eax, eax
je 0x4067d0
xor ecx, ecx
test byte [0x414240], 8
jne 0x406880
mov eax, dword [ebp - 0x42c]
mov dword [esp + 0x14], ecx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x440]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x43c]
mov dword [esp + 4], eax
movsx eax, byte [ebp - 0x420]
mov dword [esp], eax
call fcn.00406320
movzx eax, word [ebp - 0x420]
lea ebx, [eax + 1]
mov word [ebp - 0x420], bx
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_free]
cmp bx, 0x5a
jbe 0x406590
mov eax, 0x42503c
lea esi, [esi]
lea esi, [esi]
mov dword [eax], 0
add eax, 0x20
cmp eax, 0x42537c
jne 0x406770
mov eax, dword [ebp - 0x444]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, 1
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0xea
movzx ebx, word [ebp - 0x420]
je 0x4067c8
add ebx, 1
mov word [ebp - 0x420], bx
jmp 0x40674e
mov esi, dword [edi]
jmp 0x40674e
lea eax, [ebp - 0x424]
mov dword [esp + 0xc], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x3ec]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x418]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x428]
mov dword [ebp - 0x424], 0xa0
mov dword [esp + 8], 0
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegQueryValueExW]
sub esp, 0x18
test eax, eax
jne 0x406930
test byte [0x414240], 8
jne 0x406937
lea eax, [ebp - 0x3ec]
mov dword [esp + 4], 0x4182d4
mov dword [esp], eax
mov eax, dword [sym.imp.ucrtbase.dll__wcsicmp]
mov dword [ebp - 0x448], eax
call eax
mov ecx, 3
test eax, eax
jne 0x4068b5
mov eax, dword [ebp - 0x428]
mov dword [ebp - 0x448], ecx
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegCloseKey]
mov ecx, dword [ebp - 0x448]
sub esp, 4
jmp 0x406708
mov dword [esp + 0xc], str.__Unable_to_open_SoftwareWineDrives_n
mov dword [esp + 8], str.get_drive_type
mov dword [esp + 4], 0x414240
mov dword [esp], 3
mov dword [ebp - 0x448], ecx
call fcn.00405d90
mov ecx, dword [ebp - 0x448]
jmp 0x406708
lea eax, [ebp - 0x3ec]
mov dword [esp + 4], str.network
mov dword [esp], eax
mov eax, dword [ebp - 0x448]
call eax
mov ecx, 4
test eax, eax
je 0x406856
lea eax, [ebp - 0x3ec]
mov dword [esp + 4], str.floppy
mov dword [esp], eax
mov eax, dword [ebp - 0x448]
call eax
mov ecx, 2
test eax, eax
je 0x406856
lea eax, [ebp - 0x3ec]
mov dword [esp + 4], str.cdrom
mov dword [esp], eax
mov eax, dword [ebp - 0x448]
call eax
mov ecx, 5
test eax, eax
je 0x406856
lea esi, [esi]
nop
xor ecx, ecx
jmp 0x406856
mov eax, dword [ebp - 0x450]
test eax, eax
je 0x406a3a
lea eax, [ebp - 0x418]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x454], 0x41814d
sub esp, 8
test eax, eax
jne 0x406a63
cmp word [ebp - 0x418], 0
je 0x406d94
nop
mov ecx, eax
lea eax, [eax + 1]
cmp word [ebp + ecx*2 - 0x416], 0
jne 0x406980
mov edx, 0x224c
lea eax, [ebp - 0x34a]
mov dword [ebp - 0x454], esi
mov word [ebp - 0x34c], dx
lea edx, [ebp - 0x418]
mov esi, eax
mov dword [ebp - 0x458], edi
mov dword [ebp - 0x448], edx
jmp 0x4069fb
cmp ax, 9
je 0x406c18
cmp ax, 0xa
jne 0x406c36
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea eax, [ecx - 1]
test ecx, ecx
jle 0x406d11
lea edx, [ebp - 0x22a]
cmp esi, edx
ja 0x406d11
mov ecx, eax
add dword [ebp - 0x448], 2
mov eax, dword [ebp - 0x448]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x406c01
jbe 0x4069c0
cmp ax, 0x22
je 0x406c90
cmp ax, 0x5c
jne 0x406c29
mov edi, 0x5c5c
add esi, 2
mov word [esi - 2], di
jmp 0x4069e0
lea eax, [ebp - 0x418]
mov dword [esp], 0x418140
mov dword [ebp - 0x448], eax
movzx eax, word [ebp - 0x448]
mov dword [esp + 4], eax
call fcn.004059c0
mov dword [ebp - 0x454], eax
mov eax, dword [ebp - 0x44c]
test eax, eax
je 0x406d56
lea eax, [ebp - 0x3ec]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, 0x41814d
sub esp, 8
test eax, eax
jne 0x406b9b
cmp word [ebp - 0x3ec], 0
je 0x406db6
lea esi, [esi]
lea esi, [esi]
mov ecx, eax
lea eax, [eax + 1]
cmp word [ebp + ecx*2 - 0x3ea], 0
jne 0x406ab0
mov eax, 0x224c
mov dword [ebp - 0x458], esi
lea edx, [ebp - 0x34a]
mov word [ebp - 0x34c], ax
lea eax, [ebp - 0x3ec]
mov dword [ebp - 0x45c], edi
mov esi, eax
mov dword [ebp - 0x448], ecx
jmp 0x406b2d
cmp ax, 9
je 0x406bf0
cmp ax, 0xa
jne 0x406cae
mov eax, 0x6e5c
add edx, 2
mov word [edx - 2], ax
mov edi, dword [ebp - 0x448]
lea ecx, [ebp - 0x22a]
lea eax, [edi - 1]
cmp edx, ecx
ja 0x406b61
test edi, edi
jle 0x406b61
mov dword [ebp - 0x448], eax
movzx eax, word [esi]
add esi, 2
cmp ax, 0xd
je 0x406bdc
jbe 0x406af0
cmp ax, 0x22
je 0x406d00
cmp ax, 0x5c
jne 0x406ca1
mov edi, 0x5c5c
add edx, 2
mov word [edx - 2], di
jmp 0x406b10
mov esi, dword [ebp - 0x458]
mov edi, dword [ebp - 0x45c]
mov byte [edx], 0x22
test eax, eax
jle 0x406dcf
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x34c]
mov dword [esp], eax
call fcn.004137b0
mov ecx, eax
mov eax, dword [ebp - 0x454]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], str.Got_type__s_for__s_n
mov dword [esp + 0x14], eax
mov dword [esp + 8], str.get_drive_type
mov dword [esp + 4], 0x414240
mov dword [esp], 3
call fcn.00405d90
jmp 0x40682f
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0x725c
add edx, 2
mov word [edx - 2], ax
jmp 0x406b10
mov eax, 0x745c
add edx, 2
mov word [edx - 2], ax
jmp 0x406b10
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x4069e0
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x4069e0
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x406d8a
mov edi, eax
mov byte [esi], 0x5c
add esi, 5
shr di, 0xc
movzx edi, di
movzx edx, byte [edi + str.0123456789abcdefadd_drive]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [esi - 4], dl
movzx edx, byte [edi + str.0123456789abcdefadd_drive]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefadd_drive]
and edi, 0xf
mov byte [esi - 3], dl
movzx edx, byte [edi + str.0123456789abcdefadd_drive]
mov byte [esi - 1], al
mov byte [esi - 2], dl
jmp 0x4069e0
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x4069e0
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x406d80
mov edi, eax
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ecx, byte [edi + str.0123456789abcdefadd_drive]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [edi + str.0123456789abcdefadd_drive]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefadd_drive]
and edi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [edi + str.0123456789abcdefadd_drive]
mov byte [edx - 1], al
mov byte [edx - 2], cl
jmp 0x406b10
mov eax, 0x225c
add edx, 2
mov word [edx - 2], ax
jmp 0x406b10
mov edx, esi
mov edi, dword [ebp - 0x458]
mov esi, dword [ebp - 0x454]
mov byte [edx], 0x22
test eax, eax
jle 0x406daf
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x34c]
mov dword [esp], eax
call fcn.004137b0
mov dword [ebp - 0x454], eax
jmp 0x406a63
lea eax, [ebp - 0x3ec]
mov dword [esp], 0x418140
mov dword [ebp - 0x448], eax
movzx eax, word [ebp - 0x448]
mov dword [esp + 4], eax
call fcn.004059c0
mov ecx, eax
jmp 0x406b9b
mov byte [edx], al
add edx, 1
jmp 0x406b10
mov byte [esi], al
add esi, 1
jmp 0x4069e0
mov eax, 0x224c
mov byte [ebp - 0x34a], 0x22
mov word [ebp - 0x34c], ax
lea eax, [ebp - 0x34a]
mov edx, eax
mov eax, edx
add eax, 1
jmp 0x406d3a
mov ecx, 0x224c
mov byte [ebp - 0x34a], 0x22
lea edx, [ebp - 0x34a]
mov word [ebp - 0x34c], cx
lea eax, [edx + 1]
jmp 0x406b88