Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Global.s Dim output(0)
- Procedure explodeStringArray(Array a$(1), s$, delimeter$)
- Protected count, i
- count = CountString(s$,delimeter$) + 1
- ;Debug Str(count) + " substrings found"
- Dim a$(count)
- For i = 1 To count
- a$(i - 1) = StringField(s$,i,delimeter$)
- Next
- ProcedureReturn count ;return count of substrings
- EndProcedure
- Procedure getProduct(ProgID, Product.s)
- Output$ = ""
- ; Debug ProgID
- ; Debug Product
- If ProgID
- While ProgramRunning(ProgID)
- If AvailableProgramOutput(ProgID)
- Output$ + ReadProgramString(ProgID)
- EndIf
- Wend
- CloseProgram(ProgID) ; Close the connection to the program
- EndIf
- SplittedString$ = ""
- FindStr$ = Left(Output$, 12)
- Occurences$ = Str(CountString(Output$, FindStr$))
- If(Val(Occurences$) = 0)
- MessageRequester("Woops!", "No Security Product(s) Found!")
- Else
- If(Val(Occurences$) >= 1)
- ;This system has more than one Antivirus!" ; Do Split for 1 antivirus <- We want this value :)
- explodeStringArray(output(), Output$, "displayName=")
- If(Product.s = "AV")
- MessageRequester("We've Found an AntiVirus!", output(1))
- EndIf
- If(Product.s = "SPY")
- MessageRequester("We've Found an AntiSpyWare!", output(1))
- EndIf
- If(Product.s = "FW")
- MessageRequester("We've Found a FireWall!", output(1))
- EndIf
- EndIf
- EndIf
- EndProcedure
- ; MessageRequester("TITLE", Str(OSVersion()))
- ; 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.
- Procedure getAntiVirus()
- If OSVersion() <= #PB_OS_Windows_Vista
- ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter Path AntiVirusProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
- getProduct(ProgID, "AV")
- Else ;Host OS is higher than Vista. We can rest assured and run it with the new WMIC statement :D
- ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
- getProduct(ProgID, "AV")
- EndIf
- EndProcedure
- Procedure getAntiSpyware()
- If OSVersion() <= #PB_OS_Windows_Vista
- ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter Path AntiSpywareProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
- getProduct(ProgID, "SPY")
- Else ;Host OS is higher than Vista. We can rest assured and run it with the new WMIC statement :D
- ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiSpywareProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
- getProduct(ProgID, "SPY")
- EndIf
- EndProcedure
- Procedure getFirewall()
- If OSVersion() <= #PB_OS_Windows_Vista
- ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter Path FirewallProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
- getProduct(ProgID, "FW")
- Else ;Host OS is higher than Vista. We can rest assured and run it with the new WMIC statement :D
- ProgID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter2 Path FirewallProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
- getProduct(ProgID, "FW")
- EndIf
- EndProcedure
- getAntiVirus()
- getAntiSpyware()
- getFirewall()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement