SHARE
TWEET

*Updated 3/6/2017*

0xNOP Mar 6th, 2017 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Global.s Dim output(0)
  2.  
  3. Procedure explodeStringArray(Array a$(1), s$, delimeter$)
  4.   Protected count, i
  5.   count = CountString(s$,delimeter$) + 1
  6.  
  7.   ;Debug Str(count) + " substrings found"
  8.   Dim a$(count)
  9.   For i = 1 To count
  10.     a$(i - 1) = StringField(s$,i,delimeter$)
  11.   Next
  12.   ProcedureReturn count ;return count of substrings
  13. EndProcedure
  14.  
  15. Procedure getProduct(ProgID, Product.s)
  16.   Output$ = ""
  17. ;   Debug ProgID
  18. ;   Debug Product
  19. If ProgID
  20.   While ProgramRunning(ProgID)
  21.     If AvailableProgramOutput(ProgID)
  22.       Output$ + ReadProgramString(ProgID)
  23.     EndIf
  24.   Wend
  25.   CloseProgram(ProgID) ; Close the connection to the program
  26. EndIf
  27. SplittedString$ = ""
  28. FindStr$ = Left(Output$, 12)
  29. Occurences$ = Str(CountString(Output$, FindStr$))
  30. If(Val(Occurences$) = 0)
  31.     MessageRequester("Woops!", "No Security Product(s) Found!")
  32. Else
  33.   If(Val(Occurences$) >= 1)
  34.     ;This system has more than one Antivirus!" ; Do Split for 1 antivirus <- We want this value :)
  35.     explodeStringArray(output(), Output$, "displayName=")
  36.     If(Product.s = "AV")
  37.       MessageRequester("We've Found an AntiVirus!", output(1))
  38.     EndIf
  39.    
  40.     If(Product.s = "SPY")
  41.       MessageRequester("We've Found an AntiSpyWare!", output(1))
  42.     EndIf
  43.    
  44.     If(Product.s = "FW")
  45.       MessageRequester("We've Found a FireWall!", output(1))
  46.     EndIf
  47.    
  48.   EndIf
  49. EndIf
  50. EndProcedure
  51.  
  52. ; MessageRequester("TITLE", Str(OSVersion()))
  53.  
  54. ; I've read that WMI changed the way it behaves from Vista SP2 and above, earlier "root\SecurityCenter" was needed, now "root\SecurityCenter2" is needed.
  55.  
  56. Procedure getAntiVirus()
  57.   If OSVersion() <= #PB_OS_Windows_Vista
  58.     ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter Path AntiVirusProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
  59.     getProduct(ProgID, "AV")
  60.   Else ;Host OS is higher than Vista. We can rest assured and run it with the new WMIC statement :D
  61.     ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
  62.     getProduct(ProgID, "AV")
  63. EndIf
  64. EndProcedure
  65.  
  66. Procedure getAntiSpyware()
  67.   If OSVersion() <= #PB_OS_Windows_Vista
  68.     ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter Path AntiSpywareProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
  69.     getProduct(ProgID, "SPY")
  70.   Else ;Host OS is higher than Vista. We can rest assured and run it with the new WMIC statement :D
  71.     ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiSpywareProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
  72.     getProduct(ProgID, "SPY")
  73. EndIf
  74. EndProcedure
  75.  
  76. Procedure getFirewall()
  77.   If OSVersion() <= #PB_OS_Windows_Vista
  78.     ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter Path FirewallProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
  79.     getProduct(ProgID, "FW")
  80.   Else ;Host OS is higher than Vista. We can rest assured and run it with the new WMIC statement :D
  81.     ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter2 Path FirewallProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
  82.     getProduct(ProgID, "FW")
  83. EndIf
  84. EndProcedure
  85.  
  86. getAntiVirus()
  87. getAntiSpyware()
  88. getFirewall()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top