1
0
mirror of synced 2024-11-28 01:10:55 +01:00
This commit is contained in:
ptmaster 2024-03-26 13:48:22 +00:00
parent b14349537d
commit 978487b865

View File

@ -158,11 +158,18 @@ HOOK_DYNAMIC (i64, __fastcall, copy_data, i64, void *dest, int length) {
} else if (gMode == Mode::Plugin) {
FARPROC getQrEvent = GetProcAddress (gPlugin, "getQr");
if (getQrEvent) {
auto byteData = ((GetQrEvent*) getQrEvent) ();
std::cout << "Plugin QR: " << ZXing::ToHex (byteData) << std::endl;
auto dataSize = byteData.size ();
std::vector<BYTE> byteBuffer = ((GetQrEvent*) getQrEvent) ();
memcpy (dest, byteData.data (), dataSize);
std::stringstream ss;
ss << std::hex << std::setfill('0');
for (const auto& byte : bytes) {
ss << std::setw(2) << static_cast<int>(byte);
}
std::cout << "Plugin QR: " << ss.str() << std::endl;
auto dataSize = byteBuffer.size();
memcpy (dest, byteBuffer.data(), dataSize);
gState = State::Ready;
gMode = Mode::Card;
return dataSize;