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

Method WriteString

libop/memory/ProcessMemory.cpp:426–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426long ProcessMemory::WriteString(HWND hwnd, const wstring &address, long type, const wstring &value) {
427 vector<uchar> bin;
428 // type follows the historical DM convention: 0=ACP/GBK, 1=UTF-16, 2=UTF-8.
429 switch (type) {
430 case 1:
431 bin = encodeUnicodeBytes(value);
432 break;
433 case 2:
434 bin = wideToBytes(value, CP_UTF8, true);
435 break;
436 case 0:
437 default:
438 bin = wideToBytes(value, CP_ACP, true);
439 break;
440 }
441 if (bin.empty())
442 return 0;
443 return WriteRaw(hwnd, address, bin.data(), bin.size()) ? 1 : 0;
444}
445
446bool ProcessMemory::prepare_process(HWND hwnd) {
447 _hwnd = hwnd;

Callers

nothing calls this directly

Calls 5

encodeUnicodeBytesFunction · 0.85
wideToBytesFunction · 0.85
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected