Shabat Closer

Wednesday, February 6, 2013

TECH : shortcut to lock computer


How to Quickly Lock Your Computer
 
create a new windows shortcut :
location: C:\Windows\System32\rundll32.exe user32.dll,LockWorkStation

MYSQL : Countries list for mysql

Countries list for mysql

SQL format:


CREATE TABLE IF NOT EXISTS `world_countries` (
  `country_id` int(5) NOT NULL AUTO_INCREMENT,
  `iso2` char(2) DEFAULT NULL,
  `short_name` varchar(80) NOT NULL DEFAULT '',
  `long_name` varchar(80) NOT NULL DEFAULT '',
  `iso3` char(3) DEFAULT NULL,
  `numcode` smallint(6) DEFAULT NULL,
  `un_member` varchar(12) DEFAULT NULL,
  `calling_code` varchar(8) DEFAULT NULL,
  `continent_code` char(2) NOT NULL,
  PRIMARY KEY (`country_id`),
  KEY `iso2` (`iso2`),
  KEY `iso3` (`iso3`),
  KEY `short_name` (`short_name`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=242 ;
--
-- Dumping data for table `world_countries`
--
INSERT INTO `world_countries` (`country_id`, `iso2`, `short_name`, `long_name`, `iso3`, `numcode`, `un_member`, `calling_code`, `continent_code`) VALUES
(6, 'AD', 'Andorra', 'Principality of Andorra', 'AND', 20, 'yes', '376', 'EU'),
(11, 'AR', 'Argentina', 'Argentine Republic', 'ARG', 32, 'yes', '54', 'SA'),
(12, 'AM', 'Armenia', 'Republic of Armenia', 'ARM', 51, 'yes', '374', 'AS'),
(14, 'AU', 'Australia', 'Commonwealth of Australia', 'AUS', 36, 'yes', '61', 'OC'),
(15, 'AT', 'Austria', 'Republic of Austria', 'AUT', 40, 'yes', '43', 'EU'),
(16, 'AZ', 'Azerbaijan', 'Republic of Azerbaijan', 'AZE', 31, 'yes', '994', 'AS'),
(18, 'BH', 'Bahrain', 'Kingdom of Bahrain', 'BHR', 48, 'yes', '973', 'AS'),
(20, 'BB', 'Barbados', 'Barbados', 'BRB', 52, 'yes', '1+246', 'NA'),
(21, 'BY', 'Belarus', 'Republic of Belarus', 'BLR', 112, 'yes', '375', 'EU'),
(22, 'BE', 'Belgium', 'Kingdom of Belgium', 'BEL', 56, 'yes', '32', 'EU'),
(28, 'BA', 'Bosnia and Herzegovina', 'Bosnia and Herzegovina', 'BIH', 70, 'yes', '387', 'EU'),
(31, 'BR', 'Brazil', 'Federative Republic of Brazil', 'BRA', 76, 'yes', '55', 'SA'),
(34, 'BG', 'Bulgaria', 'Republic of Bulgaria', 'BGR', 100, 'yes', '359', 'EU'),
(37, 'KH', 'Cambodia', 'Kingdom of Cambodia', 'KHM', 116, 'yes', '855', 'AS'),
(39, 'CA', 'Canada', 'Canada', 'CAN', 124, 'yes', '1', 'NA'),
(44, 'CL', 'Chile', 'Republic of Chile', 'CHL', 152, 'yes', '56', 'SA'),
(45, 'CN', 'China', 'People''s Republic of China', 'CHN', 156, 'yes', '86', 'AS'),
(48, 'CO', 'Colombia', 'Republic of Colombia', 'COL', 170, 'yes', '57', 'SA'),
(52, 'CR', 'Costa Rica', 'Republic of Costa Rica', 'CRI', 188, 'yes', '506', 'NA'),
(54, 'HR', 'Croatia', 'Republic of Croatia', 'HRV', 191, 'yes', '385', 'EU'),
(56, 'CY', 'Cyprus', 'Republic of Cyprus', 'CYP', 196, 'yes', '357', 'AS'),
(57, 'CZ', 'Czech Republic', 'Czech Republic', 'CZE', 203, 'yes', '420', 'EU'),
(59, 'DK', 'Denmark', 'Kingdom of Denmark', 'DNK', 208, 'yes', '45', 'EU'),
(63, 'EC', 'Ecuador', 'Republic of Ecuador', 'ECU', 218, 'yes', '593', 'SA'),
(64, 'EG', 'Egypt', 'Arab Republic of Egypt', 'EGY', 818, 'yes', '20', 'AF'),
(65, 'SV', 'El Salvador', 'Republic of El Salvador', 'SLV', 222, 'yes', '503', 'NA'),
(68, 'EE', 'Estonia', 'Republic of Estonia', 'EST', 233, 'yes', '372', 'EU'),
(70, 'FK', 'Falkland Islands (Malvinas)', 'The Falkland Islands (Malvinas)', 'FLK', 238, 'no', '500', 'SA'),
(73, 'FI', 'Finland', 'Republic of Finland', 'FIN', 246, 'yes', '358', 'EU'),
(74, 'FR', 'France', 'French Republic', 'FRA', 250, 'yes', '33', 'EU'),
(80, 'GE', 'Georgia', 'Georgia', 'GEO', 268, 'yes', '995', 'AS'),
(81, 'DE', 'Germany', 'Federal Republic of Germany', 'DEU', 276, 'yes', '49', 'EU'),
(83, 'GI', 'Gibraltar', 'Gibraltar', 'GIB', 292, 'no', '350', 'EU'),
(84, 'GR', 'Greece', 'Hellenic Republic', 'GRC', 300, 'yes', '30', 'EU'),
(85, 'GL', 'Greenland', 'Greenland', 'GRL', 304, 'no', '299', 'NA'),
(86, 'GD', 'Grenada', 'Grenada', 'GRD', 308, 'yes', '1473', 'NA'),
(95, 'HN', 'Honduras', 'Republic of Honduras', 'HND', 340, 'yes', '504', 'NA'),
(96, 'HK', 'Hong Kong', 'Hong Kong', 'HKG', 344, 'no', '852', 'AS'),
(97, 'HU', 'Hungary', 'Republic of Hungary', 'HUN', 348, 'yes', '36', 'EU'),
(98, 'IS', 'Iceland', 'Republic of Iceland', 'ISL', 352, 'yes', '354', 'EU'),
(99, 'IN', 'India', 'Republic of India', 'IND', 356, 'yes', '91', 'AS'),
(100, 'ID', 'Indonesia', 'Republic of Indonesia', 'IDN', 360, 'yes', '62', 'AS'),
(103, 'IE', 'Ireland', 'Ireland', 'IRL', 372, 'yes', '353', 'EU'),
(105, 'IL', 'Israel', 'State of Israel', 'ISR', 376, 'yes', '972', 'AS'),
(106, 'IT', 'Italy', 'Italian Republic', 'ITA', 380, 'yes', '39', 'EU'),
(108, 'JP', 'Japan', 'Japan', 'JPN', 392, 'yes', '81', 'AS'),
(110, 'JO', 'Jordan', 'Hashemite Kingdom of Jordan', 'JOR', 400, 'yes', '962', 'AS'),
(111, 'KZ', 'Kazakhstan', 'Republic of Kazakhstan', 'KAZ', 398, 'yes', '7', 'AS'),
(114, 'KW', 'Kuwait', 'State of Kuwait', 'KWT', 414, 'yes', '965', 'AS'),
(115, 'KG', 'Kyrgyzstan', 'Kyrgyz Republic', 'KGZ', 417, 'yes', '996', 'AS'),
(117, 'LV', 'Latvia', 'Republic of Latvia', 'LVA', 428, 'yes', '371', 'EU'),
(122, 'LI', 'Liechtenstein', 'Principality of Liechtenstein', 'LIE', 438, 'yes', '423', 'EU'),
(123, 'LT', 'Lithuania', 'Republic of Lithuania', 'LTU', 440, 'yes', '370', 'EU'),
(124, 'LU', 'Luxembourg', 'Grand Duchy of Luxembourg', 'LUX', 442, 'yes', '352', 'EU'),
(125, 'MO', 'Macao', 'The Macao Special Administrative Region', 'MAC', 446, 'no', '853', 'AS'),
(126, 'MK', 'Macedonia', 'The Former Yugoslav Republic of Macedonia', 'MKD', 807, 'yes', '389', 'EU'),
(129, 'MY', 'Malaysia', 'Malaysia', 'MYS', 458, 'yes', '60', 'AS'),
(132, 'MT', 'Malta', 'Republic of Malta', 'MLT', 470, 'yes', '356', 'EU'),
(138, 'MX', 'Mexico', 'United Mexican States', 'MEX', 484, 'yes', '52', 'NA'),
(139, 'MR', 'Mauritania', 'Islamic Republic of Mauritania', 'MRT', 478, 'yes', '222', 'AF'),
(140, 'MD', 'Moldava', 'Republic of Moldova', 'MDA', 498, 'yes', '373', 'EU'),
(141, 'MC', 'Monaco', 'Principality of Monaco', 'MCO', 492, 'yes', '377', 'EU'),
(143, 'ME', 'Montenegro', 'Montenegro', 'MNE', 499, 'yes', '382', 'EU'),
(145, 'MA', 'Morocco', 'Kingdom of Morocco', 'MAR', 504, 'yes', '212', 'AF'),
(151, 'MM', 'Myanmar', 'Republic of the Union of Myanmar', 'MMR', 104, 'yes', '95', 'AS'),
(152, 'NL', 'Netherlands', 'Kingdom of the Netherlands', 'NLD', 528, 'yes', '31', 'EU'),
(154, 'NZ', 'New Zealand', 'New Zealand', 'NZL', 554, 'yes', '64', 'OC'),
(162, 'NO', 'Norway', 'Kingdom of Norway', 'NOR', 578, 'yes', '47', 'EU'),
(163, 'OM', 'Oman', 'Sultanate of Oman', 'OMN', 512, 'yes', '968', 'AS'),
(167, 'PA', 'Panama', 'Republic of Panama', 'PAN', 591, 'yes', '507', 'NA'),
(171, 'PH', 'Phillipines', 'Republic of the Philippines', 'PHL', 608, 'yes', '63', 'AS'),
(172, 'PE', 'Peru', 'Republic of Peru', 'PER', 604, 'yes', '51', 'SA'),
(173, 'PL', 'Poland', 'Republic of Poland', 'POL', 616, 'yes', '48', 'EU'),
(174, 'PT', 'Portugal', 'Portuguese Republic', 'PRT', 620, 'yes', '351', 'EU'),
(176, 'QA', 'Qatar', 'State of Qatar', 'QAT', 634, 'yes', '974', 'AS'),
(178, 'RO', 'Romania', 'Romania', 'ROU', 642, 'yes', '40', 'EU'),
(179, 'RU', 'Russia', 'Russian Federation', 'RUS', 643, 'yes', '7', 'EU'),
(191, 'SA', 'Saudi Arabia', 'Kingdom of Saudi Arabia', 'SAU', 682, 'yes', '966', 'AS'),
(193, 'RS', 'Serbia', 'Republic of Serbia', 'SRB', 688, 'yes', '381', 'EU'),
(196, 'SG', 'Singapore', 'Republic of Singapore', 'SGP', 702, 'yes', '65', 'AS'),
(197, 'SK', 'Slovakia', 'Slovak Republic', 'SVK', 703, 'yes', '421', 'EU'),
(198, 'SI', 'Slovenia', 'Republic of Slovenia', 'SVN', 705, 'yes', '386', 'EU'),
(201, 'ZA', 'South Africa', 'Republic of South Africa', 'ZAF', 710, 'yes', '27', 'AF'),
(203, 'KR', 'South Korea', 'Republic of Korea', 'KOR', 410, 'yes', '82', 'AS'),
(204, 'ES', 'Spain', 'Kingdom of Spain', 'ESP', 724, 'yes', '34', 'EU'),
(209, 'SZ', 'Swaziland', 'Kingdom of Swaziland', 'SWZ', 748, 'yes', '268', 'AF'),
(210, 'SE', 'Sweden', 'Kingdom of Sweden', 'SWE', 752, 'yes', '46', 'EU'),
(211, 'CH', 'Switzerland', 'Swiss Confederation', 'CHE', 756, 'yes', '41', 'EU'),
(213, 'TW', 'Taiwan', 'Taiwan, Province of China', 'TWN', 158, 'no', '886', 'AS'),
(214, 'TJ', 'Tajikistan', 'Republic of Tajikistan', 'TJK', 762, 'yes', '992', 'AS'),
(216, 'TH', 'Thailand', 'Kingdom of Thailand', 'THA', 764, 'yes', '66', 'AS'),
(222, 'TN', 'Tunisia', 'Republic of Tunisia', 'TUN', 788, 'yes', '216', 'AF'),
(223, 'TR', 'Turkey', 'Republic of Turkey', 'TUR', 792, 'yes', '90', 'AS'),
(224, 'TM', 'Turkmenistan', 'Turkmenistan', 'TKM', 795, 'yes', '993', 'AS'),
(228, 'UA', 'Ukraine', 'Ukraine', 'UKR', 804, 'yes', '380', 'EU'),
(229, 'AE', 'United Arab Emirates', 'United Arab Emirates', 'ARE', 784, 'yes', '971', 'AS'),
(230, 'GB', 'United Kingdom', 'United Kingdom of Great Britain and Nothern Ireland', 'GBR', 826, 'yes', '44', 'EU'),
(232, 'US', 'United States', 'United States of America', 'USA', 840, 'yes', '1', 'NA'),
(233, 'UY', 'Uruguay', 'Eastern Republic of Uruguay', 'URY', 858, 'yes', '598', 'SA'),
(234, 'UZ', 'Uzbekistan', 'Republic of Uzbekistan', 'UZB', 860, 'yes', '998', 'AS'),
(237, 'VE', 'Venezuela', 'Bolivarian Republic of Venezuela', 'VEN', 862, 'yes', '58', 'SA'),
(238, 'VN', 'Vietnam', 'Socialist Republic of Vietnam', 'VNM', 704, 'yes', '84', 'AS'),
(241, 'NG', 'Nigeria', 'Nigeria', 'NGA', NULL, 'yes', '234 ', 'AF');

Hacking ICQ: get left sms to send for any user on icq


get left sms to send for any user on icq  :


Link : http://c.icq.com/xtraz2/products/sms_activation/action.php?act=chkscore&uin=ICQ_NUMBER&sess_key=889477456&ccode=COUNTRY_CODE

change the
  • ICQ_NUMBER paramenter to your requested icq number.
  • COUNTRY_CODE parameter to 3 digit country code like 001


sample:
http://c.icq.com/xtraz2/products/sms_activation/action.php?act=chkscore&uin=395803305&sess_key=889477456&ccode=001

Hacking : Does your website hacked without your knowledge?


Just search in google:
inurl:"union select" intext:"different number of columns"

if your site apper in this list,
there is a big chance that your admin password was stolen


VB6 : read file into string variable

use this function to open text file into variable

Function ReadFile(filename As String) As String
  Open filename For Input As #1
     ReadFile = Input(LOF(1), 1)
    Close #1
End Function


usage:
dim data as string
data=ReadFile("filedata.txt");

Tuesday, February 5, 2013

VB6 - Visual basic 6 : get document of internet explorer window by domain

get html document from internet explorer window by domain

'Referencnces : Microsoft HTML Object Libray
Option Explicit
    Type UUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(0 To 7) As Byte
End Type
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function ObjectFromLresult Lib "oleacc.dll" (ByVal lResult As Long, riid As UUID, ByVal wParam As Long, ppvObject As Object) As Long
Private Declare Function RegisterWindowMessage Lib "user32.dll" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function CLSIDFromString Lib "ole32.dll" (ByVal lpszProgID As Long, pCLSID As UUID) As Long
Private Function WindowDOM(ByVal hwnd As Long) As IHTMLDocument2
Dim typUUID As UUID, lngRes As Long, lngMsg As Long, clid As String
lngMsg = RegisterWindowMessage("WM_HTML_GETOBJECT")
If lngMsg <> 0 Then
    lngRes = SendMessage(hwnd, lngMsg, 0&, 0&)
    If lngRes <> 0 Then
        clid = "{626fc520-a41e-11cf-a731-00a0c9082637}"
        Call CLSIDFromString(StrPtr(clid), typUUID)
        Call ObjectFromLresult(lngRes, typUUID, 0, WindowDOM)
    End If
End If
End Function
Private Function getDomainName(doc As IHTMLDocument2) As String
On Error GoTo err
getDomainName = doc.domain
Exit Function
err:
getDomainName = ""
End Function

Public Function getIEdoc_byDomain(domain As String, Optional ByVal hwndParent As Long = 0) As IHTMLDocument2
Dim hwndAfter As Long, retval As Long
Dim lpClassName As String
hwndAfter = FindWindowEx(hwndParent, 0, vbNullString, vbNullString)
Do While hwndAfter <> 0
    lpClassName = Space(256)
    retval = GetClassName(hwndAfter, lpClassName, 256)
    If Left$(lpClassName, retval) = "Internet Explorer_Server" Then
        Set getIEdoc_byDomain = WindowDOM(hwndAfter)
        If getDomainName(getIEdoc_byDomain) = domain Then
            Exit Function
        End If
    End If
    Set getIEdoc_byDomain = getIEdoc_byDomain(domain, hwndAfter)
    If Not getIEdoc_byDomain Is Nothing Then
        Exit Function
    End If
    hwndAfter = FindWindowEx(hwndParent, hwndAfter, vbNullString, vbNullString)
Loop
End Function

'usage:
Sub main()
Dim doc As IHTMLDocument2
Set doc = getIEdoc_byDomain("www.google.com")
End Sub

'if not found -- return nothing

C# : Play Sound in system service

windows server 2008/vista/windows 7 forword if u host a service W/O a user loggon the system wont start the audio devices.
to solve this u can use the dear NAudio Dll from http://naudio.codeplex.com/ - its open source.
but its a damn long (and helpful) code while u wont a simple service with only 1 CS page, so my Dear Team Chief and IT man Moshe reduced that to a single CS page just to play the sounds and here u go:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NAudio.Wave;
using NAudio.CoreAudioApi;
using System.ComponentModel.Composition;
using NAudio.Wave.SampleProviders;

namespace CallAndRead
{
   
public interface IInputFileFormatPlugin
   {
      
string Name { get; }
       string Extension { get; }
       WaveStream CreateWaveStream(string fileName);
   }
   

   [Export(typeof(IInputFileFormatPlugin))]
   class WaveInputFilePlugin : IInputFileFormatPlugin
   {       public string Name
      { get { return "WAV file"; } }
       public string Extension
      { get { return ".wav"; } }

       public WaveStream CreateWaveStream(string fileName)
       {             WaveStream readerStream = new WaveFileReader(fileName);
             if (readerStream.WaveFormat.Encoding != WaveFormatEncoding.Pcm
                   && readerStream.WaveFormat.Encoding != WaveFormatEncoding.IeeeFloat)
            {
                  readerStream =
WaveFormatConversionStream.CreatePcmStream(readerStream);
                  readerStream = new BlockAlignReductionStream(readerStream);
            }            return readerStream;
      }
   }
   

   class WASAPI
   {        public static void Concatenate(string outputFile, IEnumerable<string> sourceFiles)
        {             byte[] buffer = new byte[1024];
             WaveFileWriter waveFileWriter = null;
             try
            {                 foreach (string sourceFile in sourceFiles)
                 {                        using (WaveFileReader reader = new WaveFileReader(sourceFile))
                        {                               if (waveFileWriter == null)
                                   waveFileWriter = new WaveFileWriter(outputFile, reader.WaveFormat);
                               else
                              {                                     if (!reader.WaveFormat.Equals(waveFileWriter.WaveFormat))
                                     throw new InvalidOperationException(
                                              "Can't concatenate WAV Files that don't share the same format");
                              }                              int read;
                              while ((read = reader.Read(buffer, 0, buffer.Length)) > 0)
                             {
                                   waveFileWriter.WriteData(buffer, 0, read);
                             }
                      }
                }
            }
           
finally
           {                if (waveFileWriter != null)
                     waveFileWriter.Dispose();
           }
      }
      private IWavePlayer waveOut = new WasapiOut(NAudio.CoreAudioApi.AudioClientShareMode.Shared, 300);
      WaveStream fileWaveStream;
      Action<float> setVolumeDelegate;

     [ImportMany(typeof(IInputFileFormatPlugin))]
     public IEnumerable<IInputFileFormatPlugin> InputFileFormats { get; set; }

     void OnPreVolumeMeter(object sender, NAudio.Wave.SampleProviders.StreamVolumeEventArgs e)    {     }

      public ISampleProvider CreateInputStream(string fileName)
     {
  
        var plugin = new WaveInputFilePlugin();
           if (plugin == null)
                  throw new InvalidOperationException("Unsupported file extension");
           fileWaveStream = plugin.CreateWaveStream(fileName);           var waveChannel = new NAudio.Wave.SampleProviders.SampleChannel(fileWaveStream);
           setVolumeDelegate = (vol) => waveChannel.Volume = vol;
           waveChannel.PreVolumeMeter += OnPreVolumeMeter;
           var postVolumeMeter = new MeteringSampleProvider(waveChannel);
           postVolumeMeter.StreamVolume += OnPostVolumeMeter;           return postVolumeMeter;
     }

     
void OnPostVolumeMeter(object sender, StreamVolumeEventArgs e){      }      public WASAPI(string fileName)
     {            ISampleProvider sampleProvider = null;
            sampleProvider = CreateInputStream(fileName);
            waveOut.Init(
new SampleToWaveProvider(sampleProvider));
            waveOut.Play();            return;
      }
   }
}


usage:
and what u need to do in ur app is simply this:
WASAPI Player = new WASAPI("filetoplay.wav");
(advised to do sleep for it to finish and maybe player = null if ur the saving resources type)

: