by ghost107 on Sat Sep 01, 2012 5:20 pm
([msg=69090]see Re: C Keylogger or process attachment[/msg])
For attaching to another process you should read on this windows API:
OpenProcess()
VirtualAlloc()
ReadProcessMemory, WriteProcessMemory(This functions are detectable by the AV, so instead use VirtualProtect + memcpy, memset)
CloseHandle()
Now for For Injecting a DLL:
LoadLibrary()
GetProcAddress()
FreeLibrary()
To make a program that it is not seen you should learn to hook NtQuerySystemInformation, to remove your program from process list.
If hooking NtQuerySystemInformation is too hard you could always just make your application invisible or don't create a window,this way you will only be visible into the system processes.
To read keyboard keys there are some windows API like GetAsyncKeyState().