Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - rembolso

#61
hola. e decido jugar con algunas apis, para eso quiese enlistar en un listview los procesos, sus pid, y su ruta pero tengo un inconveniente con la ruta ...
Código (vb) [Seleccionar]
'veran en vb6 con esta api no tengo ningun problema :

Private Declare Function GetModuleFileNameExA Lib "PSAPI.DLL" (ByVal _  
   hProcess As Long, _  
   ByVal hModule As Long, ByVal _  
   lpFilename As String, _  
   ByVal nSize As Long) As Long


y adapte la api en .net de esta forma

Código (vbnet) [Seleccionar]
<System.Runtime.InteropServices.DllImport("PSAPI.DLL")> _
   Private Shared Function GetModuleFileNameExA(ByVal hWnd As System.IntPtr, ByVal hModule As Int32, ByVal lpFilename As String, ByVal nSize As Int32) As Integer
   End Function


pero al querer adquirir la ruta de cierto proceso no sale nada  porque sera ?
mi codigo

Código (vbnet) [Seleccionar]

       Dim Proceso As Process, ret As Integer, hola As String

       For Each Proceso In Process.GetProcesses

           If Proceso.ProcessName = "notepad" Then

               hola = Space(255)
               ret = GetModuleFileNameExA(Proceso.Handle, 0, hola, 255)
             
               MsgBox(Len(Microsoft.VisualBasic.Left(hola, ret))) ' no optengo nada ??
           Else
             
           End If


       Next


