M
M
Maxim Dunayevsky2014-03-17 08:38:00
Python
Maxim Dunayevsky, 2014-03-17 08:38:00

How to transcode Russian text from decompiled pyc files?

I had to do, let's say, reverse engineering. I took the decompiler of pyc files Easy Decompile. It works well, but in the output files instead of the Cyrillic alphabet, where it was, something like this:

class SpecMedGroupPupil(BaseReplicatedModel):
    '''\xd0\xa1\xd0\xb2\xd1\x8f\xd0\xb7\xd0\xba\xd0\xb0 \xd1\x81\xd0\xbf\xd0\xb5\xd1\x86\xd0\xbc\xd0\xb5\xd0\xb4\xd0\xb3\xd1\x80\xd1\x83\xd0\xbf\xd0\xbf\xd0\xb0-\xd1\x83\xd1\x87\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xba'''
    audit_log = AuditLog()
    specmedgroup = models.ForeignKey(SpecMedGroup, null = True, blank = False, db_index = True)
    pupil = models.ForeignKey(Pupil, null = True, blank = False, db_index = True)
    
    class Meta:
        verbose_name = u'\xd0\xa1\xd0\xbf\xd0\xb5\xd1\x86\xd0\xbc\xd0\xb5\xd0\xb4\xd0\xb3\xd1\x80\xd1\x83\xd0\xbf\xd0\xbf\xd0\xb0'
        verbose_name_plural = u'\xd0\xa1\xd0\xbf\xd0\xb5\xd1\x86\xd0\xbc\xd0\xb5\xd0\xb4\xd0\xb3\xd1\x80\xd1\x83\xd0\xbf\xd0\xbf\xd1\x8b'
        db_table = 'spec_med_group_pupil'

At first I tried to view the encoded strings using this resource. Sometimes it helps, but more often it gives the error "SyntaxError: JSON.parse: bad escaped character".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2014-03-17
@dunmaksim

in python console print '\xd0\xa1\xd0\xb2\xd1\x8f\xd0\xb7\xd0\xba\xd0\xb0 \xd1\x81\xd0\xbf\xd0\xb5\xd1\x86\xd0\xbc\ xd0\xb5\xd0\xb4\xd0\xb3\xd1\x80\xd1\x83\xd0\xbf\xd0\xbf\xd0\xb0-\xd1\x83\xd1\x87\xd0\xb5\xd0\xbd\xd0 \xb8\xd0\xba'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question