Function at 0x404800
Capabilities:
Get disk information

Disassembly:
push 0xffffffffffffffff
push 0x40cffb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x8bc
push ebx
mov ebx, dword [esp + 0x8d0]
push edi
push 0x104
lea eax, [esp + 0xb8]
push eax
mov dword [ebx + 0x28], 0x80000007
mov ecx, dword [0x4129d0]
push 0x11
push ecx
call dword [sym.imp.USER32.dll_LoadStringW]
mov eax, dword [ebx + 0x44]
lea edx, [esp + 0xb4]
push edx
push eax
call dword [sym.imp.USER32.dll_SetWindowTextW]
lea ecx, [esp + 0x20]
call fcn.00401770
xor ecx, ecx
mov cl, byte [ebx]
xor edi, edi
mov dword [esp + 0x8cc], edi
push ecx
lea ecx, [esp + 0x24]
call fcn.00402130
test eax, eax
jne 0x4048aa
lea ecx, [esp + 0x20]
mov dword [esp + 0x8cc], 0xffffffff
call fcn.00401e80
pop edi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x8bc]
mov dword fs:[0], ecx
add esp, 0x8c8
ret
mov eax, dword [0x412278]
push esi
xor esi, esi
cmp eax, edi
mov dword [esp + 0xc], esi
je 0x4048ef
mov eax, 0x412278
nop
mov edx, dword [ebx + 0x1c]
mov eax, dword [eax]
push edx
push eax
call fcn.00406b5e
add esp, 8
test eax, eax
je 0x4048e6
inc esi
mov ecx, dword [esi*4 + 0x412278]
cmp ecx, edi
lea eax, [esi*4 + 0x412278]
jne 0x4048c0
cmp esi, 1
mov dword [esp + 0xc], esi
je 0x40494d
mov ecx, dword [ebx + 4]
xor edx, edx
mov dl, byte [esi + 0x412288]
push 0x7fffffff
push 0xffffffffffffffff
push ecx
push edx
lea ecx, [esp + 0x34]
call fcn.00402320
test eax, eax
jne 0x404962
push str.ERROR_Failed_to_create_a_partition__n
push 1
call fcn.00401040
add esp, 8
lea ecx, [esp + 0x24]
mov dword [esp + 0x8d0], 0xffffffff
call fcn.00401e80
pop esi
pop edi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x8bc]
mov dword fs:[0], ecx
add esp, 0x8c8
ret
mov eax, dword [ebx + 4]
xor ecx, ecx
mov cl, byte [0x412289]
push edi
push 0x4000000
push eax
push ecx
jmp 0x404903
mov dword [esp + 0x10], edi
mov edi, dword [sym.imp.KERNEL32.dll_GetDriveTypeW]
push ebp
lea ecx, [ecx]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [esp + 0xbc]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetLogicalDriveStringsW]
cmp word [esp + 0xbc], 0
lea esi, [esp + 0xbc]
je 0x404a1d
xor eax, eax
mov ax, word [esi]
push eax
call fcn.004066bf
add esp, 4
cmp ax, 0x43
jb 0x4049f6
push esi
call edi
cmp eax, 2
je 0x4049c1
cmp eax, 3
jne 0x4049f6
xor edx, edx
mov dx, word [esi]
lea ecx, [esp + 0x1c]
push ecx
push edx
call fcn.00401230
add esp, 8
test eax, eax
jne 0x4049ed
movzx eax, word [esi]
push eax
push str.ERROR_Failed_to_locate_the_physical_disk_of__c:__n
push 3
call fcn.00401040
add esp, 0xc
jmp 0x4049f6
movzx ecx, byte [ebx]
cmp dword [esp + 0x1c], ecx
je 0x404a0b
push esi
call fcn.00406154
lea esi, [esi + eax*2 + 2]
add esp, 4
cmp word [esi], 0
jne 0x4049a0
jmp 0x404a1d
xor ebp, ebp
mov bp, word [esi]
test bp, bp
mov dword [esp + 0x24], ebp
jne 0x404bba
mov eax, dword [esp + 0x14]
inc eax
cmp eax, 8
mov dword [esp + 0x14], eax
jl 0x404970
movzx edx, byte [ebx]
push edx
push str.WARNING_No_system_assigned_drive_letter_for_HD_1d__n
push 3
call fcn.00401040
add esp, 0xc
mov ebp, 0x43
call dword [sym.imp.KERNEL32.dll_GetLogicalDrives]
shr eax, 2
test eax, eax
je 0x404a6a
test al, 1
je 0x404a61
shr eax, 1
inc ebp
test eax, eax
jne 0x404a54
jmp 0x404a6a
test bp, bp
mov dword [esp + 0x24], ebp
jne 0x404a94
push str.ERROR_No_available_drive_letter_s___n
push 1
call fcn.00401040
add esp, 8
lea ecx, [esp + 0x28]
mov dword [esp + 0x8d4], 0xffffffff
call fcn.00401e80
xor eax, eax
jmp 0x4051f2
mov cx, word [0x40f6f0]
movzx dx, byte [ebx]
mov eax, dword [0x40f6ec]
mov word [esp + 0x20], cx
mov ecx, 0xe
mov esi, str.deviceharddisknpartition1
lea edi, [esp + 0x80]
rep movsd dword es:[edi], dword [esi]
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x80]
push eax
lea ecx, [esp + 0x20]
movsw word es:[edi], word [esi]
mov edi, dword [sym.imp.KERNEL32.dll_DefineDosDeviceW]
push ecx
add edx, 0x30
push 1
mov word [esp + 0x28], bp
mov word [esp + 0xac], dx
call edi
test eax, eax
jne 0x404b05
movzx edx, byte [ebx]
push edx
push str.ERROR_Failed_to_assign_a_drive_letter_to_HD_1d__n
push 1
call fcn.00401040
add esp, 0xc
jmp 0x404a79
mov eax, dword [0x40edec]
mov ecx, dword [0x40edf0]
push 0x104
mov dword [esp + 0x18], eax
lea edx, [esp + 0x6c8]
push edx
lea eax, [esp + 0x1c]
push eax
mov dword [esp + 0x24], ecx
mov word [esp + 0x20], bp
call dword [sym.imp.KERNEL32.dll_GetVolumeNameForVolumeMountPointW]
test eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
jne 0x404b59
call esi
push eax
push str.GetVolumeNameForVolumeMountPoint
call fcn.00401120
add esp, 8
mov word [esp + 0x6c4], 0
lea ecx, [esp + 0x80]
push ecx
lea edx, [esp + 0x20]
push edx
push 7
call edi
test eax, eax
jne 0x404b7e
call esi
push eax
push str.DefineDosDevice
call fcn.00401120
add esp, 8
lea eax, [esp + 0x6c4]
push eax
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_SetVolumeMountPointW]
test eax, eax
jne 0x404bba
call esi
push eax
push str.SetVolumeMountPoint
call fcn.00401120
movzx edx, byte [ebx]
push edx
push str.ERROR_Failed_to_assign_a_drive_letter_to_HD_1d__n
push 1
call fcn.00401040
add esp, 0x14
jmp 0x404a79
push 0x104
lea eax, [esp + 0xc0]
push eax
mov dword [ebx + 0x28], 0
mov ecx, dword [0x4129d0]
push 0x12
push ecx
call dword [sym.imp.USER32.dll_LoadStringW]
mov eax, dword [ebx + 0x44]
lea edx, [esp + 0xbc]
push edx
push eax
call dword [sym.imp.USER32.dll_SetWindowTextW]
push ebx
push ebp
mov word [ebx + 2], bp
call fcn.004028f0
add esp, 8
test eax, eax
jne 0x404c0b
push str.ERROR_Failed_to_format_the_device__n
jmp 0x404a6f
cmp dword [esp + 0x10], 1
jne 0x404fea
mov eax, dword [esp + 0x5c]
test eax, eax
jl 0x404fea
jg 0x404c32
cmp dword [esp + 0x58], 0x4000000
jbe 0x404fea
mov ebp, dword [esp + 0x54]
shl ebp, 0xc
push ebp
call fcn.00406a90
mov esi, eax
add esp, 4
test esi, esi
je 0x404fea
mov ecx, ebp
mov edx, ecx
shr ecx, 2
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
push ebp
mov dword [esi], 4
push esi
lea ecx, [esp + 0x30]
mov byte [esi + 0x23], 1
call fcn.00401cb0
test eax, eax
lea ecx, [esp + 0x28]
je 0x404a7d
mov eax, dword [esp + 0x50]
push ebp
push esi
push 1
push eax
call fcn.00401d40
mov ecx, dword [esp + 0x50]
movzx edi, word [esi + 0xe]
mov ebx, dword [esp + 0x58]
xor edx, edx
sub ebx, ecx
mov ecx, dword [esp + 0x5c]
sbb ecx, edx
mov eax, edi
cdq
sub ebx, eax
sbb ecx, edx
push 0
add ebx, 0x3f
push 0x2002
adc ecx, 0
push ecx
push ebx
call fcn.00406790
mov ecx, dword [esi + 0x24]
mov ebx, eax
mov eax, dword [esi + 0x1c]
lea edx, [eax + ecx]
add edx, edi
mov dword [esp + 0x10], edx
lea edx, [eax + edi]
mov dword [esp + 0x1c], edx
lea eax, [eax + ecx*2]
add edx, ebx
add eax, edi
mov byte [esi + 0xd], 0x40
mov edi, dword [esp + 0x50]
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x58]
push ebp
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x20]
lea ecx, [eax + ebx*2]
sub edx, edi
push esi
mov dword [esi + 0x20], edx
mov dword [esi + 0x24], ebx
mov eax, dword [esp + 0x58]
push 1
mov dword [esp + 0x28], ecx
push eax
lea ecx, [esp + 0x38]
call fcn.00401de0
mov ecx, dword [esp + 0x54]
mov edx, ecx
shr ecx, 2
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x10], eax
jae 0x404e1b
mov edi, dword [esp + 0x24]
push ebp
push esi
push 1
push edi
lea ecx, [esp + 0x38]
call fcn.00401d40
mov ecx, dword [esp + 0x54]
push ebp
add ecx, esi
push ecx
push 1
push edi
lea ecx, [esp + 0x38]
call fcn.00401de0
mov edx, dword [esp + 0x1c]
push ebp
push esi
push 0x40
push edx
lea ecx, [esp + 0x38]
call fcn.00401de0
mov eax, dword [esp + 0x10]
push ebp
push esi
push 1
push eax
lea ecx, [esp + 0x38]
call fcn.00401d40
mov ecx, dword [esp + 0x14]
push ebp
push esi
push 1
push ecx
lea ecx, [esp + 0x38]
call fcn.00401de0
mov ecx, dword [esp + 0x54]
mov edx, ecx
shr ecx, 2
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x14]
dec ebx
inc eax
test ebx, ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], eax
jbe 0x404e8f
jmp 0x404dd0
cmp ebx, 0x1000
mov edi, 0x1000
ja 0x404ddf
mov edi, ebx
mov eax, dword [esp + 0x14]
push ebp
push esi
push edi
push eax
lea ecx, [esp + 0x38]
call fcn.00401de0
mov ecx, dword [esp + 0x10]
push ebp
push esi
push edi
push ecx
lea ecx, [esp + 0x38]
call fcn.00401de0
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
add edx, edi
add ecx, edi
sub ebx, edi
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], ecx
jne 0x404dd0
jmp 0x404e8f
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0x14]
cmp edi, ebx
jbe 0x404e8f
push ebp
push esi
push 1
push edi
lea ecx, [esp + 0x38]
call fcn.00401d40
mov edx, dword [esp + 0x54]
push ebp
add edx, esi
push edx
push 1
push edi
lea ecx, [esp + 0x38]
call fcn.00401de0
push ebp
push esi
push 1
push ebx
lea ecx, [esp + 0x38]
call fcn.00401de0
mov edi, dword [esp + 0x24]
push ebp
push esi
push 1
push edi
lea ecx, [esp + 0x38]
call fcn.00401d40
mov eax, dword [esp + 0x54]
push ebp
add eax, esi
push eax
push 1
push edi
lea ecx, [esp + 0x38]
call fcn.00401de0
mov ecx, dword [esp + 0x1c]
push ebp
push esi
push 0x40
push ecx
lea ecx, [esp + 0x38]
call fcn.00401de0
mov dword [esi], 4
mov eax, dword [esp + 0x50]
mul dword [esp + 0x54]
mov dword [esi + 8], eax
mov dword [esi + 0xc], edx
mov edx, dword [esp + 0x50]
mov ecx, dword [esp + 0x58]
xor eax, eax
sub ecx, edx
mov edx, dword [esp + 0x5c]
sbb edx, eax
mov eax, dword [esp + 0x54]
xor edi, edi
push edi
push eax
push edx
push ecx
call fcn.00406750
mov dword [esi + 0x14], edx
mov edx, dword [esp + 0x8dc]
mov dword [esi + 0x10], eax
mov ecx, dword [esp + 0x50]
mov dword [esi + 0x18], ecx
mov dword [esi + 0x1c], 1
mov byte [esi + 0x20], 0xc
mov al, byte [edx + 4]
push ebp
push esi
lea ecx, [esp + 0x30]
mov byte [esi + 0x21], al
mov byte [esi + 0x22], 1
mov byte [esi + 0x23], 1
call fcn.00401cb0
test eax, eax
je 0x404a79
push esi
call fcn.0040683a
mov ebx, dword [sym.imp.KERNEL32.dll_GetLogicalDriveStringsW]
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [esp + 0x28], edi
mov dword [esp + 0x18], edi
mov edi, dword [sym.imp.KERNEL32.dll_GetDriveTypeW]
add esp, 4
push 0x3e8
call ebp
lea ecx, [esp + 0xbc]
push ecx
push 0x104
call ebx
cmp word [esp + 0xbc], 0
lea esi, [esp + 0xbc]
je 0x404fd1
xor edx, edx
mov dx, word [esi]
push edx
call fcn.004066bf
add esp, 4
cmp ax, 0x43
jb 0x404fb0
push esi
call edi
cmp eax, 2
je 0x404f74
cmp eax, 3
jne 0x404fb0
xor ecx, ecx
mov cx, word [esi]
lea eax, [esp + 0x1c]
push eax
push ecx
call fcn.00401230
add esp, 8
test eax, eax
jne 0x404fa0
movzx edx, word [esi]
push edx
push str.ERROR_Failed_to_locate_the_physical_disk_of__c:__n
push 3
call fcn.00401040
add esp, 0xc
jmp 0x404fb0
mov eax, dword [esp + 0x8dc]
movzx ecx, byte [eax]
cmp dword [esp + 0x1c], ecx
je 0x404fc5
push esi
call fcn.00406154
lea esi, [esi + eax*2 + 2]
add esp, 4
cmp word [esi], 0
jne 0x404f53
jmp 0x404fd1
movzx esi, word [esi]
test si, si
mov dword [esp + 0x24], esi
jne 0x404fe3
mov eax, dword [esp + 0x14]
inc eax
cmp eax, 8
mov dword [esp + 0x14], eax
jl 0x404f27
mov ebx, dword [esp + 0x8dc]
mov edx, dword [ebx + 4]
mov eax, dword [ebx + 0x40]
mov ebp, dword [sym.imp.USER32.dll_PostMessageW]
neg edx
sbb edx, edx
push 0
and edx, 0xffffffe7
add edx, 0x7d
push edx
push 0x8001
push eax
call ebp
cmp word [esp + 0x24], 0x43
jb 0x405164
push 0x400
lea ecx, [esp + 0x2c8]
push ecx
push 1
push 0
lea ecx, [esp + 0x38]
call fcn.00401d40
mov edx, dword [0x412278]
mov eax, dword [ebx + 0x1c]
push edx
push eax
call fcn.00406b5e
add esp, 8
test eax, eax
jne 0x405052
mov byte [esp + 0x486], 0xe
jmp 0x405071
mov edx, dword [str.FAT32]
mov eax, dword [ebx + 0x1c]
push edx
push eax
call fcn.00406b5e
add esp, 8
test eax, eax
jne 0x40508b
mov byte [esp + 0x486], 0xc
push 0x400
lea ecx, [esp + 0x2c8]
push ecx
push 1
lea ecx, [esp + 0x34]
push 0
call fcn.00401de0
cmp dword [ebx + 0xc], 1
jne 0x405164
push 0x400
lea edx, [esp + 0x2c8]
push edx
push 1
push 1
lea ecx, [esp + 0x38]
call fcn.00401d40
xor eax, eax
mov ecx, 0x60
lea edi, [esp + 0x2c4]
rep stosd dword es:[edi], eax
push 0x200
lea eax, [esp + 0x4c8]
push eax
mov ecx, 0x1f
mov esi, 0x412290
lea edi, [esp + 0x2cc]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x492]
push 1
push ecx
lea ecx, [esp + 0x38]
call fcn.00401d40
test eax, eax
je 0x404a79
push 5
lea edx, [esp + 0x4fe]
push str.FAT12
push edx
call fcn.00406b02
add esp, 0xc
test eax, eax
jne 0x40511f
mov byte [esp + 0x486], 1
jmp 0x405142
push 5
lea eax, [esp + 0x4fe]
push str.FAT16
push eax
call fcn.00406b02
add esp, 0xc
test eax, eax
jne 0x405142
mov byte [esp + 0x486], 6
push 0x400
lea ecx, [esp + 0x2c8]
push ecx
push 1
push 0
lea ecx, [esp + 0x38]
call fcn.00401de0
test eax, eax
je 0x404a79
mov eax, dword [0x4129d0]
push 0x104
lea edx, [esp + 0xc0]
push edx
push 0x21
push eax
call dword [sym.imp.USER32.dll_LoadStringW]
mov edx, dword [ebx + 0x44]
lea ecx, [esp + 0xbc]
push ecx
push edx
call dword [sym.imp.USER32.dll_SetWindowTextW]
mov eax, dword [esp + 0x24]
push ebx
push eax
mov dword [ebx + 0x28], 0x80010002
call fcn.00403eb0
add esp, 8
test eax, eax
jne 0x4051bc
push str.ERROR_Failed_to_make_the_device_DOS_bootable__n
call fcn.00406ad1
add esp, 4
jmp 0x404a79
mov eax, dword [ebx + 4]
test eax, eax
mov dword [ebx + 0x28], 0
je 0x4051d9
mov ecx, dword [ebx + 0x40]
push 0
push 0x7d
push 0x8001
push ecx
call ebp
lea ecx, [esp + 0x28]
mov dword [esp + 0x8d4], 0xffffffff
call fcn.00401e80
mov eax, 1
mov ecx, dword [esp + 0x8cc]
pop ebp
pop esi
pop edi
pop ebx
mov dword fs:[0], ecx
add esp, 0x8c8
ret