Jump to content

Recommended Posts

Posted

FlutterShy,

Can you describe what this does and how you are using it?

Global $Result = _UnHideMyAss('$Source')

kylomas

Oh, well, I didn't test it on the file, made a few changes to it that should hopefully make it a little more reliable now, I wasn't accounting for the styles tags in the html to have the ";" in them :P

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7

Global $Result = _UnHideMyAss(BinaryToString(InetRead("http://www.comfaca.com/aiyo.txt",8)))
If @error Then Exit ConsoleWrite(@error & @CR)
ConsoleWrite($Result)

; #FUNCTION# ====================================================================================================================
; Name ..........: _UnHideMyAss
; Description ...: Recovers proxies from hidemyass.com
; Syntax ........: _UnHideMyAss($HTML)
; Parameters ....: $HTML - HTML web source.
; Return values .: A string white space delimetered list
; Author ........: FlutterShy
; Modified ......:
; Remarks .......: will most liekly stop working after a month from this post
; Example .......: No
; ===============================================================================================================================
Func _UnHideMyAss($HTML)
    Local $tables = StringRegExp($HTML, "(?s)(?i)<table.*>.*</table>", 3); extract entire tabel
    If @error Then Return SetError(1, 0, 0)

    Local $aBody = StringRegExp($tables[0], "(?s)<tr(?i:[^>].*)>.*</tr>", 3); get the smaller table
    If @error Then Return SetError(2, 0, 0)

    Local $Fields = StringRegExp($aBody[0], "<tr(?i:[^>].*)>((?s).*?)</tr>", 3); seperate the groups of entries
    If @error Then Return SetError(3, 0, 0)

    Local $Step
    Local $Out
    Local $Styles
    Local $TempStyles

    For $o = 0 To UBound($Fields) - 1
        $HTML = StringReplace(StringReplace($Fields[$o], @CR, ""), @LF, ""); remove all line break things

        $aBody = StringRegExp($HTML, "<style>(.*?)</style>", 3); extract CSS styles
        If @error Then ContinueLoop;Return SetError(4, $o, 0)

        $Styles = StringRegExp($aBody[0], ".(.*?){display:(.+?)}", 3); get css values
        If @error Then ContinueLoop

        $TempStyles = $Styles

        ReDim $Styles[200][2]
        $Step = 0

        For $I = 0 To (UBound($TempStyles) - 1) Step 2; load styles to array
            $Styles[$Step][0] = $TempStyles[$I]
            $Styles[$Step][1] = $TempStyles[$I + 1]
            $Step += 1
        Next

        ReDim $Styles[$Step][2]

        $aBody = StringRegExp($HTML, '(?s)</style>.*?<span class="country">', 3); get the actual obfuscated proxy content
        If @error Then ContinueLoop

        $aBody[0] = StringRegExpReplace($aBody[0], '<spansstyle="display:s?none;?">.*?</span>', ""); remove the ones that will not show up
        $aBody[0] = StringRegExpReplace($aBody[0], '<divsstyle="display:s?none;?">.*?</div>', ""); seperate regexp to avoid confusion

        For $I = 0 To UBound($Styles) - 1
            If StringInStr($Styles[$I][1], "none", 2) Then _; remove the CSS styles none displayed entities or whatever
                    $aBody[0] = StringRegExpReplace($aBody[0], '<(?:span|div)sclass="' & $Styles[$I][0] & '">.*?</(?:span|div)>', "")
        Next

        $aBody[0] = StringRegExpReplace($aBody[0], '<(?:span|div).*?>([.d]*?)</(?:span|div)>', "$1"); remove dummy tags
        $aBody[0] = StringRegExpReplace(StringStripWS($aBody[0], 8), '<td>([^>]d+)</td>', ":$1"); set port
        $aBody[0] = StringRegExpReplace($aBody[0], '<[^<]*>', ""); remove everything else now

        $Out &= $aBody[0] & @CRLF
    Next

    Return SetError(0, 0, $Out)
EndFunc   ;==>_UnHideMyAss

script speaks for itself/

Posted

FlutterShy,

Pardon the ambiguity of my question. What I should have asked is "why are you passing what appears ro be a variable name as a string?"

Yes, the code is self-evident.

Thanks,

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Posted

What I should have asked is "why are you passing what appears ro be a variable name as a string?"

Typo I guess, I don't remember why I did that :/

Anyway, I was revising it a while ago, made some changes.

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
Global $Result = _FindProxies(FileRead(".ttxt"))
If @error Then Exit ConsoleWrite("Error: " & @error & @CR)
For $I = 0 To UBound($Result) - 1
ConsoleWrite($Result[$I] & @CRLF)
Next
; #FUNCTION# ====================================================================================================================
; Name ..........: _FindProxies
; Description ...: Scraps for proxies
; Syntax ........: _FindProxies($HTML)
; Parameters ....: $HTML - HTML web source.
; Return values .: A string white space delimetered list
; Author ........: FlutterShy
; Modified ......:
; Remarks .......: ...
; Example .......: No
; ===============================================================================================================================
Func _FindProxies($HTML)
Local $ProxyList = $HTML
    Local $Fields = StringRegExp($HTML, "(?i)<tr[^>]*>((?s).+?)</tr>", 3); seperate the groups of entries
    If Not @error Then
  Local $indexCount
  Local $aCSS
  Local $sTemp
  Local $aBody
  For $o = 0 To UBound($Fields) - 1
   $HTML = $Fields[$o]
   $aBody = StringRegExp($HTML, "(?i)<style>([^<]+)</style>", 3); extract CSS styles
   If @error Then ContinueLoop
   $aCSS = StringRegExp($aBody[0], "(?i).([^{]+){display:([^}]+)}", 3); get css values
   If @error Then ContinueLoop
   $sTemp = $aCSS
   ReDim $aCSS[9999][2]
   $indexCount = 0
   For $I = 0 To (UBound($sTemp) - 1) Step 2; load styles to array
    $aCSS[$indexCount][0] = $sTemp[$I]
    $aCSS[$indexCount][1] = $sTemp[$I + 1]
    $indexCount += 1
   Next
   ReDim $aCSS[$indexCount][2]
   $aBody = StringRegExp($HTML, '(?s)(?i)</style>.*?<spans*class="country">', 3); get the actual obfuscated proxy content
   If @error Then ContinueLoop
   $aBody[0] = StringRegExpReplace($aBody[0], '(?i)<(?:span|div)s*style="display:s*none[^"]*">[^<]*</(?:span|div)>', ""); remove the ones that will not show up
   For $I = 0 To UBound($aCSS) - 1
    If StringInStr($aCSS[$I][1], "none", 2) Then _; remove the CSS styles none displayed entities or whatever
    $aBody[0] = StringRegExpReplace($aBody[0], '(?i)<(?:span|div)s*class="' & $aCSS[$I][0] & '">[^<]*</(?:span|div)>', "")
   Next
   $aBody[0] = StringRegExpReplace($aBody[0], '(?i)<(?:span|div)[^>]*>([.d]+)</(?:span|div)>', "$1"); remove dummy tags
   $aBody[0] = StringRegExpReplace(StringStripWS($aBody[0], 8), '(?i)<td>([^<]+)</td>', ":$1"); set port
   $aBody[0] = StringRegExpReplace($aBody[0], '<[^<]*>', ""); remove everything else now
   $ProxyList &= $aBody[0] & @CRLF
  Next
EndIf
Local $aResult = StringRegExp($ProxyList, "(?:25[0-5]|2[0-4]d|1?[1-9]d?|1dd).(?:(?:25[0-5]|2[0-4]d|1?[1-9]d?|1dd|0).){2}(?:25[0-5]|2[0-4]d|1?[1-9]d?|1dd|0):d{2,5}", 3)
If @error Then Return SetError(1, 0, 0)
    Return SetError(0, 0, $aResult)
EndFunc   ;==>_FindProxies
Posted (edited)
Simple Solution
#include <Array.au3>
$file_content = "Hello there the following is a table <table><tr><td>This is the First Columm</td></table> Table overs here Next Table" & @CR & _
"<table><tr><td>Next Table first columm</td></table> Gone Fishing ;)"
$table = TagBetween( $file_content, 'table' )
_ArrayDisplay($table)


; #FUNCTION# ====================================================================================================================
; Name ..........: TagBetween
; Description ...:
; Syntax ........: TagBetween ($sString, $sTag)
; Parameters ....: $sString - The string to search.
; $sTag - A non-empty tag.
; Return values .: Success : Returns an array with global matches
; Failure : Returns -1 and sets @error and @extended [see StringRegExp with flag 3]
;
; Author ........: Phoenix XL
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func TagBetween ( $sString, $sTag )
$aRet = StringRegExp($sString, "(?i)(?s)<" & $sTag & ">(.*?)</" & $sTag & ">", 3)
If @error Then Return SetError(@error, @extended, -1)
Return $aRet
EndFunc
Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...