Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. #include "stdafx.h"
  2.  
  3. static void error_callback(int error, const char* description)
  4. {
  5. //DbgPrint("Error %d: %s\n", error, description);
  6. }
  7.  
  8. bool CreateMenus()
  9. {
  10. // Setup window
  11. glfwSetErrorCallback(error_callback);
  12. if (!glfwInit())
  13. return 1;
  14. glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
  15. glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
  16. glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  17. #if __APPLE__
  18. glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
  19. #endif
  20. GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL3 example", NULL, NULL);
  21. glfwMakeContextCurrent(window);
  22. glfwSwapInterval(1); // Enable vsync
  23. gl3wInit();
  24.  
  25. // Setup ImGui binding
  26. ImGui_ImplGlfwGL3_Init(window, true);
  27.  
  28. // Load Fonts
  29. // - If no fonts are loaded, dear imgui will use the default font. You can also load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
  30. // - AddFontFromFileTTF() will return the ImFont* so you can store it if you need to select the font among multiple.
  31. // - If the file cannot be loaded, the function will return NULL. Please handle those errors in your application (e.g. use an assertion, or display an error and quit).
  32. // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call.
  33. // - Read 'extra_fonts/README.txt' for more instructions and details.
  34. // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ !
  35. //ImGuiIO& io = ImGui::GetIO();
  36. //io.Fonts->AddFontDefault();
  37. //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Roboto-Medium.ttf", 16.0f);
  38. //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f);
  39. //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
  40. //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
  41. //ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
  42. //IM_ASSERT(font != NULL);
  43.  
  44. bool show_test_window = true;
  45. bool show_another_window = false;
  46. ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
  47.  
  48. // Main loop
  49. while (!glfwWindowShouldClose(window))
  50. {
  51. glfwPollEvents();
  52.  
  53. ImGui_ImplGlfwGL3_NewFrame();
  54.  
  55. const ImVec2 size(300, 200);
  56. bool open = true;
  57. float alpha = 0.90f;
  58. // ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_ShowBorders ;
  59. //std::string textBtn = "(" + std::to_string(click_count) + ") Clicks";
  60.  
  61. ImGui::Begin("Primera ventana", &open, size, alpha);
  62. ImGui::Text("Muestra un texto en la ventana.");
  63. // if (ImGui::Button(textBtn.c_str())) click_count++;
  64. ImGui::End();
  65.  
  66. int display_w, display_h;
  67. glfwGetFramebufferSize(window, &display_w, &display_h);
  68. glViewport(0, 0, display_w, display_h);
  69. glClear(GL_COLOR_BUFFER_BIT);
  70.  
  71. ImGui::Render();
  72.  
  73. glfwSwapBuffers(window);
  74. }
  75.  
  76. // Cleanup
  77. ImGui_ImplGlfwGL3_Shutdown();
  78. glfwTerminate();
  79. }
  80.  
  81. void InitCheat( )
  82. {
  83. while( !HwInit( ) )
  84. Sleep( 90 );
  85.  
  86. for( int i = 0; i < 10; i++ )
  87. {
  88. GetCEFuncs();
  89. }
  90.  
  91. pEngfuncs->Con_Printf( "This Work Perfect!" );
  92.  
  93. CreateMenus();
  94. }
  95.  
  96.  
  97. BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
  98. {
  99. if( ul_reason_for_call == DLL_PROCESS_ATTACH )
  100. {
  101. DisableThreadLibraryCalls((HINSTANCE)hModule);
  102.  
  103. CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)InitCheat, 0, 0, 0 );
  104.  
  105. /* DWORD ThreadAdresi = 0x01400000, Old; // aki ba el start adrez :v
  106. VirtualProtect((LPVOID)ThreadAdresi,0x1000,PAGE_EXECUTE_READWRITE,&Old);
  107. CONTEXT ctx;
  108. HANDLE tHand = CreateRemoteThread(GetCurrentProcess(),0,0,(LPTHREAD_START_ROUTINE)0x01400000,0,0,0);
  109. SuspendThread(tHand);
  110. ctx.ContextFlags = CONTEXT_INTEGER;
  111. GetThreadContext(tHand, &ctx);
  112. ctx.Eax = (DWORD)InitCheat; // aki el rial adrez v:
  113. ctx.ContextFlags = CONTEXT_INTEGER;
  114. SetThreadContext(tHand, &ctx);
  115. ResumeThread(tHand); */
  116. // return Thread;//(LPVOID)ctx.Eax;
  117. }
  118.  
  119. return TRUE;
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement