| 203 | } |
| 204 | |
| 205 | std::string hexdump(const BYTE *buf, int nLength, int nDumpUnitSize /*=1*/) |
| 206 | { |
| 207 | int nCharsInResult= nLength*(nDumpUnitSize==1?3:nDumpUnitSize==2?5:nDumpUnitSize==4?9:9); |
| 208 | std::string line; |
| 209 | |
| 210 | line.reserve(nCharsInResult); |
| 211 | |
| 212 | switch(nDumpUnitSize) |
| 213 | { |
| 214 | case 1: hexdumpbytes(line, buf, nLength); break; |
| 215 | case 2: hexdumpwords(line, (WORD*)buf, nLength); break; |
| 216 | case 4: hexdumpdwords(line, (DWORD*)buf, nLength); break; |
| 217 | } |
| 218 | return line; |
| 219 | } |
| 220 | std::string hexdump(DWORD dwOffset, const BYTE *buf, int nLength, int nDumpUnitSize /*=1*/, int nMaxUnitsPerLine /*=16*/) |
| 221 | { |
| 222 | int nCharsInLine= 10+nMaxUnitsPerLine*(nDumpUnitSize==1?4:nDumpUnitSize==2?6:nDumpUnitSize==4?10:10); |
no test coverage detected