Function at 0x47e7c3
Capabilities:
Print debug messages
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x19c
mov dword [ebp - 4], 0
cmp dword [0x672bd4], 0
je 0x47e87e
cmp dword [0x672bcc], 0
je 0x47e87e
push 0x1c
push 0
push 0x672b90
call fcn.004e8440
add esp, 0xc
push 0x1c
push 0
push 0x672bb0
call fcn.004e8440
add esp, 0xc
mov dword [0x672bb0], 0xd0
mov eax, dword [ebp + 0x2c]
shr eax, 9
mov dword [0x672bb4], eax
mov dword [0x672bb8], 0x53
mov dword [0x672bbc], 0x4d
mov dword [0x672bc0], 0x49
mov dword [0x672bc4], 0xe0
mov dword [0x672bc8], 0xb0
push 0
mov ecx, dword [ebp + 0x2c]
push ecx
mov edx, dword [ebp + 0x28]
push edx
push 0x672b90
push 0x672bb0
mov eax, dword [ebp + 0x20]
push eax
call fcn.0048030f
add esp, 0x18
mov dword [ebp - 4], eax
jmp 0x47ed30
cmp dword [0x672bd4], 0
je 0x47e92a
cmp dword [0x672bd0], 0
je 0x47e92a
push 0x1c
push 0
push 0x672b90
call fcn.004e8440
add esp, 0xc
push 0x1c
push 0
push 0x672bb0
call fcn.004e8440
add esp, 0xc
mov dword [0x672bb0], 0xd5
mov ecx, dword [ebp + 0x2c]
shr ecx, 9
mov dword [0x672bb4], ecx
mov dword [0x672bb8], 0x53
mov dword [0x672bbc], 0x4d
mov dword [0x672bc0], 0x49
mov dword [0x672bc4], 0xe0
mov dword [0x672bc8], 0xb0
push 0
mov edx, dword [ebp + 0x2c]
push edx
mov eax, dword [ebp + 0x28]
push eax
push 0x672b90
push 0x672bb0
mov ecx, dword [ebp + 0x20]
push ecx
call fcn.0048030f
add esp, 0x18
mov dword [ebp - 4], eax
jmp 0x47ed30
cmp dword [0x56c104], 0
je 0x47e9ba
mov dword [0x672bb0], 0
mov edx, dword [ebp + 0x2c]
shr edx, 9
mov dword [0x672bb4], edx
mov eax, dword [ebp + 0x24]
and eax, 0xffff
mov dword [0x672bb8], eax
mov ecx, dword [ebp + 0x24]
shr ecx, 8
and ecx, 0xffff
mov dword [0x672bbc], ecx
mov edx, dword [ebp + 0x24]
shr edx, 0x10
and edx, 0xffff
mov dword [0x672bc0], edx
mov dword [0x672bc4], 0xe0
mov dword [0x672bc8], 0xc8
push 2
mov eax, dword [ebp + 0x2c]
push eax
mov ecx, dword [ebp + 0x28]
push ecx
push 0x672b90
push 0x672bb0
mov edx, dword [ebp + 0x20]
push edx
call fcn.0048030f
add esp, 0x18
mov dword [ebp - 4], eax
jmp 0x47ed30
cmp dword [ebp + 8], 0
je 0x47eb26
mov eax, dword [ebp + 0x2c]
shr eax, 9
mov word [ebp - 0x2c], ax
push 0x1f
push 0
lea ecx, [ebp - 0x28]
push ecx
call fcn.004e8440
add esp, 0xc
push 0xd
push 0
lea edx, [ebp - 0x3c]
push edx
call fcn.004e8440
add esp, 0xc
mov byte [ebp - 0x28], 0x55
mov byte [ebp - 0x27], 0x53
mov byte [ebp - 0x26], 0x42
mov byte [ebp - 0x25], 0x43
mov eax, dword [ebp + 0x2c]
and eax, 0xff
mov byte [ebp - 0x20], al
mov ecx, dword [ebp + 0x2c]
shr ecx, 8
and ecx, 0xff
mov byte [ebp - 0x1f], cl
mov edx, dword [ebp + 0x2c]
shr edx, 0x10
and edx, 0xff
mov byte [ebp - 0x1e], dl
mov eax, dword [ebp + 0x2c]
shr eax, 0x18
and eax, 0xff
mov byte [ebp - 0x1d], al
mov byte [ebp - 0x1c], 0x80
mov byte [ebp - 0x1a], 0xa
mov cl, byte [ebp + 0x30]
mov byte [ebp - 0x19], cl
mov edx, dword [ebp + 0x24]
shr edx, 0x18
mov byte [ebp - 0x17], dl
mov eax, dword [ebp + 0x24]
shr eax, 0x10
mov byte [ebp - 0x16], al
mov ecx, dword [ebp + 0x24]
shr ecx, 8
mov byte [ebp - 0x15], cl
mov edx, dword [ebp + 0x24]
and edx, 0xff
mov byte [ebp - 0x14], dl
mov eax, dword [ebp - 0x2c]
and eax, 0xffff
sar eax, 8
mov byte [ebp - 0x12], al
mov ecx, dword [ebp - 0x2c]
and ecx, 0xffff
and ecx, 0xff
mov byte [ebp - 0x11], cl
push 0
lea edx, [ebp - 8]
push edx
push 0x1f
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x47eabb
push str.Pipe_Stall
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
jmp 0x47ed33
push 0
lea edx, [ebp - 8]
push edx
mov eax, dword [ebp + 0x2c]
push eax
mov ecx, dword [ebp + 0x28]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x47eae3
xor eax, eax
jmp 0x47ed33
push 0
lea eax, [ebp - 8]
push eax
push 0xd
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x47eb09
xor eax, eax
jmp 0x47ed33
mov eax, dword [ebp - 0x30]
and eax, 0xff
test eax, eax
je 0x47eb1c
xor eax, eax
jmp 0x47ed33
mov eax, 1
jmp 0x47ed33
push 0x50
push 0
lea ecx, [ebp - 0x8c]
push ecx
call fcn.004e8440
add esp, 0xc
mov word [ebp - 0x8c], 0x2c
mov byte [ebp - 0x89], 0
mov byte [ebp - 0x88], 1
mov byte [ebp - 0x87], 0
mov byte [ebp - 0x86], 0x10
mov byte [ebp - 0x85], 0
mov byte [ebp - 0x84], 1
mov edx, dword [ebp + 0x2c]
mov dword [ebp - 0x80], edx
mov eax, dword [0x55fa20]
mov dword [ebp - 0x7c], eax
mov ecx, dword [ebp + 0x28]
mov dword [ebp - 0x78], ecx
mov dword [ebp - 0x74], 0x30
mov dl, byte [ebp + 0x30]
mov byte [ebp - 0x70], dl
mov eax, dword [ebp + 0x24]
shr eax, 0x10
and eax, 0xffff
shr eax, 8
mov byte [ebp - 0x6e], al
mov ecx, dword [ebp + 0x24]
shr ecx, 0x10
and ecx, 0xffff
and ecx, 0xff
mov byte [ebp - 0x6d], cl
mov edx, dword [ebp + 0x24]
and edx, 0xffff
and edx, 0xffff
shr edx, 8
mov byte [ebp - 0x6c], dl
mov eax, dword [ebp + 0x24]
and eax, 0xffff
and eax, 0xffff
and eax, 0xff
mov byte [ebp - 0x6b], al
mov ecx, dword [ebp + 0x2c]
shr ecx, 9
shr ecx, 8
mov byte [ebp - 0x69], cl
mov edx, dword [ebp + 0x2c]
shr edx, 9
and edx, 0xff
mov byte [ebp - 0x68], dl
mov dword [ebp - 0x94], 0x50
mov dword [ebp - 0x90], 0
cmp dword [ebp + 0x20], 0xffffffff
je 0x47ed30
push 0
lea eax, [ebp - 0x90]
push eax
mov ecx, dword [ebp - 0x94]
push ecx
lea edx, [ebp - 0x8c]
push edx
mov eax, dword [ebp - 0x94]
push eax
lea ecx, [ebp - 0x8c]
push ecx
push 0x4d014
mov edx, dword [ebp + 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov dword [ebp - 4], eax
mov dword [ebp - 0x19c], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x19c], eax
push 0x104
push 0
lea eax, [ebp - 0x198]
push eax
call fcn.004e8440
add esp, 0xc
cmp dword [ebp - 4], 0
jne 0x47ecb2
mov ecx, dword [ebp - 0x19c]
push ecx
mov edx, dword [ebp + 0x24]
push edx
push str._SMIReadSector_:_Read_LBA__0x_x__DeviceIoControl_ERROR___d_n
lea eax, [ebp - 0x198]
push eax
call fcn.004e894d
add esp, 0x10
lea ecx, [ebp - 0x198]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
jmp 0x47ed33
mov edx, dword [ebp - 0x8a]
and edx, 0xff
test edx, edx
je 0x47ecf7
mov eax, dword [ebp - 0x8a]
and eax, 0xff
push eax
mov ecx, dword [ebp + 0x24]
push ecx
push str._SMIReadSector_:_Read_LBA__0x_x__Fw_return_error___d_n
lea edx, [ebp - 0x198]
push edx
call fcn.004e894d
add esp, 0x10
lea eax, [ebp - 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
jmp 0x47ed33
cmp dword [ebp - 0x90], 3
jne 0x47ed29
mov ecx, dword [ebp + 0x24]
push ecx
push str._SMIReadSector_:_Read_LBA__0x_x__8Port_issue_fail_n
lea edx, [ebp - 0x198]
push edx
call fcn.004e894d
add esp, 0xc
lea eax, [ebp - 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
jmp 0x47ed33
mov eax, 1
jmp 0x47ed33
mov eax, dword [ebp - 4]
mov esp, ebp
pop ebp
ret