DOMAIN IS FOR SALE! MAKE AN OFFER to mail@maytech.ru

Hub software detection

From DCppWiki

Jump to: navigation, search

Hublist.org uses a hub's $Lock string to detect the hub type and the features supported (such as not sending $MyINFO). Correct detection helps to gather statistics from the hubs and helps to use minimum bandwidth from the hub.

Here is the detection method (VB version):

Function DetectLock(sLock As String) As eType
  '(C) Gadget
  DetectLock = typUnknownHub
  If EReg("^\$Lock [0-9A-Za-z\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{40,120} Pk=[0-9A-Za-z\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{16}$", sLock) Then DetectLock = typNMDCHub
  If EReg("^\$Lock [0-9A-Za-z\:\;\<\=\>\?\@\[\\\]\^\_\`]{45} Pk=PTOKAX[0-9A-Za-z\:\;\<\=\>\?\@\[\\\]\^\_\`]{16}$", sLock) Then
    DetectLock = typPtokaX 'Ptaczek's version
  ElseIf EReg("^\$Lock [0-9A-Za-z\:\;\<\=\>\?\@\[\\\]\^\_\`]{45} Pk=PTOKAX$", sLock) Then
    DetectLock = typPtokaX 'PtokaX DC Hub 0.3.3.0 PPK devel build
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL[0-9A-Za-z\:\;\<\=\>\?\@\[\\\]\^\_\`]{29} Pk=PtokaX$", sLock) Then
    DetectLock = typPtokaX 'Version 0.3.3.0 build 16.07 or above
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL[0-9A-Za-z\:\;\<\=\>\?\@\[\\\]\^\_\`]{30} Pk=PtokaX$", sLock) Then
    DetectLock = typPtokaX 'Version 0.3.3.1 or above
  ElseIf EReg("^\$Lock .{30,80} Pk=SBDCHUB$", sLock) Then
    DetectLock = typSBHub
  ElseIf sLock = "$Lock 987654321 Pk=Xh" Or sLock = "$Lock 987654321 Pk=xx" Then
    DetectLock = typxHub
  ElseIf sLock = "$Lock EXTENDEDPROTOCOL987654321 Pk=Xh" Then
    DetectLock = typxHub
  ElseIf EReg("^\$Lock [0-9A-Za-z\*\<\>\%\-\'\:\;\(\)\+]{54} Pk=[0-9A-Za-z\*\<\>\%\-\'\:\;\(\)\+]{16}$", sLock) Then
    DetectLock = typShasta
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{30,80} Pk=[0-9A-Za-y]{10}$", sLock) Then
    DetectLock = typNetcomandos
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{28} Pk=$", sLock) Then
    DetectLock = typNetcomandos 'Looks like it, claims to be NMDCH, lock length static and pk missing
  ElseIf sLock = "$Lock EXTENDEDPROTOCOL Pk=NETC" Then
    DetectLock = typNetcomandos 'Newer variation
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{30,60} Pk=\[YABBA-[0-9\.]{5,8}\][0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{2}$", sLock) Then
    DetectLock = typYABBA 'Version 1
  ElseIf EReg("^\$Lock .{50,100} Pk=YABBA-2.x-(win32|linux)$", sLock) Then
    DetectLock = typYABBA 'Version 2
  ElseIf sLock = "$Lock o=;CxWkTu=59fJ,kPvRe1ysMaL7UxS<agr3@340;,KQfoMZ8FJH-D&I&tY(7Lop0aKQA%(K[zZ?PBz;nPi. Pk='mL@lNXypQ;uE,X)" Then
    DetectLock = typRyalth
  ElseIf EReg("^\$Lock [a-z]{2,200} Pk=[a-z]{2,200}$", sLock) Then
    DetectLock = typNMDCHub2
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLDEFDEFDEFDEFDEFDEFDEF Pk=SDCH[0-9\.\,]{1,9}DEFDEF$", sLock) Then
    DetectLock = typSDCH
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLDEFDEFDEFDEFDEFDEFDEF Pk=DDCH[0-9\.\,]{1,9}DEFDEF$", sLock) Then
    DetectLock = typDDCH 'DDCH by TheNOP 0.3.37
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLDEFDEFDEFDEFDEFDEFDEF Pk=DDCH[0-9\.\,]{1,9} SVN [0-9]{2,4}DEFDEF$", sLock) Then
    DetectLock = typDDCH 'DDCH by TheNOP 0.3.38
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLDEFDEFDEFDEFDEFDEFDEF Pk=DDCH[0-9\.\,]{1,9}SVN[0-9]{2,4}DEFDEF$", sLock) Then
    DetectLock = typDDCH 'DDCH by TheNOP >=0.3.39
  ElseIf EReg("^\$Lock NONEXTENDEDPROTOCOLABCABC Pk=DCHUBPLUSPLUS[0-9\.]{1,6}ABCABC$", sLock) Then
    DetectLock = typDCHpp 'pre-0.290
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLABCABC Pk=DCHUBPLUSPLUS[0-9a-z\.]{1,7}ABCABC$", sLock) Then
    DetectLock = typDCHpp
  ElseIf sLock = "$Lock Sending_key_isn't_neccessary,_key_won't_be_checked. Pk=Same_goes_here." Then
    DetectLock = typOpenDCHub
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLABCABCABCABCABCABCABC Pk=OPENDCVBHUBABCABC" Then
    DetectLock = typOpenDCVBHub
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLABCABCABCABC Pk=OPENCSHARPHUB" Then
    DetectLock = typOpenCSharpHub
  ElseIf sLock = "$Lock NONEXTENDEDPROTOCOLABCABCABCABC Pk=OPENCSHARPHUB" Then
    DetectLock = typOpenCSharpHub 'Older version
  ElseIf EReg("^\$Lock [0-9A-Za-z\#\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\}\~\à \ç]{48,80} Pk=[0-9A-Za-z\#\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\}\~\à \ç]{15}$", sLock) Then
    DetectLock = typOpenCSharpHub 'Very old version
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL_verlihub (Pk|pK)=version[a-zA-Z0-9\_\.\+\- ]{1,60}$", sLock) Then
    DetectLock = typVerlihub
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL_(winverlihub|winverliHub|WinVerliHub) (Pk|pK)=version[a-zA-Z0-9\_\.\+\- ]{1,60}$", sLock) Then
    DetectLock = typWinVerlihub
  ElseIf EReg("^\$Lock ANGELHUBSERVEREXTENDEDPROTOCOL pk=ANGELHUBV[0-9\.]{1,6}$", sLock) Then
    DetectLock = typAngelHub
  ElseIf sLock = "$Lock EXTENDEDPROTOCOL:SPEEDSHAKE_This_hub_was_written_by_Yoshi_ Pk=None" Then
    DetectLock = typYHub 'pre-0.385
  ElseIf EReg("^\$Lock YHUB::This_hub_was_written_by_Yoshi::.{13,20} Pk=[A-Za-z0-9\.\[\] ]{3,26}$", sLock) Then
    DetectLock = typYHub 'pre-Beta 0.387 [t9]
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL::This_hub_was_written_by_Yoshi::.{13,20} Pk=YHub$", sLock) Then
    DetectLock = typYHub
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL::This_hub_was_written_by_Yoshi::.{10,15} Pk=YnHub$", sLock) Then
    DetectLock = typYNHub
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLashwaswrittenbynevandyoshiandfusbar2DfsTPlnd Pk=c2DaLnrJQ2dsE('P" Then
    DetectLock = typAsh
  ElseIf sLock = "$Lock LINUXHUB Pk=EXTENDED" Then
    DetectLock = typImpHub
  ElseIf sLock = "$Lock EXTENDEDPROTOCOL Pk=ImpHub" Then
    DetectLock = typImpHub 'clone5.myftp.org
  ElseIf EReg("^\$Lock [0-9A-Za-z]{16} Pk=ImpHub$", sLock) Then
    DetectLock = typImpHub 'newer version
  ElseIf EReg("^\$Lock REDIRECTHUB-V[0-9\.]{1,5}-ABCABCABCABCABCABC Pk=aDe2003$", sLock) Then
    DetectLock = typRedirectHub 'Ade's version
  ElseIf sLock = "$Lock DC++HubRedirecterBySniper Pk=HubRedirecter" Then
    DetectLock = typRedirectHub 'Sniper's version
  ElseIf sLock = "$Lock XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Pk=DIRECTCONNECTSECURHUB" Then
    DetectLock = typDCSH 'pre v1.2
  ElseIf EReg("^\$Lock XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Pk=DCSH:[0-9\.]{1,5}$", sLock) Then
    DetectLock = typDCSH
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLABCABCABCABCABCABC Pk=DCSH:[0-9\.]{1,5}$", sLock) Then
    DetectLock = typDCSH
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{30,100} Pk=Net4God$", sLock) Then
    DetectLock = typZPocHub 'Net2God/OpenDCD variation
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{30,100} Pk=AllianceHubServer$", sLock) Then
    DetectLock = typZPocHub 'AllianceHubServer/OpenDCD variation
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLABCABCABCABCABCABCABC Pk=ZDCROOMSERVERAABC" Then
    DetectLock = typZPocHub 'ZDC Room Server (ZPOC w/dc protocol)
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLABCABCABCABCABCABCABC Pk=ZPOCCHRISITANCABC" Then
    DetectLock = typZPocHub 'ZDC Room Server (ZPOC w/dc protocol)
  ElseIf sLock = "$Lock X(f355e24-3Q6hgfsBd3#3rd2 Pk=PTOKAX%3FTc/" Then
    DetectLock = typVerlihub 'arena.tropico.se, claims to be ptokax but static and too short lock
  ElseIf sLock = "$Lock ABCDEFGHIJKLMNOPQABCDEFGHIJKLMNOPQ Pk=THISISATEST" Then
    DetectLock = typUndetected 'dc411.jmimix.no-ip.org "PtokaX DC Hub 0.3.2.2 PF'2003 edition"
  ElseIf sLock = "$Lock NoLockImplementedYet Pk=1234" Then
    DetectLock = typUndetected 'borf.mine.nu
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLDEFDEFDEFDEFDEFDEFDEF Pk=xDC[0-9\.\,]{1,5}DEFDEF$", sLock) Then
    DetectLock = typxDC 'xDC
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLDEFDEFDEFDEFDEFDEFDEF Pk=ISDCH[0-9\.\,]{1,5}DEFDEF$", sLock) Then
    DetectLock = typISDCH
  ElseIf sLock = "$Lock EXTENDEDPROTOCOL::LatHack_DC_Hub Pk=LatHack_DC_Hub" Then
    DetectLock = typLatHack
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL_nimaci Pk=version[0-9\.\,]{1,7}$", sLock) Then
    DetectLock = typNimaci
  ElseIf EReg("^\$Lock DCHPRO Pk=[0-9a-zA-Z\.\,]{5,8}$", sLock) Then
    DetectLock = typDCHPro
  ElseIf EReg("^\$Lock [A-Z] Pk=[0-9A-Za-z\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{15,16}$", sLock) Then
    DetectLock = typSDHub 'SdHub++ 0.10, Agent 0017's hub software (with invalid lock)
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLABCABCABCABCABCABCABC Pk=PTOKAX_0.1.6" Then
    DetectLock = typUndetected 'petson.mine.nu, maybe leaked DCH++ or opendcvbhub?
  ElseIf sLock = "$Lock Sparrow DC HUB:11241124740527" Then
    DetectLock = typSparrow 'sparrow.no-ip.biz, only seen once
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{50,100} $", sLock) Then
    DetectLock = typUndetected 'dc.buh.cz (claiming to be nmdch 1.0.25, lock missing, looks like opendcd variation)
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLABCABCABCABCABCABCABC Pk=TMMDCHUBABCABC" Then
    DetectLock = typTMMDCHub
  ElseIf sLock = "$Lock BUILDBYCHRISTIANTREPANIER@GSPRODUC.WEBHOP.ORG Pk=GSDCHUBSERVERABABABABA" Then
    DetectLock = typGSDCHub
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLBLACKDCHUBBLACKDCHUBBLACKDCHUB Pk=BLACKDCHUB_WIN32" Then
    DetectLock = typBlackDCHub
  ElseIf sLock = "$Lock EXTENDEDPROTOCOLBLACKDCHUBBLACKDCHUBBLACKDCHUB Pk=BLACKDCHUB_LINUX" Then
    DetectLock = typBlackDCHub
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL[0-9A-Za-z\.\,\-\_]{1,40} Pk=DC_Galaxy$", sLock) Then
    DetectLock = typDCGalaxy 'b_w_johan-Kkipars-K-Pone-Shadow
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL_HeXhub_RO_[a-zA-Z0-9]{10,16} Pk=versiunea[a-zA-Z0-9\.]{1,8}$", sLock) Then
    DetectLock = typHexHub 'Lord_Zero's hubsoft
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOLAquila\[\[.{4}\]\] Pk=Aquila$", sLock) Then
    DetectLock = typAquilaHub 'Aquila by Jove
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL::TkHub_was_written_by_Cat::[0-9\.]{3,60} Pk=tkhub$", sLock) Then
    DetectLock = typTkHub 'TkHub by Cat
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL::AdmiHUB_[0-9\.\,]{1,8} Pk=Irrevelant$", sLock) Then
    DetectLock = typAdmiHub
  ElseIf EReg("^\$Lock [0-9A-Za-z\.\,\-\_]{3,32} Pk=xhub$", sLock) Then
    DetectLock = typxHub2
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{30,100} Pk=OpenDCd$", sLock) Then
    DetectLock = typOpenDCD
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{30,100} Pk=opendcd$", sLock) Then
    DetectLock = typOpenDCD
  ElseIf EReg("^\$Lock [0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{50,100} Pk=[0-9A-Za-y\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`]{5}$", sLock) Then
    DetectLock = typDCDaemon
  ElseIf EReg("^\$Lock EXTENDEDPROTOCOL_Hubsoft_made_by_TnT[ [0-255\.] ] Pk=NitroHub", sLock) Then
    DetectLock = typNitroHub
  End If
End Function

New or changed hub versions/lock strings can be sent with description to gadget@hublist.org