Register for your free account! | Forgot your password?

You last visited: Today at 11:04

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



PyLoader (Python 2.7)

Discussion on PyLoader (Python 2.7) within the Metin2 Hacks, Bots, Cheats, Exploits & Macros forum part of the Metin2 category.

Reply
 
Old   #1
 
maximus780's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 18
Received Thanks: 21
PyLoader (Python 2.7)

Simple python loader for metin2 client(or any game) that uses Python 2.7 so that you can load your scripts and import modules offered by the game that means you can use functions the game exposed to it's scripting system(bindings).

I couldn't find working loader for 2.7 so here it is.



USAGE: Place PyLoader.mix in metin2 client directory, if you want to use it as .dll then just rename it.

There is no support for compiled python(*.pyc) files and no autoload function but I'm giving you the source code so you can add this yourself!

SCAN:
Attached Files
File Type: zip PyLoader101.zip (12.6 KB, 24090 views)
File Type: zip PyLoader101_src.zip (3.5 KB, 7092 views)
maximus780 is offline  
Thanks
15 Users
Old 05/22/2016, 19:44   #2
 
elite*gold: 726
Join Date: Jul 2010
Posts: 14,233
Received Thanks: 7,914
it works with small scripts but when I try to execute longer scripts the client crashes. Any idea for a solution? the other public pyloader (v2.7) have the same problem.
noahrmal is offline  
Old 05/22/2016, 20:16   #3
 
elite*gold: 0
Join Date: Jan 2012
Posts: 3
Received Thanks: 0
I playing on Tr pvp servers there is loyein hackshield please help meeee ::
yig123it123 is offline  
Old 05/22/2016, 20:39   #4
 
KaMeR1337's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,415
Received Thanks: 5,444
Quote:
Originally Posted by 123klo View Post
it works with small scripts but when I try to execute longer scripts the client crashes. Any idea for a solution? the other public pyloader (v2.7) have the same problem.
try pyrun_simplefile
KaMeR1337 is offline  
Thanks
2 Users
Old 05/22/2016, 20:59   #5
 
maximus780's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 18
Received Thanks: 21
Quote:
Originally Posted by 123klo View Post
it works with small scripts but when I try to execute longer scripts the client crashes. Any idea for a solution? the other public pyloader (v2.7) have the same problem.
How many lines has your script that crashes the client?

I haven't experienced this issue yet. This could be either problem with python library or metin2 client.

700-1000 lines load just fine to me.

Quote:
Originally Posted by KaMeR1337 View Post
try pyrun_simplefile
PyRun_SimpleFile is missing in most of clients like it's not exported

dumpbin output:
Quote:
568 237 00115240 PyRun_AnyFile
569 238 00115260 PyRun_AnyFileEx
570 239 001144D0 PyRun_AnyFileExFlags
571 23A 00115280 PyRun_AnyFileFlags
572 23B 00115D00 PyRun_File
573 23C 00115D30 PyRun_FileEx
574 23D 00115B80 PyRun_FileExFlags
575 23E 00115D60 PyRun_FileFlags
576 23F 00116890 PyRun_InteractiveLoop
577 240 001167D0 PyRun_InteractiveLoopFlags
578 241 00116070 PyRun_InteractiveOne
579 242 00115E20 PyRun_InteractiveOneFlags
580 243 00116000 PyRun_SimpleStringFlags
581 244 00115D90 PyRun_String
582 245 00115B10 PyRun_StringFlags
maximus780 is offline  
Thanks
3 Users
Old 05/22/2016, 21:25   #6
 
elite*gold: 726
Join Date: Jul 2010
Posts: 14,233
Received Thanks: 7,914
Quote:
Originally Posted by maximus780 View Post
How many lines has your script that crashes the client?

I haven't experienced this issue yet. This could be either problem with python library or metin2 client.

700-1000 lines load just fine to me.



PyRun_SimpleFile is missing in most of clients like it's not exported

dumpbin output:
I want to load , I have a file which just imports the main script (hackbar). But this one imports about 20 other scripts. All in all there are thousands lines of code which have to be imported.

The Pythonloader from musicinstructor for python version 2.2 works fine:
->
noahrmal is offline  
Old 05/23/2016, 00:09   #7
 
maximus780's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 18
Received Thanks: 21
I haven't checked your mod yet but I've checked pythonloader you mentioned and it uses PyRun_SimpleFile and PyRunSimpleString. Those functions are high level functions to low level python PyRun_File(more specifically PyRun_FileExFlags, PyParser_ASTFromFile) and PyRun_String(deeper PyRun_StringFlags and very low-level PyParser_ASTFromString) you can find them

Metin2 client bundles custom version of python27.dll which replaces PyModule_GetDict with PyForModule_GetActualDictionary and some Py_ForProgramAddActualName, this is just for confusion but it's exactly the same.

I've tried replacing PyRun_SimpleStringFlags with PyRun_File but the game closes, maybe memory is protected? I will let you know if I find more clues but I rarely find time for playing with games.

The logic behind loading python scripts from file:


Quote:
m = PyImport_AddModule("__main__");
if (m == NULL)
return -1;
d = PyModule_GetDict(m);
.....
v = PyRun_FileExFlags(fp, filename, Py_file_input, d, d,
closeit, flags);
Attached my messy code lol with few different options.

Have fun
Attached Files
File Type: zip dllmain.zip (2.0 KB, 666 views)
maximus780 is offline  
Old 05/23/2016, 08:44   #8
 
KaMeR1337's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,415
Received Thanks: 5,444
Quote:
Originally Posted by maximus780 View Post
Metin2 client bundles custom version of python27.dll which replaces PyModule_GetDict with PyForModule_GetActualDictionary and some Py_ForProgramAddActualName, this is just for confusion but it's exactly the same.
thats why my multihack crashes on some pserver i suppose
KaMeR1337 is offline  
Old 05/23/2016, 15:53   #9
 
maximus780's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 18
Received Thanks: 21
123klo: please check this version if it crashes to you. I'm trying to mimic here m2 way of loading python scripts.

also check this script and run it with loader and see what happens:

Quote:
filename = 'yourscript.py'

f = open(filename, 'r')
content = f.read()
# or exec(compile(content, filename, 'exec'));
exec(content);
Attached Files
File Type: zip PyLoader_experimental.zip (17.3 KB, 592 views)
maximus780 is offline  
Old 05/23/2016, 16:07   #10
 
elite*gold: 0
Join Date: Mar 2011
Posts: 66
Received Thanks: 13
I can't load Klo's multihack on Tsuyoshi2

Even not with the new experimental version

MasterGamer1 is offline  
Old 05/23/2016, 17:11   #11
 
maximus780's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 18
Received Thanks: 21
Quote:
Originally Posted by MasterGamer1 View Post
I can't load Klo's multihack on Tsuyoshi2

Even not with the new experimental version

Please try updated one. It looks like in your client this function is not renamed. I have added a fallback for old one.
Attached Files
File Type: zip PyLoader_experimental2.zip (17.4 KB, 518 views)
maximus780 is offline  
Old 05/23/2016, 17:40   #12
 
elite*gold: 0
Join Date: Mar 2011
Posts: 66
Received Thanks: 13
how do I type in the filename?



I swear to ***, you're my hero if you can make Klo123's bot work on that.
MasterGamer1 is offline  
Old 05/23/2016, 19:10   #13
 
maximus780's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 18
Received Thanks: 21
Fixes crashes on 123klo's mod and probably in other scripts too. I will include the source code as soon as I refactor the code.

EDIT: I've got report, there was some problem where you couldn't insert commands for example on Metin2.SG. That's fixed already. See first post for an update.

Quote:
Originally Posted by MasterGamer1 View Post
how do I type in the filename?

You can type in the filename now. Download updated dll.
maximus780 is offline  
Old 05/23/2016, 23:16   #14
 
elite*gold: 0
Join Date: Mar 2011
Posts: 66
Received Thanks: 13
Still doesn't work on Tsuyoshi2



Edit: Maybe Klo123 could help on this as well. Would be AMAZING to see his great hack working again
MasterGamer1 is offline  
Old 05/24/2016, 12:40   #15
 
elite*gold: 726
Join Date: Jul 2010
Posts: 14,233
Received Thanks: 7,914
Quote:
Originally Posted by MasterGamer1 View Post
Still doesn't work on Tsuyoshi2



Edit: Maybe Klo123 could help on this as well. Would be AMAZING to see his great hack working again
try to open the file "syser.txt" of your metin2 client and post the content here. Anyway the latest m2kmod version wont work for 2.7 clients at the moment because they are only compiled for 2.2 client. But on 01.06 I will release an update for 2.7 and some other features.

the latest version of maximus780 works with m2kmod now (wait for the update next week)
noahrmal is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Python Frage] Python aus Clienten importieren
04/23/2016 - Metin2 Private Server - 16 Replies
Guten Tag. Ich habe eine kleine Frage. Da ich es selber nicht verstehe und mit Python einfach nichts kann, frage ich mal wieder euch lieben, da ihr mir bis jetzt immer geholfen habt. Ich möchte meinen Skript im Spiel testen ohne die .epk und .eix dauernd zu verpacken/entpacken. Deshalb möchte in in die Game.py in der root.epk eine Art Pfad importieren. Das heißt, ich will es ungefähr so machen: https://i.gyazo.com/9875d4bbe00655e4af5efbe19789c e14.png Natürlich ist dies nur ein...
[Python-Modul]EXP-Donator (kompatibel mit Python Loader)
11/23/2013 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 27 Replies
Moin, da man mich danach gefragt hat und ich sowieso mal ein Beispiel für die Benutzung meines Python Loaders veröffentlichen wollte, habe ich die Gelegenheit genutzt und euch eben einen EXP-Spendebot geschrieben. Man kann ihn einfach mit dem oben verlinkten Python Module Loader laden und ihn mit F5 aktivieren/deaktivieren. Sobald ihr mehr als 99 Erfahrungspunkte habt (man kann nur in 100er Schritten spenden), werden alle Erfahrungspunkte an eure Gilde gespendet. Wer Lust hat und...
Help to make a python file works with python loader
03/03/2013 - Metin2 - 2 Replies
Hey epvp! I want make a very. Little hack works on pythonn loader can anybody help me please?
Metin2 - Python - Wie Python Hacks verschlüsseln und Server überprüfen (GF/PServe)
09/23/2012 - Metin2 - 2 Replies
Ich wollte fragen, wie man Python Hacks am besten Verschlüsselt ? und wie man feststellen kann ob man auf einem GF / Pserver spielt. ?
Python + Eric Python IDE installieren ?!
07/05/2011 - General Coding - 0 Replies
hat sich erledigt.



All times are GMT +2. The time now is 11:04.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.