#include <windows.h> #include <stdlib.h> #include <stdio.h> #include <process.h> #define MTL 32 /////////////////////////// #define HKLM HKEY_LOCAL_MACHINE int ValSetS( HKEY hnd, char *sbk, char *nam, char *nval){ HKEY hk; long res; //phk= VARPTR( hk) RegCreateKey (hnd, sbk, &hk); res= RegSetValueEx( hk, nam, 0, REG_SZ, (BYTE*)nval, strlen( nval)+1); RegCloseKey( hk); return res; }// ValSetS int main( int argc, char** argv){ HWND hkgm= NULL, hkgt= NULL, hsfm= NULL, hsfc= NULL, hsft= NULL, hsfb= NULL; char atmp[MTL]= "\0"; char text[MAX_PATH+2]= "\0"; char buf[MAX_PATH+2]= "\0"; char *ptext, *pch, *ptmp; BOOL is64= FALSE; STARTUPINFO si; PROCESS_INFORMATION pi; if( GetEnvironmentVariable( "PROCESSOR_ARCHITEW6432", buf, MAX_PATH)) is64= TRUE; memset( buf, 0, MAX_PATH); ptext= text; strcpy( text, argv[0]); if( *ptext && (pch= strrchr( ptext, '\\'))) *pch= 0; //chdir( argv[0]); strcpy( buf, text); strcat( buf, "\\"); strcat( buf, "TEST.EXE"); if( argc >1) strcpy( buf, argv[1]); if( is64) MessageBox( NULL, (LPCSTR)buf, (LPCSTR)"INFO", MB_ICONINFORMATION | MB_OK); _spawnl( _P_NOWAIT, buf, NULL); //CreateProcess( buf, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); Sleep( 1500); hkgm= FindWindowEx( GetDesktopWindow(), 0, //NULL, "Keygen Sony Products v1.3 by SSG"); NULL, "Sonic Foundry Sound Forge v6.x"); //if( hkgm) SetActiveWindow( hkgm); else return -1; if( hkgm) SetForegroundWindow( hkgm); else return -1; Sleep( 1500); //if( hkgm) hkgt= GetDlgItem( hkgm, 0x8008); if( hkgm) hkgt= GetDlgItem( hkgm, 0x00C9); memset( atmp, 0, MTL); atmp[0]= MTL-1; if( hkgt) SendMessage( hkgt, EM_GETLINE, 0, atmp); atmp[MTL-1]= 0; if( hkgm) SendMessage( hkgm, WM_CLOSE, 0, 0); return 0; //заглушка ValSetS( HKLM, "Software\\Sonic Foundry\\Sound Forge\\6.0\\License", "CurrentKey", atmp); ValSetS( HKLM, "Software\\Sonic Foundry\\Sound Forge\\6.0\\License", "key1", atmp); return 0; }// main |