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

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


  Mostrar Temas
Páginas: 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15
31  Programación / Desarrollo Web / [Resuelto] [JS] Chrome Trex juego elimina window,document.. en: 26 Agosto 2015, 12:06 pm
Hola estibe haciendo un bot para el juego tRex de chrome que aparece cuando no tienes conexión pero creo que han actualizado el código y ahora eliminan variables globales como document, window etc... para que no puedas acceder a los elementos de la pagina...

Ahora estoy mirando el código intentando ver como y donde lo hacen.
El código lo pueden conseguir desde chrome F12 -> Network -> Offline
Ideas ??
Un saludo
32  Programación / Programación C/C++ / Beep desde thread, new + delete en: 23 Agosto 2015, 18:52 pm
Hola tengo esto:
Código
  1. bool SaveBeep(int a, int b){
  2. int *c = new int(2);
  3. c[0] = a;
  4. c[1] = b;
  5. if (!CreateThread(0, 0, beepThread, (LPVOID)c, 0, 0))
  6. return 0;
  7. return 1;
  8. }
  9.  
  10. DWORD WINAPI beepThread(LPVOID p){
  11. int * a = (int*)p;
  12. Beep(a[0], a[1]);
  13. delete[]a;
  14. return 0;
  15. }

Error de memoria en delete[]a;
También probé:
Código
  1. delete &a[0];
  2. delete &a[1];
pero sigue igual.
Primero probé así pero no recibía los int
Código
  1. bool SaveBeep(int a, int b){
  2. int c[2] = { a, b };
  3. if (!CreateThread(0, 0, beepThread, (LPVOID)c, 0, 0))
  4. return 0;
  5. return 1;
  6. }
  7.  
  8. DWORD WINAPI beepThread(LPVOID p){
  9. int * a = (int*)p;
  10. Beep(a[0], a[1]);
  11. return 0;
  12. }

Ideas??

Un saludo
33  Programación / Programación C/C++ / fclose sin argumentos en: 18 Agosto 2015, 14:21 pm
Código
  1. int main(int argc, char *argv[])
  2. {
  3. char Nombre[20];
  4. FILE *archivo;
  5. char letras[1000];
  6. archivo = fopen("config.txt", "r");
  7. fgets(letras, 1000, archivo);
  8. strcpy(Nombre, letras);
  9. printf("%s\n", Nombre);
  10. fclose;
  11. system("PAUSE");
  12.  
  13. return EXIT_SUCCESS;
  14. }

En la parte de fclose; porque funciona sin ningún argumento???

Un saludo
34  Programación / Programación C/C++ / DLL con STL (vector,string,stringstream) exportar en: 16 Agosto 2015, 06:08 am
Hola tengo una DLL que exporta esta función:

Código
  1. //Al principio era: vector<string> split(string str,char c);
  2. void split(string str, char c,vector<string>* strings){
  3. stringstream stream(str);
  4. string item;
  5. while (getline(stream, item, c)){
  6. strings->push_back(item);
  7. }
  8. }
  9.  

Luego:
Código
  1. HMODULE lib = LoadLibrary("C:\\Users\\Dimitar\\Documents\\Visual Studio 2013\\Projects\\BasicTools\\Release\\BasicTools.dll");
  2. if (lib == NULL){
  3. e("Library failed to load!");
  4. }
  5. _split split = (_split)GetProcAddress(lib, "split");
  6. if (!split){
  7. e("Failed to load split!");
  8. }
  9. string test = "Hola me llamo Jose!";
  10. vector<string> strings;
  11. split(test, ' ', &strings);
  12. for (auto str : strings){
  13. cout << str << endl;
  14. }

Recibo error por alocar memoria, me lo esperaba...
Hay alguna manera de exportar vector y string?

Un saludo
35  Programación / Programación C/C++ / Convertir LPWSTR a char ** en: 12 Agosto 2015, 11:22 am
Hola, se les ocurre mejor manera de convertir un LPWSTR a char **;
Código
  1. int argc;
  2. LPWSTR *_argv = CommandLineToArgvW(GetCommandLineW(), &argc);
  3. char ** argv = new char*[argc * 200];
  4. for (int i = 0; i < argc; i++){
  5. argv[i] = new char[200];
  6. wcstombs(argv[i], _argv[i], 200);
  7. }
  8.  
  9.  
  10.  
  11. for (int i = 0; i < argc; i++){
  12. delete [] argv[i];
  13. }
  14. delete[] argv;

Un saludo
36  Programación / Scripting / [Bath] Sleep + msg.exe no funciona en: 3 Agosto 2015, 12:52 pm
Hola, teniendo esto:

Código
  1. ping 1.1.1.1 -n 1 -w 15000 > nul
  2. msg * hola!
Lo abro, cambio de usuario y espero recibir un 'hola!' pero no aparece nada.
Tampoco si abro cmd y utilizo msg * hola!
Solo si envió mensajes hasta el usuario desde el que ejecuto el comando.

Por que ?

Un saludo
37  Programación / Scripting / [Python] Imprimir mas rápido en: 3 Agosto 2015, 11:09 am
Hola tengo este codigo:

Código
  1. from os import system
  2. from msvcrt import getch
  3. import colorama
  4. from colorama import Fore
  5. import json
  6.  
  7. colorama.init()
  8.  
  9. maxX = 80
  10. maxY = 40
  11.  
  12. system('mode 80,40')
  13. class posistion:
  14. def __init__(self):
  15. self.x = 0
  16. self.y = 1
  17. def addX(self,v = 1):
  18. if self.x < maxX - 1:
  19. self.x += v
  20. if self.x < 0:
  21. self.x = 0
  22. return self.x
  23. else:
  24. return -1
  25. def addY(self,v = 1):
  26. if self.y < maxY - 1:
  27. self.y += v
  28. if self.y < 1:
  29. self.y = 1
  30. return self.y
  31. else:
  32. return -1
  33. class cForSave:
  34. pass
  35.  
  36. def Mprint(m):
  37. r = '\n'
  38. for i,x in enumerate(m):
  39. for j,y in enumerate(x):
  40. if i == pos.y and j == pos.x:
  41. r += (Fore.RED + y)
  42. elif y == ' ':
  43. r += (Fore.WHITE + y)
  44. else:
  45. r += (Fore.WHITE + y)
  46. print r,
  47. #print pos.x,pos.y
  48.  
  49.  
  50. pos = posistion()
  51. matrix = [[' ' for x in range(1,maxX + 1)] for x in range(1,maxY + 1)]
  52. while True:
  53. c = getch()
  54. if c == '\000' or c == '\xe0':
  55. key = ord(getch())
  56. if key == 77: # right
  57. pos.addX()
  58. elif key == 75: # left
  59. pos.addX(-1)
  60. elif key == 80: # bottom
  61. pos.addY()
  62. elif key == 72: # top
  63. pos.addY(-1)
  64. elif c == '\t': # Save monster to file
  65. f = open('monster','w')
  66. s = cForSave()
  67. s.matrix = matrix
  68. s.pos = pos
  69. json.dump(s,f)
  70. f.close()
  71. system('cls')
  72. print 'Monster saved!'
  73. system('pause')
  74. elif c == '\r': # Load monster from file
  75. try:
  76. f = open('monster','r')
  77. s = json.load(f)
  78. matrix = s.matrix
  79. pos = s.pos
  80. except IOError:
  81. system('cls')
  82. print 'Monster file not found!'
  83. system('pause')
  84. else:
  85. matrix[pos.y][pos.x] = c
  86. system('cls')
  87.  
  88. Mprint(matrix)
  89.  
  90.  
Funciona pero muy lento y la pantalla parpadea. Es mi segundo programa en python y no se me ocurrió otra manera. No se como modificar solo un carácter del terminal con python y no reescribir todo.

Un saludo
38  Sistemas Operativos / Windows / Windows 8.1 se reinicia al jugar juegos (npsvctrig) en: 26 Julio 2015, 16:09 pm
Hola tengo un pc en el que no consigo ver el problema.
pc se reinicia de repente sin mostrar ningún aviso. Tampoco se muestra el BSOD.
Comprobé y la temperatura del pc no sube mas de 75% la GPU lo demás es todavía menos.
En el log tengo esto:
Citar
Level Date and Time Source Event ID Task Category
Information 7/26/2015 4:35:17 PM Microsoft-Windows-Winlogon 7001 (1101) User Logon Notification for Customer Experience Improvement Program
Information 7/26/2015 4:34:58 PM Service Control Manager 7026 None "The following boot-start or system-start driver(s) did not load:
dam"
Information 7/26/2015 4:34:54 PM Microsoft-Windows-DHCPv6-Client 51046 Service State Event DHCPv6 client service is started
Information 7/26/2015 4:34:54 PM Microsoft-Windows-Dhcp-Client 50036 Service State Event DHCPv4 client service is started
Information 7/26/2015 4:34:53 PM Microsoft-Windows-UserModePowerService 12 (10) Process C:\Windows\System32\atieclxx.exe (process ID:396) reset policy scheme from {381B4222-F694-41F0-9685-FF5BB260DF2E} to {381B4222-F694-41F0-9685-FF5BB260DF2E}
Information 7/26/2015 4:34:47 PM Microsoft-Windows-FilterManager 6 None File System Filter 'luafv' (6.3, ‎2014‎-‎02‎-‎22T15:14:25.000000000Z) has successfully loaded and registered with Filter Manager.
Information 7/26/2015 4:34:31 PM Microsoft-Windows-Kernel-Processor-Power 55 (47) "Processor 7 in group 0 exposes the following power management capabilities:

Idle state type: ACPI Idle (C) States (2 state(s))

Performance state type: ACPI Performance (P) / Throttle (T) States
Nominal Frequency (MHz): 3501
Maximum performance percentage: 100
Minimum performance percentage: 22
Minimum throttle percentage: 22"
Information 7/26/2015 4:34:31 PM Microsoft-Windows-Kernel-Processor-Power 55 (47) "Processor 5 in group 0 exposes the following power management capabilities:

Idle state type: ACPI Idle (C) States (2 state(s))

Performance state type: ACPI Performance (P) / Throttle (T) States
Nominal Frequency (MHz): 3501
Maximum performance percentage: 100
Minimum performance percentage: 22
Minimum throttle percentage: 22"
Information 7/26/2015 4:34:31 PM Microsoft-Windows-Kernel-Processor-Power 55 (47) "Processor 3 in group 0 exposes the following power management capabilities:

Idle state type: ACPI Idle (C) States (2 state(s))

Performance state type: ACPI Performance (P) / Throttle (T) States
Nominal Frequency (MHz): 3501
Maximum performance percentage: 100
Minimum performance percentage: 22
Minimum throttle percentage: 22"
Information 7/26/2015 4:34:31 PM Microsoft-Windows-Kernel-Processor-Power 55 (47) "Processor 1 in group 0 exposes the following power management capabilities:

Idle state type: ACPI Idle (C) States (2 state(s))

Performance state type: ACPI Performance (P) / Throttle (T) States
Nominal Frequency (MHz): 3501
Maximum performance percentage: 100
Minimum performance percentage: 22
Minimum throttle percentage: 22"
Information 7/26/2015 4:34:31 PM Microsoft-Windows-Kernel-Processor-Power 55 (47) "Processor 6 in group 0 exposes the following power management capabilities:

Idle state type: ACPI Idle (C) States (2 state(s))

Performance state type: ACPI Performance (P) / Throttle (T) States
Nominal Frequency (MHz): 3501
Maximum performance percentage: 100
Minimum performance percentage: 22
Minimum throttle percentage: 22"
Information 7/26/2015 4:34:31 PM Microsoft-Windows-Kernel-Processor-Power 55 (47) "Processor 4 in group 0 exposes the following power management capabilities:

Idle state type: ACPI Idle (C) States (2 state(s))

Performance state type: ACPI Performance (P) / Throttle (T) States
Nominal Frequency (MHz): 3501
Maximum performance percentage: 100
Minimum performance percentage: 22
Minimum throttle percentage: 22"
Information 7/26/2015 4:34:31 PM Microsoft-Windows-Kernel-Processor-Power 55 (47) "Processor 2 in group 0 exposes the following power management capabilities:

Idle state type: ACPI Idle (C) States (2 state(s))

Performance state type: ACPI Performance (P) / Throttle (T) States
Nominal Frequency (MHz): 3501
Maximum performance percentage: 100
Minimum performance percentage: 22
Minimum throttle percentage: 22"
Information 7/26/2015 4:34:31 PM Microsoft-Windows-Kernel-Processor-Power 55 (47) "Processor 0 in group 0 exposes the following power management capabilities:

Idle state type: ACPI Idle (C) States (2 state(s))

Performance state type: ACPI Performance (P) / Throttle (T) States
Nominal Frequency (MHz): 3501
Maximum performance percentage: 100
Minimum performance percentage: 22
Minimum throttle percentage: 22"
Information 7/26/2015 4:34:29 PM Microsoft-Windows-Ntfs 98 None Volume E: (\Device\HarddiskVolume2) is healthy.  No action is needed.
Critical 7/26/2015 4:34:27 PM Microsoft-Windows-Kernel-Power 41 (63) The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly.
Information 7/26/2015 4:34:27 PM Microsoft-Windows-FilterManager 6 None File System Filter 'npsvctrig' (6.3, ‎2013‎-‎08‎-‎22T14:38:22.000000000Z) has successfully loaded and registered with Filter Manager.
Information 7/26/2015 4:34:27 PM Microsoft-Windows-Ntfs 98 None Volume C: (\Device\HarddiskVolume3) is healthy.  No action is needed.
Information 7/26/2015 4:34:20 PM Microsoft-Windows-Ntfs 98 None Volume \\?\Volume{7103d8b7-302d-11e5-8250-806e6f6e6963} (\Device\HarddiskVolume1) is healthy.  No action is needed.
Information 7/26/2015 4:34:19 PM Microsoft-Windows-FilterManager 6 None File System Filter 'WdFilter' (6.3, ‎2015‎-‎01‎-‎30T13:20:58.000000000Z) has successfully loaded and registered with Filter Manager.
Information 7/26/2015 4:34:19 PM Microsoft-Windows-FilterManager 6 None File System Filter 'Wof' (6.3, ‎2014‎-‎03‎-‎13T11:27:29.000000000Z) has successfully loaded and registered with Filter Manager.
Information 7/26/2015 4:34:19 PM Microsoft-Windows-FilterManager 6 None File System Filter 'FileInfo' (6.3, ‎2014‎-‎02‎-‎22T15:13:10.000000000Z) has successfully loaded and registered with Filter Manager.
Information 7/26/2015 4:34:18 PM Microsoft-Windows-Kernel-Boot 30 None The firmware reported boot metrics.
Information 7/26/2015 4:34:18 PM Microsoft-Windows-Kernel-Boot 32 None The bootmgr spent 0 ms waiting for user input.
Information 7/26/2015 4:34:18 PM Microsoft-Windows-Kernel-Boot 18 None There are 0x1 boot options on this system.
Information 7/26/2015 4:34:18 PM Microsoft-Windows-Kernel-Boot 27 None The boot type was 0x0.
Information 7/26/2015 4:34:18 PM Microsoft-Windows-Kernel-Boot 20 None The last shutdown's success status was false. The last boot's success status was true.
Information 7/26/2015 4:34:18 PM Microsoft-Windows-Kernel-General 12 None The operating system started at system time ‎2015‎-‎07‎-‎26T13:34:18.495664700Z.
Information 7/26/2015 4:34:50 PM EventLog 6013 None The system uptime is 32 seconds.
Information 7/26/2015 4:34:50 PM EventLog 6005 None The Event log service was started.
Information 7/26/2015 4:34:50 PM EventLog 6009 None Microsoft (R) Windows (R) 6.03. 9600  Multiprocessor Free.
Error 7/26/2015 4:34:50 PM EventLog 6008 None The previous system shutdown at 4:19:01 PM on ‎7/‎26/‎2015 was unexpected.
Information 7/26/2015 4:11:16 PM Microsoft-Windows-Power-Troubleshooter 1 None "The system has returned from a low power state.

Sleep Time: ‎2015‎-‎07‎-‎26T12:51:30.053921800Z
Wake Time: ‎2015‎-‎07‎-‎26T13:11:08.832026900Z

Wake Source: Device -Controladora de host extensible 3.0 de USB de Intel(R): 0100 (Microsoft)"
Information 7/26/2015 4:11:08 PM Microsoft-Windows-Kernel-Power 131 (33) Firmware S3 times. ResumeCount: 1, FullResume: 1811, AverageResume: 1811
Information 7/26/2015 4:11:08 PM Microsoft-Windows-Kernel-General 1 None "The system time has changed to ‎2015‎-‎07‎-‎26T13:11:08.500000000Z from ‎2015‎-‎07‎-‎26T12:51:35.664466200Z.

Change Reason: System time synchronized with the hardware clock."
Information 7/26/2015 3:51:30 PM Microsoft-Windows-Kernel-Power 42 (64) "The system is entering sleep.

Sleep Reason: System Idle"

Sube el archivo .evtx aquí: https://drive.google.com/file/d/0BwSx2kOJel7xeWtic0p5ZXpRUlE/view?usp=sharing
Al leer vi que justo antes del reinicio se ejecuta:
Filter 'npsvctrig' (6.3, ‎2013‎-‎08‎-‎22T14:38:22.000000000Z) has successfully loaded and registered with Filter Manager.
Ayuden pls
Un saludo
39  Programación / Programación C/C++ / Porque es posible llamar a una función puntero sin usar "*" ? en: 8 Julio 2015, 15:06 pm
Hola,
teniendo esto:
Código
  1. typedef bool (_funct)(char* buffer,int maxLength);
  2. _funct * funct = (_funct*)GetProcAddress(library, "funct");
  3. //Porque es posible llamar a un puntero funcion de esta manera? :
  4. funct(..);
  5. //Me parece mas logico asi:
  6. (*funct)(..);
  7.  

Saludos
40  Programación / Programación C/C++ / WH_CALLWNDPROC llamada de forma rara en: 8 Julio 2015, 01:18 am
Hola estuve probando cositas y en este codigo:

Código
  1. //Main.cpp
  2. typedef void(_MakeHook)(DWORD threadID, int dlgID);
  3.  
  4. int _tmain(int argc, _TCHAR* argv[])
  5. {
  6. HWND hwnd = FindWindow("wxWindowNR", "FileZilla");
  7. if (hwnd == 0){
  8. printf("FileZilla not found\n");
  9. getchar();
  10. return 0;
  11. }
  12.  
  13. HMODULE library = LoadLibrary("C:\\Users\\User\\Documents\\Visual Studio 2013\\Projects\\stealPwDll_real\\x64\\Debug\\stealPwDll_dll.dll");
  14. if (library == NULL){
  15. printf("error library %d\n",GetLastError());
  16. }
  17. _MakeHook * MakeHook = (_MakeHook *)GetProcAddress(library, "MakeHook");
  18. if (MakeHook == 0){
  19. printf("getpw error\n");
  20. }
  21. MakeHook(GetWindowThreadProcessId(hwnd, 0), 0xFFFF83C4);
  22.  
  23. MSG msg;
  24. while (!GetMessage(&msg, 0, 0, 0)){
  25. TranslateMessage(&msg);
  26. DispatchMessage(&msg);
  27. }
  28.  
  29. getchar();
  30. return 0;
  31. }


Código
  1. //Código del main_dll.cpp
  2. #include <Windows.h>
  3. #include "main.h"
  4. #include <stdio.h>
  5.  
  6. #pragma warning(disable:4996)
  7.  
  8. HMODULE hmodule;
  9. HHOOK hook;
  10. bool msgSend = false;
  11. int g = 0;
  12.  
  13. BOOL WINAPI DllMain(HMODULE hmodule,DWORD reason,LPVOID){
  14. if (reason == DLL_PROCESS_ATTACH){
  15. ::hmodule = hmodule;
  16. }
  17. return 1;
  18. }
  19.  
  20.  
  21.  
  22.  
  23. void MakeHook(DWORD id, int dlgID){
  24. hook = SetWindowsHookEx(WH_CALLWNDPROC, getPw, hmodule, id);
  25. if (hook == NULL){
  26. char msg[100];
  27. sprintf(msg, "Hook error -> %d", GetLastError());
  28. MessageBox(0, msg, "Hook error", MB_ICONERROR);
  29. }
  30. }
  31.  
  32.  
  33. LRESULT CALLBACK getPw(int code,WPARAM wparam,LPARAM lparam){
  34. if (code != HC_ACTION){
  35. return (CallNextHookEx(hook, code, wparam, lparam));
  36. }
  37. else if(!wparam){
  38. if (!msgSend){
  39. g++;
  40. char msg[100];
  41. sprintf(msg, "%d", g);
  42. MessageBox(0, "Not current thread call", msg, MB_ICONINFORMATION); //  ----------- Parte rara --------
  43. msgSend = true;
  44. }
  45. }
  46. return 1;
  47. }

Si utilizo el código del main_dll.cpp me muestra 30 MessageBox empezando desde g = 30
Si cambio el código:
Código
  1. LRESULT CALLBACK getPw(int code,WPARAM wparam,LPARAM lparam){
  2. if (code != HC_ACTION){
  3. return (CallNextHookEx(hook, code, wparam, lparam));
  4. }
  5. else if(!wparam){
  6. if (!msgSend){
  7. msgSend = true; // ----- Parte cambiada -> msgSend = true; sube primero
  8. g++;
  9. char msg[100];
  10. sprintf(msg, "%d", g);
  11. MessageBox(0, "Not current thread call", msg, MB_ICONINFORMATION);
  12.  
  13. }
  14. }
  15. return 1;
  16. }

Me muestra solo un MessageBox como debe ser.

Porque???

Un saludo
Páginas: 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines