node/lib/metasm/metasm/os/windows.rb
def list_modules(pid)
		h = WinAPI.createtoolhelp32snapshot(WinAPI::TH32CS_SNAPMODULE, pid)
		return [] if h == WinAPI::INVALID_HANDLE_VALUE
		list = []
		me = WinAPI.alloc_c_struct('MODULEENTRY32', :dwsize => :size)
		return [] if not WinAPI.module32first(h, me)
		loop do
			m = Process::Module.new
			m.addr = me.modbaseaddr
			m.size = me.modbasesize
			m.path = me.szexepath.to_strz
			list << m
			break if WinAPI.module32next(h, me) == 0
		end
		WinAPI.closehandle(h)
		list
	end
# retrieve the list of Modules for a process with addr/size/path filled
retrieve the list of Modules for a process with addr/size/path filled
retrieve the list of Modules for a process with addr / size / path filled
def list_modules(pid)
		h = WinAPI.createtoolhelp32snapshot(WinAPI::TH32CS_SNAPMODULE, pid)
		return [] if h == WinAPI::INVALID_HANDLE_VALUE
		list = []
		me = WinAPI.alloc_c_struct('MODULEENTRY32', :dwsize => :size)
		return [] if not WinAPI.module32first(h, me)
		loop do
			m = Process::Module.new
			m.addr = me.modbaseaddr
			m.size = me.modbasesize
			m.path = me.szexepath.to_strz
			list << m
			break if WinAPI.module32next(h, me) == 0
		end
		WinAPI.closehandle(h)
		list
	end
def list_modules ( pid ) h = WinAPI . createtoolhelp32snapshot ( WinAPI :: TH32CS_SNAPMODULE , pid ) return [ ] if h == WinAPI :: INVALID_HANDLE_VALUE list = [ ] me = WinAPI . alloc_c_struct ( 'MODULEENTRY32' , :dwsize => :size ) return [ ] if not WinAPI . module32first ( h , me ) loop do m = Process :: Module . new m . addr = me . modbaseaddr m . size = me . modbasesize m . path = me . szexepath . to_strz list << m break if WinAPI . module32next ( h , me ) == 0 end WinAPI . closehandle ( h ) list end
retrieve the list of Modules for a process with addr/size/path filled
retrieve the list of Modules for a process with addr / size / path filled
pid