Function at 0x402d20
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x40a004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov ebx, edx
mov dword [ebp - 0x30], 0
push 0
push 0
mov edx, 0x2d
mov edi, ecx
call fcn.00401510
add esp, 8
mov ecx, edi
call fcn.00401640
mov ecx, edi
call fcn.00401750
cmp dword [edi + 0x20], 6
jge 0x402d68
or ecx, 0xffffffff
jmp 0x402d7e
mov edx, dword [edi]
movzx eax, byte [edx]
movzx ecx, byte [edx + 1]
shl eax, 8
or ecx, eax
cmp ecx, 0xba
je 0x402da0
push ecx
push str.unexpected_response__0x_04x__n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
movzx esi, byte [edx + 2]
movzx eax, byte [edx + 3]
shl esi, 8
or esi, eax
mov eax, 0xaf286bcb
mul esi
mov eax, esi
mov ecx, esi
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 6
mov dword [ebp - 0x34], eax
imul eax, eax, 0x4c
sub ecx, eax
je 0x402ded
push esi
push str.not_divisible_by_struct_size__0x_04x__n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
mov ecx, 0x407984
mov eax, ebx
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x402e14
test dl, dl
je 0x402e10
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x402e14
add eax, 2
add ecx, 2
test dl, dl
jne 0x402df4
xor eax, eax
jmp 0x402e19
sbb eax, eax
or eax, 1
test eax, eax
je 0x402e64
push 0x40774c
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov ebx, eax
add esp, 8
mov dword [ebp - 0x30], ebx
test ebx, ebx
jne 0x402e56
push str.fopen_failed_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
push str._Partitions__n
push ebx
call fcn.00401050
add esp, 8
push str.detecting_sector_size_n
push 2
mov esi, 0xa
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
mov edi, dword [edi]
add esp, 8
mov eax, dword [ebp - 0x34]
add edi, 4
mov dword [ebp - 0x38], edi
test eax, eax
je 0x402f91
lea ebx, [edi + 0x4a]
mov edi, eax
nop word [eax + eax]
movzx edx, byte [ebx + 1]
mov ecx, esi
movzx eax, byte [ebx]
shl edx, 8
or edx, eax
movzx eax, byte [ebx - 1]
shl edx, 8
or edx, eax
movzx eax, byte [ebx - 2]
shl edx, 8
or edx, eax
mov eax, edx
shr eax, cl
test eax, eax
jne 0x402ed3
dec esi
mov eax, edx
mov ecx, esi
shr eax, cl
test eax, eax
je 0x402ec8
add ebx, 0x4c
sub edi, 1
jne 0x402ea0
mov edi, dword [ebp - 0x38]
xor ebx, ebx
xor eax, eax
cmp eax, 0x24
jae 0x402fd3
movzx ecx, word [edi + eax*2]
mov byte [ebp + eax - 0x2c], cl
cmp ecx, 0x100
jae 0x402f00
inc eax
test ecx, ecx
jne 0x402ee2
test ecx, ecx
jne 0x402fd3
movzx edx, byte [edi + 0x4b]
mov ecx, esi
movzx eax, byte [edi + 0x4a]
shl edx, 8
or edx, eax
movzx eax, byte [edi + 0x49]
shl edx, 8
or edx, eax
movzx eax, byte [edi + 0x48]
shl edx, 8
or edx, eax
push edx
mov eax, edx
shr eax, cl
push eax
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x2c]
push eax
push ebx
push str.__d___s___u___u__n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
mov eax, dword [ebp - 0x30]
add esp, 0x18
test eax, eax
je 0x402f84
lea ecx, [ebp - 0x2c]
push ecx
push str._____Partition_id__s__size_
push eax
call fcn.00401050
lea eax, [ebx + 1]
add esp, 0xc
cmp eax, dword [ebp - 0x34]
je 0x402fbe
push dword [ebp - 0x38]
push str._u____n
push dword [ebp - 0x30]
call fcn.00401050
add esp, 0xc
inc ebx
add edi, 0x4c
cmp ebx, dword [ebp - 0x34]
jb 0x402ee0
mov ebx, dword [ebp - 0x30]
test ebx, ebx
je 0x402fad
push str.__Partitions__n
push ebx
call fcn.00401050
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0xc
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004056f6
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x30]
push 0xffffffffffffffff
push str.0x_x____n
push ebx
call fcn.00401050
add esp, 0xc
jmp 0x402f98
push str.bad_partition_name_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3