FrankRizzo
April 30th, 2006, 20:56
I'm attempting to become the authority on Protection Plus. (The Nolan Blender of it if you will).
My plan is to make a replacement .dll will nice debugging facilities built in, etc. I have ALOT of the code written, all the replacement function stubs in place, and I have it working for target #1. I have picked up a couple of newer targets, and THEY don't like the format of my function declarations in the .DLL.
So, I'm asking for help with this.
I have searched and nothing specifically deals with this.
IDA spits out a function prototype from the dll like this:
According to the site over at SoftwareKey.com, this function has THIS prototype:
I've tried BOTH in my dll, and when one of my targets tries to use it, (It's an Excel sheet of all things!), it spits out "Bad DLL Calling Convention - Error 49".
In the VBA in the Excel sheet, it's declared like this:
And called like this:
(Sanitized to anonymize the target)
Anyone have any ideas of what I'm doing wrong?
My plan is to make a replacement .dll will nice debugging facilities built in, etc. I have ALOT of the code written, all the replacement function stubs in place, and I have it working for target #1. I have picked up a couple of newer targets, and THEY don't like the format of my function declarations in the .DLL.
So, I'm asking for help with this.
I have searched and nothing specifically deals with this.
IDA spits out a function prototype from the dll like this:
Code:
int __stdcall pp_lfopen(LPCSTR lpFileName, int, int, int, int)
According to the site over at SoftwareKey.com, this function has THIS prototype:
Code:
LONG pp_lfopen(LPSTR filename, LONG flags, LONG lftype, LPSTR password, LPLONG handle)
I've tried BOTH in my dll, and when one of my targets tries to use it, (It's an Excel sheet of all things!), it spits out "Bad DLL Calling Convention - Error 49".
In the VBA in the Excel sheet, it's declared like this:
Code:
Declare Function pp_lfopen Lib "LIBNAME.dll" (ByVal filename As String, ByVal flags As Long, ByVal lftype As Long, ByVal password As String, ByRef handle As Long) As Long
And called like this:
Code:
Public Const LF_FILE = 1
...
retval = pp_lfopen(SysDir & "\filename.lf", 2, LF_FILE, "PaSsWoRd", lfHandle)
(Sanitized to anonymize the target)
Anyone have any ideas of what I'm doing wrong?