Alguna sugerencia. gracias ..
:( :( :( :(
#62
Programación C/C++ / consejo Base de Datos..
1 Agosto 2011, 20:30 PM
hola . estoy asiendo una base de datos para millones de usuarios. Y tengo dos dudas enfrentadas. Son las siguientes : (en c++)

¿Cuál  de estas formas es mas rápida y consume menos recursos?

Forma 1: mantener en una Cadena todos los usuarios (supongamos q serian 2 millones)  y en la petición extraer el usuario directamente de cadena. Pero lo malo es que consume mucha ram y en la hora de buscar un usuario entre 2 millones consume mucho y se puede desbordar el  buffer.
Forma 2: mantener en una carpeta  todas las carpetas con los nombres de usuario y adentro de la carpeta un archivo .txt con su datos .asi en la petición lo extrae directamente mas rápido y no consume ram pero consume disco y muchas carpetas ejemplo:

Petición :usuario rembolso&pass&choripan
Server: busca una carpeta que se llame rembolso y dentro de esa carpeta esta rembolsopass.txt

UsuariosDB\Rembolso\rembolsopass.txt

La petición es mas rápida pero como ya aclare consume mucho disco y lo hace mas lento pero no importa necesitaría un consejo. Y si hay otra forma por favor postéenla.

gracias por leer
#63
ASM / Re: mover en memoria
25 Julio 2011, 19:18 PM
gracias. estoy buscando informacion asrca de la la estructura dememoria en assm y como actua . esto ya lo eecho en c++ y en vb  con copymen en c pero quiero en asm jeje .si termino el code lo posteo gracias
#64
ASM / Re: mover en memoria
25 Julio 2011, 07:30 AM
Иōҳ ese ejemplo si no me equivoco es para concatenar cadenas pero lo q yo busco es unir sectores de memoria (en ejecucion).
ejemplo
memoria :D
DIRECCION|   Hex byte                                     |show bytes
------------------------------------------------------------------------------
03BB0000   |  4D 65 6E 73 61 6A 65                   |Mensaje.....
03BB0001   |  00 00 00 00 20 14 55                    | . . . . . 2  @
03BB0009   |  48 6F 6C 61 20 4D 75 6E 64 6F      |Hola Mundo......
------------------------------------------------------------------------------
LA COSITA es que me traslade la cadena  03BB0000(mensaje) a la cadena 03BB0009   (hola mundo). y el sector de  memoria quedaria :
DIRECCION|   Hex byte                                     |show bytes
------------------------------------------------------------------------------
03BB0000   |  4D 65 6E 73 61 6A 65                   |Mensaje.....
03BB0001   |  00 00 00 00 20 14 55                    | . . . . . 2  @
03BB0009   |  48 6F 6C 61 20 4D 75 6E 64 6F 4D 65 6E 73 61 6A 65     |Hola Mundo Mensaje......
------------------------------------------------------------------------------
quedaria modificado en memoria. (supongamo que es la memoria de otro proceso )
lo que necesito es concatenar cualquier sector de memoria no importa si es de otra aplicacion
#65
ASM / Re: mover en memoria
25 Julio 2011, 04:38 AM
tendrias un ejemplo de como funciona o mas detalle yo encontre este pero no lo entiendo mucho con el rep

MOV AH, 62h
: INT 21h
: MOV ES, BX
: CLD
:
: mov bx, @data
: mov es, bx
: lea di, buffer
: mov cx , 333
: rep movsb
: mov [di], 30h ;** line 23 ????
:
: mov dx,buffer
: MOV AH, 09h
: INT 21h
#66
ASM / Re: Libros de Ensamblador / ASM [eBooks]
24 Julio 2011, 22:23 PM
q lindo jamon porq hace un ratito empeze con asm
#67
ASM / mover en memoria
24 Julio 2011, 22:16 PM
hola. acabo de empezar a programar en asm y e echo unos 25 ejemplos con hola mundo y ese tipo de cosa tambien e practicado descargar de una pila en orden etc. pero me encuentro con esta actividad mover el contenido de una direccion de memoria a otra direccion  ejemplo:
direccion a
004033C0 "hola mundo"
direccion b
004033E0 "mira esto:"
-------------
.MODEL SMALL
.CODE
Programa:
MOV AX, 004033C0
MOV DS, AX
MOV 004033E0 ,AX

.STACK

END Programa
------------ Y EN la direccion de mem 004033E0  TENDRIA QUE QUEDAR "mira esto: hola mundo"
pero me sale error bue me canse de intentarlo de mil formas diferentes talves me den una mano soy nobb ajaja  y un tutorial donde salgan este tipo de ejemplos saludos
#68
gracias .. me re olvide del binario... xD:
#69
hola . estoy intentando abrir archivos de mi pc y encontro una imagen que no se abre.

es esta imagen:

es la del celular del facebook .
Código (vb) [Seleccionar]
Public Function AbrirArichivo(file As String)
Dim n_File As Integer
Dim Linea As String
    n_File = FreeFile()
Open file For Input As n_File

While Not EOF(n_File)

Line Input #n_File, Linea

Wend

Close #n_File
AbrirArichivo = Linea
text2.text =  AbrirArichivo ' en este texto se visualizan los siguiente bytes: ‰PNG
' solo esos bytes porq no se visualiza todo el archivo .
End Function
#70
Programación C/C++ / error copilando WinPcap
9 Febrero 2011, 02:15 AM
hola . estoy con dev c++ 5.0 utilizando la libreria winpcap .  y busque un ejemplo de filtrar paquetes .
Código (cpp) [Seleccionar]
/*
* Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
* Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Politecnico di Torino, CACE Technologies
* nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/


#include <stdlib.h>
#include <stdio.h>

#include <pcap.h>

#define MAX_PRINT 80
#define MAX_LINE 16


void usage();


void main(int argc, char **argv)
{
pcap_t *fp;
char errbuf[PCAP_ERRBUF_SIZE];
char *source=NULL;
char *ofilename=NULL;
char *filter=NULL;
int i;
pcap_dumper_t *dumpfile;
struct bpf_program fcode;
bpf_u_int32 NetMask;
int res;
struct pcap_pkthdr *header;
const u_char *pkt_data;

    if (argc == 1)
    {
        usage();
        return;
    }

    for(i=1;i < argc; i+= 2)
    {

        switch (argv[i] [1])
        {
            case 's':
            {
                source=argv[i+1];
            };
            break;

            case 'o':
            {
                ofilename=argv[i+1];
            };
            break;

            case 'f':
            {
                filter=argv[i+1];
            };
            break;
        }
    }

    // open a capture from the network
    if (source != NULL)
    {
        if ( (fp= pcap_open(source,
                            1514 /*snaplen*/,
                            PCAP_OPENFLAG_PROMISCUOUS /*flags*/,
                            20 /*read timeout*/,
                            NULL /* remote authentication */,
                            errbuf)
                            ) == NULL)
        {
            fprintf(stderr,"\nUnable to open the adapter.\n");
            return;
        }
    }

    else usage();

    if (filter != NULL)
    {
        // We should loop through the adapters returned by the pcap_findalldevs_ex()
        // in order to locate the correct one.
        //
        // Let's do things simpler: we suppose to be in a C class network ;-)
        NetMask=0xffffff;

        //compile the filter
        if(pcap_compile(fp, &fcode, filter, 1, NetMask) < 0)
        {
            fprintf(stderr,"\nError compiling filter: wrong syntax.\n");
            return;
        }

        //set the filter
        if(pcap_setfilter(fp, &fcode)<0)
        {
            fprintf(stderr,"\nError setting the filter\n");
            return;
        }

    }

    //open the dump file
    if (ofilename != NULL)
    {
        dumpfile= pcap_dump_open(fp, ofilename);

        if (dumpfile == NULL)
        {
            fprintf(stderr,"\nError opening output file\n");
            return;
        }
    }
    else usage();

    //start the capture
    while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0)
    {

        if(res == 0)
        /* Timeout elapsed */
        continue;

        //save the packet on the dump file
        pcap_dump((unsigned char *) dumpfile, header, pkt_data);

    }
}


void usage()
{

    printf("\npf - Generic Packet Filter.\n");
    printf("\nUsage:\npf -s source -o output_file_name [-f filter_string]\n\n");
    exit(0);
}


Código (asm) [Seleccionar]
[code=bash]In file included from C:/Dev-Cpp/include/pcap.h:14,
                 from main.c:38:
C:/Dev-Cpp/include/pcap++/Packet.h:16: error: syntax error before "pcappp"
C:/Dev-Cpp/include/pcap++/Packet.h:16: error: syntax error before '{' token

C:/Dev-Cpp/include/pcap++/Packet.h:36: error: syntax error before "Data"
C:/Dev-Cpp/include/pcap++/Packet.h:36: warning: data definition has no type or storage class
C:/Dev-Cpp/include/pcap++/Packet.h:42: warning: data definition has no type or storage class
C:/Dev-Cpp/include/pcap++/Packet.h:50: error: syntax error before "const"
C:/Dev-Cpp/include/pcap++/Packet.h:50: warning: data definition has no type or storage class
C:/Dev-Cpp/include/pcap++/Packet.h:56: error: syntax error before "const"
C:/Dev-Cpp/include/pcap++/Packet.h:69: error: syntax error before '&' token
C:/Dev-Cpp/include/pcap++/Packet.h:84: error: `packet' undeclared here (not in a function)
C:/Dev-Cpp/include/pcap++/Packet.h:84: warning: data definition has no type or storage class
C:/Dev-Cpp/include/pcap++/Packet.h:85: error: `false' undeclared here (not in a function)
C:/Dev-Cpp/include/pcap++/Packet.h:85: warning: data definition has no type or storage class
C:/Dev-Cpp/include/pcap++/Packet.h:86: error: syntax error before '}' token
C:/Dev-Cpp/include/pcap++/Packet.h: In function `get_seconds':
C:/Dev-Cpp/include/pcap++/Packet.h:116: error: syntax error before '{' token
C:/Dev-Cpp/include/pcap++/Packet.h:168: error: syntax error before "Data"

In file included from C:/Dev-Cpp/include/pcap++/DataLink.h:15,

                 from C:/Dev-Cpp/include/pcap.h:15,
                 from main.c:38:
C:/Dev-Cpp/include/string.h:37: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:42: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:43: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:46: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:49: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:51: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:53: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:54: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:55: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:56: warning: `__pure__' attribute ignored
C:/Dev-Cpp/include/string.h:67: warning: `__malloc__' attribute ignored
C:/Dev-Cpp/include/string.h:92: warning: `__malloc__' attribute ignored
C:/Dev-Cpp/include/string.h:97: error: storage class specified for parameter `strcasecmp'
C:/Dev-Cpp/include/string.h:97: error: syntax error before '{' token

C:/Dev-Cpp/include/string.h:103: error: storage class specified for parameter `strncasecmp'
C:/Dev-Cpp/include/string.h:103: error: syntax error before '{' token
C:/Dev-Cpp/include/string.h:170: error: storage class specified for parameter `wcscmpi'
C:/Dev-Cpp/include/string.h:170: error: redefinition of parameter 'wcscmpi'
C:/Dev-Cpp/include/string.h:167: error: previous definition of 'wcscmpi' was here
C:/Dev-Cpp/include/string.h:170: error: syntax error before '{' token
In file included from C:/Dev-Cpp/include/pcap.h:15,
                 from main.c:38:
C:/Dev-Cpp/include/pcap++/DataLink.h:17: error: syntax error before "namespace"
C:/Dev-Cpp/include/pcap++/DataLink.h:482: error: parameter `desc' is initialized
C:/Dev-Cpp/include/pcap++/DataLink.h:482: error: `m_type' undeclared (first use in this function)
C:/Dev-Cpp/include/pcap++/DataLink.h:482: error: (Each undeclared identifier is reported only once
C:/Dev-Cpp/include/pcap++/DataLink.h:482: error: for each function it appears in.)
C:/Dev-Cpp/include/pcap++/DataLink.h:482: confused by earlier errors, bailing out

make.exe: *** [main.o] Error 1

Ejecución Terminada

ALGUNA solucion que me ofrescan
documentacion:http://www.winpcap.org/docs/docs_40_2/html/group__wpcapsamps.html

surce code de winpcap: http://www.winpcap.org/install/bin/PacketCE.zip[/code]