Show Posts
|
|
Pages: [1] 2
|
|
1
|
Scripting / Module Releases / Fasm Module for Squirrel
|
on: April 05, 2026, 06:36:32 pm
|
The FASM Advantage: Stripping Squirrel to the Bone Why is the FASM source shorter than the C source? The official C SDK relies on a giant wrapper structure called SquirrelAPI. Every time C code calls sq->pushstring, the compiler generates code to look up an offset, dereference a pointer, and then execute. In FASM, we skip the middleman. We define the offsets (like SQ_PUSHSTRING = 0x7C) as direct constants. We aren't asking a struct where the function is; we are telling the CPU exactly where to jump. We also skip the sprintf overhead used in the C RegisterSquirrelFunc for parameter checking. The Linux Portability Factor One of the biggest strengths of writing in FASM is how close we are to the binary level. While the current source is a PE DLL for Windows, a Linux version is entirely possible with minimal effort. The cross-platform logic: On Windows, the server uses LoadLibrary() to bring the module into memory. On Linux, it uses dlopen(). To port this to a Linux-based server, we would simply: - Change the format PE header to format ELF.
- Adjust the SQLoad export to match the Linux shared object symbols (.so).
- Swap Win32-specific setup (like AllocConsole) for standard ioctl or write syscalls.
The "Direct Include" Revolution Normally, to use an external library in Squirrel, you have to write a C++ bridge and register every single function. By writing a custom Loader Module in FASM, we can hook sq_compile. Instead of registering functions one by one, the FASM module acts as a dynamic linker—using GetProcAddress (Win) or dlsym (Linux) to map exports directly into the Squirrel Root Table at runtime. This allows a script to include() a system library as if it were a native part of the VM. The Full FASM Sourceformat PE DLL at 0x10000000 entry DllMain
include 'win32ax.inc'
; ============================================================================= ; SQUIRREL API OFFSETS ; ============================================================================= SQ_GETTOP = 0x50 SQ_PUSHSTRING = 0x7C SQ_PUSHINTEGER = 0x84 SQ_PUSHBOOL = 0x88 SQ_GETINTEGER = 0xB0 SQ_SETNATIVECLOSURENAME = 0xDC SQ_PUSHROOTTABLE = 0x108 SQ_NEWSLOT = 0x11C SQ_POP = 0x44 SQ_NEWCLOSURE = 0x70
section '.data' data readable writeable sq_v dd 0 sq_ptr dd 0 szHelloName db 'Hello', 0 szHelloMsg db 'FASM: UserData retrieved successfully!', 10, 0 szSumName db 'Sum', 0 szInitMsg db 10,'--- FASM Squirrel Module Initialized Synchronously ---', 10, 0
section '.code' code readable executable
DllMain: mov eax, 1 ret 12
; ----------------------------------------------------------------------------- ; SQLoad(v, api) - Synchronous Entry Point ; ----------------------------------------------------------------------------- SQLoad: push ebp mov ebp, esp push esi push ebx
; 1. Store the VM and API pointers immediately mov eax, [ebp+8] mov [sq_v], eax mov esi, eax ; ESI = HSQUIRRELVM
mov eax, [ebp+12] mov [sq_ptr], eax mov ebx, eax ; EBX = API Pointer
; 2. Initialize Console for debugging invoke AllocConsole cinvoke printf, szInitMsg
; 3. Register "Hello" push szHelloName push Hello push esi call RegisterFunc add esp, 12
; 4. Register "Sum" push szSumName push Sum push esi call RegisterFunc add esp, 12
; 5. Return 0 (or 1 depending on LU requirements, usually 0 for success in SQ modules) xor eax, eax pop ebx pop esi pop ebp ret
; ----------------------------------------------------------------------------- ; RegisterFunc(v, func_ptr, name) ; ----------------------------------------------------------------------------- RegisterFunc: push ebp mov ebp, esp push ebx push esi
mov esi, [ebp+8] ; v mov ebx, [sq_ptr] ; api
; sq_pushroottable(v) push esi call dword [ebx + SQ_PUSHROOTTABLE] add esp, 4
; sq_pushstring(v, name, -1) push -1 push dword [ebp+16] push esi call dword [ebx + SQ_PUSHSTRING] add esp, 12
; sq_newclosure(v, func_ptr, 0) push 0 push dword [ebp+12] push esi call dword [ebx + SQ_NEWCLOSURE] add esp, 12
; sq_setnativeclosurename(v, -1, name) push dword [ebp+16] push -1 push esi call dword [ebx + SQ_SETNATIVECLOSURENAME] add esp, 12
; sq_newslot(v, -3, SQFalse) push 0 push -3 push esi call dword [ebx + SQ_NEWSLOT] add esp, 12
; sq_pop(v, 1) push 1 push esi call dword [ebx + SQ_POP] add esp, 8
pop esi pop ebx pop ebp ret
; ----------------------------------------------------------------------------- ; Sum(v) - Squirrel Function ; ----------------------------------------------------------------------------- Sum: push ebp mov ebp, esp sub esp, 8 ; Local vars for integers push ebx push esi
mov esi, [ebp+8] ; v mov ebx, [sq_ptr] ; api
; Check arg count (Stack top) push esi call dword [ebx + SQ_GETTOP] add esp, 4
cmp eax, 3 ; Root + 2 args jne .wrong_args
; Get Arg 1 (Slot 2) lea eax, [ebp-4] push eax push 2 push esi call dword [ebx + SQ_GETINTEGER] add esp, 12
; Get Arg 2 (Slot 3) lea eax, [ebp-8] push eax push 3 push esi call dword [ebx + SQ_GETINTEGER] add esp, 12
; Add mov eax, [ebp-4] add eax, [ebp-8]
; Push Result push eax push esi call dword [ebx + SQ_PUSHINTEGER] add esp, 8 jmp .finish
.wrong_args: push 0 push esi call dword [ebx + SQ_PUSHBOOL] add esp, 8
.finish: mov eax, 1 pop esi pop ebx mov esp, ebp pop ebp ret
; ----------------------------------------------------------------------------- ; Hello(v) - Squirrel Function ; ----------------------------------------------------------------------------- Hello: push ebp mov ebp, esp push ebx mov ebx, [sq_ptr] push -1 push szHelloMsg push dword [ebp+8] call dword [ebx + SQ_PUSHSTRING] add esp, 12 mov eax, 1 pop ebx pop ebp ret
SQUnload: xor eax, eax ret SQCallback: xor eax, eax ret SQPulse: xor eax, eax ret
section '.idata' import data readable library kernel32,'KERNEL32.DLL', msvcrt,'MSVCRT.DLL' import kernel32, AllocConsole,'AllocConsole' import msvcrt, printf,'printf'
section '.edata' export data readable export 'LU_Mod.dll', \ SQLoad, 'SQLoad', \ SQUnload, 'SQUnload', \ SQCallback, 'SQCallback', \ SQPulse, 'SQPulse'
section '.reloc' fixups data discardable
High Performance. Zero Bloat. Bare Metal. If anyone is interested in being able to directly load a dll inside of Squirrel and skip the standard way of importing exported functions, I can work on that very soon
|
|
|
|
|
2
|
Scripting / Script Help / Beta Draw out
|
on: September 25, 2015, 06:01:47 pm
|
 on the right hand side will be server info that can be turned on and off by a cmd. I really need help with this and im willing to waste Real Cash on this if it means paying a scripter . server will be a Free server.In game cash will be used for Gold accounts when the time comes (Already have all the scripts needed for that).. The game will have endless game play due to the XP system The Plan is,You cant enter any vehicle until you lock it same goes with weapons.There may be more to it after this finally comes toggether
