Advertisement
JordanTGraves

Untitled

Aug 17th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include <istream>
  4. #include <string>
  5.  
  6.  
  7. #define _CRT_SECURE_NO_WARNINGS
  8.  
  9. int main() { return 0; }
  10.  
  11.  
  12.  
  13.  
  14. using namespace std;
  15.  
  16.  
  17. namespace PrintExploit {
  18. namespace Integers {
  19. int OutputType = 2; // 0 = Print, 1 = Info, 2 = Warn, 3 = Error
  20. }
  21. }
  22.  
  23.  
  24. int Address(int Offset) {
  25. return (Offset - 0x00400000 + (DWORD)GetModuleHandle("RobloxPlayerBeta.exe"));
  26. }
  27.  
  28.  
  29. typedef int(__cdecl *SINGLETON)(int a1, const char *a2);
  30. SINGLETON SingletonPrint = (SINGLETON)Address(0x51EB70);
  31.  
  32.  
  33. void ConsoleBypass() {
  34. DWORD CheckerValue;
  35. VirtualProtect((PVOID)&FreeConsole, 1, PAGE_EXECUTE_READWRITE, &CheckerValue);
  36. *(BYTE*)(&FreeConsole) = (0xC3);
  37. }
  38.  
  39.  
  40. void Console(const char* ConsoleTitle) {
  41. ConsoleBypass();
  42. AllocConsole();
  43. SetConsoleTitleA(ConsoleTitle);
  44. freopen("CONOUT$", "w", stdout);
  45. freopen("CONIN$", "r", stdin);
  46. HWND ConsoleHandle = GetConsoleWindow();
  47. ::SetWindowPos(ConsoleHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
  48. ::ShowWindow(ConsoleHandle, SW_NORMAL);
  49. }
  50.  
  51.  
  52.  
  53. void MainFunction() {
  54.  
  55. Console("Print Exploit");
  56. do {
  57. string OutputString = "Print Test";
  58. getline(cin, OutputString);
  59. SingletonPrint(PrintExploit::Integers::OutputType, OutputString.c_str());
  60. } while (true);
  61. }
  62.  
  63.  
  64. int __stdcall DllMain(HMODULE DLL, DWORD Reason, void* Useless) {
  65. if (Reason == 1) {
  66. CreateThread(0, 0, (LPTHREAD_START_ROUTINE)MainFunction, 0, 0, 0);
  67. }
  68. return TRUE;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement