Raised This Month: $51 Target: $400
 12% 

Lysis: An experimental .smx decompiler


Post New Thread Reply   
 
Thread Tools Display Modes
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 03-09-2013 , 10:21   Re: Lysis: An experimental .smx decompiler
Reply With Quote #151

I've updated the site with changes from Peace-Maker to address some of the issues in the last few posts.

Quote:
Originally Posted by GibloeDelo View Post
Why not decompile files?
error: /* Lysis timeout. */
The server isn't very powerful, and some plugins will timeout to prevent the process from running too long. You can decompile locally or post the smx in this thread for help.
__________________

Last edited by GoD-Tony; 03-09-2013 at 12:59.
GoD-Tony is offline
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 04-09-2013 , 19:21   Re: Lysis: An experimental .smx decompiler
Reply With Quote #152

Quote:
Originally Posted by GoD-Tony View Post
You can decompile locally or post the smx in this thread for help.
First install the suite to compile the thing, more junk on the computer ...
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
Oliveboy
Member
Join Date: Feb 2010
Old 04-14-2013 , 15:51   Re: Lysis: An experimental .smx decompiler
Reply With Quote #153

Guys, I want to use this decompiler to decompile an smx files. Now I do have the include files and the .sp files that are include in the smx files.

So there is an geo.smx file which includes a bunch of .inc files that i have and also some other .sp files which i also have. The only file i dont have is the geo.sp file. Is it possible to decompile this file in a proper fashion?

Greetz, Oliveboy.
Oliveboy is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 04-14-2013 , 16:26   Re: Lysis: An experimental .smx decompiler
Reply With Quote #154

Quote:
Originally Posted by Oliveboy View Post
Guys, I want to use this decompiler to decompile an smx files. Now I do have the include files and the .sp files that are include in the smx files.

So there is an geo.smx file which includes a bunch of .inc files that i have and also some other .sp files which i also have. The only file i dont have is the geo.sp file. Is it possible to decompile this file in a proper fashion?

Greetz, Oliveboy.
You'll have to strip out the functions and globals you know of the included files manually. The file names of the included files are stored inside the .smx including the information which function is defined in which file. (.dbg.lines and .dbg.files sections)

You can check the filenames e.g. here at the bottom. I'll see, if i can add the file and line next to the function names.
http://wcfan.de/diverse/spfile.php

Edit: Added the file where the function is defined and the line number next to the function name, but the line numbers are off by some random value sometimes, showing a higher line number than it's actually in the file. That seems to be a problem with the compiler somewhere? Checking the address of the function against the line numbers in the sourcefile differ.
__________________

Last edited by Peace-Maker; 04-14-2013 at 18:33.
Peace-Maker is offline
Oliveboy
Member
Join Date: Feb 2010
Old 04-16-2013 , 16:45   Re: Lysis: An experimental .smx decompiler
Reply With Quote #155

Quote:
Originally Posted by Peace-Maker View Post
You'll have to strip out the functions and globals you know of the included files manually. The file names of the included files are stored inside the .smx including the information which function is defined in which file. (.dbg.lines and .dbg.files sections)

You can check the filenames e.g. here at the bottom. I'll see, if i can add the file and line next to the function names.
http://wcfan.de/diverse/spfile.php

Edit: Added the file where the function is defined and the line number next to the function name, but the line numbers are off by some random value sometimes, showing a higher line number than it's actually in the file. That seems to be a problem with the compiler somewhere? Checking the address of the function against the line numbers in the sourcefile differ.
How do I manage this. I'm just a noob. Would be nice to know how to do this!
Oliveboy is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-16-2013 , 16:48   Re: Lysis: An experimental .smx decompiler
Reply With Quote #156

Quote:
Originally Posted by Peace-Maker View Post
but the line numbers are off by some random value sometimes, showing a higher line number than it's actually in the file. That seems to be a problem with the compiler somewhere? Checking the address of the function against the line numbers in the sourcefile differ.
I believe they are computed post-preprocessor, hence the discrepancy.
__________________
asherkin is offline
StoneWolf
New Member
Join Date: Mar 2013
Old 04-17-2013 , 07:27   Re: Lysis: An experimental .smx decompiler
Reply With Quote #157

A thousand THANKS, BAILOPAN.

I lost the source code of my plugin and was able to recover all of it. Though, I had to edit Lysis' code a bit. Just to let you guys know, if you ever get this error : "ERROR! unknown operator", try adding the unknown operator to NodeRewriter.cs, in the "visit" function, at switch (op). This may break things, I didn't look at 95% of Lysis' code, but for me it just worked. I added this :
PHP Code:
case "==":
    
spop SPOpcode.eq;
    break; 
to the switch, though this case probably isn't in the switch for a reason.

By the way, I found something that looks wrong in Instructions.cs, in the function replaceSuccessor ; please correct me if I'm wrong, but shouldn't this :
PHP Code:
if (== 0)
    
defaultCase_ block;
cases_[1].target block
be :
PHP Code:
if (== 0)
    
defaultCase_ block;
else
    
cases_[1].target block
?

Last edited by StoneWolf; 04-17-2013 at 07:34.
StoneWolf is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 04-17-2013 , 13:14   Re: Lysis: An experimental .smx decompiler
Reply With Quote #158

Quote:
Originally Posted by StoneWolf View Post
A thousand THANKS, BAILOPAN.

I lost the source code of my plugin and was able to recover all of it. Though, I had to edit Lysis' code a bit. Just to let you guys know, if you ever get this error : "ERROR! unknown operator", try adding the unknown operator to NodeRewriter.cs, in the "visit" function, at switch (op). This may break things, I didn't look at 95% of Lysis' code, but for me it just worked. I added this :
PHP Code:
case "==":
    
spop SPOpcode.eq;
    break; 
to the switch, though this case probably isn't in the switch for a reason.

By the way, I found something that looks wrong in Instructions.cs, in the function replaceSuccessor ; please correct me if I'm wrong, but shouldn't this :
PHP Code:
if (== 0)
    
defaultCase_ block;
cases_[1].target block
be :
PHP Code:
if (== 0)
    
defaultCase_ block;
else
    
cases_[1].target block
?
If you want to use lysis locally i'd recommend checking the current bug tracker. There are several patches already to fix and enhance functionality.

For the operations with Float's check here and the second one here.

GoD-Tony's online version posted in the first pages of this thread does have all those patches included too.
__________________
Peace-Maker is offline
BAILOPAN
Join Date: Jan 2004
Old 04-18-2013 , 04:07   Re: Lysis: An experimental .smx decompiler
Reply With Quote #159

stonewolf: I'm really glad this helped! At a glance, both of your fixes look good to me.

Peace-Maker: If you want I can move Lysis off to github, or we can get you checkin access to AM HG. I shouldn't be holding up your patches and I'm not maintaining Lysis.
__________________
egg

Last edited by BAILOPAN; 04-18-2013 at 04:09.
BAILOPAN is offline
Oliveboy
Member
Join Date: Feb 2010
Old 04-24-2013 , 17:36   Re: Lysis: An experimental .smx decompiler
Reply With Quote #160

Can you add smlib to your online decompiler?
Oliveboy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode