Answer the question
In order to leave comments, you need to log in
How to pass control to __asm?
Hello.
Let's say we have this code:
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
PROCESSENTRY32 entry;
DWORD procID = 0;
if (Process32First(snapshot, &entry) == TRUE) {
while (Process32Next(snapshot, &entry) == TRUE) {
if (strcmp(entry.szExeFile, "Checker.exe") == 0) {
procID = entry.th32ProcessID;
}
}
}
if (procID != 0) {
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS | PROCESS_VM_READ, NULL, procID);
__asm {
mov eax, hProcess
push eax
push 0
call TerminateProcess
}
}
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS | PROCESS_VM_READ, NULL, procID);
__asm {
mov eax, hProcess
push eax
push 0
call TerminateProcess
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question