![]() |
#1
|
||||
|
||||
a good GUI framework for writing keygen: ImGui
For writing keygen, only limited types of widgets are needed, such as EditBox/Button/ComboBox/CheckBox etc.
Dear ImGui is a good GUI framework for writing keygen, with the concept of "Immediate Mode GUI", which is quite different from stateful GUI framework such as MFC/Qt etc. The generated EXE is less than 200KB with "Win32 + DirectX" binding and static CRT linking and /OPT:REF and /OPT:ICF. If you cut some source code manually, or use VC-LTL(https://github.com/Chuyu-Team/VC-LTL), EXE size can be decreased more. It also has bindings for MacOS and Linux, which means you can also easily write small-size GUI keygen for MacOS and Linux, though different bindings require recompiling. If you want universal binding, SDL binding may be a choice, but the file size may increase. github(we can play with its examples. The author of Dear ImGUI is quite active): https://github.com/ocornut/imgui some hints: 1. uncomment the following macros to cut gamepad support and directx xinput to decrease file size and remove xinput dll dependency. Code:
#define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD #define IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT Code:
ImGuiIO& io = ImGui::GetIO(); io.IniFilename = NULL; Code:
//ImGui::StyleColorsDark(); ImGui::StyleColorsClassic(); //ImGui::StyleColorsLight(); Code:
ImGuiIO& io = ImGui::GetIO(); font = io.Fonts->AddFontFromFileTTF(u8"c:\\windows\\fonts\\cour.ttc", 16.0f * highDPIscaleFactor,...) get DPI scaling factor "highDPIscaleFactor" for current desktop window, then multiply any height/width with this factor. Code:
ImGui_ImplWin32_EnableDpiAwareness(); float highDPIscaleFactor = ImGui_ImplWin32_GetDpiScaleForHwnd(GetDesktopWindow()); Code:
ImGuiStyle& style = ImGui::GetStyle(); style.ScaleAllSizes(highDPIscaleFactor); Code:
HWND hwnd = ::CreateWindow(wc.lpszClassName, L"window demo title", WS_POPUPWINDOW, 0, 0, WINDOW_WIDTH * highDPIscaleFactor, WINDOW_HEIGHT * highDPIscaleFactor, NULL, NULL, wc.hInstance, NULL); Code:
ImGuiIO& io = ImGui::GetIO(); font = io.Fonts->AddFontFromFileTTF(u8"c:\\windows\\fonts\\cour.ttc", 16.0f * highDPIscaleFactor,...) Code:
ImGui::BeginChild("Child", ImVec2(0, 90 * highDPIscaleFactor), true, window_flags); 6. specify widget width with font size. note: font size returned by ImGui::GetFontSize() is already DPI-scaled. 25.0 is the number of chars. If you use CJK font, the font width is double of English fonts, the width of 1 CJK char is that of 2 English chars. Code:
ImGui::PushItemWidth((float)(int)(ImGui::GetFontSize() * 25.0f)); ... ImGui::PopItemWidth(); A window widget is a kind of ImGui widgets whose type is "window". hide win32 main window title: just pass WS_POPUPWINDOW instead of WS_OVERLAPPEDWINDOW to CreateWindow. Code:
HWND hwnd = ::CreateWindow(wc.lpszClassName, L"demo", WS_POPUPWINDOW, 0, 0, WINDOW_WIDTH * highDPIscaleFactor, WINDOW_HEIGHT * highDPIscaleFactor, NULL, NULL, wc.hInstance, NULL); save the title bar height in a global variable for later use. Code:
static int titleBarHeight = 0; ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::SetNextWindowSize(ImGui::GetIO().DisplaySize); bool windowStatus = true; ImGui::Begin(u8"demo window widget title", &windowStatus, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings); if (!titleBarHeight) titleBarHeight = ImGui::GetFrameHeight(); Code:
if (!windowStatus) ::PostQuitMessage(0); Code:
static bool dragWindow = false; // Win32 message handler LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam)) return true; static POINT startPos; switch (msg) { case WM_LBUTTONDOWN: startPos.x = (int)(short)LOWORD(lParam); startPos.y = (int)(short)HIWORD(lParam); if (titleBarHeight > 0 && startPos.y <= titleBarHeight) { dragWindow = true; SetCapture(hWnd); } break; case WM_LBUTTONUP: if (dragWindow) { dragWindow = false; ReleaseCapture(); } break; case WM_MOUSEMOVE: if (dragWindow && (wParam & MK_LBUTTON)) { RECT mainWindowRect; POINT pos; int windowWidth, windowHeight; pos.x = (int)(short)LOWORD(lParam); pos.y = (int)(short)HIWORD(lParam); GetWindowRect(hWnd, &mainWindowRect); windowHeight = mainWindowRect.bottom - mainWindowRect.top; windowWidth = mainWindowRect.right - mainWindowRect.left; ClientToScreen(hWnd, &pos); MoveWindow(hWnd, pos.x - startPos.x, pos.y - startPos.y, windowWidth, windowHeight, TRUE); } break; Code:
ImGuiIO& io = ImGui::GetIO(); io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
__________________
AKA Solomon/blowfish. Last edited by WhoCares; 04-09-2020 at 20:52. |
#2
|
|||
|
|||
I remember the good old days where we did not have to play around dealing with all this high DPI support
![]() This framework looks to be for gaming in its intention and not Keynes but an excellent repurposing for sure. Bloat free games would be nice too at any rate. Does this support Ancient OS like WinXP and Win98 as those have become increasingly difficult to target with late MSVC builds. A 32 bit app that runs perfectly everywhere is a rare finder these days. |
#3
|
||||
|
||||
Some comments on what you've suggested so far. (I'm very familiar with ImGui and use it in multiple game-related projects.)
1. You can cut down the 'bloat' as well by disabling the demo code. Code:
#define IMGUI_DISABLE_DEMO_WINDOWS Code:
AddFontFromMemoryTTF AddFontFromMemoryCompressedTTF AddFontFromMemoryCompressedBase85TTF https://github.com/ocornut/imgui/blob/master/examples/imgui_impl_win32.cpp#L344 Using this setup will also link against gdi32.dll as an extra import. As for the scaling of things, ImGui has a means of doing these steps globally instead of having to track and handle the scaling yourself per-object/per-font. For fonts, the ImGui::IO object holds a setting value for this called: Code:
ImGui::GetIO().FontGlobalScale https://github.com/ocornut/imgui/issues/1786#issuecomment-523332319 As for handling rendering, ImGui is designed for games but can be implemented into [virtually] anything as you are in control of how it renders. There used to be a GDI/GDI+ renderer for it but was discontinued as time went on. For a keygen, this would probably be the ideal framework to use as the renderer instead of Direct3D/OpenGL/SDL to keep resources low (if that matters to you). GDI/GDI+ is also back-supported since Windows XP so it should work on any Windows machine, so the total support coverage will be easier to deal with. You can find a pull request that is for a GDI renderer here: https://github.com/ocornut/imgui/pull/2724 I'd recommend using GDI+ instead though for the newer features and better performance. Along with that, you can also introduce layered window usage if need be to completely remove the window and make things transparent by doing this. You can render ImGui to a GDI+ bitmap/surface and use UpdateLayeredWindow to do the final draw/blit with transparency as needed. (Be sure to render the ImGui scene with the needed transparent color key so the unused/background area is the proper color etc.)
__________________
Personal Projects Site: https://atom0s.com |
The Following User Gave Reputation+1 to atom0s For This Useful Post: | ||
WhoCares (04-10-2020) |
#4
|
||||
|
||||
thanks for sharing this
Quote:
__________________
AKA Solomon/blowfish. |
#5
|
||||
|
||||
It's ok for WinXP, just use the XP toolchain of MSVC to compile your source code.
as for Win98, far too old to support it, just forget it ![]() Quote:
__________________
AKA Solomon/blowfish. Last edited by WhoCares; 04-10-2020 at 13:55. |
The Following User Says Thank You to WhoCares For This Useful Post: | ||
chants (04-10-2020) |
#6
|
||||
|
||||
Keygen for VMware ESXi 7.0, with ImGUI, VS 2019 project.
__________________
AKA Solomon/blowfish. |
The Following User Gave Reputation+1 to WhoCares For This Useful Post: | ||
synkro (06-07-2020) |
The Following 9 Users Say Thank You to WhoCares For This Useful Post: | ||
alekine322 (12-08-2022), MarcElBichon (06-04-2020), Mendax47 (06-04-2020), niculaita (06-04-2020), p4r4d0x (06-04-2020), rx3 (12-30-2022), synkro (06-07-2020), uranus64 (12-05-2022), zeuscane (06-05-2020) |
#7
|
||||
|
||||
additional info:
you can slightly edit the source code to make keygens for VMware Workstation/Fusion etc. Just post this to test whether I can edit my own post. The above posts can not be edited due to the forum rules/settings.
__________________
AKA Solomon/blowfish. |
#8
|
|||
|
|||
@WhoCares
do you have plans to add support for VmW workstation products? 2) MS is complaining about using CryptXXX WinAPI as follows: Important This API is deprecated. New and existing software should start using Cryptography Next Generation APIs. Microsoft may remove this API in future releases. Last edited by sendersu; 12-05-2022 at 16:47. |
#9
|
||||
|
||||
Here is the updated for vmware workstation 17
I successfully build it with vs2019 and vs2022, windows sdk 10, there is no deprecation warnings/errors. We can still use crypto api though MS doc says it's deprecated. and, you can replace the SHA1 hasher and strong random number generator with openssl functions. or only use the weak RNG( CRT rand() function ). Quote:
__________________
AKA Solomon/blowfish. |
The Following 3 Users Say Thank You to WhoCares For This Useful Post: | ||
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cracking .NET Framework applications | dee | General Discussion | 1 | 01-16-2003 03:02 |