+
@@ -90,8 +96,10 @@ $(function() {
11 if (roundDown < size) unitsNum ++;
12 return unitsNum * unit;
+
+
18 if (buf == NULL)
return false;
@@ -100,8 +108,10 @@ $(function() {
+
+
@@ -110,7 +120,9 @@ $(function() {
+
+
@@ -132,7 +144,9 @@ $(function() {
+
+
@@ -162,7 +176,9 @@ $(function() {
83 BYTE *cntnt = buf + offset;
+
+
@@ -173,8 +189,10 @@ $(function() {
+
+
@@ -182,7 +200,9 @@ $(function() {
+
+
109 if (dstPtr == srcPtr)
return false;
@@ -210,7 +230,9 @@ $(function() {
131 memcpy(dstPtr, srcPtr, srcSize);
+
+
137 std::string newTextStr = newText.toStdString();
@@ -225,7 +247,9 @@ $(function() {
+
+
@@ -237,7 +261,9 @@ $(function() {
159 return QString::fromUtf8(ptr,
static_cast<int>(asciiLen));
+
+
@@ -249,7 +275,9 @@ $(function() {
170 if (ptr == NULL)
return "";
171 return QString::fromUtf16(ptr,
static_cast<int>(len));
+
+
@@ -263,7 +291,9 @@ $(function() {
185 return QString::fromUtf16(ptr,
static_cast<int>(asciiLen));
+
+
@@ -274,7 +304,9 @@ $(function() {
+
+
@@ -285,7 +317,9 @@ $(function() {
206 memset(buf, filling, bufSize);
+
+
212 if (
isValid(buf) ==
false ||
isValid(
this) ==
false)
return false;
@@ -312,7 +346,9 @@ $(function() {
233 memcpy(target, source, sizeToFill);
+
+
239 if (rawOffset ==
INVALID_ADDR || size == 0)
return false;
@@ -332,7 +368,9 @@ $(function() {
+
+
259 if (rawOffset ==
INVALID_ADDR || size == 0)
return false;
@@ -365,14 +403,18 @@ $(function() {
+
290template <
typename INT_TYPE>
+
293 INT_TYPE val = *((INT_TYPE*)ptr);
+
+
299 if (isOk) (*isOk) =
false;
@@ -383,31 +425,35 @@ $(function() {
-
307 if (size ==
sizeof(uint8_t)) val = _getNumValue<uint8_t>(ptr);
-
308 else if (size ==
sizeof(uint16_t)) val = _getNumValue<uint16_t>(ptr);
-
309 else if (size ==
sizeof(uint32_t)) val = _getNumValue<uint32_t>(ptr);
-
310 else if (size ==
sizeof(uint64_t)) val = _getNumValue<uint64_t>(ptr);
+
+
+
+
-
314 if (isOk) (*isOk) =
true;
-
+
314 if (
isOk) (*isOk) =
true;
+
+
318template <
typename INT_TYPE>
-
+
+
-
321 INT_TYPE* valPtr = (INT_TYPE*)ptr;
-
322 if ((*valPtr) == nVal)
return false;
-
+
+
+
+
-
+
+
-
+
333 "Cannot get Ptr at: %llX of size: %lX!",
334 static_cast<unsigned long long>(offset),
@@ -416,20 +462,20 @@ $(function() {
-
340 if (size ==
sizeof(uint8_t)) {
-
+
+
-
344 else if (size ==
sizeof(uint16_t)) {
-
+
344 else if (size ==
sizeof(
uint16_t)) {
+
-
348 else if (size ==
sizeof(uint32_t)) {
-
+
348 else if (size ==
sizeof(
uint32_t)) {
+
-
352 else if (size ==
sizeof(uint64_t)) {
-
+
352 else if (size ==
sizeof(
uint64_t)) {
+
@@ -437,85 +483,96 @@ $(function() {
+
-
+
+
-
364 if (!textPtr)
return false;
+
-
366 size_t newLen = newText.length() + 1;
-
-
+
+
+
-
+
-
376 const char* newTextC = newText.c_str();
-
377 if (!strcmp(newTextC, textPtr)) {
+
+
-
381 if (fieldLimitLen != 0) {
-
+
+
-
384 memset(textPtr, 0, fieldLimitLen);
-
385 if (newLen > fieldLimitLen) {
-
386 newLen = fieldLimitLen;
+
+
+
-
390 memcpy(textPtr, newTextC, newLen);
-
391 textPtr[newLen] =
'\0';
+
+
+
-
+
+
-
397 BYTE *contentPart = this->
getContentAt(offset, contentSize);
-
398 if (!contentPart)
return 0;
+
+
400 if (!fIn.isReadable())
return 0;
-
402 size_t toLoad = fIn.size() < contentSize ? fIn.size() : contentSize;
-
403 BYTE *fBuf = (BYTE*)::calloc(toLoad, 1);
-
+
402 size_t toLoad = fIn.size() < contentSize ? fIn.size() : contentSize;
+
+
-
407 size_t loaded = fIn.read((
char*)fBuf, toLoad);
-
408 memset(contentPart, 0, contentSize);
-
409 memcpy(contentPart, fBuf, loaded);
-
410 free(fBuf); fBuf = NULL;
+
+
+
+
-
+
+
-
-
418 : parent(v_parent), offset(v_offset), size(v_size)
+
+
+
-
420 if (v_parent == NULL)
throw BufferException(
"Cannot make subBuffer for NULL buffer!");
+
+
+
-
+
INT_TYPE _getNumValue(void *ptr)
bool _setNumValue(void *ptr, INT_TYPE nVal)
@@ -562,7 +619,7 @@ $(function() {