Coder Social home page Coder Social logo

ahmed17said06 / windowsprocessanalysisanddumping Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.63 MB

A Windows process memory parser that opens a running process i.e. “notepad.exe” or any .exe and parse the .exe PEB data structure and extract the PEB fields.

C++ 100.00%

windowsprocessanalysisanddumping's Introduction

WindowsProcessAnalysisAndDumping

A Windows process memory parser that opens a running process i.e. “notepad.exe” or any .exe and parse the .exe PEB data structure and extract the PEB fields.

In Windows operating systems, a process is a running instance of a program. Each process has its own virtual address space, which is isolated from other processes. The Process Environment Block (PEB) is a data structure used by Windows to store information about a process. The PEB contains a variety of data, including the process's environment variables, command line arguments, and module handles. The PEB is used by the Windows loader to set up the process's initial state, and it can be accessed by the process itself to retrieve information about its own execution context. The PEB is an important data structure for understanding how Windows processes work, and it is often used in malware analysis and reverse engineering.

In the demo develop a Windows process memory parser that opens a running process i.e. “notepad.exe” or any .exe and parse the .exe PEB data structure and extract the PEB fields. In order to access “notepad.exe” find the process Id (PID) and get a handle to it using Windows API “OpenProcess” or you can traverse the Windows process list using the APIs “CreateToolhelp32Snapshot”, Process32First and Process32Next to find our “notepad.exe” process. Once you get a handle to “notepad.exe” • Print the basic information of "notepad.exe" process from the PEB data structure. • Parse the “notepad.exe” Portable Executable Header in memory and extract the NT and DOS headers and exported/import functions. Research the following data structure that contains this information such as PIMAGE_NT_HEADERS. PIMAGE_EXPORT_DIRECTORY and PIMAGE_DOS_HEADER • Use the PEB to find the base address of loaded “kernel32.dll” and all other Dlls loaded by “notepad.exe”. You need to iterate through data structures internal to the Windows loader such as PTEB, PLIST_ENTRY, PEB_LDR_DATA and LDR_DATA_TABLE_ENTRY. >>> https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntqueryinformationprocess#process_basic_information

API documentation: 1. https://learn.microsoft.com/en-us/windows/win32/api/winternl/ns-winternl-peb_ldr_data 2. https://learn.microsoft.com/en-us/windows/win32/api/winternl/ns-winternl-peb_ldr_data#remarks 3. https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocess 4. https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_data_directory 5. https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_optional_header32

windowsprocessanalysisanddumping's People

Contributors

ahmed17said06 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.