diff --git a/src/gui/Src/Gui/DataCopyDialog.cpp b/src/gui/Src/Gui/DataCopyDialog.cpp index 1d6b9f2e..6ef6411e 100644 --- a/src/gui/Src/Gui/DataCopyDialog.cpp +++ b/src/gui/Src/Gui/DataCopyDialog.cpp @@ -2,6 +2,7 @@ #include "ui_DataCopyDialog.h" #include "Bridge.h" #include +#include #define AF_INET6 23 // Internetwork Version 6 typedef PCTSTR(__stdcall* INETNTOPW)(INT Family, PVOID pAddr, wchar_t* pStringBuf, size_t StringBufSize); @@ -19,6 +20,8 @@ DataCopyDialog::DataCopyDialog(const QVector* data, QWidget* parent) : Q mTypes[DataCString] = FormatType { tr("C-Style String"), 1 }; mTypes[DataCUnicodeString] = FormatType { tr("C-Style Unicode String"), 1 }; mTypes[DataCShellcodeString] = FormatType { tr("C-Style Shellcode String"), 1 }; + mTypes[DataString] = FormatType { tr("String"), 1 }; + mTypes[DataUnicodeString] = FormatType { tr("Unicode String"), 1 }; mTypes[DataPascalByte] = FormatType { tr("Pascal BYTE (Hex)"), 42 }; mTypes[DataPascalWord] = FormatType { tr("Pascal WORD (Hex)"), 21 }; mTypes[DataPascalDword] = FormatType { tr("Pascal DWORD (Hex)"), 10 }; @@ -219,6 +222,18 @@ void DataCopyDialog::printData(DataType type) } break; + case DataString: + { + data = QTextCodec::codecForLocale()->makeDecoder()->toUnicode((const char*)(mData->data()), mData->size()); + } + break; + + case DataUnicodeString: + { + data = QString::fromUtf16((const ushort*)(mData->data()), mData->size() / sizeof(ushort)); + } + break; + case DataPascalByte: { data += QString().sprintf("Array [1..%u] of Byte = (\n", mData->size()); diff --git a/src/gui/Src/Gui/DataCopyDialog.h b/src/gui/Src/Gui/DataCopyDialog.h index e8b5f974..0921753b 100644 --- a/src/gui/Src/Gui/DataCopyDialog.h +++ b/src/gui/Src/Gui/DataCopyDialog.h @@ -37,6 +37,8 @@ private: DataCString, DataCUnicodeString, DataCShellcodeString, + DataString, + DataUnicodeString, DataPascalByte, DataPascalWord, DataPascalDword,