phadar
asked on
C translation
Hi Experts,
Need C Translation
#include <string.h>
#include <windows.h>
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{
H_Intr99; HINSTANCE
H_Intr99=NULL;
typedef long (__stdcall * INTR99)(char *,char*,char *[]);
INTR99 intr99;
H_Intr99=LoadLibrary("INTR 32.DLL");
if (H_Intr99==NULL)
{
// MessageBox
}
intr99=(INTR99)GetProcAddr ess(H_Intr 99,"intr99 ");
if (intr99 == NULL)
{
// MessageBox
}
char int_ot[160];
memset(int_ot,'0',150);
intr99("B10000003C1200D011 150T0101", int_ot,0);
FreeLibrary(H_Intr99);
return 1;
}
Need C Translation
#include <string.h>
#include <windows.h>
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{
H_Intr99; HINSTANCE
H_Intr99=NULL;
typedef long (__stdcall * INTR99)(char *,char*,char *[]);
INTR99 intr99;
H_Intr99=LoadLibrary("INTR
if (H_Intr99==NULL)
{
// MessageBox
}
intr99=(INTR99)GetProcAddr
if (intr99 == NULL)
{
// MessageBox
}
char int_ot[160];
memset(int_ot,'0',150);
intr99("B10000003C1200D011
FreeLibrary(H_Intr99);
return 1;
}
I'm afraid C doesn't know string type, so I would use PChar
ziolko.
ziolko.
ASKER
Well I tried every possible variables, String, PChar and I get AV when calling the function :(
how did you call this function?
btw. isn't this dLL some kind of trojan?
ziolko.
btw. isn't this dLL some kind of trojan?
ziolko.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Well no ziolko, this dll is not a trojan. I've heard of a trojan with the same name but that dll is legimate.
GetProcAddress is lowercase and I don't get error at this stage.
The AV raise when calling the function.
But finally I managed to call the function without any AV.
The problem seems to be Fiiling Char ( FillChar(int_ot,150,0) ), I removed that one and it works fine now.
INTR99('B10000003C1200D011 150T0101', PChar(int_ ot),nil);
Anyway, Thanks ziolko for your time and comments.
Philip
GetProcAddress is lowercase and I don't get error at this stage.
The AV raise when calling the function.
But finally I managed to call the function without any AV.
The problem seems to be Fiiling Char ( FillChar(int_ot,150,0) ), I removed that one and it works fine now.
INTR99('B10000003C1200D011
Anyway, Thanks ziolko for your time and comments.
Philip
>>I've heard of a trojan with the same name but that dll is legimate.
ok then I would suggest renaming this DLL as it can be recognized as possible threat to system by most anti-virus software.
ziolko.
ok then I would suggest renaming this DLL as it can be recognized as possible threat to system by most anti-virus software.
ziolko.
Open in new window