views:

262

answers:

3

I have 2 .pyo python files that I can convert to .py source files, but they don't compile perfectly as hinted by decompyle's verify.

Therefore looking at the source code, I can tell that config.pyo simply had variables in in an array:

ADMIN_USERIDS = [116901, 141, 349244, 39, 1159488]

I would like to take the original .pyo and disassembly or whatever I need to do inorder to change one of these IDs.

Or....

in model.pyo the source indicates a

if (productsDeveloperId != self.getUserId()):

All I would want to do is hex edit the != to be a == .....Simple with a windows exe program but I can't find a good python disassembler anywhere.

Any suggestions are welcomed...I am new to reading bytecode and new to python as well.

A: 

Convert the .pyo files to .py and then edit the .py and then run python on the .py files. Python will regenerate the .pyo files Don't edit the pyo

I don't know the python bytecode but I would doubt that the strings == or 1= would appear in the .pyo file

Although a much better way is get the original .py files and use them. If they give the wrong program as implied by wanting to change != to == then you could ask the supplier to fix the bug.

Mark
A: 

This is Brian, the question asker.

I have completed what I needed to do by just trial and error and hex editing, hex edit...then convert the source...see what I changed..until I finally narrowed down what I was looking for. The constants (Admin IDs) were in the hex file as converted hex (obviously) but backwards.

I still have no idea how or where I'd find the !=

I heard IDA Pro newest version supports python, but I havent learned how to get python to work on it.

Brian
A: 

IDA up to 6.0 doesn't have a .pyc decompilation module.

Vlad