Skip to content

Commit dd60185

Browse files
committed
Hacky dumping of scsi commands
1 parent 92b2f25 commit dd60185

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

windows/CLI/CLI.vcxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,32 @@
8181
<ProjectGuid>{267E9D28-7245-4182-9740-F386F4299E83}</ProjectGuid>
8282
<Keyword>Win32Proj</Keyword>
8383
<RootNamespace>CLI</RootNamespace>
84-
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
84+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
8585
</PropertyGroup>
8686
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8787
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
8888
<ConfigurationType>Application</ConfigurationType>
8989
<UseDebugLibraries>true</UseDebugLibraries>
90-
<PlatformToolset>v141</PlatformToolset>
90+
<PlatformToolset>v142</PlatformToolset>
9191
<CharacterSet>NotSet</CharacterSet>
9292
</PropertyGroup>
9393
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
9494
<ConfigurationType>Application</ConfigurationType>
9595
<UseDebugLibraries>false</UseDebugLibraries>
96-
<PlatformToolset>v141</PlatformToolset>
96+
<PlatformToolset>v142</PlatformToolset>
9797
<WholeProgramOptimization>true</WholeProgramOptimization>
9898
<CharacterSet>NotSet</CharacterSet>
9999
</PropertyGroup>
100100
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
101101
<ConfigurationType>Application</ConfigurationType>
102102
<UseDebugLibraries>true</UseDebugLibraries>
103-
<PlatformToolset>v141</PlatformToolset>
103+
<PlatformToolset>v142</PlatformToolset>
104104
<CharacterSet>NotSet</CharacterSet>
105105
</PropertyGroup>
106106
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
107107
<ConfigurationType>Application</ConfigurationType>
108108
<UseDebugLibraries>false</UseDebugLibraries>
109-
<PlatformToolset>v141</PlatformToolset>
109+
<PlatformToolset>v142</PlatformToolset>
110110
<WholeProgramOptimization>true</WholeProgramOptimization>
111111
<CharacterSet>NotSet</CharacterSet>
112112
</PropertyGroup>

windows/DtaDiskNVMe.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ along with sedutil. If not, see <http://www.gnu.org/licenses/>.
3232
#include "DtaStructures.h"
3333
#include "DtaHexDump.h"
3434
#include "DtaDiskUSB.h"
35+
#include <fstream>
3536

3637
using namespace std;
3738

@@ -144,6 +145,16 @@ uint8_t DtaDiskNVMe::sendCmd(ATACOMMAND cmd, uint8_t protocol, uint16_t comID,
144145
&bytesReturn,
145146
NULL);
146147

148+
static int op = 0;
149+
ofstream fout;
150+
++op;
151+
LOG(I) << " ";
152+
LOG(I) << (cmd == IF_RECV ? "recv" : "send") + std::to_string(op) + " '" + std::to_string(protocol) + "' '" + std::to_string(comID) + "'";
153+
DtaHexDump(buffer, bufferlen);
154+
fout.open((cmd == IF_RECV ? "recv" : "send") + std::to_string(op) + ".bin", ios::binary | ios::out);
155+
fout.write((char*)buffer, bufferlen);
156+
fout.close();
157+
147158
if (0 == iRet)
148159
{
149160
LOG(D4) << "cdb after ";

0 commit comments

Comments
 (0)