Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; English Forum: https://forum.tuts4you.com/
- ; Author: 0xNOP
- ; Date: 6.April.2016
- ; OS: Windows
- ; Demo: No
- 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 getAV(ID.i)
- Output$ = ""
- ProgID = ID
- 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 Antivirus 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=")
- MessageRequester("We've Got a Hit!", "Installed: " + output(1))
- EndIf
- EndIf
- EndProcedure
- ; 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.
- If OSVersion() <= #PB_OS_Windows_Vista
- ID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter Path AntiVirusProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
- getAV(ID)
- Else ;Host OS is higher than Vista. We can rest assured and run it with the new WMIC statement :D
- ID = RunProgram("wmic", "/Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide)
- getAV(ID)
- EndIf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement