home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Quantico / km / wolfdlg.cpp.txt < prev    next >
Encoding:
Text File  |  2000-05-25  |  12.6 KB  |  589 lines

  1. // wolfDlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "wolf.h"
  6. #include "wolfDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CAboutDlg dialog used for App About
  16. char *GenKey(char *In);
  17.  
  18. class CAboutDlg : public CDialog
  19. {
  20. public:
  21.         CAboutDlg();
  22.  
  23. // Dialog Data
  24.         //{{AFX_DATA(CAboutDlg)
  25.         enum { IDD = IDD_ABOUTBOX };
  26.         //}}AFX_DATA
  27.  
  28.         // ClassWizard generated virtual function overrides
  29.         //{{AFX_VIRTUAL(CAboutDlg)
  30.         protected:
  31.         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  32.         //}}AFX_VIRTUAL
  33.  
  34. // Implementation
  35. protected:
  36.         //{{AFX_MSG(CAboutDlg)
  37.         //}}AFX_MSG
  38.         DECLARE_MESSAGE_MAP()
  39. };
  40.  
  41. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  42. {
  43.         //{{AFX_DATA_INIT(CAboutDlg)
  44.         //}}AFX_DATA_INIT
  45. }
  46.  
  47. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  48. {
  49.         CDialog::DoDataExchange(pDX);
  50.         //{{AFX_DATA_MAP(CAboutDlg)
  51.         //}}AFX_DATA_MAP
  52. }
  53.  
  54. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  55.         //{{AFX_MSG_MAP(CAboutDlg)
  56.                 // No message handlers
  57.         //}}AFX_MSG_MAP
  58. END_MESSAGE_MAP()
  59.  
  60. /////////////////////////////////////////////////////////////////////////////
  61. // CWolfDlg dialog
  62.  
  63. CWolfDlg::CWolfDlg(CWnd* pParent /*=NULL*/)
  64.         : CDialog(CWolfDlg::IDD, pParent)
  65. {
  66.         //{{AFX_DATA_INIT(CWolfDlg)
  67.         m_Name = _T("");
  68.         m_Key = _T("");
  69.         //}}AFX_DATA_INIT
  70.         // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
  71.         m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  72. }
  73.  
  74. void CWolfDlg::DoDataExchange(CDataExchange* pDX)
  75. {
  76.         CDialog::DoDataExchange(pDX);
  77.         //{{AFX_DATA_MAP(CWolfDlg)
  78.         DDX_Text(pDX, IDC_EDIT1, m_Name);
  79.         DDX_Text(pDX, IDC_EDIT2, m_Key);
  80.         //}}AFX_DATA_MAP
  81. }
  82.  
  83. BEGIN_MESSAGE_MAP(CWolfDlg, CDialog)
  84.         //{{AFX_MSG_MAP(CWolfDlg)
  85.         ON_WM_SYSCOMMAND()
  86.         ON_WM_PAINT()
  87.         ON_WM_QUERYDRAGICON()
  88.         ON_BN_CLICKED(IDOK, OnOk)
  89.         //}}AFX_MSG_MAP
  90. END_MESSAGE_MAP()
  91.  
  92. /////////////////////////////////////////////////////////////////////////////
  93. // CWolfDlg message handlers
  94.  
  95. BOOL CWolfDlg::OnInitDialog()
  96. {
  97.         CDialog::OnInitDialog();
  98.  
  99.         // Add "About..." menu item to system menu.
  100.  
  101.         // IDM_ABOUTBOX must be in the system command range.
  102.         ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  103.         ASSERT(IDM_ABOUTBOX < 0xF000);
  104.  
  105.         CMenu* pSysMenu = GetSystemMenu(FALSE);
  106.         CString strAboutMenu;
  107.         strAboutMenu.LoadString(IDS_ABOUTBOX);
  108.         if (!strAboutMenu.IsEmpty())
  109.         {
  110.                 pSysMenu->AppendMenu(MF_SEPARATOR);
  111.                 pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  112.         }
  113.  
  114.         // Set the icon for this dialog.  The framework does this automatically
  115.         //  when the application's main window is not a dialog
  116.         SetIcon(m_hIcon, TRUE);                 // Set big icon
  117.         SetIcon(m_hIcon, FALSE);                // Set small icon
  118.  
  119.         // TODO: Add extra initialization here
  120.  
  121.         return TRUE;  // return TRUE  unless you set the focus to a control
  122. }
  123.  
  124. void CWolfDlg::OnSysCommand(UINT nID, LPARAM lParam)
  125. {
  126.         if ((nID & 0xFFF0) == IDM_ABOUTBOX)
  127.         {
  128.                 CAboutDlg dlgAbout;
  129.                 dlgAbout.DoModal();
  130.         }
  131.         else
  132.         {
  133.                 CDialog::OnSysCommand(nID, lParam);
  134.         }
  135. }
  136.  
  137. // If you add a minimize button to your dialog, you will need the code below
  138. //  to draw the icon.  For MFC applications using the document/view model,
  139. //  this is automatically done for you by the framework.
  140.  
  141. void CWolfDlg::OnPaint()
  142. {
  143.         if (IsIconic())
  144.         {
  145.                 CPaintDC dc(this); // device context for painting
  146.  
  147.                 SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
  148.  
  149.                 // Center icon in client rectangle
  150.                 int cxIcon = GetSystemMetrics(SM_CXICON);
  151.                 int cyIcon = GetSystemMetrics(SM_CYICON);
  152.                 CRect rect;
  153.                 GetClientRect(&rect);
  154.                 int x = (rect.Width() - cxIcon + 1) / 2;
  155.                 int y = (rect.Height() - cyIcon + 1) / 2;
  156.  
  157.                 // Draw the icon
  158.                 dc.DrawIcon(x, y, m_hIcon);
  159.         }
  160.         else
  161.         {
  162.                 CDialog::OnPaint();
  163.         }
  164. }
  165.  
  166. // The system calls this to obtain the cursor to display while the user drags
  167. //  the minimized window.
  168. HCURSOR CWolfDlg::OnQueryDragIcon()
  169. {
  170.         return (HCURSOR) m_hIcon;
  171. }
  172.  
  173. void CWolfDlg::OnOk()
  174. {
  175.         char Name[100];
  176.         UpdateData();
  177.         strcpy(Name,m_Name);
  178.         m_Key = GenKey(Name);
  179.         UpdateData(FALSE);
  180. }
  181.  
  182. char Reg[100];
  183.  
  184. // FTP Wolf KeyGen Routine
  185. /*
  186. char *GenKey(char *In)
  187. {
  188. char *init="FW";
  189. int i , j;
  190. char temp[10];
  191. unsigned int *l,p;
  192. if (strlen(In) < 5 )
  193.         {
  194.         strcpy(Reg,"Lammer enter more than 4 Chars");
  195.         return Reg;
  196.         }
  197. strcpy(Reg,init);
  198. strcat(Reg,"-");
  199. strncpy(temp,In,4);
  200. for ( i = 0 ; i < 2 ; i ++)
  201. for ( j = 0 ; j < 4 ; j ++)
  202.         temp[j] = (init[i]+1)* temp[j];
  203.  
  204. for ( i = 0 ; i < strlen(In) ; i ++)
  205. for ( j = 0 ; j < 4 ; j ++)
  206.         temp[j] = (In[i]+2)^ temp[j];
  207.  
  208. l = (unsigned int *)temp;
  209. p = l[0];
  210. if ( p == 0 )
  211. {
  212.         strcpy(Reg,"You are not allowed to use this name");
  213.         return Reg;
  214. }
  215. while  ( p <=  9999) p = p * 10;
  216. while ( p >= 999999) p /=10;
  217. //p /=10;
  218. sprintf(Reg+3,"%i",p);
  219. return Reg;
  220. }
  221. */
  222. /*
  223. // X Wolf KeyGen Routine
  224. char *GenKey(char *In)
  225. {
  226. char *init="XW";
  227. int i , j;
  228. char temp[10];
  229. unsigned int *l,p;
  230. if (strlen(In) < 5 )
  231.         {
  232.         strcpy(Reg,"Lammer enter more than 4 Chars");
  233.         return Reg;
  234.         }
  235. strcpy(Reg,init);
  236. strcat(Reg,"-");
  237. strncpy(temp,In,4);
  238.  
  239. for ( i = 0 ; i < 2 ; i ++)
  240. for ( j = 0 ; j < 4 ; j ++)
  241.         temp[j] = (init[i]+1)* temp[j];
  242.  
  243. for ( i = 0 ; i < strlen(In) ; i ++)
  244. for ( j = 0 ; j < 4 ; j ++)
  245.         temp[j] = (In[i]+1)^ temp[j];
  246.  
  247. l = (unsigned int *)temp;
  248. p = l[0];
  249. p = -p;
  250. if ( p == 0 )
  251. {
  252.         strcpy(Reg,"You are not allowed to use this name");
  253.         return Reg;
  254. }
  255. while  ( p <=  9999) p = p * 10;
  256. while ( p >= 999999) p /=10;
  257. //p /=10;
  258. sprintf(Reg+3,"%i",p);
  259. return Reg;
  260. }
  261. */
  262. /*
  263. // WarezWolf KeyGen Routine
  264. char *GenKey(char *In)
  265. {
  266. char *init="WW";
  267. int i , j;
  268. char temp[10];
  269. unsigned int *l,p;
  270. if (strlen(In) < 5 )
  271.         {
  272.         strcpy(Reg,"Lammer enter more than 4 Chars");
  273.         return Reg;
  274.         }
  275. strcpy(Reg,init);
  276. strcat(Reg,"-");
  277. strncpy(temp,In,4);
  278.  
  279. for ( i = 0 ; i < 2 ; i ++)
  280. for ( j = 0 ; j < 4 ; j ++)
  281.         temp[j] = (init[i])* temp[j];
  282.  
  283. for ( i = 0 ; i < strlen(In) ; i ++)
  284. for ( j = 0 ; j < 4 ; j ++)
  285.         temp[j] = (In[i])^ temp[j];
  286.  
  287. l = (unsigned int *)temp;
  288. p = l[0];
  289. p = -p;
  290. if ( p == 0 )
  291. {
  292.         strcpy(Reg,"You are not allowed to use this name");
  293.         return Reg;
  294. }
  295. while  ( p <=  9999) p = p * 10;
  296. while ( p >= 999999) p /=10;
  297. //p /=10;
  298. sprintf(Reg+3,"%i",p);
  299. return Reg;
  300. }
  301. */
  302. /*
  303. // BWolf KeyGen Routine
  304. char *GenKey(char *In)
  305. {
  306. char *init="BW";
  307. int i , j, k;
  308. char temp[10];
  309. int *l,p;
  310. unsigned char *m;
  311. if (strlen(In) < 5 )
  312.         {
  313.         strcpy(Reg,"Lammer enter more than 4 Chars");
  314.         return Reg;
  315.         }
  316. strcpy(Reg,init);
  317. strcat(Reg,"-");
  318. strncpy(temp,In,4);
  319.  
  320. for ( i = 0 ; i < 2 ; i ++)
  321. for ( j = 0 ; j < 4 ; j ++)
  322.         temp[j] = (init[i]+5)* (temp[j]);
  323.  
  324. for ( i = 0 ; i < strlen(In) ; i ++)
  325. for ( j = 0 ; j < 4 ; j ++)
  326.         temp[j] = (In[i]+5)^ (temp[j]);
  327. l = (int *)temp;
  328. p = l[0];
  329. if (p < 0 ) p = -p;
  330. if ( p == 0 )
  331. {
  332.         strcpy(Reg,"You are not allowed to use this name");
  333.         return Reg;
  334. }
  335. while  ( p <=  9999) p = p * 10;
  336. while ( p >= 999999) p /=10;
  337. sprintf(Reg+3,"%i",p);
  338. return Reg;
  339. }
  340. */
  341.  
  342. /*
  343. // PhoneWolf KeyGen Routine
  344. char *GenKey(char *In)
  345. {
  346. char *init="PH";
  347. int i , j, k;
  348. char temp[10];
  349. int *l,p;
  350. unsigned char *m;
  351. if (strlen(In) < 5 )
  352.         {
  353.         strcpy(Reg,"Lammer enter more than 4 Chars");
  354.         return Reg;
  355.         }
  356. strcpy(Reg,init);
  357. strcat(Reg,"-");
  358. strncpy(temp,In,4);
  359.  
  360. for ( i = 0 ; i < 2 ; i ++)
  361. for ( j = 0 ; j < 4 ; j ++)
  362.         temp[j] = (init[i]+4)* (temp[j]);
  363.  
  364. for ( i = 0 ; i < strlen(In) ; i ++)
  365. for ( j = 0 ; j < 4 ; j ++)
  366.         temp[j] = (In[i]+4) ^ (temp[j]);
  367.  
  368. l = (int *)temp;
  369. p = l[0];
  370. if ( p <0 ) p = -p;
  371. if ( p == 0 )
  372. {
  373.         strcpy(Reg,"You are not allowed to use this name");
  374.         return Reg;
  375. }
  376. while  ( p <=  9999) p = p * 10;
  377. while ( p >= 999999) p /=10;
  378. sprintf(Reg+3,"%i",p);
  379. return Reg;
  380. }
  381. */
  382. // SubmitWolf KeyGen Routine
  383. /*
  384. char *GenKey(char *In)
  385. {
  386. char *init="SE";
  387. int i , j, k;
  388. char temp[10];
  389. int *l,p;
  390. unsigned char *m;
  391. if (strlen(In) < 5 )
  392.         {
  393.         strcpy(Reg,"Lammer enter more than 4 Chars");
  394.         return Reg;
  395.         }
  396. strcpy(Reg,init);
  397. strcat(Reg,"-");
  398. strncpy(temp,In,4);
  399.  
  400. for ( i = 0 ; i < 2 ; i ++)
  401. for ( j = 0 ; j < 4 ; j ++)
  402.         temp[j] = (init[i]+6)* (temp[j]);
  403.  
  404. for ( i = 0 ; i < strlen(In) ; i ++)
  405. for ( j = 0 ; j < 4 ; j ++)
  406.         temp[j] = (In[i]+6) ^ (temp[j]);
  407.  
  408. l = (int *)temp;
  409. p = l[0];
  410. if ( p <0 ) p = -p;
  411. if ( p == 0 )
  412. {
  413.         strcpy(Reg,"You are not allowed to use this name");
  414.         return Reg;
  415. }
  416. while  ( p <=  9999) p = p * 10;
  417. while ( p >= 999999) p /=10;
  418. sprintf(Reg+3,"%i",p);
  419. return Reg;
  420. }
  421.  
  422. */
  423. /*
  424. // MP3-Wolf
  425. char *GenKey(char *In)
  426. {
  427. char *init="MW";
  428. int i , j, k;
  429. char temp[10];
  430. int *l,p;
  431. unsigned char *m;
  432. if (strlen(In) < 5 )
  433.         {
  434.         strcpy(Reg,"Lammer enter more than 4 Chars");
  435.         return Reg;
  436.         }
  437. strcpy(Reg,init);
  438. strcat(Reg,"-");
  439. strncpy(temp,In,4);
  440.  
  441. for ( i = 0 ; i < 2 ; i ++)
  442. for ( j = 0 ; j < 4 ; j ++)
  443.         temp[j] = (init[i]+8)* (temp[j]);
  444.  
  445. for ( i = 0 ; i < strlen(In) ; i ++)
  446. for ( j = 0 ; j < 4 ; j ++)
  447.         temp[j] = (In[i]+8) ^ (temp[j]);
  448.  
  449. l = (int *)temp;
  450. p = l[0];
  451. if ( p <0 ) p = -p;
  452. if ( p == 0 )
  453. {
  454.         strcpy(Reg,"You are not allowed to use this name");
  455.         return Reg;
  456. }
  457. while  ( p <=  9999) p = p * 10;
  458. while ( p >= 999999) p /=10;
  459. sprintf(Reg+3,"%i",p);
  460. return Reg;
  461. }
  462. */
  463. /*
  464. // Web-Wolf
  465. char *GenKey(char *In)
  466. {
  467. char *init="IW";
  468. int Offset= 0xc;
  469. int i , j, k;
  470. char temp[10];
  471. int *l,p;
  472. unsigned char *m;
  473. if (strlen(In) < 5 )
  474.         {
  475.         strcpy(Reg,"Lammer enter more than 4 Chars");
  476.         return Reg;
  477.         }
  478. strcpy(Reg,init);
  479. strcat(Reg,"-");
  480. strncpy(temp,In,4);
  481.  
  482. for ( i = 0 ; i < 2 ; i ++)
  483. for ( j = 0 ; j < 4 ; j ++)
  484.         temp[j] = (init[i])* (temp[j]);
  485.  
  486. for ( i = 0 ; i < strlen(In) ; i ++)
  487. for ( j = 0 ; j < 4 ; j ++)
  488.         temp[j] = (In[i]) ^ (temp[j]);
  489.  
  490. l = (int *)temp;
  491. p = l[0];
  492. if ( p <0 ) p = -p;
  493. if ( p == 0 )
  494. {
  495.         strcpy(Reg,"You are not allowed to use this name");
  496.         return Reg;
  497. }
  498. while  ( p <=  9999) p = p * 10;
  499. while ( p >= 999999) p /=10;
  500. sprintf(Reg+3,"%i",p);
  501. return Reg;
  502.  
  503. }
  504. */
  505. /*
  506. // sharIt-Wolf
  507. char *GenKey(char *In)
  508. {
  509. char *init="IW";
  510. int Offset= 0xc;
  511. int i , j, k;
  512. char temp[10];
  513. int *l,p;
  514. unsigned char *m;
  515. if (strlen(In) < 5 )
  516.         {
  517.         strcpy(Reg,"Lammer enter more than 4 Chars");
  518.         return Reg;
  519.         }
  520. strcpy(Reg,init);
  521. strcat(Reg,"-");
  522. strncpy(temp,In,4);
  523.  
  524. for ( i = 0 ; i < 2 ; i ++)
  525. for ( j = 0 ; j < 4 ; j ++)
  526.         temp[j] = (init[i]+9)* (temp[j]);
  527.  
  528. for ( i = 0 ; i < strlen(In) ; i ++)
  529. for ( j = 0 ; j < 4 ; j ++)
  530.         temp[j] = (In[i]+9) ^ (temp[j]);
  531.  
  532. l = (int *)temp;
  533. p = l[0];
  534. if ( p <0 ) p = -p;
  535. if ( p == 0 )
  536. {
  537.         strcpy(Reg,"You are not allowed to use this name");
  538.         return Reg;
  539. }
  540. while  ( p <=  9999) p = p * 10;
  541. while ( p >= 999999) p /=10;
  542. sprintf(Reg+strlen(init)+1,"%i",p);
  543. return Reg;
  544.  
  545. }
  546.  
  547. */
  548.  
  549. /* sharit 2.00 */
  550. char *GenKey(char *In)
  551. {
  552. char *init="SH";
  553. int Offset= 0xc;
  554. int i , j, k;
  555. char temp[10];
  556. int *l,p;
  557. unsigned char *m;
  558. if (strlen(In) < 5 )
  559.         {
  560.         strcpy(Reg,"Lammer enter more than 4 Chars");
  561.         return Reg;
  562.         }
  563. strcpy(Reg,init);
  564. strcat(Reg,"-");
  565. strncpy(temp,In,4);
  566.  
  567. for ( i = 0 ; i < 2 ; i ++)
  568. for ( j = 0 ; j < 4 ; j ++)
  569.         temp[j] = (init[i]+7)* (temp[j]);
  570.  
  571. for ( i = 0 ; i < strlen(In) ; i ++)
  572. for ( j = 0 ; j < 4 ; j ++)
  573.         temp[j] = (In[i]+7) ^ (temp[j]);
  574.  
  575. l = (int *)temp;
  576. p = l[0];
  577. if ( p <0 ) p = -p;
  578. if ( p == 0 )
  579. {
  580.         strcpy(Reg,"You are not allowed to use this name");
  581.         return Reg;
  582. }
  583. while  ( p <=  9999) p = p * 10;
  584. while ( p >= 999999) p /=10;
  585. sprintf(Reg+strlen(init)+1,"%i",p);
  586. return Reg;
  587.  
  588. }
  589.