tag:blogger.com,1999:blog-977684764667858073.post430074610548497679..comments2024-02-09T21:43:15.143+00:00Comments on /bɑs ˈtjɛ̃ no ˈse ʁɑ/ (hadess) | News: Python code obfuscationBastien Nocerahttp://www.blogger.com/profile/14621847888418739807noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-977684764667858073.post-73806299808819507912011-07-07T17:43:04.572+01:002011-07-07T17:43:04.572+01:00That looks like it was done with pyobfuscate. Whic...That looks like it was done with pyobfuscate. Which is open source and not obfuscated itself, so you could probably figure out how it works and modify it to reverse the obfuscation faster than you could puzzle it out.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-977684764667858073.post-53035509045769815442010-06-17T02:15:53.810+01:002010-06-17T02:15:53.810+01:00krkhan: probably because they don't want peopl...krkhan: probably because they don't want people to link directly to their video feeds without going through their website and tons of adverts...Bastien Nocerahttps://www.blogger.com/profile/14621847888418739807noreply@blogger.comtag:blogger.com,1999:blog-977684764667858073.post-44992599593146346842010-06-17T02:01:31.153+01:002010-06-17T02:01:31.153+01:00Why would anyone do that is beyond me :s<i>Why</i> would anyone do that is beyond me :sAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-977684764667858073.post-88145723020273288622010-06-16T23:06:31.245+01:002010-06-16T23:06:31.245+01:00Anonymous: thanks, but there's at least a 100 ...Anonymous: thanks, but there's at least a 100 lines of obfuscated code like that in the tarball.Bastien Nocerahttps://www.blogger.com/profile/14621847888418739807noreply@blogger.comtag:blogger.com,1999:blog-977684764667858073.post-53505900849892371142010-06-16T22:48:38.842+01:002010-06-16T22:48:38.842+01:00Really, that's vile... let's see what it d...Really, that's vile... let's see what it does...<br /><br />Line 1, we're using urllib to open a url, and in line 2, reading content from it.<br /><br />In line 3, we appear to be replacing / characters in a path with the platform's path separator (thus redundant on Unix) and appending it to the current directory. Which on the 4th line, we split on the path separator, to give a list of directory names.<br /><br />In marginally more readable form:<br /><br />fp = urllib.urlopen(data[list])<br><br />urlContent = fp.read()<br><br />path = os.getcwd() + data[list+1].replace("/", os.sep)<br><br />pathElements = path.split(os.sep)<br><br /><br /><br />Just *why* it's doing all this, I've no idea.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-977684764667858073.post-84255491743332929682010-06-16T14:51:22.627+01:002010-06-16T14:51:22.627+01:00Wonderful. :)Wonderful. :)Mattiashttps://www.blogger.com/profile/10304242597338667720noreply@blogger.com