Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma warning(disable: 4793)
- #include <windows.h>
- #include "Functions.h"
- #include "Form1.h"
- #define JMP(start, target) (int)(((int)target - (int)start) - 5)
- using namespace TabTeaBot;
- [STAThreadAttribute]
- int Main()
- {
- Application::EnableVisualStyles();
- Application::SetCompatibleTextRenderingDefault(false);
- Application::Run(gcnew Form1());
- return 0;
- }
- BOOL Jump(unsigned long ulAddress, void* Function, unsigned long ulNops)
- {
- __try
- {
- *(unsigned char*)ulAddress = 0xE9;
- *(unsigned long*)(ulAddress + 1) = JMP(ulAddress, Function);
- memset((void*)(ulAddress + 5), 0x90, ulNops);
- return true;
- }
- __except (EXCEPTION_EXECUTE_HANDLER) { return false; }
- }
- bool Call(unsigned long ulAddress, void* Function, unsigned long ulNops)
- {
- __try
- {
- *(unsigned char*)ulAddress = 0xE8;
- *(unsigned long*)(ulAddress + 1) = jmp(ulAddress, Function);
- memset((void*)(ulAddress + 5), 0x90, ulNops);
- return true;
- }
- __except (EXCEPTION_EXECUTE_HANDLER) { return false; }
- }
- unsigned long GetCall(unsigned long ulAddress)
- {
- if (*(unsigned char*)ulAddress == 0xE8) return (unsigned long)(ulAddress + 5 + *(int*)(ulAddress + 1));
- return NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement