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

 

 


Tema destacado: Curso de javascript por TickTack


  Mostrar Temas
Páginas: [1]
1  Programación / ASM / Problema para pasar un codigo de MASM a FASM en: 27 Octubre 2009, 03:59 am
Hola, tengo un problema para traducir un codigo en MASM a FASM.
El codigo es parte de una DLL que inyecto en otro proceso.
(Sirve para llamar a la funcion PostMessage de la libreria user32.dll en ejecutables protegidos con GameGuard)

Codigo en MASM:
Código
  1. Pulsacion proc
  2. LOCAL wParam1:DWORD
  3. LOCAL lParam1:WORD
  4.  
  5. mov wParam1,VK_SPACE ;Tecla a Pulsar
  6. invoke MapVirtualKey, wParam1,0
  7. mov lParam1, ax ; Mapeo virtual de la tecla y movemos los dos ultimos bytes a lParam1
  8.  
  9. invoke PostMessageX, hWnd, WM_KEYDOWN, wParam1, lParam1 ; Pulsacion virtual, Tecla en estado presionado.
  10. invoke PostMessageX, hWnd, WM_KEYUP, wParam1, lParam1 ; Pulsacion virtual , tecla en estado de reposo.
  11.  
  12. ret
  13.  
  14. Pulsacion endp
  15.  
  16. PostMessageX proc W:DWORD, X:DWORD, Y:DWORD, Z:DWORD
  17. option prologue:none
  18. option epilogue:none
  19.  
  20. push ebp ; Trampolin
  21. mov ebp, esp
  22. jmp Salto; El resultado va hacia salto donde tenemos ya guardada nuestro handle del "PostMessage"
  23.  
  24. PostMessageX endp


Mi traducción del código a FASM:
Código
  1. proc Pulsar
  2.  locals
  3.    wParam1 dd ?
  4.    lParam1 dw ?
  5.  endl
  6.  
  7.  mov [wParam1],VK_SPACE
  8.  invoke MapVirtualKey,[wParam1],0
  9.  mov [lParam1],ax
  10.  
  11.  stdcall PostMessageX,[hwnd],WM_KEYDOWN,[wParam1],[lParam1]      ; EL PROBLEMA ESTA AQUÍ
  12.  stdcall PostMessageX,[hwnd],WM_KEYUP,[wParam1],[lParam1]           ; EL PROBLEMA ESTA AQUÍ
  13.  
  14.  ret
  15. endp
  16.  
  17. proc PostMessageX W,X,Y,Z
  18.  push ebp
  19.  mov ebp,esp
  20.  jmp [Func]
  21. endp


Gracias.
2  Programación / Programación Visual Basic / Declarando una Libreria en VB6 en: 22 Octubre 2008, 22:57 pm
Buenas a todos, abro este post para exponer mi problema.
He conseguido un codigo en C/C++ que lo que hace es cargar una libreria utilizando la funcion LoadLibrary, GetProcAddress y FreeLibrary.
Lo que yo quiero es hacer lo mismo que hace ese codigo en C/C++ pero en VB6, he intentado hacerlo declarando la libreria utilizando (Declare Function "taltal" lib "libreria.dll"), y tambien declarando la funcion LoadLibrary y demas he intentando usarla para cargar la otra libreria.. pero de ningun modo he podido conseguir que funcionase.
El problema esque en mi codigo vb6 me devuelve el string "salida" y el integer "ret" vacios. Me han dicho algo de que debo reservar un espacio de memoria para que la funcion pueda guardar los datos de salida, pero no se como hacerlo..

Aqui os dejo los 2 codigos, el MIO creado en VB6:

Código
  1. Private Declare Function descifrar Lib "Steam.dll" Alias "SteamDecryptDataForThisMachine" _
  2. (ByRef encpwd As String, ByVal encpwdlen As Long, ByRef pwd As String, ByVal pwdlen As Long, ByRef ret As Integer) As Long
  3.  
  4. Private Sub Form_Load()
  5. Dim clave As String
  6. Dim salida As String
  7. Dim ret As Integer
  8.  
  9. clave = "FB438E0EE7653893D139C47160AC11A6E6E5EE661F1AE5D7A83337D0F6CB8972254FB1165DB4F0711F8FFBC07377"
  10.  
  11. descifrar clave, Len(clave), salida, Len(salida), ret
  12.  
  13. MsgBox "Phrase: " & clave & vbCrLf & _
  14.        "Len(Phrase): " & Len(clave) & vbCrLf & vbCrLf & _
  15.        "Password: " & salida & vbCrLf & _
  16.        "Len(Password): " & ret
  17. End
  18. End Sub




y el codigo que encontré en C/C++:

Código
  1. /*
  2. by Luigi Auriemma
  3. */
  4.  
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <stdint.h>
  8. #include <windows.h>
  9.  
  10. typedef int (__stdcall *SteamDecryptDataForThisMachine_t)(char *a, int b, char *c, int d, int *e);
  11.  
  12.  
  13. int main(int argc, char *argv[]) {
  14.    SteamDecryptDataForThisMachine_t    SteamDecryptDataForThisMachine;
  15. HANDLE  dll;
  16.    int     len;
  17.    char    pwd[100],
  18.            *encpwd;
  19.  
  20.    if(argc < 2) {
  21.        printf("\n"
  22.            "Usage: %s <encrypted_password>\n"
  23.            "\n", argv[0]);
  24.        exit(1);
  25.    }
  26.    encpwd = argv[1];
  27.  
  28. dll = LoadLibrary("STEAM.DLL");
  29. if(!dll) {
  30.        printf("\nError: the file STEAM.DLL has not been found\n");
  31.        exit(1);
  32.    }
  33.    SteamDecryptDataForThisMachine = (void *)GetProcAddress(dll, "SteamDecryptDataForThisMachine");
  34.    if(!SteamDecryptDataForThisMachine) {
  35.        printf("\nError: the function SteamDecryptDataForThisMachine has not been found\n");
  36.        exit(1);
  37.    }
  38.  
  39.    if(!SteamDecryptDataForThisMachine(encpwd, strlen(encpwd), pwd, sizeof(pwd), &len)) {
  40.        printf("\n  password: %.*s\n", len, pwd);
  41.    } else {
  42.        printf("\nError: you can't decrypt this encrypted password\n");
  43.    }
  44.    FreeLibrary(dll);
  45.    return(0);
  46. }
3  Media / Juegos y Consolas / Optimizar FPS del CSS en: 19 Julio 2008, 11:13 am
hola a todos, buscando informacion por la red para intentar subir al maximo los fps de counter strike source e encontrado este fabuloso programa que te permite entre otras cosas desactivar la sincronizacion horizontal de la pantalla para conseguir muchos mas fps, aki adjunto una foto del mismo y el enlace para la descarga, es muy sencillo de usar asi que no creo que tengan ningun problema. Un saludo. :)




ENLACE DE DESCARGA:
http://rapidshare.com/files/130804087/fpsoptimizer.rar
4  Programación / Programación Visual Basic / [ayuda] sacar contraseñas guardadas de msn en: 22 Febrero 2008, 12:39 pm
wenas, estoy intentando traducir un codigo que encontré en C++ para sacar las contraseñas guardadas del msn messenger, pero no consigo hacerlo, alguien me puede exar un cable o decirme que es lo que hago mal? gracias.

Mi codigo en VB6:
Código
  1. Private Declare Function CredEnumerateA Lib "advapi32.dll" (ByVal lpszFilter As Integer, ByVal lFlags As Integer, ByRef pCount As Integer, ByRef lppCredentials As Integer) As Integer
  2. Private Declare Function CredFree Lib "advapi32.dll" (ByVal pBuffer As Integer) As Integer
  3. Private Declare Function CryptUnprotectData Lib "crypt32.dll" (ByRef pDataIn As DATA_BLOB, ByVal ppszDataDescr As Integer, ByRef pOptionalEntropy As DATA_BLOB, ByVal pvReserved As Integer, ByVal pPromptStruct As Integer, ByVal dwFlags As Integer, ByRef pDataOut As DATA_BLOB) As Integer
  4. Private Const EntropyString = "82BD0E67-9FEA-4748-8672-D5EFE5B779B0"
  5.  
  6. Private Type DATA_BLOB
  7.  cbData As Long
  8.  pbData As String 'As Long
  9. End Type
  10.  
  11. Dim blobCrypt As DATA_BLOB
  12. Dim blobEntropy As DATA_BLOB
  13. Dim blobPlainText As DATA_BLOB
  14. Dim EntropyData(37) As String
  15. Private Sub Form_Load()
  16. CredEnumerateA 0, 0, Count, CredentialCollection
  17.  
  18. For i = 1 To 36
  19.   EntropyData(i) = Mid(EntropyString, i, 1)
  20. Next i
  21.  
  22. For i = 0 To Count
  23.    blobCrypt.pbData = EntropyData(i) 'CredentialCollection[i]->CredentialBlob;
  24.    blobCrypt.cbData = 1 'CredentialCollection[i]->CredentialBlobSize;
  25.    blobEntropy.pbData = 1 '(BYTE *)&EntropyData;
  26.    blobEntropy.cbData = 74 'sizeof(EntropyData);
  27.  
  28.    CryptUnprotectData blobCrypt, 0, blobEntropy, 0, 0, 1, blobPlainText
  29.  
  30.    'MsgBox blobPlainText.cbData
  31.    MsgBox blobPlainText.pbData 'deberia devolver el password del msn
  32. Next i
  33.  
  34. CredFree (CredentialCollection)
  35. End
  36. End Sub




Codigo que encontré en C++:
Código
  1. #include<windows.h>
  2. #include<stdio.h>
  3.  
  4. typedef struct _CREDENTIAL_ATTRIBUTEA {
  5.  LPSTR Keyword;
  6.  DWORD Flags;
  7.  DWORD ValueSize;
  8.  LPBYTE Value;
  9. } CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA;
  10.  
  11. typedef struct _CREDENTIALA {
  12.  DWORD Flags;
  13.  DWORD Type;
  14.  LPSTR TargetName;
  15.  LPSTR Comment;
  16.  FILETIME LastWritten;
  17.  DWORD CredentialBlobSize;
  18.  LPBYTE CredentialBlob;
  19.  DWORD Persist;
  20.  DWORD AttributeCount;
  21.  PCREDENTIAL_ATTRIBUTEA Attributes;
  22.  LPSTR TargetAlias;
  23.  LPSTR UserName;
  24. } CREDENTIALA, *PCREDENTIALA;
  25.  
  26. typedef struct _CRYPTOAPI_BLOB {
  27.  DWORD  cbData;
  28.  BYTE*  pbData;
  29. } DATA_BLOB;
  30.  
  31. typedef struct _CRYPTPROTECT_PROMPTSTRUCT {
  32. DWORD   cbSize;
  33. DWORD   dwPromptFlags;
  34. HWND    hwndApp;
  35. LPCWSTR  szPrompt;
  36. } CRYPTPROTECT_PROMPTSTRUCT;
  37.  
  38. typedef CREDENTIALA CREDENTIAL;
  39. typedef PCREDENTIALA PCREDENTIAL;
  40.  
  41.  
  42. typedef BOOL (WINAPI *typeCryptUnprotectData)(
  43.           DATA_BLOB *,
  44.           LPWSTR *,
  45.           DATA_BLOB *,
  46.           PVOID *,          
  47.           CRYPTPROTECT_PROMPTSTRUCT *,
  48.           DWORD,
  49.           DATA_BLOB *
  50. );
  51. typedef BOOL (WINAPI *typeCredEnumerateA)(
  52.           LPCTSTR,
  53.           DWORD,
  54.           DWORD *,
  55.           PCREDENTIALA **
  56. );
  57. typedef BOOL (WINAPI *typeCredReadA)(
  58.           LPCTSTR,
  59.           DWORD,
  60.           DWORD,
  61.           PCREDENTIALA *
  62. );
  63. typedef VOID (WINAPI *typeCredFree)(PVOID);
  64.  
  65. typeCredEnumerateA pfCredEnumerateA;
  66. typeCredReadA pfCredReadA;
  67. typeCredFree pfCredFree;
  68. typeCryptUnprotectData pfCryptUnprotectData;
  69.  
  70. int main()
  71. {
  72.  PCREDENTIAL *CredentialCollection = NULL;
  73.  DATA_BLOB blobCrypt, blobPlainText, blobEntropy;
  74.  
  75.  char szEntropyStringSeed[37] = "82BD0E67-9FEA-4748-8672-D5EFE5B779B0"; //credui.dll
  76.  short int EntropyData[37];
  77.  short int tmp, pnet, j;
  78.  
  79.  HMODULE hDLL, hDLL2;
  80.  DWORD Count, i;
  81.  
  82.  if (hDLL = LoadLibrary("advapi32.dll")) {
  83.   pfCredEnumerateA = (typeCredEnumerateA)GetProcAddress(hDLL, "CredEnumerateA");
  84.   pfCredReadA = (typeCredReadA)GetProcAddress(hDLL, "CredReadA");
  85.   pfCredFree = (typeCredFree)GetProcAddress(hDLL, "CredFree");
  86.  
  87.   if (pfCredEnumerateA == NULL ||
  88.     pfCredReadA == NULL ||
  89.     pfCredFree == NULL) {
  90.  
  91.     printf("Error!\n");
  92.     return -1;
  93.   }
  94.  }
  95.  
  96.  if (hDLL2 = LoadLibrary("crypt32.dll")) {
  97.   pfCryptUnprotectData = (typeCryptUnprotectData)GetProcAddress(hDLL2, "CryptUnprotectData");
  98.  
  99.   if (pfCryptUnprotectData == NULL) {
  100.     printf("Error!\n");
  101.     return -1;
  102.   }
  103.  }
  104.  
  105.  pfCredEnumerateA(0, 0, &Count, &CredentialCollection);
  106.  printf("\nCount: %d\n", Count);
  107.  //Calculate Entropy Data
  108.  for (i = 0; i < 37; i++) { // strlen(szEntropyStringSeed) = 37
  109.   tmp = (short int)szEntropyStringSeed[i];
  110.   tmp <<= 2;
  111.   EntropyData[i] = tmp;
  112.  }
  113.  
  114.  if (Count) {
  115.   for (i = 0; i < Count; i++) {
  116.     pnet = strcmp(CredentialCollection[i]->TargetName, "Passport.Net\\*");
  117.     if (!pnet) {
  118.      blobEntropy.pbData = (BYTE *)&EntropyData;
  119.      blobEntropy.cbData = 74; //sizeof(EntropyData)
  120.  
  121.      blobCrypt.pbData = CredentialCollection[i]->CredentialBlob;
  122.      blobCrypt.cbData = CredentialCollection[i]->CredentialBlobSize;
  123.  
  124.      pfCryptUnprotectData(&blobCrypt, NULL, &blobEntropy, NULL, NULL, 1, &blobPlainText);
  125.  
  126.      printf("<-- MSN Messenger -->\n");  
  127.      printf("Username : %s\n", CredentialCollection[i]->UserName);
  128.      printf("Password : %ls\n\n", blobPlainText.pbData);
  129.     } else {
  130.      printf("<-- Windows Live Messenger -->\n");
  131.      printf("Username : %s\n", CredentialCollection[i]->TargetName);
  132.      printf("Password : %ls\n\n", CredentialCollection[i]->CredentialBlob);
  133.     }
  134.   }
  135.  }
  136.  pfCredFree(CredentialCollection);
  137.  system("PAUSE");
  138.  return 0;
  139. }
  140.  
5  Programación / Programación Visual Basic / Problema con LISTBOX en: 12 Abril 2007, 16:26 pm
Aber me explico como puedo.. XD
parece una tonteria y tiene que ser facilisimo xo ske no caigo..
Código:
 Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
 List1.AddItem Winsock1.RemoteHostIP
yo tengo esto para saber kien me esta haciendo una peticion de conexion
como puedo acer que si la ip ya esta en el list no la añada?
con List1.Text tiene que estar seleccionado....
 alguien me ayuda? Gracias
6  Programación / Programación Visual Basic / ayuda plizz en: 9 Mayo 2006, 16:34 pm
wenas, keria krear una aplicacion que kada x segundos tecleara la tecla "q" por ejemplo, entiendo eso de los timers y toa la pesca pero e buscao codigos de keyloggers y to eso y nose a que api de windows ai que llamar, ninguna contesta xDD. creo k el GetAsyncKeyState no es... weno alguien me puede ayudar?? muxas gracias. [ZoNik]  ;)
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines