Skip to content

Commit

Permalink
Add hexdump to help determine what I am sending and receiving
Browse files Browse the repository at this point in the history
Also added a class shell with copyrite message
  • Loading branch information
r0m30 committed Mar 19, 2014
1 parent 1e2fa63 commit e776fbd
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,4 @@ $RECYCLE.BIN/

# Mac desktop service store files
.DS_Store
*.lnk
28 changes: 28 additions & 0 deletions msed/Class_Skeleton.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* C:B**************************************************************************
This software is Copyright © 2014 Michael Romeo <r0m30@r0m30.com>
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* C:E********************************************************************** */
#include "os.h"
#include "Class_Skeleton.h"


Class_Skeleton::Class_Skeleton()
{
}


Class_Skeleton::~Class_Skeleton()
{
}
25 changes: 25 additions & 0 deletions msed/Class_Skeleton.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once
/* C:B**************************************************************************
This software is Copyright © 2014 Michael Romeo <r0m30@r0m30.com>
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* C:E********************************************************************** */
#pragma once
class Class_Skeleton
{
public:
Class_Skeleton();
~Class_Skeleton();
};

3 changes: 3 additions & 0 deletions msed/Discovery0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "Discovery0.h"
#include "D0Structures.h"
#include "Endianfixup.h"
#include "HexDump.h"
#include <iostream>

using namespace std;
Expand All @@ -39,6 +40,8 @@ Discovery0::Discovery0(LPVOID d0Response)
Discovery0Features * body;
epos = cpos = (UINT8 *)d0Response;
hdr = (Discovery0Header *)d0Response;
cout << "\nDumping D0Response"<< std::endl;
HexDump(hdr, SWAP32(hdr->length));
epos = epos + SWAP32(hdr->length);
cpos = cpos + 48; // TODO: check header version

Expand Down
28 changes: 28 additions & 0 deletions msed/HexDump.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* C:B**************************************************************************
This software is Copyright © 2014 Michael Romeo <r0m30@r0m30.com>
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* C:E********************************************************************** */
#include "os.h"
#include <stdio.h>
void HexDump(void * address, int length) {
UINT8 * cpos = (UINT8 *)address;
UINT8 * epos = cpos + length;
printf("\n");
while (cpos < epos){
printf("%02x %02x %02x %02x %02x %02x %02x %02x ", cpos[0], cpos[1], cpos[2], cpos[3], cpos[4], cpos[5], cpos[6], cpos[7]);
printf("%02x %02x %02x %02x %02x %02x %02x %02x\n", cpos[8], cpos[9], cpos[10], cpos[11], cpos[12], cpos[13], cpos[14], cpos[15]);
cpos = cpos + 16;
}
}
18 changes: 18 additions & 0 deletions msed/HexDump.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* C:B**************************************************************************
This software is Copyright © 2014 Michael Romeo <r0m30@r0m30.com>
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* C:E********************************************************************** */
#pragma once
void HexDump(void * address, int length);
7 changes: 7 additions & 0 deletions msed/msed.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,27 @@
<Text Include="win32\ReadMe_Windows.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Class_Skeleton.h" />
<ClInclude Include="D0Structures.h" />
<ClInclude Include="Discovery0.h" />
<ClInclude Include="DiskList.h" />
<ClInclude Include="Endianfixup.h" />
<ClInclude Include="HexDump.h" />
<ClInclude Include="os.h" />
<ClInclude Include="scandisk.h" />
<ClInclude Include="Session.h" />
<ClInclude Include="TCGLexicon.h" />
<ClInclude Include="win32\Device.h" />
<ClInclude Include="win32\DiskList_Win32.h" />
<ClInclude Include="win32\ioctlATA.h" />
<ClInclude Include="win32\os_Win32.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Class_Skeleton.cpp" />
<ClCompile Include="Discovery0.cpp" />
<ClCompile Include="HexDump.cpp" />
<ClCompile Include="msed.cpp" />
<ClCompile Include="Session.cpp" />
<ClCompile Include="win32\Device.cpp" />
<ClCompile Include="win32\DiskList.cpp" />
<ClCompile Include="win32\ioctlATA.cpp" />
Expand Down
21 changes: 21 additions & 0 deletions msed/msed.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@
<ClInclude Include="win32\Device.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Class_Skeleton.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="HexDump.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Session.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TCGLexicon.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="msed.cpp">
Expand All @@ -80,5 +92,14 @@
<ClCompile Include="win32\Device.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Class_Skeleton.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HexDump.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Session.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

0 comments on commit e776fbd

Please sign in to comment.