MCPcopy Create free account
hub / github.com/WallBreaker2/op / trimNullByteLength

Function trimNullByteLength

libop/memory/ProcessMemory.cpp:60–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60size_t trimNullByteLength(const vector<uchar> &bin, size_t charWidth) {
61 if (charWidth == 0 || bin.empty())
62 return 0;
63 for (size_t i = 0; i + charWidth <= bin.size(); i += charWidth) {
64 bool zero = true;
65 for (size_t j = 0; j < charWidth; ++j) {
66 if (bin[i + j] != 0) {
67 zero = false;
68 break;
69 }
70 }
71 if (zero)
72 return i;
73 }
74 return bin.size();
75}
76
77bool address_has_operator(const wstring &address) {
78 for (wchar_t c : address) {

Callers 1

ReadStringMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected