|
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: bool SaveBeep(int a, int b){ int *c = new int(2); c[0] = a; c[1] = b; if (!CreateThread(0, 0, beepThread, (LPVOID)c, 0, 0)) return 0; return 1; } DWORD WINAPI beepThread(LPVOID p){ int * a = (int*)p; Beep(a[0], a[1]); delete[]a; return 0; }
Error de memoria en delete[]a;También probé: delete &a[0]; delete &a[1];
pero sigue igual. Primero probé así pero no recibía los int bool SaveBeep(int a, int b){ int c[2] = { a, b }; if (!CreateThread(0, 0, beepThread, (LPVOID)c, 0, 0)) return 0; return 1; } DWORD WINAPI beepThread(LPVOID p){ int * a = (int*)p; Beep(a[0], a[1]); return 0; }
Ideas?? Un saludo
|
|
|
33
|
Programación / Programación C/C++ / fclose sin argumentos
|
en: 18 Agosto 2015, 14:21 pm
|
int main(int argc, char *argv[]) { char Nombre[20]; FILE *archivo; char letras[1000]; archivo = fopen("config.txt", "r"); fgets(letras, 1000, archivo); strcpy(Nombre, letras); printf("%s\n", Nombre); fclose; system("PAUSE"); return EXIT_SUCCESS; }
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: //Al principio era: vector<string> split(string str,char c); void split(string str, char c,vector<string>* strings){ stringstream stream(str); string item; while (getline(stream, item, c)){ strings->push_back(item); } }
Luego: HMODULE lib = LoadLibrary("C:\\Users\\Dimitar\\Documents\\Visual Studio 2013\\Projects\\BasicTools\\Release\\BasicTools.dll"); if (lib == NULL){ e("Library failed to load!"); } _split split = (_split)GetProcAddress(lib, "split"); if (!split){ e("Failed to load split!"); } string test = "Hola me llamo Jose!"; vector<string> strings; split(test, ' ', &strings); for (auto str : strings){ cout << str << endl; }
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 **; int argc; LPWSTR *_argv = CommandLineToArgvW(GetCommandLineW(), &argc); char ** argv = new char*[argc * 200]; for (int i = 0; i < argc; i++){ argv[i] = new char[200]; wcstombs(argv[i], _argv[i], 200); } for (int i = 0; i < argc; i++){ delete [] argv[i]; } delete[] argv;
Un saludo
|
|
|
36
|
Programación / Scripting / [Bath] Sleep + msg.exe no funciona
|
en: 3 Agosto 2015, 12:52 pm
|
Hola, teniendo esto: ping 1.1.1.1 -n 1 -w 15000 > nul 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: from os import system from msvcrt import getch import colorama from colorama import Fore import json colorama.init() maxX = 80 maxY = 40 system('mode 80,40') class posistion: def __init__(self): self.x = 0 self.y = 1 def addX(self,v = 1): if self.x < maxX - 1: self.x += v if self.x < 0: self.x = 0 return self.x else: return -1 def addY(self,v = 1): if self.y < maxY - 1: self.y += v if self.y < 1: self.y = 1 return self.y else: return -1 class cForSave: pass def Mprint(m): r = '\n' for i,x in enumerate(m): for j,y in enumerate(x): if i == pos.y and j == pos.x: r += (Fore.RED + y) elif y == ' ': r += (Fore.WHITE + y) else: r += (Fore.WHITE + y) print r, #print pos.x,pos.y pos = posistion() matrix = [[' ' for x in range(1,maxX + 1)] for x in range(1,maxY + 1)] while True: c = getch() if c == '\000' or c == '\xe0': key = ord(getch()) if key == 77: # right pos.addX() elif key == 75: # left pos.addX(-1) elif key == 80: # bottom pos.addY() elif key == 72: # top pos.addY(-1) elif c == '\t': # Save monster to file f = open('monster','w') s = cForSave() s.matrix = matrix s.pos = pos json.dump(s,f) f.close() system('cls') print 'Monster saved!' system('pause') elif c == '\r': # Load monster from file try: f = open('monster','r') s = json.load(f) matrix = s.matrix pos = s.pos except IOError: system('cls') print 'Monster file not found!' system('pause') else: matrix[pos.y][pos.x] = c system('cls') Mprint(matrix)
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: 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=sharingAl 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
|
|
|
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: //Main.cpp typedef void(_MakeHook)(DWORD threadID, int dlgID); int _tmain(int argc, _TCHAR* argv[]) { HWND hwnd = FindWindow("wxWindowNR", "FileZilla"); if (hwnd == 0){ printf("FileZilla not found\n"); getchar(); return 0; } HMODULE library = LoadLibrary("C:\\Users\\User\\Documents\\Visual Studio 2013\\Projects\\stealPwDll_real\\x64\\Debug\\stealPwDll_dll.dll"); if (library == NULL){ printf("error library %d\n",GetLastError()); } _MakeHook * MakeHook = (_MakeHook *)GetProcAddress(library, "MakeHook"); if (MakeHook == 0){ printf("getpw error\n"); } MakeHook(GetWindowThreadProcessId(hwnd, 0), 0xFFFF83C4); MSG msg; while (!GetMessage(&msg, 0, 0, 0)){ TranslateMessage(&msg); DispatchMessage(&msg); } getchar(); return 0; }
//Código del main_dll.cpp #include <Windows.h> #include "main.h" #include <stdio.h> #pragma warning(disable:4996) HMODULE hmodule; HHOOK hook; bool msgSend = false; int g = 0; BOOL WINAPI DllMain(HMODULE hmodule,DWORD reason,LPVOID){ if (reason == DLL_PROCESS_ATTACH){ ::hmodule = hmodule; } return 1; } void MakeHook(DWORD id, int dlgID){ hook = SetWindowsHookEx(WH_CALLWNDPROC, getPw, hmodule, id); if (hook == NULL){ char msg[100]; sprintf(msg, "Hook error -> %d", GetLastError()); MessageBox(0, msg, "Hook error", MB_ICONERROR); } } LRESULT CALLBACK getPw(int code,WPARAM wparam,LPARAM lparam){ if (code != HC_ACTION){ return (CallNextHookEx(hook, code, wparam, lparam)); } else if(!wparam){ if (!msgSend){ g++; char msg[100]; sprintf(msg, "%d", g); MessageBox(0, "Not current thread call", msg, MB_ICONINFORMATION); // ----------- Parte rara -------- msgSend = true; } } return 1; }
Si utilizo el código del main_dll.cpp me muestra 30 MessageBox empezando desde g = 30Si cambio el código: LRESULT CALLBACK getPw(int code,WPARAM wparam,LPARAM lparam){ if (code != HC_ACTION){ return (CallNextHookEx(hook, code, wparam, lparam)); } else if(!wparam){ if (!msgSend){ msgSend = true; // ----- Parte cambiada -> msgSend = true; sube primero g++; char msg[100]; sprintf(msg, "%d", g); MessageBox(0, "Not current thread call", msg, MB_ICONINFORMATION); } } return 1; }
Me muestra solo un MessageBox como debe ser. Porque??? Un saludo
|
|
|
|
|
|
|