elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


  Mostrar Mensajes
Páginas: [1]
1  Programación / Programación General / Alguien que me ayude a Ordenar este Código? en: 18 Septiembre 2014, 22:05 pm
Hola, tengo este código (LUA script cheat engine)... es un Process List para seleccionar navegadores. Soy principiante en el tema, necesito que alguien me ayude a Organizarlo.

Gracias de antemano. :)

Código
  1. function CEButton1Click(sender)
  2. SmartAttach =.. {..  wanted_processes = { 'chrome.exe','plugin%-container.exe',..                       'flashplayerplugin','dragon.exe' }..                       ,..  currentprocesslist = {}.. }....function SmartAttach:Start(  )..self.form  =  createForm( true )..  setProperty( self.form ,  "Position",  "" )..  setProperty( self.form ,  "BiDiMode",  "bdLeftToRight" )..  self.form.Caption  =  'Process List'..  self.form.height  =  46..  self.form.width  =  463..  self.combobox  =  createComboBox( self.form )..  self.combobox.top  =  10..  self.combobox.left  =  10..  self.combobox.width  =  213..  self.combobox.ReadOnly  =  true..  self.button  =  createButton( self.form )..  self.button.Caption  =  'Enable'..  self.button.top  =  10..  self.button.left  =  240..  self.button.onClick  =  function ( sender ) self:Attach( sender )end......  self.button.width  =  95..  self.pickhighestmem  =  createButton( self.form )..  self.pickhighestmem.Caption  =  'Refresh Process '..  self.pickhighestmem.top  =  10..  self.pickhighestmem.left  =  353..  self.pickhighestmem.width  =  100..  self.pickhighestmem.onClick  =  function ( sender ) self:RefreshList( sender ) end..  self.form.show()..  SmartAttach:RefreshList()..end......function SmartAttach.SortByKey(T,K,reverse)..  if reverse==true then table.sort(T, function (a,b) return a[K] > b[K] end)..                   else table.sort(T, function (a,b) return a[K] < b[K] end) end..  return T..end....function SmartAttach.ProcessMatch(s)..  for _,v in pairs(SmartAttach.wanted_processes) do..    if s:match(v:lower()) then return true end..  end..  return false..end....function SmartAttach.gatherData()..  local handle  =  io.popen( "tasklist.exe /fo csv" )..  local processTable = {}..  local skip = true..  local tmp = nil..  for line in handle:lines() do..    if skip then skip = false..    else..      tmp = {}..      for t in line:gmatch('\"(.-)\"') do..       table.insert(tmp,t)..      end..      local processName = tmp[1]..      if SmartAttach.ProcessMatch(processName:lower()) then..        local PID         = tmp[2]..      --local Session     = tmp[3]..      --local SessionNum  = tmp[4]..        local MemoryUsage = tmp[5]:gsub("[^%d]",'')+0  -- +0 converts to number....        local entry = { processName=processName, PID=PID, MemoryUsage=MemoryUsage }..        processTable[#processTable+1] = entry..      end..    end..  end..  handle:close()..  return SmartAttach.SortByKey(processTable,'MemoryUsage',true)..end....function SmartAttach.RefreshList()..  local items = SmartAttach.combobox.items..  items.clear()..  SmartAttach.currentprocesslist = SmartAttach.gatherData()..  if ( #SmartAttach.currentprocesslist > 0 ) then..    for _,v in ipairs( SmartAttach.currentprocesslist ) do..      strings_add(items, string.format('%.1f',v.MemoryUsage/1024)..'MB'..' - '..v.processName)..    end..  SmartAttach.combobox.ItemIndex  =  0..  else..    return showMessage( "No Browser in the process" )..  end..end....function SmartAttach:Attach(sender)..  local index = SmartAttach.combobox.ItemIndex..  if index < 0 then return end..  openProcess( tonumber(SmartAttach.currentprocesslist[index + 1].PID) )..end....SmartAttach:Start()..end



[MOD]: Utiliza el botón de "Insertar Código"
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines