1
0
mirror of synced 2024-12-04 20:17:55 +01:00

Send card data over on swipe

This commit is contained in:
Bemani Witch 2022-07-14 18:40:12 +02:00
parent ee253d92f3
commit 807265765e
2 changed files with 46 additions and 4 deletions

View File

@ -1,6 +1,8 @@
#include "banapass.h" #include "banapass.h"
#include "log.h" #include "log.h"
#include <thread>
#include <chrono>
#include <string>
#define BANA_API_VERSION "Ver 1.6.0" #define BANA_API_VERSION "Ver 1.6.0"
extern "C" extern "C"
@ -160,10 +162,50 @@ int BngRwReqSendUrlTo(UINT a, int b, UINT c, int* d,
return 1; return 1;
} }
int BngRwReqWaitTouch(UINT a, int b, UINT c, ULONGLONG d, ULONGLONG e) int BngRwReqWaitTouch(UINT a, int maxIntSomehow, UINT c, void (*callback)(int, int, void*, void*), void* e)
{ {
log("BngRwReqWaitTouch()\n"); log("BngRwReqWaitTouch()\n");
return GetAsyncKeyState('C') ? 0 : -1;
if (GetAsyncKeyState('C')) {
// Raw card data and some other stuff, who cares
unsigned char rawCardData[168] = {
0x01, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x92, 0x2E, 0x58, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x7F, 0x5C, 0x97, 0x44, 0xF0, 0x88, 0x04, 0x00,
0x43, 0x26, 0x2C, 0x33, 0x00, 0x04, 0x06, 0x10, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4E, 0x42, 0x47, 0x49, 0x43, 0x36, 0x00, 0x00, 0xFA, 0xE9, 0x69, 0x00,
0xF6, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
std::string accessCode = "30764352518498791337";
std::string chipId = "7F5C9744F111111143262C3300040610";
memcpy(rawCardData + 0x50, accessCode.c_str(), accessCode.size() + 1);
memcpy(rawCardData + 0x2C, chipId.c_str(), chipId.size() + 1);
int dn = 0;
int reader_status = 0;
std::thread t(callback, dn, reader_status, rawCardData, e);
t.detach();
// this is a really ugly hack, forgive me
using namespace std::chrono_literals;
std::this_thread::sleep_for(100ms);
return 1;
}
else {
return -1;
}
} }
} }

View File

@ -27,7 +27,7 @@ extern "C"
BANA_API int BngRwReqLed(UINT, UINT, ULONGLONG, ULONGLONG); BANA_API int BngRwReqLed(UINT, UINT, ULONGLONG, ULONGLONG);
BANA_API int BngRwReqSendMailTo(UINT, int, UINT, int*, char*, char*, char*, char*, ULONGLONG, ULONGLONG); BANA_API int BngRwReqSendMailTo(UINT, int, UINT, int*, char*, char*, char*, char*, ULONGLONG, ULONGLONG);
BANA_API int BngRwReqSendUrlTo(UINT, int, UINT, int*, char*, char*, ULONGLONG, ULONGLONG); BANA_API int BngRwReqSendUrlTo(UINT, int, UINT, int*, char*, char*, ULONGLONG, ULONGLONG);
BANA_API int BngRwReqWaitTouch(UINT, int, UINT, ULONGLONG, ULONGLONG); BANA_API int BngRwReqWaitTouch(UINT a, int maxIntSomehow, UINT c, void (*callback)(int, int, void*, void*), void* e);
BANA_API ULONGLONG BngRwReqSetLedPower(); BANA_API ULONGLONG BngRwReqSetLedPower();
} }