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 - Borito30

#151
La librería es la siguiente:
Código (cpp) [Seleccionar]
#pragma once

#if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__)
   #error MinHook supports only x86 and x64 systems.
#endif

#include <windows.h>

// MinHook Error Codes.
typedef enum MH_STATUS
{
   // Unknown error. Should not be returned.
   MH_UNKNOWN = -1,

   // Successful.
   MH_OK = 0,

   // MinHook is already initialized.
   MH_ERROR_ALREADY_INITIALIZED,

   // MinHook is not initialized yet, or already uninitialized.
   MH_ERROR_NOT_INITIALIZED,

   // The hook for the specified target function is already created.
   MH_ERROR_ALREADY_CREATED,

   // The hook for the specified target function is not created yet.
   MH_ERROR_NOT_CREATED,

   // The hook for the specified target function is already enabled.
   MH_ERROR_ENABLED,

   // The hook for the specified target function is not enabled yet, or already
   // disabled.
   MH_ERROR_DISABLED,

   // The specified pointer is invalid. It points the address of non-allocated
   // and/or non-executable region.
   MH_ERROR_NOT_EXECUTABLE,

   // The specified target function cannot be hooked.
   MH_ERROR_UNSUPPORTED_FUNCTION,

   // Failed to allocate memory.
   MH_ERROR_MEMORY_ALLOC,

   // Failed to change the memory protection.
   MH_ERROR_MEMORY_PROTECT,

   // The specified module is not loaded.
   MH_ERROR_MODULE_NOT_FOUND,

   // The specified function is not found.
   MH_ERROR_FUNCTION_NOT_FOUND
}
MH_STATUS;

// Can be passed as a parameter to MH_EnableHook, MH_DisableHook,
// MH_QueueEnableHook or MH_QueueDisableHook.
#define MH_ALL_HOOKS NULL

#ifdef __cplusplus
extern "C" {
#endif

   // Initialize the MinHook library. You must call this function EXACTLY ONCE
   // at the beginning of your program.
   MH_STATUS WINAPI MH_Initialize(VOID);

   // Uninitialize the MinHook library. You must call this function EXACTLY
   // ONCE at the end of your program.
   MH_STATUS WINAPI MH_Uninitialize(VOID);

   // Creates a Hook for the specified target function, in disabled state.
   // Parameters:
   //   pTarget    [in]  A pointer to the target function, which will be
   //                    overridden by the detour function.
   //   pDetour    [in]  A pointer to the detour function, which will override
   //                    the target function.
   //   ppOriginal [out] A pointer to the trampoline function, which will be
   //                    used to call the original target function.
   //                    This parameter can be NULL.
   MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal);

   // Creates a Hook for the specified API function, in disabled state.
   // Parameters:
   //   pszModule  [in]  A pointer to the loaded module name which contains the
   //                    target function.
   //   pszTarget  [in]  A pointer to the target function name, which will be
   //                    overridden by the detour function.
   //   pDetour    [in]  A pointer to the detour function, which will override
   //                    the target function.
   //   ppOriginal [out] A pointer to the trampoline function, which will be
   //                    used to call the original target function.
   //                    This parameter can be NULL.
   MH_STATUS WINAPI MH_CreateHookApi(
       LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal);

   // Creates a Hook for the specified API function, in disabled state.
   // Parameters:
   //   pszModule  [in]  A pointer to the loaded module name which contains the
   //                    target function.
   //   pszTarget  [in]  A pointer to the target function name, which will be
   //                    overridden by the detour function.
   //   pDetour    [in]  A pointer to the detour function, which will override
   //                    the target function.
   //   ppOriginal [out] A pointer to the trampoline function, which will be
   //                    used to call the original target function.
   //                    This parameter can be NULL.
   //   ppTarget   [out] A pointer to the target function, which will be used
   //                    with other functions.
   //                    This parameter can be NULL.
   MH_STATUS WINAPI MH_CreateHookApiEx(
       LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget);

   // Removes an already created hook.
   // Parameters:
   //   pTarget [in] A pointer to the target function.
   MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget);

   // Enables an already created hook.
   // Parameters:
   //   pTarget [in] A pointer to the target function.
   //                If this parameter is MH_ALL_HOOKS, all created hooks are
   //                enabled in one go.
   MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget);

   // Disables an already created hook.
   // Parameters:
   //   pTarget [in] A pointer to the target function.
   //                If this parameter is MH_ALL_HOOKS, all created hooks are
   //                disabled in one go.
   MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget);

   // Queues to enable an already created hook.
   // Parameters:
   //   pTarget [in] A pointer to the target function.
   //                If this parameter is MH_ALL_HOOKS, all created hooks are
   //                queued to be enabled.
   MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget);

   // Queues to disable an already created hook.
   // Parameters:
   //   pTarget [in] A pointer to the target function.
   //                If this parameter is MH_ALL_HOOKS, all created hooks are
   //                queued to be disabled.
   MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget);

   // Applies all queued changes in one go.
   MH_STATUS WINAPI MH_ApplyQueued(VOID);

   // Translates the MH_STATUS to its name as a string.
   const char * WINAPI MH_StatusToString(MH_STATUS status);

#ifdef __cplusplus
}
#endif



Como podría agregar a las funciones casts a void* digamos dentro de los parametros, ya que necesito hacer la conversión de un puntero a función a un void*.
#152
Cita de: ivancea96 en 14 Marzo 2017, 14:58 PM
Esa librería sera de C (los errores son errores de conversión de un puntero a función a un void*, cosa que en C se podía hacer de forma implícita). O modificas las funciones añadiendo casts a void*, o:
https://www.codeproject.com/Articles/44326/MinHook-The-Minimalistic-x-x-API-Hooking-Libra
Hay una parte que pone: If you are a C++ user, ...
Primero tengo unas dudas cuando dices librería te refieres a cabecera? también se le puede llamar libreria a un .h por ejemplo? Segundo :
Citarlos errores son errores de conversión de un puntero a función a un void*, cosa que en C se podía hacer de forma implícita). O modificas las funciones añadiendo casts a void*

Cuando dices añadir casts a void* te refieres que en la libreria/cabecera minhook.h debó incluirle el * de puntero?

En cuanto a esto:
CitarIf you are a C++ user, ...

Lo intente cambiando la parte de arriba y de abajo y dejando el main tal como estaba pero al compilarlo seguia devolviendo error.

#153
Estoy intentando compilar ejemplos de esta libreria:
https://www.codeproject.com/KB/winsdk/LibMinHook/MinHook_133_src.zip

El tio compila ejemplos de todos pero cuando yo lo intento me devuelve:
C:\Users\Androide\Desktop\minhook\Dynamic\MinHook_133_src\include\MinHook.h:141:
22: note:   candidate expects 5 arguments, 4 provided
DynamicLinkSample.cpp:12:18: note: template<class T> MH_STATUS MH_CreateHookApiE
x(LPCWSTR, LPCSTR, LPVOID, T**)
inline MH_STATUS MH_CreateHookApiEx(LPCWSTR pszModule, LPCSTR pszProcName, LPVO
ID pDetour, T** ppOriginal)
                 ^
DynamicLinkSample.cpp:12:18: note:   template argument deduction/substitution fa
iled:
DynamicLinkSample.cpp:37:88: note:   cannot convert 'DetourMessageBoxW' (type 'i
nt (__attribute__((__stdcall__)) *)(HWND, LPCWSTR, LPCWSTR, UINT) {aka int (__at
tribute__((__stdcall__)) *)(HWND__*, const wchar_t*, const wchar_t*, unsigned in
t)}') to type 'LPVOID {aka void*}'
    if (MH_CreateHookApiEx(L"user32", "MessageBoxW", &DetourMessageBoxW, &fpMes
sageBoxW) != MH_OK)

       ^
DynamicLinkSample.cpp:43:35: error: invalid conversion from 'int (__attribute__(
(__stdcall__)) *)(HWND, LPCWSTR, LPCWSTR, UINT) {aka int (__attribute__((__stdca
ll__)) *)(HWND__*, const wchar_t*, const wchar_t*, unsigned int)}' to 'LPVOID {a
ka void*}' [-fpermissive]
    if (MH_EnableHook(&MessageBoxW) != MH_OK)
                                  ^
In file included from DynamicLinkSample.cpp:2:0:
C:\Users\Androide\Desktop\minhook\Dynamic\MinHook_133_src\include\MinHook.h:154:
22: note: initializing argument 1 of 'MH_STATUS MH_EnableHook(LPVOID)'
    MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget);
                     ^
DynamicLinkSample.cpp:52:36: error: invalid conversion from 'int (__attribute__(
(__stdcall__)) *)(HWND, LPCWSTR, LPCWSTR, UINT) {aka int (__attribute__((__stdca
ll__)) *)(HWND__*, const wchar_t*, const wchar_t*, unsigned int)}' to 'LPVOID {a
ka void*}' [-fpermissive]
    if (MH_DisableHook(&MessageBoxW) != MH_OK)
                                   ^
In file included from DynamicLinkSample.cpp:2:0:
C:\Users\Androide\Desktop\minhook\Dynamic\MinHook_133_src\include\MinHook.h:161:
22: note: initializing argument 1 of 'MH_STATUS MH_DisableHook(LPVOID)'
    MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget);
                     ^


Supongo algo estare haciendo mal. En este caso estoy intentando desde consola con g++, que el compilador sería mingw.
#154
Cita de: ivancea96 en 14 Marzo 2017, 13:57 PM
En español, "Vinculador -> General -> Directoriosde bibliotecas adicionales" para las carpetas y "Vinculador -> Entrada -> Dependencias adicionales" para los archivos.

Directoriosde bibliotecas adicionales" para las carpetas

Esta parte se refiere a los .lib o a las cabeceras .h?

Y la segunda parte si lo entendi

"Vinculador -> Entrada -> Dependencias adicionales" para los archivos.

Para los ficheros estáticos(.lib).

Vale si es correcto directorio para los .lib y nombre de los .lib.
#155
Hola tengo una duda donde podría colocar los .lib en visual studio capturas:


#156
abri otro post ya que este es antiguo y no lo puedo poner otra vez para resolverlo
#157
Bueno muchas veces cuando empezamos a programar usamos un ide y pensamos que es el mismo programa pero detrás de cada ide se encuentra un compilador que basicamente es un programa informático que traduce un programa escrito en un lenguaje de programación a otro lenguaje diferente. Este proceso de traducción se conoce como compilación.

Aqui teneis una lista de compiladores para la mayoría de lenguajes de programación:

Ada
*Aonix ObjectAda for Windows : Aonix offers the windows version of their compiler as a free download (Win).
*AVL Ada9X 1.91 : Ada95 environment, featuring editor, interpreter, manual (DOS).
*ez2load : Free DOS Ada 95 compiler based on GNAT (DOS).


Assembly
*Alab 1.3 b1 : Alab stands for Assembly Laboratory, an assembly / watcom C IDE. Be careful though, it requires a third-party Assembler (such as TurboAsm - not included) (DOS).
*Arrowsoft Assembler 1.0D : Equivalent to MASM 3.0 (DOS).
DR Assembler Tools (RASM) v1.3 : Digital Research's assembler tools (DOS). (70.1kb)
*Flat Assembler (FASM) 1.42 : Fast, efficient self-assembling x86 assembler (DOS/Win/Linux).
Microsoft Macro Assembler (MASM) 5.10 : This is a pretty advanced version of a good assembler (DOS). (628kb)
*Netwide Assembler (NASM) 0.98 : A general-purpose open source x86 assembler. Includes disassembler (DOS/Win/Linux).
*NewBasic Assembler (NBASM) : Freeware, near MASM 5.1x compatible, visual IDE (DOS).
*Pass32 v2 : Free x86 Assembler for PMode Applications (DOS/Win).
Turbo Assembler (TASM) V2.0 : The most popular assembler by Borland. This version is rather old though (DOS). (478kb)
*Win 32 + Assembler : GoAsm, GoLink etc. Assembler tools for the 32 bit Win programmer (Win).


Basic
*ASIC 5.00 : A free BASICA/QBASIC compiler.
*MicroBasic 3.2 : Small compiler that produces COM + EXE files (DOS).
MS Quick Basic 4.5 : My favorite BASIC compiler. Very friendly environment (DOS). (895kb)
MS Visual Basic 3.0 : Be careful, the help files are not included (Win 3.x). (470kb)
*Phenix Object Basic : Object oriented basic for Linux (Linux).
*Rapid-Q : Cross-platform basic (Win/Linux...).
*ScriptBasic V1.0 : Create portable applications or even web application in Basic (Win/Linux).
*UBasic86 (32bit) v8.8c : High precision math-oriented BASIC interpreter (DOS).
*XBasic : 32/64bit BASIC interactive program development environment (Win/Linux).
*Yabasic 2.716 : Yet Another BASIC that implements the most common and simple elemets of the language (Win/Linux).


C / C++
// LOS MÁS IMPORTANTES EN C++//
*MinGW. Es un compilador similar al de GNU (GCC - GNU Compiler Collection) pero para windows.
*Visual Studio. Proviene de la familia Visual C++, es otro de los más utilizados por windows lanzado por microsoft.
*Cygwin. Es un entorno de desarrollo parecido a Unix y una interfaz en modo comando para Microsoft Windows.
/////////////////////////////////////////
*Borland Turbo: A solid C compiler. Register at the Borland site and download it for free (DOS).
*Digital Mars C/C++ Compliler v8.31 : Complete C / C++ compiler package (Win).
*DJGPP : Complete 32-bit C/C++ development system (DOS/Win)
*LadSoft cc386 2.06 : 32 bit ANSI C compiler with limited C++ support (DOS/Win).
*lcc 4.2 : A retargetable ANSI C compiler for most platforms (Win/Linux...).
*Pacific C Compiler : Freeware C Compiler (DOS).
*Sphinx C-- final : Sphinx C-- is a combination of C and 80x86 assembly language (DOS).
*Watcom C/C++ v11.0c : Complete multi-platform development environment (DOS/Win/OS2)


Cobol
*DOS COBOL v0.001alpha or Win32 ver : Small COBOL interpreter (DOS/Win).
MS COBOL V2.2 : Cobol is an old business oriented language that used to be extremely popular. Today it is only used by very few veteran programmers (DOS). (744kb)


D
*Digital Mars D Compliler : D was created as a C / C++ successor. It is still in Alpha stage of development (Win).

Eiffel
*iss-base 4 : Freeware version of a commercial compiler for the object-oriented Eiffel language (Win/Linux).
*SmartEiffel : Fast, small and open source Eiffel compiler. Outputs to C / Java (Win/any ANSI C environment).


Forth
*Pygmy Forth 1.5 : Fast direct-threaded Forth (DOS).

Fortran
BC Fortran 77 v1.3b : Compiler, linker, module library and resident run-time w/debugger (DOS). (181kb)
*F Compiler : You download via ftp compiler versions for many operating systems (Win/...)
Lahey Fortran 77 v3.0 : The Lahey is a well known F77 compiler, although this is an early version (DOS). (382kb)
Microsoft FORTRAN 5.1 : A good and well known compiler (DOS). (1.74MB)
*Watcom FORTRAN v11.0c : FORTRAN 77 development environment (DOS/Win/OS2)


