• Welcome to Valhalla Legends Archive.
 

UnCensor() Method Code

Started by Joe[x86], March 20, 2005, 08:46 PM

Previous topic - Next topic

Ban

Quote from: Adron on March 22, 2005, 11:05 AM
Quote from: Ban on March 22, 2005, 09:38 AM
Or perhaps they just bashed random shift-numbers until they came up with a string of similiar length. If they had changed the length of the string the point of the original message would have never been gotten across; some things are needed to properly understand some sentences/messages

Or if they had changed the length of the message, they would have had to copy the resultant string to a new position in memory, incurring a performance loss. By ensuring that the replacement strings are the same length as the original strings, they can just overwrite the censored words inplace.

Good point, I failed to consider that.

Quote
But it might only appear so because of the small character range given.

I would think that is more than likely,  as there are only 6 characters used in the replacements...

R.a.B.B.i.T

To solve replacement issues: replace the longest words first.

@Lenny: You only need to check in public channels, which cuts the actual amount of filtering down.

Adron

Quote from: rabbit on March 24, 2005, 04:28 PM
To solve replacement issues: replace the longest words first.

Hmm, so this would work?


        message = message.replaceAll("&@$%&#$@%", "masturbat");
        message = message.replaceAll("@$%!@%&",   "asshole");
        message = message.replaceAll("@$%!@!&",   "asswipe");
        message = message.replaceAll("%&$#@#!",   "lesbian");

        message = message.replaceAll("!@!@!%",    "faggot");
        message = message.replaceAll("!@!@&#",    "nigger");
        message = message.replaceAll("!@!@%&",    "nipple");
        message = message.replaceAll("!#!@$&",    "orgasm");
        message = message.replaceAll("!@!@!@",    "vagina");

        message = message.replaceAll("#@%$!",     "bitch");
        message = message.replaceAll("$!@!$",     "chink");
        message = message.replaceAll("%@%&!",     "dildo");
        message = message.replaceAll("&#&$%",     "erect");
        message = message.replaceAll("!@!@#",     "nigga");
        message = message.replaceAll("!&!@$",     "penis");
        message = message.replaceAll("!&$%@",     "pussy");
        message = message.replaceAll("!@!#&",     "whore");

        message = message.replaceAll("$%@%",      "clit");
        message = message.replaceAll("$!$%",      "cock");
        message = message.replaceAll("$&!%",      "cunt");
        message = message.replaceAll("%@$%",      "dick");
        message = message.replaceAll("!&$%",      "fuck");
        message = message.replaceAll("!@!$",      "gook");
        message = message.replaceAll("$@$&",      "kike");
        message = message.replaceAll("$%&!",      "klux");
        message = message.replaceAll("$!@%",      "shit");
        message = message.replaceAll("$%&%",      "slut");

        message = message.replaceAll("$%$",       "kkk");


Try it on "vaginaerect"?

Lenny

Regardless, it would still be a waste of server perfomance.  And if Adron is correct, they're trying to optimize something that isn't necessary.

But I personally think an 'uncensor()' method is a novelty feature that bots need not have. 

Why battle.net chose to have a distinct censor pattern for each word is beyond me. 

The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Warrior

What would be funny is if they just put random letters together and some of you are boggling your minds for nothing :P
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Joe[x86]

#20
Quote from: MyndFyre on March 21, 2005, 06:36 PM
Quote from: iago on March 21, 2005, 06:33 PM
Quote from: MyndFyre on March 21, 2005, 06:29 PM
Instead of making a scornful remark

I'd call it a "joke".  He's said the same thing to me before :)

I would generally agree, except that he didn't actually incorporate your suggested change, which I think would have been, mm, 6 lines?  :P

Thats because I haven't had time. 3rd quarter just ended at my school, and I had about a month's worth of homework (I never did any of it when it was asigned) over the past few days. I was just joking, and I asumed that nobody would take it as a "scornful remark". Its just the kind of thing iago and I do.


@LoRd[nK]: Good to know you have nothing better to do than to try to shit on the little guy's day. Atleast I give credit for other's work incorporated into mine. Also, my code is nicely tabbed and easy to follow, unlike your wonderful code.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

iago

Quote from: Joey on March 24, 2005, 08:20 PM
I was just joking, and I asumed that nobody would take it as a "scornful remark". Its just the kind of thing iago and I do.
That's what I said :P

Quote@LoRd[nK]: Good to know you have nothing better to do than to try to shit on the little guy's day. Atleast I give credit for other's work incorporated into mine. Also, my code is nicely tabbed and easy to follow, unlike your wonderful code.
Let's be nice here, children; if you want to be mad then take it to PM.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Joe[x86]

I'll shut my mouth if he shuts his. I'm done for now. I just wanted to remind him he hasn't exactly perfect either.

Due to the emmence ammount of work it takes to post every single update at a good 5 forums, the code updates will only be posted here. Thanks to everyone for their suggestions.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

iago

Quote from: Joey on March 24, 2005, 08:51 PM
I'll shut my mouth if he shuts his. I'm done for now. I just wanted to remind him he hasn't exactly perfect either.

Far from it, but this is the wrong place to get into it.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*