stichwort dll injection.
damit kannst du ein eigenes programm (sofern du es als dll compilierst)
in ein anderes einschleusen und somit sogar neue funktionen hinzufügen!

du brauchst nur nen injector und etwas verständnis

den injector gibts hier im forum. das verständnis kann ich dir nicht geben nur nen beispiel code
Code: Alles auswählen
; PureBasic Visual Designer v3.95 build 1485 (PB4Code)
IncludeFile "test_injection_include.pb"
InitKeyboard()
Procedure main()
start:
While GetAsyncKeyState_(#VK_HOME) = 0
Debug PeekB(*0x0040D564)
Delay(10)
Wend
Open_Window_0()
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
CloseWindow(#Window_0)
Goto start
EndProcedure
CreateThread(@main(),0)
der injector:
Code: Alles auswählen
Procedure DebugPrevileg(Flag)
Define tk.TOKEN_PRIVILEGES, hToken.l
OpenProcessToken_(GetCurrentProcess_(),#TOKEN_ADJUST_PRIVILEGES | #TOKEN_QUERY | #TOKEN_READ, @hToken)
LookupPrivilegeValue_(0,"SeDebugPrivilege",tk\Privileges\Luid)
tk\PrivilegeCount = 1
If Flag = #True
tk\Privileges\Attributes = #SE_PRIVILEGE_ENABLED
Else
tk\Privileges\Attributes = 0
EndIf
AdjustTokenPrivileges_(hToken,0,tk,0,0,0)
EndProcedure
Procedure Inject(PID,DLLPath.s)
Define hThread.l, hProcess.l,pLibRemote.l,hLibModule.l
DebugPrevileg(#True)
hProcess = OpenProcess_(#PROCESS_ALL_ACCESS, #False, PID)
pLibRemote = VirtualAllocEx_(hProcess, #Null, 255, #MEM_COMMIT, #PAGE_READWRITE)
WriteProcessMemory_(hProcess, pLibRemote, DLLPath, 255, #Null)
hThread = CreateRemoteThread_(hProcess,#Null,0,GetProcAddress_(GetModuleHandle_("Kernel32"), "LoadLibraryA"),pLibRemote,0,#Null)
WaitForSingleObject_(hThread, #INFINITE)
GetExitCodeThread_(hThread, @hLibModule)
CloseHandle_(hThread)
CloseHandle_(hProcess)
VirtualFreeEx_(hProcess, pLibRemote, SizeOf(DLLPath), #MEM_RELEASE)
DebugPrevileg(#False)
ProcedureReturn hLibModule
EndProcedure
; Protected Result.l,DllFileName$,Size.l,Process.l,RemoteMem.l,BytesWritten.l,LoadLibrary_Address.l,hThread.l
dllpath.s = OpenFileRequester("Dll to inject..." ,"*.dll", "Dll |*.dll", 0)
OpenConsole()
PrintN("enter PID: ")
pid$ = Input()
CloseConsole()
Inject(Val(pid$),dllpath.s)