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

 

 


Tema destacado: Tutorial básico de Quickjs


  Mostrar Mensajes
Páginas: [1] 2
1  Programación / Programación C/C++ / Winosck Hook Codigo de ejemplo en: 8 Febrero 2011, 19:17 pm
Hola, estoy intentando hacer un hook al winsock desde una DLL. Pero todos los ejemplos que encuentro son usando la librería detours.

Alguien sabe o tiene algún ejemplo que pueda usar??

Un Saludo y muchas gracias
2  Programación / .NET (C#, VB.NET, ASP) / Re: [Duda c#] Incio de funcion automaticamente tras carga el from en: 26 Agosto 2010, 19:43 pm
Hola, al ponerlo se ejecuta antes de salir el form =S
3  Programación / .NET (C#, VB.NET, ASP) / Re: [Duda c#] Incio de funcion automaticamente tras carga el from en: 26 Agosto 2010, 19:08 pm
Gracias por responder, al sobrescribir  el método OnLoad ya se muestra automáticamente el form pero la descarga no comienza =S

Así tengo mi código:
Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Net;
  10. using System.IO;
  11. using System.Xml;
  12.  
  13. namespace WindowsFormsApplication1
  14. {
  15.    public partial class main : Form
  16.    {
  17.        public string fileName;
  18.        public string fileType;
  19.        public string fileUrl;
  20.        public string rName;
  21.        public string rUrl;
  22.        public string rDesc;
  23.        public string typeRar = "rar";
  24.  
  25.        public main()
  26.        {
  27.            InitializeComponent();
  28.            main_readXml("http://[url]/file.xml");
  29.            this.Text = rName;
  30.        }
  31.        protected override void OnLoad(EventArgs e)
  32.        {
  33.  
  34.        }
  35.        private void main_Load(object sender, EventArgs e)
  36.        {
  37.            main_Download();
  38.        }
  39.  
  40.  
  41.        public void main_Download()
  42.        {
  43.            if (!System.IO.File.Exists(fileName))
  44.            {
  45.                WebRequest req = WebRequest.Create(fileUrl);
  46.                WebResponse response = req.GetResponse();
  47.                Stream stream = response.GetResponseStream();
  48.  
  49.  
  50.                //Download in chuncks
  51.                byte[] buffer = new byte[1024];
  52.  
  53.                //Get Total Size
  54.                int dataLength = (int)response.ContentLength;
  55.  
  56.                //With the total data we can set up our progress indicators
  57.                progressBar1.Maximum = dataLength;
  58.                //lbProgress.Text = "0/" + dataLength.ToString();
  59.  
  60.                //this.Text = "Downloading...";
  61.                Application.DoEvents();
  62.  
  63.                //Download to memory
  64.                //Note: adjust the streams here to download directly to the hard drive
  65.                FileStream memStream = new FileStream(fileName, FileMode.Create);
  66.  
  67.                while (true)
  68.                {
  69.                    //Try to read the data
  70.                    int bytesRead = stream.Read(buffer, 0, buffer.Length);
  71.  
  72.                    if (bytesRead == 0)
  73.                    {
  74.                        //Finished downloading
  75.                        progressBar1.Value = progressBar1.Maximum;
  76.                        // lbProgress.Text = dataLength.ToString() + "/" + dataLength.ToString();
  77.  
  78.                        Application.DoEvents();
  79.                        break;
  80.                    }
  81.                    else
  82.                    {
  83.                        //Write the downloaded data
  84.                        memStream.Write(buffer, 0, bytesRead);
  85.  
  86.                        //Update the progress bar
  87.                        if (progressBar1.Value + bytesRead <= progressBar1.Maximum)
  88.                        {
  89.                            progressBar1.Value += bytesRead;
  90.                            // lbProgress.Text = progressBar1.Value.ToString() + "/" + dataLength.ToString();
  91.  
  92.                            progressBar1.Refresh();
  93.                            Application.DoEvents();
  94.                        }
  95.                    }
  96.                }
  97.  
  98.                if (fileType == typeRar)
  99.                {
  100.                    Unrar rar = new Unrar();
  101.  
  102.                    rar.Open(fileName, Unrar.OpenMode.Extract);
  103.  
  104.                    rar.DestinationPath = "";
  105.                    while (rar.ReadHeader())
  106.                    {
  107.                        rar.Extract();
  108.                    }
  109.  
  110.                    rar.Close();
  111.  
  112.                }
  113.                //   Application.Exit();
  114.  
  115.  
  116.            }
  117.            else
  118.            {
  119.                Application.Exit();
  120.            }
  121.  
  122.        }
  123.  
  124.        private void main_readXml(string xml_file)
  125.        {
  126.            XmlTextReader xml_document = new XmlTextReader(xml_file);
  127.            XmlDocument xDoc = new XmlDocument();
  128.            xDoc.Load(xml_document);
  129.  
  130.            XmlNodeList config = xDoc.GetElementsByTagName("config");
  131.  
  132.            XmlNodeList actus = ((XmlElement)config[0]).GetElementsByTagName("actus");
  133.            XmlNodeList files = ((XmlElement)actus[0]).GetElementsByTagName("file");
  134.            foreach (XmlElement nodo in files)
  135.            {
  136.                int i = 0;
  137.                XmlNodeList sName = nodo.GetElementsByTagName("name");
  138.                XmlNodeList sType = nodo.GetElementsByTagName("type");
  139.                XmlNodeList sUrl = nodo.GetElementsByTagName("url");
  140.                fileName = sName[i].InnerText;
  141.                fileType = sType[i].InnerText;
  142.                fileUrl = sUrl[i].InnerText;
  143.            }
  144.  
  145.  
  146.            foreach (XmlElement nodo in config)
  147.            {
  148.                int i = 0;
  149.                XmlNodeList pName = nodo.GetElementsByTagName("sName");
  150.                XmlNodeList pUrl = nodo.GetElementsByTagName("web");
  151.                XmlNodeList pDesc = nodo.GetElementsByTagName("desc");
  152.                rName = pName[i].InnerText;
  153.                rUrl = pUrl[i].InnerText;
  154.                rDesc = pDesc[i].InnerText;
  155.            }
  156.        }
  157.    }
  158. }
  159.  
4  Programación / .NET (C#, VB.NET, ASP) / [Duda c#] Incio de funcion automaticamente tras carga el from en: 26 Agosto 2010, 17:16 pm
Hola, he echo una aplicación que lee un xml y baja un fichero de internet el cual obtiene leyendo el xml.

Mi problema es, si pongo la función el main_Load (como yo llame a la funcion que se ejecuta cuando carga el programa), no se muestra el from ni la barra de carga.

Mi duda es, ¿Como puedo hacer que la funcion de descarga se ejecute sola una vez cargado el from?

Un Saludo y Gracias
5  Programación / Ingeniería Inversa / Re: problema con exe y molebox en: 31 Octubre 2008, 22:34 pm
muchas gracias  :D :D

ya lo pueden cerrar
6  Programación / Ingeniería Inversa / Re: problema con exe y molebox en: 24 Octubre 2008, 17:27 pm
si :) pero las guias que e encontrado no estan ni en español ni en ibngles :( y es lo unico que entiendo

gracias
7  Programación / Ingeniería Inversa / Re: problema con exe y molebox en: 20 Octubre 2008, 15:39 pm
bueno aquei esta http://www.4shared.com/account/file/67613800/a5ad8187/file.html para poder ejecutarlo se necesitan unas dll aparte que etan fuera del exe pesna ocmo 10MB entre todas si kieren las subo tambien :)

Muchas gracias por la ayuda
8  Programación / Ingeniería Inversa / Re: problema con exe y molebox en: 19 Octubre 2008, 22:44 pm
subiendo pero son 62MB a si que tadara
9  Programación / Ingeniería Inversa / Re: problema con exe y molebox en: 19 Octubre 2008, 20:58 pm
oki grax el reshacker ya le tengo subo mi archivo exe?
10  Programación / Ingeniería Inversa / Re: problema con exe y molebox en: 19 Octubre 2008, 18:25 pm
gracias me gusta el foro  :D 2 cosas :) com desempaketo el molebox ya e buscdo pero las guias son para 2.6 y este es 2.7.4 lo mire con el RD detector ese y la otra me puedes recomendar algun editor de recursos

gracias ;)
Páginas: [1] 2
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines