Vitali Kremez
  • Home
  • About
  • Contact
  • Cyber Security
  • Cyber Intel
  • Programming
  • Reverse Engineering
  • Exploit Development
  • Penetration Test
  • WIN32 Assembly
  • On Writing
    • Blog
    • LSAT
    • Photo
  • Honeypot
  • Forum

Win32 ASsesmbly

Win32: Process List

7/5/2016

0 Comments

 
 ShowProcess PROTO pid:DWORD
   
Core Functions
I. mov pbuf, ptr$(buffer)                          ; cast buffer address to a pointer


    invoke EnumProcesses,pbuf,4096,ADDR breq        ; enumerate processes
    shr breq, 2                                     ; get process cou​

II. invoke ShowProcess,[esi]

III.  mov hProcess, rv(OpenProcess,PROCESS_QUERY_INFORMATION or PROCESS_VM_READ,FALSE,pid)
 .if hProcess != 0
      .if rv(EnumProcessModules,hProcess,ADDR hMod,4,ADDR cbNeeded) != 0
        invoke GetModuleBaseName,hProcess,hMod,pbuf,260
        mov ptxt, cat$(ptxt,"pid ",str$(pid)," ",pbuf)
      .else
        mov ptxt, cat$(ptxt,"pid ",str$(pid)," -fail- EnumProcessModules")
      .endif
    .else
      mov ptxt, cat$(ptxt,"pid ",str$(pid)," -fail- OpenProcess")
    .endif

Core Library
include \masm32\include\psapi.inc
includelib \masm32\lib\psapi.lib
Picture

Read More
0 Comments

    Author

    Vitali Kremez

    Archives

    July 2016
    June 2016
    May 2016

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • Home
  • About
  • Contact
  • Cyber Security
  • Cyber Intel
  • Programming
  • Reverse Engineering
  • Exploit Development
  • Penetration Test
  • WIN32 Assembly
  • On Writing
    • Blog
    • LSAT
    • Photo
  • Honeypot
  • Forum