Update qr.cpp
This commit is contained in:
parent
da82e958d7
commit
8572c9876d
@ -22,7 +22,7 @@ extern std::vector<HMODULE> plugins;
|
|||||||
|
|
||||||
typedef void event ();
|
typedef void event ();
|
||||||
typedef bool CheckQrEvent();
|
typedef bool CheckQrEvent();
|
||||||
typedef int GetQrEvent(unsigned char *buf_);
|
typedef int GetQrEvent(int, unsigned char*);
|
||||||
|
|
||||||
namespace patches::Qr {
|
namespace patches::Qr {
|
||||||
|
|
||||||
@ -163,15 +163,15 @@ HOOK_DYNAMIC (i64, __fastcall, copy_data, i64, void *dest, int length) {
|
|||||||
} else if (gMode == Mode::Plugin) {
|
} else if (gMode == Mode::Plugin) {
|
||||||
FARPROC getQrEvent = GetProcAddress (gPlugin, "getQr");
|
FARPROC getQrEvent = GetProcAddress (gPlugin, "getQr");
|
||||||
if (getQrEvent) {
|
if (getQrEvent) {
|
||||||
unsigned char plugin_data[10086] ;
|
unsigned char plugin_data[length];
|
||||||
int buf_len = ((GetQrEvent*) getQrEvent) (plugin_data);
|
int buf_len = ((GetQrEvent*) getQrEvent) (length, plugin_data);
|
||||||
|
if (buf_len > 0) {
|
||||||
memcpy (dest, plugin_data, buf_len);
|
memcpy (dest, plugin_data, buf_len);
|
||||||
|
}
|
||||||
gState = State::Ready;
|
gState = State::Ready;
|
||||||
gMode = Mode::Card;
|
|
||||||
return buf_len;
|
return buf_len;
|
||||||
} else {
|
} else {
|
||||||
gState = State::Ready;
|
gState = State::Ready;
|
||||||
gMode = Mode::Card;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user