|
|
|
|
|
3
|
Scripting / Script Help / XP GUI Panel
|
on: September 25, 2015, 07:44:46 am
|
|
I need help with scripting a panel for the server and don't know where to start. XP server goes by what story mode stats are. like boss,pickpocker
basically instead of RP im using XP(Experience)
any old rp gui panel script would be Nice to study. have not implemented XP points yet.:/ any help would be appreciated.. -Motley
|
|
|
|
|
4
|
Scripting / Scripting Discussion / Re: Server Help
|
on: September 24, 2015, 02:09:02 am
|
|
Thanks Theremin .
This is a second post if needed ill create a new post to be recognized.
I need server help. i want to create an XP server and ditch the cash system. °beginning XP users only allows certain car spawn and weapon pickups °possibility to have no rights to enter certain cars until you reach a certain XP for those special cars. °during levels of XP you will unlock certain weapons at ammunition , No need to hunt across the map(eventually the map will have hidden secrete weapon locations). °1 minute in the dodo equals 10 XP points each minute.(probably hard to script in lu)But thats a plan °Headshot equals a certain amount. °Each rank has a level word due to big scripting i plan on using the same rank from story mode °The server will be a free server until missions can be scripted. cash will be used to unlock spraying of police cars bust players . unlock specialty Golden Accounts for a certain amount of time(adds an inside mission to game-play) , °goto player but maybe in 40 cars distance away in . °hide on map °i plan on trying to script where you can only run like in story mode. After Gold Accounts you can run without banging up your keyboard XD .
There's going to be a lot and I debated to see if there is anyone willing to want to help . I plan on making a server to bring people back to liberty unleashed. (that is the game plan) server hosting will be in North America . There will really be no banning. mainly cmd spawn killing and frezzing informing the player not to hack if all fails these players will be Banned when im not in the server. and on return unban to re monitor these players.
°Another Plan, i plan use Cain and Abel to label who is who (Save There IP in an text document) to possibly see whos ban evaded.
Glad to see lu has a kick option compared to multiplayer a decade ago needing an ip stressor/ms dos attacks .WOW!!!!!!!!!!!!!!!!!
Why no permanet ban?
Liberty Unleashed has gotten small over the years and a lot has come down to banning and players giving up. i plan on preventing that. Unless It seriously has to come down to banning a player which ill have cain and abel to dettect the same ips returning back in the server.
I could really use a team of helpers that are at least okay in scripting and can help me make this a very good server.
-HENCE all of the servers are awesome servers not saying they are not. but the same thing gets old after a while.and something new will help players to swap around in servers
|
|
|
|
|
6
|
Liberty Unleashed / Support / Accidently Banned Myself
|
on: September 23, 2015, 01:39:14 am
|
|
Lol Yup. no better way to say it. i don't really know any other way to fix this. im not able to port forward until probable next year. i do have one more pc. i don't know if i can transfer the server over and unban myself... I just installed stoku admin panel and exceeded the amount of logins by mistake trying to /q pressed t up arrow key instead of /q lol yes pretty retarded....... Pretty noobish. I just need help with gaining full access of my server for test running.. if that's possible have not seen one forum on this XD
any help is appreciated.. -Mr_Motley
|
|
|
|
|
7
|
Off Topic / General Chat / Happened to get in touch with the owner of GGM The first ever GTA 3 Multiplayer
|
on: September 19, 2015, 07:06:42 pm
|
Basically a decade ago i use to be really hardcore into playing GGM and i Happened to notice he still powers his websites. Then realized his emails were still there.. so i figure why not try after all of these years.. I always wondered why didn't he continue his work.. --------------------------------------------------------------------------------------------- Well hear is the responce i happened to get His response to me: [GoE] Barna < [email protected]> 10:45 AM (23 hours ago) Hi there I find it amazing that your e-mail actually reached me, maybe even more amazing that you even wrote it :-) Sadly in 2004 I had a harddrive crash and lost the source code so even if I'd want to continue, I could not. But I'm sure if I had to look at source code I wrote back then, I'd get sick or something HAHA Maybe you could ask a guy nicknamed SpYder, who continued development after me for a while back then. 5 Years ago, someone else asked me about GGM, and I replied to that person that he/she should try to write to the email addresses [email protected] and [email protected] if the source code was still in his hands. Heard nothing further. So if you end up contacting SpYder, put me into the CC, just for nostalgic reason I'd like to get the code back. Thanks for your E-Mail, makes me happy that somehow GGM is still being remembered, even after a decade, wow! -Bernhard --------------------------------------------------------------------------------------------- My Programing is just way to rusty to be able to reveres the source code back to Bernhard If anyone happens to know the programmer spYder please let me know. --------------------------------------------------------------------------------------------- Caution all because i contacted Bernhard does not mean im trying to under throw liberty unleashed under the bus. This is where i began my first ever multiplayer experience in general . I would just love to be able to help Bernhard to have full control of his program again. Even if he doesn't want to continue to work on it. --------------------------------------------------------------------------------------------- maybe if he gets the source code back maybe Vrocker and Bernhard could calibrate. GGM launches you into story mode. Then there happens to be the hidden menus of multiplayer that can be unlocked. With some good programming that could be altered for a multiplayer for liberty unleashed showing all of the servers. then client can be changed. I mean You just never know what could happen. Just putting some who knows out there and seeking spYder . --------------------------------------------------------------------------------------------- -Happy Gaming -Mr_Motley
|
|
|
|
|
8
|
Liberty Unleashed / Suggestions / Re: SinglePlayer Missions
|
on: September 19, 2015, 06:32:02 pm
|
|
Yes it Would I just happened to talk to the programmer of GGM Multiplayer about that.. That I Would have to Probley be on Vrockers Part,Then maybe some scripting.. A dedicated mp story mode server would be awesome to share the adventure together..
|
|
|
|
|
9
|
Scripting / Scripting Discussion / Re: Server Help
|
on: September 14, 2015, 03:52:46 pm
|
|
That's really disappointing.. that really cuts my server down a lot.. basically to nothing.... i will have to study up read up on the forum... i was hoping to be able to create .ini files to force darkness and create a flashlight weapon and make the light texture for the flashlight.. but i think i can modify the weather data to change the quality of the sky instead...(darkness) seagulls flying instead skulls on fire. just really disappointed... i will read on that now before i go i want to quote is there any pics showing how the folder directory should look.
Thanks Stoku for responding to my post so fast
|
|
|
|
|
10
|
Scripting / Scripting Discussion / Server Help
|
on: September 14, 2015, 06:34:29 am
|
|
First off Hello Sorry if im posting in the wrong forms --------------------------------------------------------------------------------------------- This form is about modding a server --------------------------------------------------------------------------------------------- There could be some scripting involved ---------------------------------------------------------------------------------------------
I've been working on my server off and on for a long time. and now im ready to tweak it to make it officially the server i want..
I want to be able to have custom modules weapon.dat Gta3.img and audio files
Im trying to enforce a server function to where its first person, and alter the weapon data to bring the gun up to sight... still need to find ways to upload modifications due to i want to modify the police radio files to be something freaking creepy and that plays on foot durring the server(not police related at all)i dont know if thats what it takes to make that happen...
Kinda going for a Doom 3 Resurrection of Evil Feel. The server is still in the works, and is still in the works to be tottaly re changed.. The server will be called "Seek And Destroy".
Ive been modifying the weapon data to try to get blood on walls effect and such but that will just take time and time and fails!!.. The Main thing is can i have the weapon.dat forced to other players when they join that forces these settings?
They see what i intended the server to be? also i want to alter the pedestrians in a 3ds tool if possible and make monsters and alter the speed of certain pedestrians some run like mast gorillas etc ...
!!but!! i don't know what kind of support and capability i have. i want an abnormal server. not the same ol server something different..
Its a lot of moderating But that's want i am best at.. I know there is not much support in asi so there will be a harder battle and a lot of cutting and programming capability's . I just really need to know the support for what im able to do and how to upload these file and force it onto the server..
--------------------------------------------------------------------------------------------- PLEASE DONT BE MEAN JUST LOOKING FOR POSITIVE FEEDBACK..
|
|
|
|
|
11
|
Servers / Mess About Server / Please Re Upload Mess About Server?
|
on: September 14, 2015, 05:59:52 am
|
|
When i first joined Liberty Unleashed it was a very long time since i played Gta 3 online. Mess about was the first server i Played then Worst Server. i have not played Multiplayer for gta 3 since the GGM version 0.4 client was big. [http://www.guardians.ch/ggm/]( cant belave its still there after all these years.... and that was a extreme long time ago. id love to play on Mess about instead of it turning into a memmory like GGM. It was an awesome server. . id love to see it up and running again. maybe at least for a week..
sincere Regards for the url
-Motley
|
|
|
|
|
12
|
Liberty Unleashed / Liberty Unleashed Chat / Re: DEV POLL: Do you still use XP?
|
on: September 13, 2015, 06:43:27 am
|
|
(Windows Experience)
I still use XP Even on a high end mobo. yet its a quad core overclocked to 4.3 GHz 2 gb graphics card.
Ac cooled CPU with a heat shink device. mobo runs at 70 degrees F... im not really trying to go in depth, but im still too use to Ms Dos after commodore 64 days. windows 98 and up actually annoys me. Xp i can deal with used xp and windows 95 in school so i can still adjust. still using my old IBM keyboard due to has a close feel as the commodore.
|
|
|
|
|
15
|
Liberty Unleashed / Liberty Unleashed Chat / Re: graphics editing
|
on: June 11, 2015, 02:47:40 pm
|
|
If this is possible i will create a zip file of all the files i got to work. And i will upload them on media fire. Im really excited this could be a break through for others wanting to come back to lu and for new players to want to join liberty unleashed. The mod is awesome.i used the actual installer last night and it went to story mode instead so now i will have to take the time to move the files around. I think it went to story mode for liberty unleashed because the start menu is the Xbox menu so there's probably a running process that needs to be altered. Any support for doing this will be highly appreciated. Just remember im not using God mode it's no hacks it's texture modifications.
|
|
|
|
|