Prevent DEDE software to compile DELPHI programs

zhaozj2021-02-08  245

Prevent DEDE Software Reconciliation Delphi Program This is to prevent DEDE software from compiling Delphi programs ~ "" is my comment, the rest is original creation ~

PROGRAM Project1;

Uses forms, windows, sysutils, unit1 in 'unit1.pas' {form1}, unit2 in 'unit2.pas' {form2};

Function RegisterServiceProcess (dwProcessId, dwType: dword): Integer; Stdcall; External 'kernel32.dll' {$ R * .RES} Var HMUTEX: HWND; RET: INTEGER; hCurrentWindow: HWnd; // to decompile the szText: Array [ 0..254] OF Char; // Reflexible Begin Application.initialize; Application.Title: = 'Delphi Sunflower Breakfast Design: Zhang Guopeng'; RegisterServiceProcess (GetCurrentProcessid, 1); // Let the program in CTL Alt Del Disappeared in.

"We can see that the author registers the program into a Windows service program ~" "But everyone knows that this function is included in the Kernel32, and only in the 98 / ME tube ~" ", do not compile this as an anti-compilation The key, it can be said that there is no ~ "

/ / Prevent anti-compilation start hcurrentWindow: = getWindow (Application.handle, GW_HWndFirst);

"From the above, the author wants to know that his program window is not the top window."

While HcurrentWindow <> 0 Do Begin if getWindowText (HcurrentWindow, @sztext, 255)> 0 Then IF POS ('Dede', StrPas) <> 0 THEN

"If not, get the title of the top-machine form, is not" Dede "in doing judgment

Begin Application.MessageBox ('wants to compile me? Not that is easy!', 'Haha ... Your guy!', Mb_ok); // closewindow (hcurrentwindow); // minimize EnableWindow (HcurrentWindow, False); // Make the program's window cannot be activated If you can get the thread ID number of the program, you can make the program can't use, can't turn off, cool?

"The above two sentences are the processing of Dede ~" "CloseWindow: To minimize the set window, but the window will not clear from memory ~" "EnableWindow: Allow / prohibit the mouse and keyboard in the specified window, False is definitely can't ~ "

Halt; end; hcurrentwindow: = getWindow (hcurrentwindow, gw_hwndnext); END; / / Prevent anti-compilation end / / Prevent the secondary run of the program HMutex: = CreateMutex (Nil, False, 'delphi Sunflower Breve Design: Zhang Guopeng'); RET : = GETLASTERROR; If RET <> ERROR_ALREADY_EXISTS Then Begin Application.CreateForm (TForm1, Form1); // Application.CreateForm (TForm2, Form2); Application.Run; End Else APPLICATION.MESSAGEBOX ( 'program is already running!', 'tips ', MB_OK; ReleaseMutex (HMutex); END.

"Talk to my opinion, this method may be a simple way to prevent anti-compilation, but because it is too simple," I am not very useful now, maybe you can deal with some beginners, we can see The name of the window "" Dede "is only a string, there is no important position in the program, that is, it is not delayed" "The program is running, we can use some software to put all" all " "Change to other characters, huh, huh, this" "The program is not logical thinking, you can have no way to" Dede "after the change, it will be ^ _ ^ ~~~~~~"

转载请注明原文地址:https://www.9cbs.com/read-2767.html

New Post(0)