-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProfanityUnfilter.txt
160 lines (135 loc) · 5.44 KB
/
ProfanityUnfilter.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
Option Explicit
Script("Name") = "Profanity UnFilter"
Script("Author") = "Hdx"
Script("Major") = 0
Script("Minor") = 0
Script("Revision") = 1
'=============================================='
'Why did I make this? Shits and fucking giggels'
'What does it do? It reverses the Profanity filter of Battle.net, so you see "fuck you" instead of "!&$% you"'
'Is it complete? I think so, but probably not. Its not hard to add more filters, if you find more tell me in the thread.'
' Updated by Pyro on 2017-12-11
' - Use event pre-processor system
' - Added new word filters
Const EVENT_PROCESSOR_SCRIPT = "Chat Event Pre-Processor"
Private Const SID_CHATEVENT = &H0F
Private Const EID_WHISPER = &H04
Private Const EID_TALK = &H05
Private Const EID_BROADCAST = &H06
Private Const EID_WHISPERSENT = &H0A
Private Const EID_INFO = &H12
Private Const EID_ERROR = &H13
Private Const EID_EMOTE = &H17
Private SwapPacket
Private HasProcessor
Sub Event_Load()
HasProcessor = Not (GetScriptByName(EVENT_PROCESSOR_SCRIPT) Is Nothing)
If HasProcessor Then
Call ObserveScript(EVENT_PROCESSOR_SCRIPT)
End If
SwapPacket = True
End Sub
Sub Event_PacketReceived(Protocol, ID, Length, Data)
If HasProcessor Then Exit Sub
If (Protocol = "BNCS") Then
If (ID = SID_CHATEVENT) Then
Dim pBuffer
Set pBuffer = DataBufferEx()
pBuffer.Data = Mid(Data, 5)
Call Recv_SID_CHATEVENT(pBuffer)
Set pBuffer = Nothing
End If
End If
End Sub
'(DWORD) Event ID'
'(DWORD) Users Flags'
'(DWORD) Ping'
'(DWORD) IP Address (Defunct)'
'(DWORD) Account number (Defunct)'
'(DWORD) Registration Authority (Defunct)'
'(STRING) Username'
'(STRING) Text '
' This method is skipped if the event processor is installed and enabled.
Private Sub Recv_SID_CHATEVENT(Buffer)
If (SwapPacket = False) Then Exit Sub
Dim EventID: EventID = Buffer.GetDWORD()
Dim Flags: Flags = Buffer.GetDWORD()
Dim Ping: Ping = Buffer.GetDWORD()
Dim IPAddr: IPAddr = Buffer.GetDWORD()
Dim Account: Account = Buffer.GetDWORD()
Dim Auth: Auth = Buffer.GetDWORD()
Dim Username: Username = Buffer.GetString()
Dim Text: Text = Buffer.GetString()
Call Event_ChatEventReceived(EventID, Flags, Ping, IPAddr, Account, Auth, Username, Text)
End Sub
Public Sub Event_ChatEventReceived(EventID, Flags, Ping, IP, Account, RegAuth, Username, Message)
Dim NewText
If (SwapPacket = False) Then Exit Sub
' Is this a user-generated event?
Select Case EventID
Case EID_WHISPER, EID_TALK, EID_BROADCAST, EID_WHISPERSENT, EID_INFO, EID_ERROR, EID_EMOTE:
NewText = Message
NewText = UnfilterProfanity(NewText)
' Was any profanity found?
If StrComp(Message, NewText, vbBinaryCompare) = 0 Then
Exit Sub
End If
Message = NewText
Case Else
Exit Sub
End Select
' Build the replacement packet
Dim out: Set out = DataBufferEx()
out.InsertByte &HFF
out.InsertByte SID_CHATEVENT
out.InsertWORD 4 + (6 * 4) + Len(Username) + 1 + Len(Message) + 1 ' header, 6 UInt32's, 2 Strings in 2 null terminators
out.InsertDWORD EventID
out.InsertDWORD Flags
out.InsertDWORD Ping
out.InsertDWORD IP
out.InsertDWORD Account
out.InsertDWORD RegAuth
out.InsertNTString CStr(Username)
out.InsertNTString CStr(Message)
SwapPacket = False
Call ForceBNCSPacketParse(out.Data)
SwapPacket = True
VetoThisMessage
End Sub
'List taken from VL Forums: http://forum.valhallalegends.com/index.php/topic,1931.msg14988.html#msg14988 '
Private Function UnfilterProfanity(Text)
Text = Replace(Text, "!&$%@", "pussy" )
Text = Replace(Text, "$!@%", "shit" )
Text = Replace(Text, "#@%$!", "bitch" )
Text = Replace(Text, "!@!#&", "whore" )
Text = Replace(Text, "%@$%", "dick" )
Text = Replace(Text, "!@!@%&", "nipple" )
Text = Replace(Text, "$!$%", "cock" )
Text = Replace(Text, "$&!%", "cunt" )
Text = Replace(Text, "!&!@$", "penis" )
Text = Replace(Text, "!@!@!@", "vagina" )
Text = Replace(Text, "!@!@&#", "nigger" )
Text = Replace(Text, "!@!@#", "nigga" )
Text = Replace(Text, "@$%!@%&", "asshole" )
Text = Replace(Text, "$%$", "kkk" )
Text = Replace(Text, "$%@%", "clit" )
Text = Replace(Text, "!&$%", "fuck" )
Text = Replace(Text, "!@!@!%", "faggot" )
Text = Replace(Text, "$%&!", "klux" )
Text = Replace(Text, "%@%&!", "dildo" )
Text = Replace(Text, "&@$%&#$@%", "masturbat")
Text = Replace(Text, "&#&$%", "erect" )
Text = Replace(Text, "$%&%", "slut" )
Text = Replace(Text, "$@$&", "kike" )
Text = Replace(Text, "%&$#@#!", "lesbian" )
Text = Replace(Text, "$!@!$", "chink" )
Text = Replace(Text, "!#!@$&", "orgasm" )
Text = Replace(Text, "@$%!@!&", "asswipe" )
Text = Replace(Text, "!@!$", "gook" )
Text = Replace(Text, "$%#!%&!", "scrotum" )
Text = Replace(Text, "%!&$!&", "douche" )
Text = Replace(Text, "@!&$", "anus" )
Text = Replace(Text, "!@#@", "nazi" )
Text = Replace(Text, "!#@$%", "prick" )
UnfilterProfanity = Text
End Function