Need documentation for runecl.

Bug reports and feature requests. New features can only be added to the current development version. Bug-fixes may be back-ported.

Current release: 099 / Current development: 100
Post Reply
Yukiko
Distro Developer
Posts: 2525
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Need documentation for runecl.

Post by Yukiko » Mon Dec 11, 2017 1:12 am

I am trying to help my son with a problem. He is working on a project to help another shard and they are missing some SRC files for their shard. It was suggested by a Core developer that we try runecl, using switch -v, for a clue as to what those scripts do so my son can try to recreate them as SRC files. He was having problems with runecl. As that shard is running an earlier version of the Core I decided to see if I could get runecl to work on a compiled file from the Distro under the current Core. My thoughts were that perhaps his version of runecl was bugged. I could not get runecl to execute properly. As you can see from the output below one error is that it cannot find module uo.
Here is what I entered at the command line and the corresponding output from runecl:

Code: Select all

D:\DistroDev2\scripts>runecl -v D:\DistroDev2\scripts\misc\logon.ecl
EScript Executor v1.12
Copyright (C) 1993-2016 Eric N. Swanson

WARNING: D:\DistroDev2\scripts\misc\logon.ecl: Unable to find module uo
Assertion Failed: prog_ok_, executor.cpp, line 3448
failed to open logfile log/start.log

##########################################################
Current StackBackTrace
(function-name not available) - 0x140087957
  (filename not available)
(function-name not available) - 0x1400856af
  (filename not available)
(function-name not available) - 0x14006be3a
  (filename not available)
(function-name not available) - 0x14006b992
  (filename not available)
(function-name not available) - 0x1400495bd
  (filename not available)
(function-name not available) - 0x1400399f3
  (filename not available)
(function-name not available) - 0x1400395a0
  (filename not available)
(function-name not available) - 0x140038cdf
  (filename not available)
(function-name not available) - 0x140083328
  (filename not available)
(function-name not available) - 0x14003a413
  (filename not available)
(function-name not available) - 0x14008df39
  (filename not available)
BaseThreadInitThunk - 0x7ffe55bc1fe4
  (filename not available)
RtlUserThreadStart - 0x7ffe5845ef91
  (filename not available)
##########################################################
getaddrinfo() failed for "polserver.com" due to "Either the application has not called WSAStartup, or WSAStartup failed. "(code: 10093)
This is using the latest Core build.
If I am doing something wrong PLEASE tell me.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

bodom
POL Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Need documentation for runecl.

Post by bodom » Mon Dec 11, 2017 2:10 am

Some time ago, I wrote an escript decompiler.

Basically, it takes and .ecl and gives you back and .src and .inc (doing some guessing for the .inc part).

Bad news is that it was meant for POL093, so it will not work on POL099, good news is that to make it work, you should only need to remap tokens in bytecode (since during the years, somebody instead of adding new tokens at the end, inserted them in the middle, shifting everything up/down): that should be doable in a few hours of Python coding.

PM me if you need it.

Sgt Shagrat
New User
Posts: 2
Joined: Sat Sep 17, 2016 3:27 am

Re: Need documentation for runecl.

Post by Sgt Shagrat » Tue Dec 04, 2018 3:05 am

bodom wrote:
Mon Dec 11, 2017 2:10 am
Some time ago, I wrote an escript decompiler.

Basically, it takes and .ecl and gives you back and .src and .inc (doing some guessing for the .inc part).

Bad news is that it was meant for POL093, so it will not work on POL099, good news is that to make it work, you should only need to remap tokens in bytecode (since during the years, somebody instead of adding new tokens at the end, inserted them in the middle, shifting everything up/down): that should be doable in a few hours of Python coding.

PM me if you need it.
Hi Bodom,
I found this thread searching for an Escript decompiler
I'm working on an old POL93, can you help me with this tool you wrote? I would be grateful :)

bodom
POL Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Need documentation for runecl.

Post by bodom » Tue Dec 04, 2018 6:42 pm

Since many people have been asking, I've just chosen to publish it.

There are two branches: the master works on POL093. The "untested" should work on POL096.

If you make improvements, you are welcome to contribute back.

ThisIsMe
Distro Developer
Posts: 68
Joined: Sun Jul 17, 2016 1:29 am
Contact:

Re: Need documentation for runecl.

Post by ThisIsMe » Tue Dec 04, 2018 9:48 pm

bodom wrote:
Tue Dec 04, 2018 6:42 pm
Since many people have been asking, I've just chosen to publish it.

There are two branches: the master works on POL093. The "untested" should work on POL096.

If you make improvements, you are welcome to contribute back.
I can assure you the 096 version works swimmingly, there is some cleanup involved but it will get the job done.

When I say cleanup I mean, you likely can not just decompile an ecl and just compile the src file and have it run, you will need to cleanup some extra stuff near the top of the src file but it is not incredibly difficult to know which of these things does not fit in.

Thanks again Bodom and Turley for the help on my dilemma.

User avatar
Ciechu
New User
Posts: 23
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

Re: Need documentation for runecl.

Post by Ciechu » Wed Dec 05, 2018 7:39 am

This decompilator is that thing I was waiting for 18 years. Is there any solution to decompile 095 files? When I try, I got msg that ecl version is 3.

It will save my time. We make a new copy of old shard, which was great in Poland in 2004 year.

Thank you, for your work.
"Live Fast, Die Fast"
- GG Allin

bodom
POL Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Need documentation for runecl.

Post by bodom » Wed Dec 05, 2018 7:49 am

Try the 096 "untested" branch. It has no limitation on src version, and it should work fine.

The 093 "master" version has been tested to (almost always) produce a source file that, when compiled back, matches exactly the original decompiled binary file.

User avatar
Ciechu
New User
Posts: 23
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

Re: Need documentation for runecl.

Post by Ciechu » Wed Dec 05, 2018 8:02 am

Hello,

untested branch says it's not a pol093 version (in source file != 5), when I change this for example 3, there is no result (just blank lines)

Thanks,
"Live Fast, Die Fast"
- GG Allin

bodom
POL Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Need documentation for runecl.

Post by bodom » Wed Dec 05, 2018 8:13 am

It then probably needs some modifications to work for POL095.

Sgt Shagrat
New User
Posts: 2
Joined: Sat Sep 17, 2016 3:27 am

Re: Need documentation for runecl.

Post by Sgt Shagrat » Wed Dec 05, 2018 12:14 pm

bodom wrote:
Tue Dec 04, 2018 6:42 pm
Since many people have been asking, I've just chosen to publish it.

There are two branches: the master works on POL093. The "untested" should work on POL096.

If you make improvements, you are welcome to contribute back.
Thank you so much for this!

May I use Python on windows to run the decompiler or I need a linux distro?

Thanks in advance

bodom
POL Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Need documentation for runecl.

Post by bodom » Wed Dec 05, 2018 12:21 pm

I have never tested it under Windows, but i always write my scripts with OS portability in mind, so it should work with latest python3 for Windows.

If it doesn't, then it should be a matter of fixing a couple of lines of code.

Yukiko
Distro Developer
Posts: 2525
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Need documentation for runecl.

Post by Yukiko » Thu Dec 06, 2018 5:24 pm

It works on Windows just fine as I recall.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Post Reply