Welcome to Soldier of Fortune Community Forums
19 Oct 2018, 19:24


View unanswered postsView active topics



Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
[Release].os script decompiler v2.0 [LastUpdate:01/05] 
Author Message
Great Britain

User avatar

Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
Command line program that tries to convert .os files back into .ds file form.

Could be useful for trying to reverse or edit already existing script files.

When it doesnt' work correctly please let me know and i will try to fix it and release an updated version.

Credits: Acadie, Chin, Sauron and CheaterSkeeter.
EDit: Cleared this post up. There is now a README file supplied with the tool. Use notepad.
Current Ver : 2.0
Please find more faults if you want to improve it.


Attachments:
File comment: bugfixes
sofos_v2.0.zip [119.24 KiB]
Downloaded 17 times


Last edited by d3nd3 on 01 May 2018, 02:17, edited 22 times in total.

04 Apr 2018, 16:23
Profile
Netherlands

User avatar

Joined:
Fri May 23rd, 2014
Posts: 480
Reply with quote
Wow, how can I batch this? Preferably with output in separated folder from input but with the same folder structure.)
Got around 230 of those files nested in multiple folders.


04 Apr 2018, 19:16
Profile
Great Britain

User avatar

Topic author
Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
You'd need to write a script that can do that.  CheaterSkeeter might release one soon cos he is interested in doing something similar, you could stay tuned for that i guess, or figure it out yourself with google.

Edit. 1st argument to program is the input file, second argument is the output file, but output file is optional, and will default to decompiled.ds if left out. And i think you can pass in forwardslash and relative like ./ ../

Btw did you ever get the batch mode of sofds.exe to work? i couldnt'


04 Apr 2018, 19:49
Profile
Great Britain

User avatar

Topic author
Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
Updated 04/04/2018 23:50 v1.1 released with new feature for all math operation.


04 Apr 2018, 23:57
Profile
Great Britain

User avatar

Topic author
Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
v1.3 released, Added new features, will decompile more scripts than before, less crashes etc.


05 Apr 2018, 17:14
Profile
Israel

User avatar

Joined:
Sun Dec 04th, 2011
Posts: 384
Reply with quote
Sauron wrote:
Wow, how can I batch this? Preferably with output in separated folder from input but with the same folder structure.)
Got around 230 of those files nested in multiple folders.


Put those "230~ files nested in multiple folders" :eek: in the os folder and run the python script (v1.3 seems to be crashing on some files still)


Attachments:
v13_batch_decompile.zip [22.83 KiB]
Downloaded 17 times
06 Apr 2018, 00:37
Profile
Netherlands

User avatar

Joined:
Fri May 23rd, 2014
Posts: 480
Reply with quote
Spoiler:

It seems to have problems with decompiling these sofos.exe crashes
there where a lot more unrecognized but the python window already closed.
The file count is the same for in/out-put, might be some of them are corrupt?


Last edited by Sauron on 08 Apr 2018, 17:16, edited 1 time in total.



06 Apr 2018, 21:45
Profile
Belgium

User avatar

Joined:
Tue Nov 22nd, 2011
Posts: 1892

minato1337
Reply with quote
is this your new anti cheat dende? good thing that patience paid off


06 Apr 2018, 23:03
Profile
Canada

User avatar

Joined:
Wed Nov 23rd, 2011
Location: Kanada
Posts: 602
Reply with quote
Found an error. In the 'animation' line. Holding in seconds can't have the 'seconds' after the value

Wrong:
animate entity john performing action STD_IGUNUP_N_A_N signaling sig holding for 1.000 seconds

Right:
animate entity john performing action STD_IGUNUP_N_A_N signaling sig holding for 1.000


07 Apr 2018, 20:18
Profile
Great Britain

User avatar

Topic author
Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
@thanks acadie, @minato hehe, nice to see you're still around. @sauron .rds might be roff files, which are specific files for motion only during cinematics i believe. Haven't looked into it too much tho.  Stick to .os files only please.

cheers.


07 Apr 2018, 22:17
Profile
Great Britain

User avatar

Topic author
Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
bump: 1.4 released.


08 Apr 2018, 15:20
Profile
Canada

User avatar

Joined:
Wed Nov 23rd, 2011
Location: Kanada
Posts: 602
Reply with quote
d3nd3 wrote:
bump: 1.4 released.


The file got removed before I had the time to download it, lol.


08 Apr 2018, 16:25
Profile
Netherlands

User avatar

Joined:
Fri May 23rd, 2014
Posts: 480
Reply with quote
Attachment:
File comment: Source
dump-mappacks_os.rar [217.25 KiB]
Downloaded 14 times
Attachment:
File comment: output
dump-mappacks_ds.rar [235.03 KiB]
Downloaded 17 times
Attachment:
File comment: Single player files
SoF-Plat-ds.rar [413.92 KiB]
Downloaded 16 times
Attachment:
SoF-v0.51_demo_ds.rar [59.28 KiB]
Downloaded 13 times


08 Apr 2018, 17:14
Profile
Canada

User avatar

Joined:
Wed Nov 23rd, 2011
Location: Kanada
Posts: 602
Reply with quote
Here's two more errors:

1. Might be a tricky one because both can be applied but SIB2_INTRO.ds is an example. It should have the "to" after "by moving". It can be easier to guess when the value answers to a big vector.
animate entity sib2_commander performing action STD_WNORMAL_N_PK_A by moving [1990.000 ,1128.000 ,-344.000] signaling sig
animate entity sib2_commander performing action STD_WNORMAL_N_PK_A by moving to [1990.000 ,1128.000 ,-344.000] signaling sig

2. I don't know how this numerical value is called after a #defined variable. But there's a sequence that is wrongfully used for the animation.
#define DEATHTHROWN 6
animate entity sib2_commander performing action DEATHTHROWN holding for 2.000
-->
#define EMOTION_TALK 6
animate entity sib2_commander showing emotion EMOTION_TALK holding for 2.000


08 Apr 2018, 19:32
Profile
Great Britain

User avatar

Topic author
Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
thanks guys, i'll update it more. Btw check out the readme file in the new version.


08 Apr 2018, 23:27
Profile
Canada

User avatar

Joined:
Wed Nov 23rd, 2011
Location: Kanada
Posts: 602
Reply with quote
Here's 2 more bugs

1. Seems like the emotion problem hasn't fully fixed.
X: animate entity johntalk performing action DUCK_DN showing emotion EMOTION_TALKANGRY holding for 6.800
O: animate entity johntalk showing emotion EMOTION_TALKANGRY holding for 6.800

2. Missing the word 'entity' after a <enable/disable> trigger use
X: <enable/disable> trigger <variable>
O: <enable/disable> trigger entity <variable>


14 Apr 2018, 22:54
Profile
Great Britain

User avatar

Topic author
Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
I was under the impression that "performing action" is not an optional part of that command.  The Scripting documentation.doc suggests that.
animate entity <variable> performing action <variable / value>

And the SoF SDK also backs that up the way it extracts data.  Can you describe further why its a problem ?


15 Apr 2018, 14:29
Profile
Canada

User avatar

Joined:
Wed Nov 23rd, 2011
Location: Kanada
Posts: 602
Reply with quote
The scripting documentation doesn't mention the use of "showing emotion" which I have no idea if it was on purpose or they simply forgot.

Here's what the compiler answers simply with the line:
animate entity johntalk performing action DUCK_DN showing emotion EMOTION_TALKANGRY holding for 6.800
Spoiler:


They are two separate things. So from now, I will go by using this statement without adding the optional part except the "holding for <value>"
- animate entity <variable> showing emotion <variable / value>


15 Apr 2018, 15:22
Profile
Great Britain

User avatar

Topic author
Joined:
Fri Dec 02nd, 2011
Posts: 121
Reply with quote
Okay, I agree with you, I will fix it.


15 Apr 2018, 16:11
Profile
Canada

User avatar

Joined:
Wed Nov 23rd, 2011
Location: Kanada
Posts: 602
Reply with quote
Found two more error and one of them is not well covered in the scripting documentation.doc

1.
[ holding for <float> ]
[ holding for <variable / float> ]
I have no idea why this hasn't been explained correctly. Though, the variable must be a float number (as far I know). Maybe <float> meant to be a variable already but reading the documentation is confusing.


2.
First, I'll print what's wrong with this statement.
<float> random from [min] to [max]
<variable / float> random from [min] to [max]
Maybe <float> meant to be a variable already but reading the documentation is confusing.

Second. When I use a decimal value for "[min] to [max]", the decompiler will reverse a weird intergral value which make no sense.

Example:
Spoiler:


26 Apr 2018, 18:08
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page 1, 2  Next
Topic Views: 899


Who is online

Users browsing this forum: No registered users and 1 guest


Top
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group
www.sof1.org