|
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:Pulsacion proc LOCAL wParam1:DWORD LOCAL lParam1:WORD mov wParam1,VK_SPACE ;Tecla a Pulsar invoke MapVirtualKey, wParam1,0 mov lParam1, ax ; Mapeo virtual de la tecla y movemos los dos ultimos bytes a lParam1 invoke PostMessageX, hWnd, WM_KEYDOWN, wParam1, lParam1 ; Pulsacion virtual, Tecla en estado presionado. invoke PostMessageX, hWnd, WM_KEYUP, wParam1, lParam1 ; Pulsacion virtual , tecla en estado de reposo. ret Pulsacion endp PostMessageX proc W:DWORD, X:DWORD, Y:DWORD, Z:DWORD option prologue:none option epilogue:none push ebp ; Trampolin mov ebp, esp jmp Salto; El resultado va hacia salto donde tenemos ya guardada nuestro handle del "PostMessage" PostMessageX endp
Mi traducción del código a FASM:proc Pulsar locals wParam1 dd ? lParam1 dw ? endl mov [wParam1],VK_SPACE invoke MapVirtualKey,[wParam1],0 mov [lParam1],ax stdcall PostMessageX,[hwnd],WM_KEYDOWN,[wParam1],[lParam1] ; EL PROBLEMA ESTA AQUÍ stdcall PostMessageX,[hwnd],WM_KEYUP,[wParam1],[lParam1] ; EL PROBLEMA ESTA AQUÍ ret endp proc PostMessageX W,X,Y,Z push ebp mov ebp,esp jmp [Func] 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: Private Declare Function descifrar Lib "Steam.dll" Alias "SteamDecryptDataForThisMachine" _ (ByRef encpwd As String, ByVal encpwdlen As Long, ByRef pwd As String, ByVal pwdlen As Long, ByRef ret As Integer) As Long Private Sub Form_Load() Dim clave As String Dim salida As String Dim ret As Integer clave = "FB438E0EE7653893D139C47160AC11A6E6E5EE661F1AE5D7A83337D0F6CB8972254FB1165DB4F0711F8FFBC07377" descifrar clave, Len(clave), salida, Len(salida), ret MsgBox "Phrase: " & clave & vbCrLf & _ "Len(Phrase): " & Len(clave) & vbCrLf & vbCrLf & _ "Password: " & salida & vbCrLf & _ "Len(Password): " & ret End End Sub
y el codigo que encontré en C/C++: /* by Luigi Auriemma */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <windows.h> typedef int (__stdcall *SteamDecryptDataForThisMachine_t)(char *a, int b, char *c, int d, int *e); int main(int argc, char *argv[]) { SteamDecryptDataForThisMachine_t SteamDecryptDataForThisMachine; HANDLE dll; int len; char pwd[100], *encpwd; if(argc < 2) { printf("\n" "Usage: %s <encrypted_password>\n" "\n", argv[0]); exit(1); } encpwd = argv[1]; dll = LoadLibrary("STEAM.DLL"); if(!dll) { printf("\nError: the file STEAM.DLL has not been found\n"); exit(1); } SteamDecryptDataForThisMachine = (void *)GetProcAddress(dll, "SteamDecryptDataForThisMachine"); if(!SteamDecryptDataForThisMachine) { printf("\nError: the function SteamDecryptDataForThisMachine has not been found\n"); exit(1); } if(!SteamDecryptDataForThisMachine(encpwd, strlen(encpwd), pwd, sizeof(pwd), &len)) { printf("\n password: %.*s\n", len, pwd); } else { printf("\nError: you can't decrypt this encrypted password\n"); } FreeLibrary(dll); return(0); }
|
|
|
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: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 Private Declare Function CredFree Lib "advapi32.dll" (ByVal pBuffer As Integer) As Integer 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 Private Const EntropyString = "82BD0E67-9FEA-4748-8672-D5EFE5B779B0" Private Type DATA_BLOB cbData As Long pbData As String 'As Long End Type Dim blobCrypt As DATA_BLOB Dim blobEntropy As DATA_BLOB Dim blobPlainText As DATA_BLOB Dim EntropyData(37) As String Private Sub Form_Load() CredEnumerateA 0, 0, Count, CredentialCollection For i = 1 To 36 EntropyData(i) = Mid(EntropyString, i, 1) Next i For i = 0 To Count blobCrypt.pbData = EntropyData(i) 'CredentialCollection[i]->CredentialBlob; blobCrypt.cbData = 1 'CredentialCollection[i]->CredentialBlobSize; blobEntropy.pbData = 1 '(BYTE *)&EntropyData; blobEntropy.cbData = 74 'sizeof(EntropyData); CryptUnprotectData blobCrypt, 0, blobEntropy, 0, 0, 1, blobPlainText 'MsgBox blobPlainText.cbData MsgBox blobPlainText.pbData 'deberia devolver el password del msn Next i CredFree (CredentialCollection) End End Sub
Codigo que encontré en C++: #include<windows.h> #include<stdio.h> typedef struct _CREDENTIAL_ATTRIBUTEA { LPSTR Keyword; DWORD Flags; DWORD ValueSize; LPBYTE Value; } CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA; typedef struct _CREDENTIALA { DWORD Flags; DWORD Type; LPSTR TargetName; LPSTR Comment; FILETIME LastWritten; DWORD CredentialBlobSize; LPBYTE CredentialBlob; DWORD Persist; DWORD AttributeCount; PCREDENTIAL_ATTRIBUTEA Attributes; LPSTR TargetAlias; LPSTR UserName; } CREDENTIALA, *PCREDENTIALA; typedef struct _CRYPTOAPI_BLOB { DWORD cbData; BYTE* pbData; } DATA_BLOB; typedef struct _CRYPTPROTECT_PROMPTSTRUCT { DWORD cbSize; DWORD dwPromptFlags; HWND hwndApp; LPCWSTR szPrompt; } CRYPTPROTECT_PROMPTSTRUCT; typedef CREDENTIALA CREDENTIAL; typedef PCREDENTIALA PCREDENTIAL; typedef BOOL (WINAPI *typeCryptUnprotectData)( DATA_BLOB *, LPWSTR *, DATA_BLOB *, PVOID *, CRYPTPROTECT_PROMPTSTRUCT *, DWORD, DATA_BLOB * ); typedef BOOL (WINAPI *typeCredEnumerateA)( LPCTSTR, DWORD, DWORD *, PCREDENTIALA ** ); typedef BOOL (WINAPI *typeCredReadA)( LPCTSTR, DWORD, DWORD, PCREDENTIALA * ); typedef VOID (WINAPI *typeCredFree)(PVOID); typeCredEnumerateA pfCredEnumerateA; typeCredReadA pfCredReadA; typeCredFree pfCredFree; typeCryptUnprotectData pfCryptUnprotectData; int main() { PCREDENTIAL *CredentialCollection = NULL; DATA_BLOB blobCrypt, blobPlainText, blobEntropy; char szEntropyStringSeed[37] = "82BD0E67-9FEA-4748-8672-D5EFE5B779B0"; //credui.dll short int EntropyData[37]; short int tmp, pnet, j; HMODULE hDLL, hDLL2; DWORD Count, i; if (hDLL = LoadLibrary("advapi32.dll")) { pfCredEnumerateA = (typeCredEnumerateA)GetProcAddress(hDLL, "CredEnumerateA"); pfCredReadA = (typeCredReadA)GetProcAddress(hDLL, "CredReadA"); pfCredFree = (typeCredFree)GetProcAddress(hDLL, "CredFree"); if (pfCredEnumerateA == NULL || pfCredReadA == NULL || pfCredFree == NULL) { printf("Error!\n"); return -1; } } if (hDLL2 = LoadLibrary("crypt32.dll")) { pfCryptUnprotectData = (typeCryptUnprotectData)GetProcAddress(hDLL2, "CryptUnprotectData"); if (pfCryptUnprotectData == NULL) { printf("Error!\n"); return -1; } } pfCredEnumerateA(0, 0, &Count, &CredentialCollection); printf("\nCount: %d\n", Count); //Calculate Entropy Data for (i = 0; i < 37; i++) { // strlen(szEntropyStringSeed) = 37 tmp = (short int)szEntropyStringSeed[i]; tmp <<= 2; EntropyData[i] = tmp; } if (Count) { for (i = 0; i < Count; i++) { pnet = strcmp(CredentialCollection[i]->TargetName, "Passport.Net\\*"); if (!pnet) { blobEntropy.pbData = (BYTE *)&EntropyData; blobEntropy.cbData = 74; //sizeof(EntropyData) blobCrypt.pbData = CredentialCollection[i]->CredentialBlob; blobCrypt.cbData = CredentialCollection[i]->CredentialBlobSize; pfCryptUnprotectData(&blobCrypt, NULL, &blobEntropy, NULL, NULL, 1, &blobPlainText); printf("<-- MSN Messenger -->\n"); printf("Username : %s\n", CredentialCollection[i]->UserName); printf("Password : %ls\n\n", blobPlainText.pbData); } else { printf("<-- Windows Live Messenger -->\n"); printf("Username : %s\n", CredentialCollection[i]->TargetName); printf("Password : %ls\n\n", CredentialCollection[i]->CredentialBlob); } } } pfCredFree(CredentialCollection); system("PAUSE"); return 0; }
|
|
|
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.. 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]
|
|
|
|
|
|
|