caused
2012-05-24 05:25:09
Hey,
does simba have functions implemented for reading the Memory of a certain application ?
does simba have functions implemented for reading the Memory of a certain application ?
2012-05-24 05:25:09
2012-05-24 05:31:58
2012-05-24 05:34:22
2012-05-24 06:35:28
From: caused
Hey,
does simba have functions implemented for reading the Memory of a certain application ?
From: mormonman
You can do it through a plugin.
2012-05-24 07:30:49
2012-05-24 12:05:53
From: caused
Is there a plugin out there that offers such functions ?
2012-05-24 13:30:37
From: Nava2
You could implement it. Just use a PChar (I think, either way I mean a pointer to a char) and point it to a memory location.. primitve, but it will do what you want.
I think Simba can already get Process information.
2012-05-24 14:13:39
2012-05-24 15:15:04
function FindWindow(ClassName, WindowName: PChar): HWND; external 'FindWindowA@User32.dll stdcall';
function SetParent(Child, Parent: HWND): HWND; external 'SetParent@User32.dll stdcall';
function VirtualFreeEx(hProcess: THANDLE; lpAddress: Pointer; dwSize: LongWord; dwFreeType: LongWord): Boolean; external 'VirtualFreeEx@Kernel32.dll stdcall';
function VirtualAllocEx(hProcess: THANDLE; lpAddress: Pointer; dwSize: LongWord; flAllocationType: LongWord; flProtect: LongWord): POINTER; external 'VirtualAllocEx@Kernel32.dll stdcall';
function GetWindowThreadProcessId(WindowHandle: HWND; var dwProcessId: LongWord): LongWord; external 'GetWindowThreadProcessId@User32.dll stdcall';
function OpenProcess(dwDesiredAccess: LongWord; bInheritHandle: Boolean; dwProcessId: LongWord): THANDLE; external 'OpenProcess@Kernel32.dll stdcall';
function ReadProcessMemory(hProcess: THANDLE; lpBaseAddress: Pointer; lpBuffer: Pointer; nSize: LongInt; dwBytesRead: LongWord): Boolean; external 'ReadProcessMemory@Kernel32.dll stdcall';
//Usage:
Function ReadInject: Boolean;
var
WindowHandle: HWND; //HANDLE.
PHandle: THandle; //HANDLE.
PID, ThreadID, BytesRead: LongWord; //DWORD.
ProcessBuffer, Something: Pointer; //void* aka LPVoid.
begin
try
//Grab a handle to the desired window..
WindowHandle:= FindWindow('SunAwtFrame', 'Public SMARTv6.9 - SMART Minimizing Autoing Resource Thing - By BenLand100');
//Get PID By Window Handle..
ThreadID:= GetWindowThreadProcessID(WindowHandle, PID);
//Get OpenProcess Handle From PID..
PHandle:= OpenProcess(PROCESS_ALL_ACCESS, False, PID);
if (PHandle <> 0) then
begin
//Allocate Space for the buffer..
ProcessBuffer := VirtualAllocEx(PHandle, nil, BUFFER_SIZE, MEM_COMMIT, PAGE_READWRITE);
//Fill the buffer with some information from a window or button or whatever..
SendMessage(WindowHandle, WM_GETTEXT, WindowID, Integer(ProcessBuffer));
//Read Process Memory Address..
ReadProcessMemory(ThreadID, ProcessBuffer, Something, SizeOf(SomethingsDataType), BytesRead);
//Free Allocated Buffer Memory..
VirtualFreeEx(taskbarProcessHandle, taskbarProcessBuffer, 0, MEM_RELEASE);
end;
finally
CloseHandle(PHandle); //external 'CloseHandle@Kernel32.dll stdcall'.
end;
end;