[Python] Modules after GameForge-Update (01.10.2013)

10/02/2013 19:17 Mi4uric3#1
Good afternoon Elitepvpers.
The update from the 01.10.2013 has changed a few things in the Metin2Client concerning Python.
Some Pythonmodules have been removed from the Root-Eterpack and were moved directly into the client-executable.

Dump:

Important for making Clientmods work again are the functions:
Code:
rootlib.isExist(char* moduleName)
rootlib.moduleImport(char* moduleName)
They can be used like this:
Code:
import rootlib
moduleName = "playerSettingModule"
if rootlib.isExist(moduleName):
	module = rootlib.moduleImport(moduleName)
The available modules are:
Code:
utils
uiUploadMark
uiTest
uiSystemOption
uiselectitem
uiRestart
uiRefine
uiQuest
uiPointReset
uiPlayerGauge
uiPickMoney
uiPhaseCurtain
uiGameButton
uiExchange
uiEquipmentDialog
uiCommon
uiCandidate
uiAttachMetin
system
Prototype
playerSettingModule
musicInfo
introLogo
introLoading
exception
debugInfo
colorInfo
I didn't test it, but it should work.

€dit:
Quote:
Originally Posted by !Beni! View Post
Code:
import __builtin__, sys
from rootlib import moduleImport

org = __builtin__.__import__
def new_import(*data):
    name = data[0]
    try:
        module = moduleImport(name)
    except SystemError:
        module = org(*data)
    if module.__name__ not in sys.modules:
        sys.modules[module.__name__] = module
    return module
__builtin__.__import__ = new_import
This should work but I didn't test it as I only use my DetourFunction-Class.
This code enables using "import ui" and such things again.
(Freely translated from German by me)

HF with it,
Mi4uric3
10/02/2013 21:28 [uLow]Beni#2
Danke... hab mich gefreut das niemand das weiß :P

naja, aber für alle denen das zuviel arbeit ist:
Code:
import __builtin__, sys
from rootlib import moduleImport

org = __builtin__.__import__
def new_import(*data):
    name = data[0]
    try:
        module = moduleImport(name)
    except SystemError:
        module = org(*data)
    if module.__name__ not in sys.modules:
        sys.modules[module.__name__] = module
    return module
__builtin__.__import__ = new_import
sollte gehen ist aber so nicht getestet, da ich eigentlich nur mehr meine DetourFunction Klasse verwendet.

dieser Code ermöglicht euch wieder "import ui" und so zum machen

to lazy for english :b
10/02/2013 22:27 KaMeR1337#3
modules still can be used normal way. any method to extract them ?
10/03/2013 17:39 [uLow]Beni#4
Quote:
Originally Posted by KaMeR1337 View Post
modules still can be used normal way. any method to extract them ?
You could import the module and decompyle it.

i don't know if the sources of the root-py's are in the binary.
10/04/2013 09:10 KaMeR1337#5
they are in binary but looks like compressed or something
10/04/2013 09:55 Mi4uric3#6
Quote:
Originally Posted by KaMeR1337 View Post
they are in binary but looks like compressed or something
I will take a look at it
10/04/2013 13:01 KaMeR1337#7
Quote:
Originally Posted by Mi4uric3 View Post
I will take a look at it
is there any good method to inject python without detour ? everytime i try i get mt2 crash with bigger py codes
10/04/2013 13:23 Mi4uric3#8
Quote:
Originally Posted by KaMeR1337 View Post
is there any good method to inject python without detour ? everytime i try i get mt2 crash with bigger py codes
python27.PyRun_SimpleFile()
python27.PyRun_SimpleString()

..?
10/04/2013 15:03 noahrmal#9
I have no c++ knowledge so i have to wait until someone release a new python loader. Where are all the python modules for example in the root?
10/04/2013 15:42 Mi4uric3#10
Quote:
Originally Posted by 123klo View Post
I have no c++ knowledge so i have to wait until someone release a new python loader. Where are all the python modules for example in the root?
Versuchs mal so: Öffne die PythonLoader.dll (Name geraten) von musicinstructor mit nem Hex-Editor und ersetz jedes "python22" mit "python27" (Unicode und Ansi). Da es ja die selben Funktionsnamen sind sollte es klappen, solange die Funktionen die selben Parameter behalten haben..
10/04/2013 22:14 KaMeR1337#11
Quote:
Originally Posted by Mi4uric3 View Post
python27.PyRun_SimpleFile()
python27.PyRun_SimpleString()

..?
yeah i know but it doesn't work well and crash game a lot. sure it works good for smaller python codes but not bigger
10/07/2013 19:58 Zetsu WoC™#12
Thank you @_@ now i have a big ideea
10/10/2013 02:39 ASDFWarrior#13
Quote:
Originally Posted by KaMeR1337 View Post
yeah i know but it doesn't work well and crash game a lot. sure it works good for smaller python codes but not bigger
I`d love if you could fix it. I used to login with your Client and everything was ok, however i just got kicked within 1 min.
12/21/2013 23:58 Laben#14
friends what is bonus add "command" like "71051" and "71052" jobs command its need for me
12/22/2013 01:52 Mi4uric3#15
Quote:
Originally Posted by Laben View Post
friends what is bonus add "command" like "71051" and "71052" jobs command its need for me
I don't understand your question..