-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b543800
commit 367f28c
Showing
5 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Project: mkbsod | ||
# Makefile created by Dev-C++ 5.11 | ||
|
||
CPP = g++.exe | ||
CC = gcc.exe | ||
WINDRES = windres.exe | ||
OBJ = main.o | ||
LINKOBJ = main.o | ||
LIBS = -L"C:/Program Files/Dev-Cpp/MinGW64/lib32" -L"C:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static-libgcc -m32 | ||
INCS = -I"C:/Program Files/Dev-Cpp/MinGW64/include" -I"C:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" | ||
CXXINCS = -I"C:/Program Files/Dev-Cpp/MinGW64/include" -I"C:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++" | ||
BIN = mkbsod.exe | ||
CXXFLAGS = $(CXXINCS) -m32 | ||
CFLAGS = $(INCS) -m32 | ||
RM = rm.exe -f | ||
|
||
.PHONY: all all-before all-after clean clean-custom | ||
|
||
all: all-before $(BIN) all-after | ||
|
||
clean: clean-custom | ||
${RM} $(OBJ) $(BIN) | ||
|
||
$(BIN): $(OBJ) | ||
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS) | ||
|
||
main.o: main.c | ||
$(CC) -c main.c -o main.o $(CFLAGS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include<windows.h> | ||
#include<Tlhelp32.h> | ||
#include<stdlib.h> | ||
#include<stdio.h> | ||
DWORD GetProcessID(char *FileName) //获取进程ID | ||
{ | ||
HANDLE myhProcess; | ||
PROCESSENTRY32 mype; | ||
BOOL mybRet; | ||
//进行进程快照 | ||
myhProcess=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); //TH32CS_SNAPPROCESS快照所有进程 | ||
//开始进程查找 | ||
mybRet=Process32First(myhProcess,&mype); | ||
//循环比较,得出ProcessID | ||
while(mybRet) | ||
{ | ||
if(strcmp(FileName,mype.szExeFile)==0) | ||
return mype.th32ProcessID; | ||
else | ||
mybRet=Process32Next(myhProcess,&mype); | ||
} | ||
return 0; | ||
} | ||
|
||
int main(void) | ||
{ | ||
//取得debug权限 | ||
HANDLE hToken; | ||
TOKEN_PRIVILEGES tp; | ||
LUID Luid; | ||
|
||
OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &hToken); | ||
LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &Luid); | ||
tp.PrivilegeCount=1; | ||
tp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED; | ||
tp.Privileges[0].Luid=Luid; | ||
AdjustTokenPrivileges(hToken, 0, &tp, sizeof(TOKEN_PRIVILEGES), NULL, NULL); | ||
//Sleep(120000); | ||
DebugActiveProcess(GetProcessID("csrss.exe")); | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[Project] | ||
FileName=mkbsod.dev | ||
Name=mkbsod | ||
Type=1 | ||
Ver=2 | ||
ObjFiles= | ||
Includes= | ||
Libs= | ||
PrivateResource= | ||
ResourceIncludes= | ||
MakeIncludes= | ||
Compiler= | ||
CppCompiler= | ||
Linker= | ||
IsCpp=0 | ||
Icon= | ||
ExeOutput= | ||
ObjectOutput= | ||
LogOutput= | ||
LogOutputEnabled=0 | ||
OverrideOutput=0 | ||
OverrideOutputName= | ||
HostApplication= | ||
UseCustomMakefile=0 | ||
CustomMakefile= | ||
CommandLine= | ||
Folders= | ||
IncludeVersionInfo=0 | ||
SupportXPThemes=0 | ||
CompilerSet=0 | ||
CompilerSettings=0000000000000000000000000 | ||
|
||
[VersionInfo] | ||
Major=1 | ||
Minor=0 | ||
Release=0 | ||
Build=0 | ||
LanguageID=1033 | ||
CharsetID=1252 | ||
CompanyName= | ||
FileVersion= | ||
FileDescription=Developed using the Dev-C++ IDE | ||
InternalName= | ||
LegalCopyright= | ||
LegalTrademarks= | ||
OriginalFilename= | ||
ProductName= | ||
ProductVersion= | ||
AutoIncBuildNr=0 | ||
SyncProduct=1 | ||
|