[Tool/Web/Other] [WIP]SA-MP ALS Hooking Generator
#1

SA-MP ALS Hooking Generator 0.3b


About
This is a simple app to generate the code needed to do an ALS hook on any callback.
Dont know what ALS Hooking is? Please check this posts for more info.

https://sampforum.blast.hk/showthread.php?tid=85907

Whats this do?
The app will generate code to hook one or more callbacks defining all the ALS code for you
with your set prefix.


supports both pre & post code for OnGameModeInit().
The interface has checkboxs with a list of all callbacks to select to hook.


Is this better/faster than y_hooks?
Quote:
Originally Posted by ******
Посмотреть сообщение
For reference, ALS and y_hooks are pretty much equal in run-time speed, but you're right that y_hooks takes longer to compile (though this has been vastly improved) and ALS takes longer to write - so if you have a tool to generate ALS code then that's a win!
Now I found y_hooks to be wonderful, and I use it myself, so it would depend on
where/what you using ALS over y_hooks, Do you want to depend on another lib,
would depend on your code, if your already using YSI then I would use y_hooks.


What language is this written in?
VS c# 2010


Update
After the discussion held here, ****** had some great ideas and some tips that I have implemented.
So credits to ****** for his tips & ideas!

List of changes
0.3b:
  • Fixed a bug in code that was generated for OnGameModeInit()
0.3a:
  • Fixed a bug in code that was generated to check for null strings.
0.3:
  • Added full support for custom functions
  • Added support for storing weather a callback exists or not.
0.2:
  • When no prefix is set, prompt user to enter one.
  • Code now generates support for null strings.
  • Added more to the interface to allow for Custom Callbacks ALS code generation.
    Read below in "Custom Callbacks" to learn how to use it.
Custom Callbacks
Adding a custom callback is easier than ever.
When you launch the ALS generator you'll see a group box
(See ss2.jpg from the attachments)
It takes 3 Parameters:
  • Name //This is the Callback Name ex: OnSomeCallBack
  • Format //This is the format specifier ex: isf
  • Arguments //This is the arguments list ex: playerid,text[],Float:fVal
Add these values and hit the Add Button.
Note that when using a string argument in a custom function
the code to check for null string is also generated for you!.
New in 0.3*
You can now add and remove custom callbacks from a list
before generating the ALS code.

Note
OnGameModeInit() is always generated. If its the only function you want to hook
Just set your prefix and hit generate!.

Future Release
I have planed for a future release that will load all callbacks from a file making it easy
to permanently add your custom callbacks. This will allow me to add the function hooking support
along with release a simple file for updating the app. This will require a rewrite of the hole system
so will not be done right away but over the next few weeks. I have another project to do before this.

Suggestions
Note this is a work in progress but fully functional,
any suggestions will be taken into consideration.


regards,
Reply


Messages In This Thread
[WIP]SA-MP ALS Hooking Generator 0.3a - by Jonny5 - 06.05.2012, 04:58
Re: [WIP]SA-MP ALS Hooking Generator - by Crazymax - 06.05.2012, 07:30
Re: [WIP]SA-MP ALS Hooking Generator - by Jonny5 - 06.05.2012, 14:12
Re: [WIP]SA-MP ALS Hooking Generator - by Crazymax - 07.05.2012, 01:57
Re: [WIP]SA-MP ALS Hooking Generator - by Jonny5 - 07.05.2012, 12:11
Re: [WIP]SA-MP ALS Hooking Generator - by Andrejs - 14.05.2012, 19:31
Re: [WIP]SA-MP ALS Hooking Generator - by Jonny5 - 15.05.2012, 13:01
Re: [WIP]SA-MP ALS Hooking Generator - by Niko_boy - 15.05.2012, 14:04
AW: [WIP]SA-MP ALS Hooking Generator - by Johann95 - 15.05.2012, 14:04
Re: [WIP]SA-MP ALS Hooking Generator - by Jonny5 - 15.05.2012, 20:05
Re: [WIP]SA-MP ALS Hooking Generator - by Y_Less - 15.05.2012, 20:44
Re: [WIP]SA-MP ALS Hooking Generator - by Jonny5 - 15.05.2012, 22:28
Re: [WIP]SA-MP ALS Hooking Generator - by Jonny5 - 16.05.2012, 17:21
Re: [WIP]SA-MP ALS Hooking Generator - by Y_Less - 16.05.2012, 20:47
Re: [WIP]SA-MP ALS Hooking Generator - by Jonny5 - 16.05.2012, 22:36
Respuesta: [WIP]SA-MP ALS Hooking Generator - by Gryphus One - 03.07.2012, 02:54
Respuesta: [WIP]SA-MP ALS Hooking Generator - by Gryphus One - 03.07.2012, 03:51

Forum Jump:


Users browsing this thread: 1 Guest(s)