|
|
#1 |
|
Junior Member
Join Date: May 2004
Posts: 7
|
Plugin Creation
Hello,
I'm trying to create a new nsis plugin to check a serial number and return a true or false value, I have made the DLL as a pluging, copied to the plugin dir, the function is being executed, but the parameters passed are not arriving to the dll. I'm not using VC++ or even c++, so I guess that I need to access the stack in some other way, but I can't find any info about this. Thanks |
|
|
|
|
|
#2 |
|
Major Dude
|
There is an example of how to create NSIS plugins including functions for accessing the stack in the NSIS distribution, see ExDLL folder.
If the language you are using is not found there you should still have a look at the functions there and try to convert them to your programming language. Vytautas
|
|
|
|
|
|
#3 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,917
|
What language are you working on? Did you try using system plugin for this?
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE. |
|
|
|
|
|
#4 |
|
Major Dude
|
Lobo Lunar, System plugin can do much but we (people from forums) don't know every trick inside it. Its readme has information but not as clear as it should be to be totally understood. I think brainsucker HAS to make a new readme for it. This request has been made since System plugin has been created, however he didn't work on it until now.
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2004
Posts: 7
|
I'm using a language called Clarion, is a 4gl language. The main problem is how should I access the stack, somebody at the IRC told me to read about System::Store, that's what I should use? And if that is ok, once I have a result on my dll, where do I store that result? On which stack?
Another question is, I want to use that DLL to validate a Serial Number, If NSIS is using the assembler stack is pretty easy for any programmer to run a debugger on the installer and check for the return value (no matter how complicated is the algorithm for the serial number) and return the correct number, is there any one out there how has solved this in a very secure way? Thank you all for your answers |
|
|
|
|
|
#6 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
As specified in ExDLL.c and ExDLL.h, the fourth and last parameter for the plug-in function, on the stack, is a pointer to the NSIS stack head. The NSIS stack head is a pointer to stack_t structure which is defined in ExDLL.h. Translate that into your programming language and you'll be able to play with the NSIS stack.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: May 2004
Posts: 7
|
Ok, just one question, I can't fully understand the following structure:
typedef struct _stack_t { struct _stack_t *next; char text[1]; // this should be the length of string_size } stack_t; the char part is ok, but I don't know what is the _stack_t, what is *next? It is a pointer to something else? It is a pointer to another structure? Thank you very much |
|
|
|
|
|
#8 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
next is a pointer to another stack_t. _stack_t is the name of the structure. See the popstring and pushstring functions for examples of how to use this structure.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: May 2004
Posts: 7
|
I think I have it know, it is a pointer to the same structure to get the following value, right?
thx, I will post my code when I finish to everyone else in case is helpfull to others in the same situation. |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: May 2004
Posts: 7
|
thx man, your help and the rest of the people here is tremendous, I thougth that our community (clarion news groups) was the only one with helping people
![]() again, thx |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: May 2004
Posts: 7
|
Well, I have the plugin working now, do you want me to post the use of the stack an all the necessary stuff directly here? Or should I put the files on other places?
The generated plugin with all the runtimes linked in is, at least 270Kb, I know, it is big but there is no way to make it smaller Just le me know what do you want me to do. |
|
|
|
|
|
#12 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,917
|
Well... is a DLL; you can try UPX
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE. |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: May 2004
Posts: 7
|
very good! it is 112kb now, not so small as the ones made with vc++ but...
|
|
|
|
|
|
#14 |
|
Major Dude
|
You can get rid of Debug stuff, and you can include LIBCTINY.LIB in your project (you can search for it on the net).
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|