Lisp / Scheme
Apteryx Lisp v1.031 : A windows 3.x Lisp compiler (Win 3.x). (212kb)
*newLISP 7.0.1 : newLISP is a compiler that has features of Common LISP and Scheme. It is still being developed (Win/Linux/Mac...).
*PC-Lisp v3.00 : Lisp stands for LISt Programming. It is considered suitable for AI. This compiler is not Object-Oriented like other compilers (XLisp etc) and is a subset of Franz Lisp (DOS).
*XLisp Plus v3.04 : This version supports most Common Lisp functions (DOS/Win).
XScheme v0.17 : An object-oriented implementation of the Scheme programming language, that lacks a good editor. Scheme is similar to, but simpler than Common Lisp (DOS). (163kb)
*Youtoo 0.93 : Yootoo is the latest EuLisp interpreter. EuLisp resembles to Lisp and it supports objects and parallel programming. Download from the ftp (Linux).
Logo
*DFP LOGO 1.2 : LOGO is a computer language designed to introduce young children to programming (DOS).
*LSRHS Free LOGO : Another LOGO interpreter (DOS).


Modula-2 / Modula-3
*Fitted Software Tools Modula-2 v3.1 : Modula-2 was designed by the creator of Pascal based on the experience and requests of PASCAL programmers (DOS).
*M3forDOS 3.1 : A DOS port for SRC Modula 3 (DOS).
*M3pc-Klangenfurt : Another DOS port for SRC Modula 3 (DOS).


Pascal
*Free Pascal V1.0.6 : A good (and free) Pascal compiler (DOS/Win/Linux...).
*Pascal Pro V0.1 : Requires TASM/MASM or NASM,TLINK32 and WDOSX or similar to produce executables (DOS).
*TMT Pascal Lite 3.90 : Fast 32 bit compiler. The DOS version is free to download. (DOS).
Turbo PASCAL 5.5 : A basic Pascal compiler (DOS).
*Virtual Pascal V2.1 : 32bit Pascal development environment (Win/OS2).


Perl
*ActivePerl 5.8 : Excellent Perl compiler. And you can't beat the price, since it is free (Win-Linux-Solaris).
Perl 4.0 : PERL - Practical Extraction Report Language - a very important and powerful script programming language (DOS). (175kb)


Prolog
BinProlog v2.20 : Prolog is a higher level language that leaves more to the compiler and simplifies the design of complex programs. This is an old but fast C-emulated compiler (DOS). (119kb)
Prolog-2 v2.35 : An MS-DOS version of prolog by Expert Systems (DOS). (149kb)
*Strawberry Prolog 2.3 : This is an excellent (and easy to use) Windows Prolog compiler. Unfortunatelly, the free (Light) Edition does not create .EXE files (Win 9x).
*Visual Prolog 6 : A complete PROLOG environment (Win).


Python
*Es un lenguaje interpretado luego utilizará un intérprete para implementar o ejecutar el código.

REXX
*BREXX 1.3 : REXX is a procedural language that allows programs and algorithms to be written in a clear and structured way (DOS/Linux). (267kb)
*Regina REXX : Regina REXX port for Win32 (Win).


Smalltalk
*Little Smalltalk v3 : Little Smalltalk is a subset of the Smalltalk object-oriented language (DOS).

Tcl
*ActiveTcl 8.4.1 : I don't know anything about Tcl, but judging from ActiveState's other products, the compiler should be very good (Win-Linux-Solaris).

xBase
*Harbour : Free xBase compiler (DOS/Win/Linux/OS2...).
*MAX 2.0 : Free xBase compiler (Win/Linux).


AutoIT
AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting.

Fuente:
Citarlista-de-compiladores-gratuitos-(cientos-de-ellos), creador Ariel.
#158
Cita de: Randomize en 12 Marzo 2017, 16:39 PM
Busca otro móvil.


Sip, consejo tonto, lo siento  :-\
Hola añado otra manera mas que sería por medio de una rom o un firmware propio te bajas el odin y le metes caña  ;)
#159
Tengo que añadir las otras librerias en modo estatico tambien:
ws2_32
dnsapi
gdi32
crypt32
secur32

Alguien sabría como conseguir las libreras estáticas creo que
crypt32
secur32

Son de openssl?