Results 1 to 10 of 10
  1. #1
    DawgiiStylz's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Dawg House
    Posts
    7,809
    Reputation
    219
    Thanks
    2,903
    My Mood
    Tired

    Finding a string within html webpage

    Titles is a bit off, but I need help splitting, trimming, whatever you're suppose to do to get this string out of a block of text.I'm terrible at thisTo the problem, I need help finding this, XX_X_X.txt (X's meaning numbers, which I'm trying to look for)I'm trying to get it from a webpage html source, which that part I can do.Any help is appreciative

    Source:
    <b>Downloadable Files</b> Downloadable Files

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

    abuckau907 (12-21-2012),WTX-HACK (12-21-2012)

  3. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,797
    My Mood
    Breezy
    Dim result As Regex = New Regex("strFileName=(?<swf>game\d+(_\d+){2}.swf)")
    Dim match As Match = result.Match(pageSource)
    Dim swfFileName As String = match.Groups("swf")
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  4. The Following User Says Thank You to master131 For This Useful Post:

    DawgiiStylz (12-21-2012)

  5. #3
    DawgiiStylz's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Dawg House
    Posts
    7,809
    Reputation
    219
    Thanks
    2,903
    My Mood
    Tired
    Quote Originally Posted by master131 View Post
    Dim result As Regex = New Regex("strFileName=(?<swf>game\d+(_\d+){2}.swf)")
    Dim match As Match = result.Match(pageSource)
    Dim swfFileName As String = match.Groups("swf")
    What the last line does? Thats the only problem I have with that code

  6. #4
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,797
    My Mood
    Breezy
    Well, I wasn't sure if that line would work in VB.NET, try this instread:
    Dim swfFileName As String = match.Groups(1).Value
    Last edited by master131; 12-21-2012 at 08:11 AM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  7. The Following User Says Thank You to master131 For This Useful Post:

    DawgiiStylz (12-21-2012)

  8. #5
    DawgiiStylz's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Dawg House
    Posts
    7,809
    Reputation
    219
    Thanks
    2,903
    My Mood
    Tired
    Quote Originally Posted by master131 View Post
    Well, I wasn't sure if that line would work in VB.NET, try this instread:
    Dim swfFileName As String = match.Groups(1).Value
    Didn't quite give me what I've wanted, but I got the result I needed. You helped me a lot

    Code:
    Cation, Its very bootlegged
     Dim x As String = GetBuild()
            Dim result As Regex = New Regex("strFileName=(?<swf>game\d+(_\d+){2}.swf)")
            Dim match As Match = result.Match(x)
            Dim y() As String = match.ToString.Split(".")
            Dim l As String = y(1).Trim(".")
            textbox.Text = y(0).Remove(0, 16).Replace("_", ".")
    I likes your drawings btw
    Fan of your coding works
    Close pls

  9. The Following User Says Thank You to DawgiiStylz For This Useful Post:

    [MPGH]master131 (12-21-2012)

  10. #6
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,797
    My Mood
    Breezy
    Also, here's what you wanted but with less code.
    Code:
    Dim groups As GroupCollection = Regex.Match(x, "strFileName=game(?<major>\d+)_(?<minor>\d+)_(?<revision>\d+).swf").Groups
    Dim version As String = String.Format("{0}.{1}.{2}", groups(1), groups(2), groups(3))
    Last edited by master131; 12-21-2012 at 08:49 AM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  11. The Following User Says Thank You to master131 For This Useful Post:

    DawgiiStylz (12-21-2012)

  12. #7
    DawgiiStylz's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Dawg House
    Posts
    7,809
    Reputation
    219
    Thanks
    2,903
    My Mood
    Tired
    Quote Originally Posted by master131 View Post
    Also, here's what you wanted but with less code.
    Code:
    Dim groups As GroupCollection = Regex.Match(x, "strFileName=game(?<major>\d+)_(?<minor>\d+)_(?<revision>\d+).swf").Groups
    Dim version As String = String.Format("{0}.{1}.{2}", groups(1), groups(2), groups(3))
    I will never get this, but Perfect. Thank you

    I actually needed the .swf and instead of replacing the "_" with ".", it wasn't needed. I was confused

  13. #8
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    haha didn't mean to click thanks, was trying to download the source to look at it. How are you retrieving the html document?
    He's using Regex..basically it lets you sort/find strings... like how * and ? are for wildcards in dos, but on steroids.

    If you want, try String.IndexOf()

    basically it will give you the index where it finds a string, for example:

    Dim testString as string = "<form name=something action=somethingelse ...> "
    Dim leftLoc as Int32 = testString.Indexof("<") '' should = 1
    Dim rightLoc as Int32 = testString.IndexOf(">") '' should = end of string

    Dim contents as string = Mid(testString, leftLoc, rightLoc)

    ^^ mess around with it. some string functions are 0 based, some are 1 based, I can't remember. If you play with it for a minute, you'll either get what you expect, or one letter short, and you'll know you got index off by 1 lol

    Also, IndexOf() can take a 'start' index, so once you find the first '<', you can find the next one by
    Dim indxTwo as Int32 = testString.IndexOf("<",leftLoc + 1)


    the +1 might be wrong

  14. #9
    DawgiiStylz's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Dawg House
    Posts
    7,809
    Reputation
    219
    Thanks
    2,903
    My Mood
    Tired
    Quote Originally Posted by abuckau907 View Post
    haha didn't mean to click thanks, was trying to download the source to look at it. How are you retrieving the html document?
    He's using Regex..basically it lets you sort/find strings... like how * and ? are for wildcards in dos, but on steroids.

    If you want, try String.IndexOf()

    basically it will give you the index where it finds a string, for example:

    Dim testString as string = "<form name=something action=somethingelse ...> "
    Dim leftLoc as Int32 = testString.Indexof("<") '' should = 1
    Dim rightLoc as Int32 = testString.IndexOf(">") '' should = end of string

    Dim contents as string = Mid(testString, leftLoc, rightLoc)

    ^^ mess around with it. some string functions are 0 based, some are 1 based, I can't remember. If you play with it for a minute, you'll either get what you expect, or one letter short, and you'll know you got index off by 1 lol

    Also, IndexOf() can take a 'start' index, so once you find the first '<', you can find the next one by
    Dim indxTwo as Int32 = testString.IndexOf("<",leftLoc + 1)


    the +1 might be wrong
    I used a simple function return the webpage source

    Code:
    Public Function GetBuild() As String        Dim s As String = String.Empty
            Dim wRequest As WebRequest
            Dim wResponse As WebResponse
            Dim sReader As StreamReader
    
    
            wRequest = WebRequest.Create("URL")
            wResponse = wRequest.GetResponse
            sReader = New StreamReader(wResponse.GetResponseStream)
            s = sReader.ReadToEnd
            sReader.Close()
            Return s
        End Function

  15. #10
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    well if regex is working for you, awesome. it's way more complex that string.indexof(). But if you ever need to pull 1 string from inside another, it can work.

    but since you read the page into a string variable..maybe try .IndexOf(). Or save it for later. But it comes in handy.

  16. The Following User Says Thank You to abuckau907 For This Useful Post:

    DawgiiStylz (12-21-2012)

Similar Threads

  1. HTML OR Javascript Submit and find
    By FrogIsHam in forum Web Languages
    Replies: 5
    Last Post: 11-13-2011, 12:31 AM
  2. Search within a webpage
    By Captain_America in forum CrossFire Discussions
    Replies: 6
    Last Post: 08-13-2011, 03:45 PM
  3. How to find subfolders within a folder
    By Bombsaway707 in forum Visual Basic Programming
    Replies: 7
    Last Post: 11-29-2010, 06:26 PM
  4. hi can any1 help me make or find a cheat code
    By CrUsHa in forum WarRock - International Hacks
    Replies: 3
    Last Post: 05-19-2006, 04:39 PM
  5. Where do i find WPE Pro?
    By Rileyman1211 in forum WarRock - International Hacks
    Replies: 1
    Last Post: 01-16-2006, 09:52 AM