Hirdetés
- Xiaomi 15T - reakció nélkül nincs egyensúly
- Poco F8 Ultra – forrónaci
- Papírvékony a jövő a Samsungnál: íme, a Galaxy TriFold!
- Motorola Edge 40 - jó bőr
- Redmi Note 13 Pro 5G - nem százas, kétszázas!
- Milyen okostelefont vegyek?
- Google Pixel topik
- iPhone topik
- Telekom mobilszolgáltatások
- Xiaomi 15T Pro - a téma nincs lezárva
Új hozzászólás Aktív témák
-
Bumbi0
csendes tag
válasz
ArchElf
#1161
üzenetére
Úgy néz ki elakadtam!
Ennek http://www.codeproject.com/KB/threads/winspy.aspx és a fentebb beszúrt linkeknek a segitségével próbálom megoldani, hogy más program memóriájában tudjak keresni.
A most linkelt linken a 3. módszer próbálom megvcalósitani, a kód injektálást a program memóriájába. Ott egy ilyen összegzés látható:
Now, we can summarize this technique in the following steps:
1, Retrieve a HANDLE to the remote process (OpenProces).
2, Allocate memory in the remote process's address space for injected data (VirtualAllocEx).3, Write a copy of the initialised INJDATA structure to the allocated memory (WriteProcessMemory).
4, Allocate memory in the remote process's address space for injected code.
5, Write a copy of ThreadFunc to the allocated memory.
6, Start the remote copy of ThreadFunc via CreateRemoteThread.
7, Wait until the remote thread terminates (WaitForSingleObject).
8, Retrieve the result from the remote process (ReadProcessMemory or GetExitCodeThread).
9, Free the memory allocated in Steps #2 and #4 (VirtualFreeEx).
10, Close the handles retrieved in Steps #6 and #1 (CloseHandle).Elvileg az első kettőt megcsináltam, de nem értem hogy milyen kódot kéne bejuttatnom a process memóriájába!
Az előző hozzászólásban emlitett linkenhez (http://www.codeproject.com/KB/threads/MDumpAll.aspx) hasonló dolog kellene, hogy csak simán a Process memóriában stringet keresni, az egész C-ben van megirva és nem sokat értek belőlle!
Sajnos nem tudom, hogy folytathatnám tovább. Azt nem értem, hogy a ProcDumpos linken nem is emlitenek DLL/kód injektálást és tud a memóriában olvasni, a másik módszernél akkor miért kell?
Előre is köszönöm szépen a segitségeteket!
Eddig igy néz ki a kód:
[DllImport("user32.dll", SetLastError=true)]
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);[DllImport("kernel32.dll")]
static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, UInt32 dwProcessId);[Flags]
enum ProcessAccessFlags : uint
{
All = 0x001F0FFF,
Terminate = 0x00000001,
CreateThread = 0x00000002,
VMOperation = 0x00000008,
VMRead = 0x00000010,
VMWrite = 0x00000020,
DupHandle = 0x00000040,
SetInformation = 0x00000200,
QueryInformation = 0x00000400,
Synchronize = 0x00100000
}[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, UInt32 dwSize, AllocationType flAllocationType, MemoryProtection flProtect);[Flags]
public enum AllocationType : uint
{
Commit = 0x1000,
Reserve = 0x2000,
Decommit = 0x4000,
Release = 0x8000,
Reset = 0x80000,
Physical = 0x400000,
TopDown = 0x100000,
WriteWatch = 0x200000,
LargePages = 0x20000000
}[Flags]
public enum MemoryProtection : uint
{
Execute = 0x10,
ExecuteRead = 0x20,
ExecuteReadWrite = 0x40,
ExecuteWriteCopy = 0x80,
NoAccess = 0x01,
ReadOnly = 0x02,
ReadWrite = 0x04,
WriteCopy = 0x08,
GuardModifierflag = 0x100,
NoCacheModifierflag = 0x200,
WriteCombineModifierflag = 0x400
}void str_Hotkey()
{
IntPtr hwnd, processHandle, remoteBuffer;
uint threadID, procID = 0;
const uint bufferSize = 1024;hwnd = GetWindowUnderCursor(); // Window handle-jének az átadása
GetWindowThreadProcessId(hwnd, out procID); // Window handle-ből ProcessID-nek a visszakapása
processHandle = OpenProcess(ProcessAccessFlags.All, true, procID); // Elvileg a process megynitása
remoteBuffer = VirtualAllocEx(processHandle, IntPtr.Zero, bufferSize, AllocationType.Commit, MemoryProtection.ExecuteWriteCopy); // Elvileg a process memóriájában foglal le memóriát a kódnak.}
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Milyen RAM-ot vegyek?
- BIOS topic
- Melyik tápegységet vegyem?
- Facebook és Messenger
- Essejó: MultiCooker avagy az elektromos kukta. Ötletek, tippek, tanácsok, receptek.
- Ford topik
- One otthoni szolgáltatások (TV, internet, telefon)
- XPEnology
- Futás, futópályák
- Kormányok / autós szimulátorok topikja
- További aktív témák...
- Apple iPhone 14 Pro Max - 256GB / Space Gray / 83% + Spigen tokok
- Logitech Trueforce G923 kormány és pedál szett váltóval, break moddal
- Bomba ár! HP ProBook 450 G7 - i5-10GEN I 8GB I 256SSD I HDMI I 15,6" FHD I Cam I W11 I Gar
- Bomba ár! HP ProBook 450 G6 - i7-8GEN I 16GB I 512SSD I HDMI I 15,6" FHD I Cam I W10 I Gari!
- Bomba ár! HP ProBook 450 G6 - i5-8GEN I 8GB I 256SSD I HDMI I 15,6" FHD I Cam I W10 I Gari!
- HP ZBook Studio x360 Gen5 Intel Xeon E-2176M - Garancia
- HIBÁTLAN iPhone 13 Pro Max 256GB Graphite -1 ÉV GARANCIA - Kártyafüggetlen, MS3756, 100% Akkumulátor
- Azonnali készpénzes Sony Playstation 5 lemezes és digitális felvásárlás személyesen/csomagküldéssel
- Dell 14 Latitude 5430 FHD IPS i7-1255U vPro 4.7Ghz 10mag 16GB 256GB Intel Iris XE Win11 LTE Garancia
- Azonnali készpénzes Intel i3 i5 i7 i9 12/13/14 gen processzor felvásárlás személyesen / csomagküldés
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: BroadBit Hungary Kft.
Város: Budakeszi


