Visual Basic .NET

This section is dedicated to Visual Basic .NET. Here you can find projects, tutorials, howto and others.

Read and Write Process Memory functions

In all windows system (I think from WindowsXP) there are funcions that allow to access, read and modify the memory of running processes. These functions are: ReadProcessMemory and WriteProcessMemory. First function allow to read bytes from an area of memory in a specified process. Second function allow to write bytes to an area of memory in a specified process. This two functions require Kernel32.lib to be declared and used.
The syntax of the two functions:

BOOL WINAPI ReadProcessMemory(
    __in HANDLE hProcess,
    __in LPCVOID lpBaseAddress,
    __out LPVOID lpBuffer,
    __in SIZE_T nSize,
    __out SIZE_T *lpNumberOfBytesRead
);

BOOL WINAPI WriteProcessMemory(
    __in HANDLE hProcess,
    __in LPVOID lpBaseAddress,
    __in LPCVOID lpBuffer,
    __in SIZE_T nSize,
    __out SIZE_T *lpNumberOfBytesWritten
);


Read more