• Welcome to Valhalla Legends Archive.
 

How To: Beat the Censor

Started by Barabajagal, November 01, 2007, 07:42 PM

Previous topic - Next topic

Barabajagal

Since everyone thought my last how to was useless, here's a more useless one. How to beat the BNet public channel censor:

Public Function DeCensor(ByVal strMessage As String) As String
Dim Caps As Boolean
    If strMessage = UCase$(strMessage) Then Caps = True
    If strMessage = LCase$(strMessage) Then Caps = False
    strMessage = Replace$(strMessage, "!&$%@", "pussy")
    strMessage = Replace$(strMessage, "!&$%", "fuck")
    strMessage = Replace$(strMessage, "$!@%", "shit")
    strMessage = Replace$(strMessage, "@$%!@%&", "asshole")
    strMessage = Replace$(strMessage, "@$%!@!&", "asswipe")
    strMessage = Replace$(strMessage, "$%$", "kkk")
    strMessage = Replace$(strMessage, "#@%$!", "bitch")
    strMessage = Replace$(strMessage, "!@!#&", "whore")
    strMessage = Replace$(strMessage, "!@!@%&", "nipple")
    strMessage = Replace$(strMessage, "!&!@$", "penis")
    strMessage = Replace$(strMessage, "$!$%", "cock")
    strMessage = Replace$(strMessage, "!@!@&#", "nigger")
    strMessage = Replace$(strMessage, "!@!@#", "nigga")
    strMessage = Replace$(strMessage, "$%&%", "slut")
    strMessage = Replace$(strMessage, "!@!@!@", "vagina")
    strMessage = Replace$(strMessage, "$&!%", "cunt")
    strMessage = Replace$(strMessage, "$%@%", "clit")
    strMessage = Replace$(strMessage, "&#&$%", "erect")
    strMessage = Replace$(strMessage, "%@$%", "dick")
    strMessage = Replace$(strMessage, "!#!@$&", "orgasm")
    strMessage = Replace$(strMessage, "$!@!$", "chink")
    strMessage = Replace$(strMessage, "!@!$", "gook")
    strMessage = Replace$(strMessage, "&@$%&#$@%", "masturbat")
    strMessage = Replace$(strMessage, "!@!@!%", "faggot")
    strMessage = Replace$(strMessage, "$%&!", "klux")
    strMessage = Replace$(strMessage, "$@$&", "kyke")
    strMessage = Replace$(strMessage, "%&$#@#!", "lesbian")
    strMessage = Replace$(strMessage, "%@%&!", "dildo")
    If Caps Then
        DeCensor = UCase$(strMessage)
    Else
        DeCensor = strMessage
    End If
End Function

Yegg

Correct me if I'm wrong, but hasn't this been done a million times before? I think I even remember seeing this in VaporBot source.

Barabajagal

#2
Quite possibly. I went through and found them all myself manually, though (didn't have asswipe for two years, either! Didn't realize it was censored cause nobody says it). Also, the way I detect caps could probably improved by using a method other than replace and detecting what the case of the letters around the censored word are.

Barabajagal

Apparently an alternate spelling of Kike. They both become the same censor.

Barabajagal

It's pretty much an obscure slander word for a Jew.

iNsaNe

why don't u just set strMessage to upper or lower so you avoid case sensitivity all together?

--edit:

lol @ nipple censor

Yegg

Looking through the list, I noticed that "erect" is a censored word... lol.

Barabajagal

uh... you mean set all incoming messages to lowercase always? That's not correct emulation at all, now is it?

And ya, Erect is stupid, and so is Dick and Cock. Every time I try to play Led Zeppelin's Moby Dick,  I get Moby %@$%. And poor Joe Cocker and Bruce Cockburn both get defaced :(

Chriso

Haha @ Moby Dick, good little function I suppose, could be a nice feature.. :)

iNsaNe

#9
Quote from: Hands of a Government Man on November 02, 2007, 12:31 AM
uh... you mean set all incoming messages to lowercase always? That's not correct emulation at all, now is it?

no you interpreted it wrong, set the variable to lowercase to avoid case sensitivty in the function when comparing the 2 strings. you would need 2 different variables

the way his function is written is  ???

edit:

now that i think of it, the best way (i can think of) is to split strMessage by the space character. After doing so, loop through each dimension of the array. If the current dimension (in upper or lower case) equals the "bad word" (in upper or lower case), then replace it with the filter. After going through the array, join all the dimensions back together with the space between.

it's not great, but it works

Chriso

Splitting it by space wouldn't work, what if someone said cockfag instead of just "cock" or "fag" nothing would happen...

Barabajagal

The best way to get cases correctly is to go through the entire string in a loop, look for Mid$(strMessage, I, 4) = "!&$%", check what case Mid$(strMessage, I - 1, 1) and Mid$(strMessage, I  + 5, 1) are (checking to make sure they're not spaces, and going one step further if they are, repeated), and set the case to that.

Also, if I recall, Chriso, I posted all these on Brutalnet and you added it to Mirage chat as well ;D

rabbit

Also note that if a message is ONLY a censored word, your function will assume it's uppercase.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Spht

Quote from: iNsaNe on November 01, 2007, 09:55 PM
why don't u just set strMessage to upper or lower so you avoid case sensitivity all together?

It's not an issue of case sensitivity. He's trying to determine the caps of the censored word to begin with, which is not only impossible, but rather redundant to even guess

Barabajagal

Rabbit, the current function I wrote does NOT assume it's upper case. Try it.