node/lib/metasm/metasm/os/windows.rb
# returns an array of Processes with pid/ppid/path filled
returns an array of Processes with pid/ppid/path filled
returns an array of Processes with pid / ppid / path filled
def list_processes
		h = WinAPI.createtoolhelp32snapshot(WinAPI::TH32CS_SNAPPROCESS, 0)
		list = []
		pe = WinAPI.alloc_c_struct('PROCESSENTRY32', :dwsize => :size)
		return if not WinAPI.process32first(h, pe)
		loop do
			p = Process.new(pe.th32processid)
			p.ppid = pe.th32parentprocessid
			p.path = pe.szexefile.to_strz
			list << p if p.pid != 0
			break if WinAPI.process32next(h, pe) == 0
		end
		WinAPI.closehandle(h)
		list
	end
def list_processes h = WinAPI . createtoolhelp32snapshot ( WinAPI :: TH32CS_SNAPPROCESS , 0 ) list = [ ] pe = WinAPI . alloc_c_struct ( 'PROCESSENTRY32' , :dwsize => :size ) return if not WinAPI . process32first ( h , pe ) loop do p = Process . new ( pe . th32processid ) p . ppid = pe . th32parentprocessid p . path = pe . szexefile . to_strz list << p if p . pid != 0 break if WinAPI . process32next ( h , pe ) == 0 end WinAPI . closehandle ( h ) list end
returns an array of Processes with pid/ppid/path filled
returns an array of Processes with pid / ppid / path filled