Page 1 of 4 123 ... LastLast
Results 1 to 15 of 49
  1. #1
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow

    CBL Stat Extraction [VB]

    Hey guys, I wrote this for Bombsaway707 a little while ago and figured I may as well share it with everyone. All I ask is that if you use this code, please have the consideration to credit me for it when you use it.

    Here you go:

    [php]
    '~~~~~~~CBL STAT CHECKER BY JASON OF MPGH~~~~~~~'

    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
    '\\\\\\ Any member of MPGH is entitled to \\\\\\'
    '\\\\\\ make use of the following source \\\\\\'
    '\\\\\\ code on the condition that credit \\\\\\'
    '\\\\\\ is given to me for the original. \\\\\\'
    '\\\\\\ I hope you enjoy. - Jason of MPGH \\\\\\'
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

    Imports System.Text.RegularExpressions

    Public Class Form1
    'for this particular code, you will first need to create a DataGridView, with two "TextBoxCell" columns'
    'set their "HeaderText" property to something you feel is appropriate (it makes no difference) and your'
    'ready to compile!'

    'create a list to store all the stats.'
    Private StatList As New List(Of Stats)
    'this is the RegEx pattern to extract a block of stats'
    Private Const Pattern As String = _
    "<tr>" & "[\s\S]" & _
    " <td class=""item"">.+</td>" & "[\s\S]" & _
    " <td class=""value"">.+</td>" & "[\s\S]" & _
    "[\s\S]" & _
    " <td class=""item"">.+</td>" & "[\s\S]" & _
    " <td class=""value"">.+</td>" & "[\s\S]" & _
    " </tr>"

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'get the stats of the specified player.'
    GetPlayerStats("JR_Pwnage")
    End Sub

    'the following is the sub procedure that will obtain the stats of a certain player and display them in'
    'a datagridview.'
    Private Sub GetPlayerStats(ByVal playerName As String)
    'clear the current player'
    DataGridView1. Rows.Clear()
    'define pagesource'
    Dim PageSource As String
    'download the pagesource of the specific player'
    Using wc As New Net.WebClient
    PageSource = wc.DownloadString("https://player.thecaconline.net/" & playerName & ".html")
    End Using
    'get all the stats from the pagesource in a big block!'
    Dim statCollection As MatchCollection = Regex.Matches(PageSource, Pattern)
    'work through each big block and get what we want!'
    For Each m As Match In statCollection
    'split the block into lines, and then use the indexes to specific lines to get what we want'
    Dim intoArray() As String = m.Value.Split(ChrW(10))
    Dim header1 As String = Regex.Match(intoArray(1), "(?<=<td class=""item"">).+(?=</td>)").Value
    Dim header2 As String = Regex.Match(intoArray(4), "(?<=<td class=""item"">).+(?=</td>)").Value
    Dim content1 As String = Regex.Match(intoArray(2), "(?<=<td class=""value"">).+(?=</td>)").Value
    Dim content2 As String = Regex.Match(intoArray(5), "(?<=<td class=""value"">).+(?=</td>)").Value
    'this is for the equipment, which doesnt follow the exact pattern of the previous entries'
    If content1.StartsWith("<a href") Then
    content1 = Regex.Match(content1, "(?<=<a href="".+"" data-tooltip="".+"">).+(?=</a>)").Value
    End If

    If content2.StartsWith("<a href") Then
    content2 = Regex.Match(content2, "(?<=<a href="".+"" data-tooltip="".+"">).+(?=</a>)").Value
    End If
    'add the two new stats to the statlist!'
    StatList.Add(New Stats With {.Stat = header1, .Value = content1})
    StatList.Add(New Stats With {.Stat = header2, .Value = content2})
    Next

    'add each entry to the datagridview. Alternatively you can just set the datasource of the '
    'DGV to "StatList", but that means changing the property names to what you want the column'
    'headers to be, so I figured this would be easier to follow'
    For Each s As Stats In StatList
    Dim row As New DataGridViewRow
    row.Cells.AddRange(New DataGridViewTextBoxCell() {New DataGridViewTextBoxCell With {.Value = s.Stat}, New DataGridViewTextBoxCell With {.Value = s.Value}})
    DataGridView1. Rows.Add(row)
    Next
    End Sub

    End Class

    'the class I created for the stats.'
    Public Class Stats
    Private HeaderName As String = ""
    Private Contents As String = ""

    'this holds the stat name (i.e Backpack A...etc)'
    Public Property Stat() As String
    Get
    Return HeaderName
    End Get
    Set(ByVal value As String)
    HeaderName = value
    End Set
    End Property

    'The value of the stat above (i.e L96A1...etc)'
    Public Property Value() As String
    Get
    Return Contents
    End Get
    Set(ByVal value As String)
    Contents = value
    End Set
    End Property
    End Class
    [/php]

    Enjoy guys, hope someone gets something out of this!

    Jason

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  2. The Following 6 Users Say Thank You to Jason For This Useful Post:

    -xGhost- (01-20-2011),dllbase (01-20-2011),KawaiiSlut (12-04-2010),NOOB (12-04-2010),UGodly (12-05-2010),_Fk127_ (12-04-2010)

  3. #2
    MEkhi2's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    Earth.
    Posts
    101
    Reputation
    10
    Thanks
    15
    My Mood
    Tired
    Amazing :]

  4. #3
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Thanks man.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  5. #4
    Functional's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    48
    Reputation
    17
    Thanks
    19
    My Mood
    Bashful
    Wow, thanks man. I'll be sure to credit you if I use this!

  6. #5
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,704
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid
    Advanced CBL Checker . Nice , will use this.

  7. #6
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by UnknownCoder View Post
    Advanced CBL Checker . Nice , will use this.
    Thanks man, good to know at least 1 person might get some use out of it
    Last edited by Jason; 12-04-2010 at 11:07 AM.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  8. #7
    GodHack2's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    644
    Reputation
    38
    Thanks
    762
    My Mood
    Amused
    alot better than the basic cbl checker gj





    beat this bitches ^^^^^^^

    Current Stats : Bored :/


    Respect list :
    Crash !
    Gordon'
    Markoj

  9. #8
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,704
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid
    Quote Originally Posted by Jason View Post


    Thanks man, good to know at least 1 person might get some use out of it :P
    I also will give credits /

  10. #9
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by UnknownCoder View Post


    I also will give credits /
    Yay!

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  11. #10
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Ima leech this /me

  12. #11
    PID3RMAN's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    im lost
    Posts
    1,413
    Reputation
    20
    Thanks
    107
    My Mood
    Amazed
    Quote Originally Posted by whit View Post
    Ima leech this /me
    Lmaooo
    beter
    life is a bitch then you die
    so lets all smoke weed
    [IMG]https://i965.photobucke*****m/albums/ae131/ian1mcpherson1/tumblr_lse7x0hQ6d1qcby0w.gif[/IMG]

  13. #12
    KawaiiSlut's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    419
    Reputation
    16
    Thanks
    87
    Nice.. + thanked for post (Might make something out've this)

  14. #13
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Thanks for the comments guys.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  15. #14
    UGodly's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    https://www.mpgh.net/forum/members/645501-ugodly.html
    Posts
    1,234
    Reputation
    18
    Thanks
    160
    My Mood
    Yeehaw
    he is vb expert

  16. #15
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by UGodly View Post
    he is vb expert
    Thanks, I guess

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

Page 1 of 4 123 ... LastLast