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


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Mensajes
Páginas: 1 ... 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 [80] 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ... 128
791  Programación / Scripting / Re: No se ejecutan los archivos python en ubuntu en: 25 Enero 2015, 17:22 pm
Lo mas fácil y que no falla es ejecutarlo desde la terminal:

python archivo.py
792  Foros Generales / Foro Libre / Re: Cuando nos va a regalar el-brujo... en: 18 Diciembre 2014, 17:27 pm
Claro que sí, hacer la carta a los reyes magos que vuestros pedidos serán cumplidos!!  :rolleyes:
793  Seguridad Informática / Análisis y Diseño de Malware / Re: [?] Proactiva? en: 15 Diciembre 2014, 13:53 pm
Se llama heurística, y para hacerlo indetectable hay, o había varios truquillos como hacer un bucle de X duración al iniciar el programa y cosas así.

Básicamente detecta el modo en el que haces las cosas.


794  Programación / Programación C/C++ / Re: Problemas con GetLIne y Threads en c en: 14 Diciembre 2014, 19:20 pm
He mirado el código y he hecho unos retoques.

Código
  1. #include <pthread.h>
  2. #include <stdio.h>
  3. #include <err.h>
  4.  
  5. #define NUM_THREADS 10
  6.  
  7. pthread_mutex_t mutex;
  8. pthread_cond_t tickets_ready;
  9.  
  10. int tickets = 2;
  11.  
  12. void* pthread_function(void *myline)
  13. {
  14. char *theline;
  15. pthread_mutex_lock(&mutex);
  16. while(tickets==0)
  17. {
  18. pthread_cond_wait(&tickets_ready,&mutex);
  19. }
  20.  
  21. -- tickets;
  22. pthread_mutex_unlock(&mutex);
  23.  
  24. theline = (char *)myline;
  25. printf("Thread working: ¡this is my line! -> %s\n", theline);
  26. sleep(1);
  27.  
  28.  
  29. pthread_mutex_lock(&mutex);
  30. ++tickets;
  31. if (tickets>=1)
  32. {
  33. pthread_cond_broadcast(&tickets_ready);
  34. /* code */
  35. }
  36.  
  37. pthread_mutex_unlock(&mutex);
  38. pthread_exit(NULL);
  39. }
  40.  
  41. int main(int argc, char** argv)
  42. {
  43. pthread_t thread[NUM_THREADS];
  44.  
  45. long int i=0;
  46. char *line;
  47. //char *lines[NUM_THREADS];
  48.  
  49. FILE *file = fopen("commands.txt", "r");
  50. char *data;
  51. size_t len;
  52.  
  53.  
  54. if(file == NULL)
  55. {
  56. err(1, "commands.txt");
  57. }
  58.  
  59.  
  60. while( i < NUM_THREADS &&  getline(&line,&len,file) != -1)
  61. {
  62. //printf("%s\n", line);
  63. pthread_create(thread+i, NULL, pthread_function, (void *)line);
  64.                pthread_join(thread[i], NULL);
  65. ++i;
  66. }
  67.  
  68. /*for ( i = 0; i < NUM_THREADS; ++i)
  69. {
  70. pthread_join(thread[i], NULL);
  71. }*/
  72. return 0;
  73. }

contenido de commands.txt:

Código:
1
2
3
4
5
6
7
8
9
0

Modo de compilación y ejecución del programa:

Código:
x@x:~/Escritorio$ gcc main.c -o main -lpthread
x@x:~/Escritorio$ ./main
Thread working: ¡this is my line! -> 1

Thread working: ¡this is my line! -> 2

Thread working: ¡this is my line! -> 3

Thread working: ¡this is my line! -> 4

Thread working: ¡this is my line! -> 5

Thread working: ¡this is my line! -> 6

Thread working: ¡this is my line! -> 7

Thread working: ¡this is my line! -> 8

Thread working: ¡this is my line! -> 9

Thread working: ¡this is my line! -> 0

saludos.
795  Programación / Programación C/C++ / Re: InputBox Windows en: 12 Diciembre 2014, 19:28 pm
Con la API CreateWindowEx. Por aquí tienes algunos ejemplos.

796  Programación / Programación C/C++ / Re: ayuda con un scanner de unidades en C/C++ en: 10 Diciembre 2014, 20:40 pm
¿Algo así?

http://msdn.microsoft.com/en-us/library/windows/desktop/aa364972%28v=vs.85%29.aspx
797  Programación / Programación General / Re: [DUDA]Crear dll a partir de exe en: 10 Diciembre 2014, 20:09 pm
En realidad no creo que así puedas evitar muchos crackers.

Por otra parte desde una DLL se puede crear una ventana perfectamente, pero claro, una DLL no la puedes ejecutar como un ejecutable... así que la tendrías que cargar desde otro exe.



798  Informática / Software / Re: duda programa para cambiar tamaño word en: 9 Diciembre 2014, 21:16 pm
Creo que lo que quieres hacer es esto:

http://office.microsoft.com/es-es/word-help/seleccionar-el-tamano-de-papel-HP005189493.aspx

799  Programación / Programación C/C++ / Re: Programa en c++ me muestra falsos valores y no cierra en: 7 Diciembre 2014, 22:13 pm
Usa elseif en vez de tantos if anidados.

PD: Esto es C, no C++.
800  Foros Generales / Foro Libre / Re: Que opinan de adultos saliendo con menores? en: 6 Diciembre 2014, 18:49 pm
Hay algunas de 16 que son mas p... que las gallinas.  :rolleyes:

Aunque siempre hay excepciones, claro esta, y se enamoraran de verdad, digo yo  :xD

Páginas: 1 ... 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 [80] 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ... 128
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines