Supreme Commander Script Extender

Post here if you want to help developing something for FAF.

Supreme Commander Script Extender

Postby PattogoTehen » 12 Nov 2013, 15:35

found this cool project at: http://forums.gaspowered.com/viewtopic.php?t=37615

summary from the original author, Mesenion:
...So it can be possible implement some CPU-intensive functions on C\C++, register this function as a library (see library "math" in Lua, for example) and call them directly from Lua...


it didnt worked with faf's FA.exe so i had to patch it.

patch diff
Code: Select all
# HG changeset patch
# User fafafaf
# Date 1384261829 -3600
#      Tue Nov 12 14:10:29 2013 +0100
# Node ID 323446b228064b134ae76b4af83ac5755fe949a4
# Parent  d381dff72f6bafefd2ade10fb2cd0cc93222cc73
fixes for faf compatibility

diff -r d381dff72f6b -r 323446b22806 scse_loader/scse_loader.cpp
--- a/scse_loader/scse_loader.cpp   Tue Nov 12 14:02:02 2013 +0100
+++ b/scse_loader/scse_loader.cpp   Tue Nov 12 14:10:29 2013 +0100
@@ -119,6 +119,12 @@

         switch(checksum)
         {
+        case 0x03b0b4ab: // FAF version
+            printf("Found Supreme Commander Forged Alliance FAF version.\n");
+            *hookAddr = 0x0090ab5d;
+            printf("Address for hook: 0x%08x.\n", *hookAddr);
+            return true;
+
         case 0x84b9e832: // Supreme Commander Forged Alliance 1.5.3599 official version
             printf("Finded Supreme Commander Forged Alliance 1.5.3599 version.\n");
             *hookAddr = 0x0090a3bd;
diff -r d381dff72f6b -r 323446b22806 scse_lualinker/LuaLinker.cpp
--- a/scse_lualinker/LuaLinker.cpp   Tue Nov 12 14:02:02 2013 +0100
+++ b/scse_lualinker/LuaLinker.cpp   Tue Nov 12 14:10:29 2013 +0100
@@ -22,6 +22,10 @@

         switch(checksum)
         {
+        case 0x03b0b4ab: // FAF version
+            log.LogMessage("Found FAF version. Setting up base\n");
+            base = 0x7a0;
+
         case 0x84b9e832: // Supreme Commander Forged Alliance 1.5.3599 official version
             log.LogMessage("Finded Supreme Commander Forged Alliance 1.5.3599 version.\n");



compiled files attached:
Attachments
scse_1.0.0.2alpha_faf.zip
patched for faf
(14.78 KiB) Downloaded 158 times
My FAF projects:
LiveStreamer Launcher, Online Replay Analyzer, Replay Syncer, Custom FAF client

Paypal: pattogotehen at outlook.com
PattogoTehen
Avatar-of-War
 
Posts: 70
Joined: 29 Aug 2013, 19:19
Has liked: 0 time
Been liked: 44 times
FAF User Name: PattogoTehen

Re: Supreme Commander Script Extender

Postby snooc » 13 Dec 2016, 00:20

How was it possible to get all these addresses? O_o

And.. is this currently being used by FAF?
snooc
 
Posts: 5
Joined: 12 Dec 2016, 18:19
Has liked: 3 times
Been liked: 2 times
FAF User Name: silentsnooc


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest