Jump to content
Korean Random
StranikS_Scan

PjOrion - редактирование, компиляция, декомпиляция, обфускация модов (Версия: 1.3.5 Дата: 11.08.2019)

Пользуетесь ли вы Орионом?  

314 members have voted

You do not have permission to vote in this poll, or see the poll results. Please sign in or register to vote in this poll.

Recommended Posts

Я что то не пойму , лорг даёт ошибку File "scripts/client/AreaDestructibles.py", line 956, но в файле всего 922 строки , это значит что Орион не до конца декомпелирует скрипт ?

Трассировку полностью запости...

Share this post


Link to post

Short link
Share on other sites

Трассировку полностью запости...

не хотелось бы вкладывать из запретных модов , я так полагаю тут таких не любят .

Share this post


Link to post

Short link
Share on other sites

так что насчёт маршала господа, подскажите как получить pyc-байткод? :ok:

Share this post


Link to post

Short link
Share on other sites

а что на счет маршала?

import marshal, sys, os

fileName, fileExtension = os.path.splitext(sys.argv[1])

f = open(sys.argv[1], 'rb')
hdr = f.read(8)
f.close()

OldMarshalLoads = marshal.loads
def NewMarshalLoads(instring):
    f = open('%_unmarshaled.pyc' % fileName, 'wb')
    f.write(hdr)
    f.write(instring)
    f.close()
    return OldMarshalLoads(instring)
marshal.loads = NewMarshalLoads

__import__(fileName)

берешь и перехватываешь. Все элементарно, Ватсон ;)

использовать, надеюсь понимаешь как.. c:\>python hookMarshal.py script.pyc

Share this post


Link to post

Short link
Share on other sites

@fecell, это дорога в ад... теперь будут писать - у меня не работает, что делаю не так.  :shy:  

  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

Теперь потребуют подробный туториал по написанию модов. С примерами по различным направлениям.

Share this post


Link to post

Short link
Share on other sites

Теперь потребуют подробный туториал по написанию модов. С примерами по различным направлениям.

 

Я кстати FAQ пишу по тихоньку надо будет запостить. Хочу туда еще примеров понаписать с бигворлдом.

  • Upvote 7

Share this post


Link to post

Short link
Share on other sites

Я кстати FAQ пишу по тихоньку надо будет запостить. Хочу туда еще примеров понаписать с бигворлдом.

Ты ваще супер чел , пользуюсь от души твоими подсказками ! Респект !

Вига се я загнул ))) это меня дети научили  :heh:

StranikS_Scan я тебе про такий игнор ошибок говорил 

<<< Traceback (most recent call last):

<<<   File "<string>", line 10, in <module>

<<< ValueError: bad marshal data (unknown type code)

или

<<<   File "<string>", line 10, in <module>

<<<   File "", line 43, in zlib_decode

<<< zlib.error: Error -3 while decompressing data: incorrect header check

 

Мод работает но не компилируется маршал .

Edited by o-0-0-0

Share this post


Link to post

Short link
Share on other sites

Мод работает но не компилируется маршал .

хммм... в pyc 4 байта magic, еще 4 timestamp, остальное - marshalled code object. Первая ошибка - неверный код типа замаршалленых данных - скорее всего неправильное начало взял.. или конец.

Вторая - неверный заголовок - то же самое.

Share this post


Link to post

Short link
Share on other sites

Really, dunno...sad part is when you do so, python log logs...nothing

 

I think game isn't ready when we try to load them at the wrong time and thus crashes but why and when, can't say. All I know is to avoid this, you have to decorate the right function (can't recall the name exactly) and do not forget to decorate the one when you leave battle or your UI will stay here :)

 

London, Capital of Great Britain     

London is the capital of Great Britain, its political, economic, and commercial centre. It is one of the largest cities in the world and the largest city in Europe. Its population is about 8 million.

London is divided into several parts: the City, Westminster, the West End, and the East End.

The heart of London is the City, its financial and business centre. Numerous banks, offices, and firms are situated there, including the Bank of England, the Stock Exchange, and the Old Bailey. Few people live here, but over a million people come to the City to work. There are some famous ancient buildings within the City. Perhaps the most striking of them is the St. Paul's Cathedral, the greatest of English churches. It was built in the 17th century by Sir Christopher Wren. The Tower of London was founded by Julius Caesar and in 1066 rebuilt by William the Conqueror. It was used as a fortress, a royal palace, and a prison. Now it is a museum.

Westminster is the governmental part of London.

Nearly all English kings and queens have been crowned in Westminster Abbey. Many outstanding statesmen, scientists, writers, poets, and painters are buried here: Newton, Darwin, Chaucer, Dickens, Tennyson, Kipling, etc.

Across the road from Westminster Abbey is Westminster Palace, the seat of the British Parliament. The Clock Tower of the Houses of Parliament is famous for its big bell, known as "Big Ben". Buckingham Palace is the official residence of the Queen.

The West End is the richest and most beautiful part of London. It is the symbol of wealth and luxury. The best hotels, shops, restaurants, clubs, and theatres are situated there.

The Trafalgar Square is the geographical centre of London. It was named in memory of Admiral Nelson's victory in the battle of Trafalgar in 1805. The tall Nelson's Column stands in the middle of the square.

On the north side of the Trafalgar Square is the National Portrait Gallery. Not far away is the British Museum — the biggest museum in London. It contains a priceless collection of ancient manuscripts, coins, sculptures, etc, and is also famous for its library.

There are a lot of factories, workshops, and docks in the East End.

 

Edited by yaotzinv

Share this post


Link to post

Short link
Share on other sites

London, Capital of Great Britain

Хм... видимо чуваку гугл транслейт не помогает...

I understand it, and i have tried to call object creation in battle. Game crashes the same way. This shows, this is not a correct reason of client crashes. When i wrote AASMX first version, i have forgot to delete text object after battle, and it stood in hangar space, as i remember... Hangar is space too as battle map, but no physics initialized. It could be understood by reading python log (something like "loading space"). Game might not be ready while loading screen is shown. But we both think that game crashes when C module can't find something required. Maybe transmitter module is running not in correct variable namespace. I think, sys.modules difference check between scripts run as mod and script in Orion will give a part of answer.

GUI.Text() может быть создан в ангаре. Инфа соточка.) Проверял. Когда цвета в AASMX фиксил)

Альтернативный вариант: скриптовой мод-ресивер (файлик в папку с модами) и через поток в памяти передавать ему данные...

Share this post


Link to post

Short link
Share on other sites

GPCracker прикольнутся решил вспомнил вот это =)

Edited by yaotzinv
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

GPCracker прикольнутся решил вспомнил вот это =)

yaotzinv ты когда изменение координат автоприцела сделаешь ? или уже никогда , хотя б захват бы сделал .

Share this post


Link to post

Short link
Share on other sites

StranikS_Scan, а сохранение редактором переменных запланировано или все же баг?

 

Выполняем код:

text = 'bla bla'
print text

Результат конечно же bla bla. Удаляем первую строку и выполняем:

print text

Вместо ожидаемой ошибки NameError: name 'text' is not defined, результат прежний: bla bla. Это конечно же не критично, просто стало интересно. Я так понимаю принцип работы основан на Python Shell.

 

А вообще искреннее спасибо за проект.

Edited by Tester

Share this post


Link to post

Short link
Share on other sites

 

А вы команду на удаление переменной записали?

del  text
print text
Edited by StranikS_Scan
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Думаю что ожидаемые обновления (обфускация) появятся не скоро . Если вообще появятся . Надеюсь что ошибаюсь .

Share this post


Link to post

Short link
Share on other sites

Спасибо автору, за удобный инструмент.  В качестве пробного шара сделал скрипт, не позволяющий в бою открыть меню для аптечки или ремкоплекта, если нет поврежденного танкиста или модуля (многие наверно промахиваются мимо нужной кнопки..). Если подгружать в орион, все работает прекрасно. Собственно вопрос.  Как теперь сделать, чтобы он работал как отдельно взятый мод?

from gui.WindowsManager import g_windowsManager

consumablesPanel = g_windowsManager.battleWindow.consumablesPanel

_expandEquipmentSlot = consumablesPanel.expandEquipmentSlot
def  __expandEquipmentSlot(idx, tagName, entityStates):
 for k in entityStates:
  if entityStates[k] in ('destroyed', 'critical'):
   _expandEquipmentSlot(idx, tagName, entityStates)
   continue
consumablesPanel.expandEquipmentSlot = __expandEquipmentSlot

Share this post


Link to post

Short link
Share on other sites

Как теперь сделать, чтобы он работал как отдельно взятый мод?

#call original code first
def new_<className>_<classMethod>(*args, **kwargs):
    result = old_<className>_<classMethod>(*args, **kwargs)
    <new code>
    return result

#call hook code first
def new_<className>_<classMethod>(*args, **kwargs):
    <new code>
    return old_<className>_<classMethod>(*args, **kwargs)

#inject code
from <module> import <class>
old_<className>_<classMethod> = <class>.<classMethod>
<class>.<classMethod> = new_<className>_<classMethod>
Двойное подчеркивание перед именем переменных в питоне - служебный символ. Обозначает private свойство/метод класса. Для обозначения оригинала/хука лучше использовать префиксы типа old_/new_ или orig_/hook_.

 

В твоем случае:

def new_ConsumablesPanel_expandEquipmentSlot(self, idx, tagName, entityStates):
    if set(entityStates.values()) & set(['destroyed', 'critical']):
        old_ConsumablesPanel_expandEquipmentSlot(self, idx, tagName, entityStates)
    return

from gui.Scaleform.Battle import ConsumablesPanel
old_ConsumablesPanel_expandEquipmentSlot = ConsumablesPanel.expandEquipmentSlot
ConsumablesPanel.expandEquipmentSlot = new_ConsumablesPanel_expandEquipmentSlot
Компилируешь этот код в *.pyc и закидываешь в папку с модами (scripts/client/mods).

CP.zip

С ремкой норм работает.

Edited by GPCracker
  • Upvote 2
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...