Gadu-Gadu Password Decoder

With this script you can recover lost UIN passwords for the popular Polish messenger Gadu-Gadu. It can also recover profile passwords. This decoder has been used 12265 times already.

What is Gadu-Gadu?

Gadu-Gadu is a Polish instant messaging client using a proprietary protocol.

Gadu-Gadu was the most popular IM service in Poland in the 90s and 2000, with over 15 million registered accounts and approximately 6.5 million users online daily.

The first versions of Gadu-Gadu kept the user's login and profile password in the configuration file encrypted with a simple algorithm.

The use of reverse engineering allowed to recover its source code.

The following decoder allows to extract both passwords and user number from this configuration file.

Gadu-Gadu or GG messenger password decoder

Decode passwords from the configuration file

* Decoded data are not saved on this site. If you don't trust us, you can immediately change the password once you decode it.

Configuration file location

Lost passwords are decoded directly from the configuration file config.dat. You can find this file in:

Operating system File path
Windows Vista / 7 / 8 / 10 C:\Users\Profile\Gadu-Gadu\Username\config.dat
Windows NT / XP C:\Documents and Settings\Profile\Gadu-Gadu\Username\config.dat
Windows 9x / ME C:\Program Files\Gadu-Gadu\users\Username\config.dat

Password decoding algorithm source code

Many years have passed since Gadu-Gadu celebrated its glory, so I decided to publish the reverse engineered source code of the password decoding algorithm in PHP for historical reasons.

////////////////////////////////////////////////////////////////////////////////
//
// zamien z 1025 na ISO
//
////////////////////////////////////////////////////////////////////////////////

public static function convert_pl($text)
{
  $pol = [ "ą", "ę", "ó", "ł", "ń", "ś", "ż", "ź", "ć", "Ą", "Ę", "Ó", "Ł", "Ń", "Ś", "Ż", "Ź", "Ć" ];
  $eng = [ "±", "ę", "ó", "ł", "ń", "¶", "ż", "Ľ", "ć", "ˇ", "Ę", "Ó", "Ł", "Ń", "¦", "Ż", "¬", "Ć" ];

  return str_replace($pol, $eng, $text);
}

////////////////////////////////////////////////////////////////////////////////
//
// find user UIN number
//
////////////////////////////////////////////////////////////////////////////////

public static function find_gg_uin($configfile, $size)
{
  $uin = "";

  for ($i = 0; $i < $size - 6; $i++)
  {
    if ($configfile[$i + 0] == 'N' &&
        $configfile[$i + 1] == 'u' &&
        $configfile[$i + 2] == 'm' &&
        $configfile[$i + 3] == 'b' &&
        $configfile[$i + 4] == 'e' &&
        $configfile[$i + 5] == 'r')
    {
      $j = $i + 5 + 3;

      $uin = ord($configfile[$j + 0]) + (ord($configfile[$j + 1]) << 8) + (ord($configfile[$j + 2]) << 16) + (ord($configfile[$j + 3]) << 24);

      if ($uin >= 4294967294) $uin -= 4294967296;

      break;
    }
  }

  return $uin;
}

////////////////////////////////////////////////////////////////////////////////
//
// find GG login password
//
////////////////////////////////////////////////////////////////////////////////

public static function find_gg_password($configfile, $size)
{
  $password = "";

  for ($i = 0; $i < $size - 9; $i++)
  {
    if ($configfile[$i + 0] == 'P' &&
        $configfile[$i + 1] == 'a' &&
        $configfile[$i + 2] == 's' &&
        $configfile[$i + 3] == 's' &&
        $configfile[$i + 4] == 'w' &&
        $configfile[$i + 5] == 'o' &&
        $configfile[$i + 6] == 'r' &&
        $configfile[$i + 7] == 'd' &&
        $configfile[$i + 8] == '2')
    {
      $j = $i + 8 + 3;

      while(ord($configfile[$j]) != 0x00)
      {
        $password .= $configfile[$j];
        $j++;
      }

      if (!empty($password))
      {
        $decoded = "";

        for ($j = 0; $j < strlen($password) / 2; $j++)
        {
          $decoded .= chr( (ord($password[$j << 1]) - 0x41 ) | ( (ord($password[ ($j << 1) + 1 ]) - 0x41) << 4 ) );
        }

        $password = static::convert_pl($decoded);

        break;
      }
    }
  }

  return $password;
}

////////////////////////////////////////////////////////////////////////////////
//
// find GG local profile login password
//
////////////////////////////////////////////////////////////////////////////////

public static function find_gg_profile_password($configfile, $size)
{
  $password = "";

  for ($i = 0; $i < $size - 11; $i++)
  {
    if ($configfile[$i + 0] == 'p' &&
        $configfile[$i + 1] == 'a' &&
        $configfile[$i + 2] == 's' &&
        $configfile[$i + 3] == 's' &&
        $configfile[$i + 4] == 'w' &&
        $configfile[$i + 5] == 'o' &&
        $configfile[$i + 6] == 'r' &&
        $configfile[$i + 7] == 'd' &&
        $configfile[$i + 8] == 's' &&
        $configfile[$i + 9] == 't' &&
        $configfile[$i +10] == 'r')
    {
      $j = $i + 10 + 3;

      while(ord($configfile[$j]) != 0x00)
      {
        $password .= chr( ord($configfile[$j]) ^ 0xFF);
        $j++;
      }

      if (!empty($password))
      {
        $password = static::convert_pl($password);
        break;
      }
    }
  }

  return $password;
}

Questions?

If you would like to ask me about Gadu-Gadu password decoder, something's not clear, or you would like to suggest an improvement, mail me. I'll be happy to answer all of your questions.