I was trying to use EXECryptor on Dev C++ IDE 4.9.9.2
I included your file and used CRYPT_START and CRYPT_END and it wouldn’t compile.
Here’s the compile log.
Compiler: Default compiler
Building Makefile: "C:\biblebowl-plus-voice2\biblebowl\Makefile.win"
Executing make clean
rm -f biblebowl-06.o to-do-list.o Player.o menuitem.o FormInputConfig.o tinyxmlparser.o tinyxml.o tinyxmlerror.o tinystr.o QuestionManager.o ConfigSettings.o ScoreBoards.o AnswerAlgorithm.o FormInput.o NPC.o Behavior.o Buzzer.o QuestionnerBehavior.o Speech.o QuestionDB.o ThreadManager.o Confetti.o Stage.o hge-experiments.exeg++.exe -D__DEBUG__ -c biblebowl-06.cpp -o biblebowl-06.o -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include" -I"C:/Microsoft Speech SDK 5.1/Include" -I"C:/biblebowl-plus-voice2/biblebowl/hge16/hge16/include" -I"C:/biblebowl-plus-voice2/biblebowl/hge16/hge16/include/src" -g3biblebowl-06.cpp: In function bool FrameFunc()’:
biblebowl-06.cpp:793: error: expected(’ before "_emit"biblebowl-06.cpp:793: error: expected asm body before "_emit"biblebowl-06.cpp:793:11: exponent has no digits
biblebowl-06.cpp:793: error: _emit’ undeclared (first use this function)biblebowl-06.cpp:793: error: (Each undeclared identifier is reported only once for each function it appears in.)biblebowl-06.cpp:793: error: expected;’ before numeric constantbiblebowl-06.cpp:793:11: invalid suffix "h" on integer constant
biblebowl-06.cpp:793:11: exponent has no digits
biblebowl-06.cpp:793:11: invalid suffix "FCh" on integer constant
biblebowl-06.cpp:793:11: exponent has no digits
biblebowl-06.cpp:793:11: invalid suffix "FCh" on integer constant
biblebowl-06.cpp:793:11: invalid suffix "FFh" on integer constant
biblebowl-06.cpp:793:11: invalid suffix "F8h" on integer constant
biblebowl-06.cpp:795: error: expected (’ before "_emit"biblebowl-06.cpp:795: error: expected asm body before "_emit"biblebowl-06.cpp:795:11: exponent has no digits
biblebowl-06.cpp:795: error: expected;’ before numeric constantbiblebowl-06.cpp:795:11: invalid suffix "h" on integer constant
biblebowl-06.cpp:795:11: exponent has no digits
biblebowl-06.cpp:795:11: invalid suffix "FCh" on integer constant
biblebowl-06.cpp:795:11: exponent has no digits
biblebowl-06.cpp:795:11: invalid suffix "FCh" on integer constant
biblebowl-06.cpp:795:11: invalid suffix "FFh" on integer constant
biblebowl-06.cpp:795:11: invalid suffix "FFh" on integer constantmake.exe: *** [biblebowl-06.o] Error 1Execution terminated
Line 793 and 795 in the biblebowl file are the points that invokes CRYPT_START and CRYPT_END
__declspec(dllexport) int __stdcall EXECryptor_GetTrialDaysLeft(int TrialPeriod);
__declspec(dllexport) int __stdcall EXECryptor_GetTrialRunsLeft(int TrialRuns);
typedef struct {
int LicType; //0..15
// if LicType = 1 then we get ExpiryMonth/ExpiryYear
// otherwise we get UserParam
int UserParam; //0..1023
int ExpiryMonth,//1..12
ExpiryYear; //2004..2024
bool F1,F2,F3,F4,F5,F6;
} TSerialNumberInfo;
Help will be greatlly appreciated.
I really want to use EXECryptor
I am using Dev C++ i believe it uses a GNU compiler. Previously in PE Lock I had to do this to the include to make it work.
ifndef PELOCK_MACROS
if defined LCC || defined GNUC
if defined GNUC
define _asm asm
endif
As you can see, I have GNUC and _asm defined as asm
Is there any chance that I could get this to compile with Dev C++ 4.9.9.2?
Stephen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Have we not already discussed this. If this is a continuation, why did you not append this message to that thread? On its own it reads rather oddly out of context. You appear to be addressing the author of EXECryptor not us.
Your log appears to have gotten mangles also with multiple messages running into each other with no newline.
However, this is the same problem you had before. None of these macros are valid GNY in-line assembler syntax.
> As you can see, I have GNUC and _asm defined as asm
That makes no difference, you need a GNUC conditional block in EXECryptor.h too, and the previous asm fix is not visible here in this file.
GNU assembler syntax is described here: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html , Follow the same pattern as for the PElock.h macros. If you cannot abstarct such patterns or extrapolate solutions and apply them to other situations, you are not programming! Or at least you did not understand the previous solution.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually in the previous thread I was discussing PELock .
With this thread, I'm trying to see if another solution EXECryptor will work. I was just wondering if this was different somehow.
Well I'll make the modifications, try it and report the results.
Stephen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> Actually in the previous thread I was discussing PELock .
Yes, but it is the same problem. The reference would have been helpful. Had I not picked up your thread, someone else may have answered duplicating effort.
Here, because I had a little time to kill, copy and paste this and place the existing CRYPT_xxxx macros in the bottom half of the #if/else construct where indicated.
Thanks very much I'll try it and see what happens.
This is one of those areas where I have no idea what's going on .
I just know the basics of c++ , classes and algorithms.
Perhaps I should study that link you sent me on the gnu compiler.
I'm going to try this out and tell you how it goes.
Thanks very much
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Greetings;
I was trying to use EXECryptor on Dev C++ IDE 4.9.9.2
I included your file and used CRYPT_START and CRYPT_END and it wouldn’t compile.
Here’s the compile log.
Compiler: Default compiler
Building Makefile: "C:\biblebowl-plus-voice2\biblebowl\Makefile.win"
Executing make clean
rm -f biblebowl-06.o to-do-list.o Player.o menuitem.o FormInputConfig.o tinyxmlparser.o tinyxml.o tinyxmlerror.o tinystr.o QuestionManager.o ConfigSettings.o ScoreBoards.o AnswerAlgorithm.o FormInput.o NPC.o Behavior.o Buzzer.o QuestionnerBehavior.o Speech.o QuestionDB.o ThreadManager.o Confetti.o Stage.o hge-experiments.exeg++.exe -D__DEBUG__ -c biblebowl-06.cpp -o biblebowl-06.o -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include" -I"C:/Microsoft Speech SDK 5.1/Include" -I"C:/biblebowl-plus-voice2/biblebowl/hge16/hge16/include" -I"C:/biblebowl-plus-voice2/biblebowl/hge16/hge16/include/src" -g3biblebowl-06.cpp: In function
bool FrameFunc()’: biblebowl-06.cpp:793: error: expected(’ before "_emit"biblebowl-06.cpp:793: error: expected asm body before "_emit"biblebowl-06.cpp:793:11: exponent has no digitsbiblebowl-06.cpp:793: error:
_emit’ undeclared (first use this function)biblebowl-06.cpp:793: error: (Each undeclared identifier is reported only once for each function it appears in.)biblebowl-06.cpp:793: error: expected;’ before numeric constantbiblebowl-06.cpp:793:11: invalid suffix "h" on integer constantbiblebowl-06.cpp:793:11: exponent has no digits
biblebowl-06.cpp:793:11: invalid suffix "FCh" on integer constant
biblebowl-06.cpp:793:11: exponent has no digits
biblebowl-06.cpp:793:11: invalid suffix "FCh" on integer constant
biblebowl-06.cpp:793:11: invalid suffix "FFh" on integer constant
biblebowl-06.cpp:793:11: invalid suffix "F8h" on integer constant
biblebowl-06.cpp:795: error: expected
(’ before "_emit"biblebowl-06.cpp:795: error: expected asm body before "_emit"biblebowl-06.cpp:795:11: exponent has no digits biblebowl-06.cpp:795: error: expected;’ before numeric constantbiblebowl-06.cpp:795:11: invalid suffix "h" on integer constantbiblebowl-06.cpp:795:11: exponent has no digits
biblebowl-06.cpp:795:11: invalid suffix "FCh" on integer constant
biblebowl-06.cpp:795:11: exponent has no digits
biblebowl-06.cpp:795:11: invalid suffix "FCh" on integer constant
biblebowl-06.cpp:795:11: invalid suffix "FFh" on integer constant
biblebowl-06.cpp:795:11: invalid suffix "FFh" on integer constantmake.exe: *** [biblebowl-06.o] Error 1Execution terminated
Line 793 and 795 in the biblebowl file are the points that invokes CRYPT_START and CRYPT_END
CRYPT_START
objStage.drawStage( questionManager.getTopScore() );
CRYPT_END
Here is the include file from EXECryptor.h
ifndef EXECRYPTOR_H
define EXECRYPTOR_H
include <windows.h>
// EXECryptor API v. 2.3
define USE_API
define USE_CRYPT_REG
define USE_STD_SERIALS
ifdef __cplusplus
extern "C" {
endif
ifdef USE_API
__declspec(dllexport) bool __stdcall EXECryptor_IsAppProtected();
__declspec(dllexport) const char * __stdcall EXECryptor_GetEXECryptorVersion();
void GetReleaseDate(int Day, int Month, int Year);
void SafeGetDate(int Day, int Month, int Year);
__declspec(dllexport) DWORD __stdcall EXECryptor_GetHardwareID();
__declspec(dllexport) void __stdcall EXECryptor_EncryptStr(const char Src, char Dst);
__declspec(dllexport) void __stdcall EXECryptor_DecryptStr(const char Src, char Dst);
__declspec(dllexport) void __stdcall EXECryptor_EncryptStrW(const wchar_t Src, wchar_t Dst);
__declspec(dllexport) void __stdcall EXECryptor_DecryptStrW(const wchar_t Src, wchar_t Dst);
__declspec(dllexport) bool __stdcall EXECryptor_SecureWrite(const char Name, const char Value);
__declspec(dllexport) bool __stdcall EXECryptor_SecureRead(const char Name, char Value);
__declspec(dllexport) bool __stdcall EXECryptor_SecureWriteW(const wchar_t Name, const wchar_t Value);
__declspec(dllexport) bool __stdcall EXECryptor_SecureReadW(const wchar_t Name, wchar_t Value);
__declspec(dllexport) int __stdcall EXECryptor_GetTrialDaysLeft(int TrialPeriod);
__declspec(dllexport) int __stdcall EXECryptor_GetTrialRunsLeft(int TrialRuns);
__declspec(dllexport) int __stdcall EXECryptor_MessageBoxA(HWND hWnd, LPCSTR lpText,
LPCSTR lpCaption, UINT uType);
__declspec(dllexport) FARPROC __stdcall EXECryptor_GetProcAddr(HMODULE hModule, LPCSTR lpProcName);
__declspec(dllexport) void __stdcall EXECryptor_AntiDebug();
__declspec(dllexport) void __stdcall EXECryptor_ProtectImport();
endif
ifdef USE_CRYPT_REG
enum TVerifyResult { vrInvalid, vrExpired, vrStolen, vrOK };
ifdef USE_STD_SERIALS
pragma pack(push,1)
typedef struct {
int LicType; //0..15
// if LicType = 1 then we get ExpiryMonth/ExpiryYear
// otherwise we get UserParam
int UserParam; //0..1023
int ExpiryMonth,//1..12
ExpiryYear; //2004..2024
bool F1,F2,F3,F4,F5,F6;
} TSerialNumberInfo;
pragma pack(pop)
__declspec(dllexport) TVerifyResult __stdcall EXECryptor_VerifySerialNumber(const char RegName,
const char SerialNumber, TSerialNumberInfo SNInfo = NULL, const char HardwareID = NULL);
__declspec(dllexport) TVerifyResult __stdcall EXECryptor_VerifySerialNumberW(const wchar_t RegistrationName,
const wchar_t SerialNumber, TSerialNumberInfo SNInfo = NULL, const wchar_t HardwareID = NULL);
__declspec(dllexport) TVerifyResult __stdcall EXECryptor_DecodeSerialNumber(const char RegistrationName,
const char SerialNumber, TSerialNumberInfo SNInfo = NULL, const char HardwareID = NULL);
__declspec(dllexport) TVerifyResult __stdcall EXECryptor_DecodeSerialNumberW(const wchar_t RegistrationName,
const wchar_t SerialNumber, TSerialNumberInfo SNInfo = NULL, const wchar_t HardwareID = NULL);
else
__declspec(dllexport) void __stdcall EXECryptor_SetCodeKey(const void *Key, int Size);
endif
__declspec(dllexport) TVerifyResult __stdcall EXECryptor_IsRegistered();
__declspec(dllexport) DWORD __stdcall EXECryptor_RegConst_0();
__declspec(dllexport) DWORD __stdcall EXECryptor_RegConst_1();
__declspec(dllexport) DWORD __stdcall EXECryptor_RegConst_2();
__declspec(dllexport) DWORD __stdcall EXECryptor_RegConst_3();
__declspec(dllexport) DWORD __stdcall EXECryptor_RegConst_4();
__declspec(dllexport) DWORD __stdcall EXECryptor_RegConst_5();
__declspec(dllexport) DWORD __stdcall EXECryptor_RegConst_6();
__declspec(dllexport) DWORD __stdcall EXECryptor_RegConst_7();
endif
ifdef __cplusplus
};
endif
#define CRYPT_START { \
__asm _emit 0EBh \
__asm _emit 006h \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0FFh \
__asm _emit 0F8h; \
{
#define CRYPT_START_UNSAFE \
__asm _emit 0EBh \
__asm _emit 006h \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0FFh \
__asm _emit 0F8h
#define CRYPT_END } \
__asm _emit 0EBh \
__asm _emit 006h \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0FFh \
__asm _emit 0FFh; \
}
#define CRYPT_END_UNSAFE \
__asm _emit 0EBh \
__asm _emit 006h \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0FFh \
__asm _emit 0FFh
ifdef USE_CRYPT_REG
#define CRYPT_REG { \
__asm _emit 0EBh \
__asm _emit 006h \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0FFh \
__asm _emit 0F9h; \
{
#define CRYPT_REG_UNSAFE \
__asm _emit 0EBh \
__asm _emit 006h \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0FFh \
__asm _emit 0F9h
#define CRYPT_UNREG { \
__asm _emit 0EBh \
__asm _emit 006h \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0FFh \
__asm _emit 0FAh; \
{
#define CRYPT_UNREG_UNSAFE \
__asm _emit 0EBh \
__asm _emit 006h \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0EBh \
__asm _emit 0FCh \
__asm _emit 0FFh \
__asm _emit 0FAh
endif
endif
Help will be greatlly appreciated.
I really want to use EXECryptor
I am using Dev C++ i believe it uses a GNU compiler. Previously in PE Lock I had to do this to the include to make it work.
ifndef PELOCK_MACROS
if defined LCC || defined GNUC
if defined GNUC
define _asm asm
endif
As you can see, I have GNUC and _asm defined as asm
Is there any chance that I could get this to compile with Dev C++ 4.9.9.2?
Stephen
Thanks Clifford I was finally able to get Execryptor to compile with the Dev Environment.
I just put the code in now. It works. Thanks.
I owe you.
Stephen
Have we not already discussed this. If this is a continuation, why did you not append this message to that thread? On its own it reads rather oddly out of context. You appear to be addressing the author of EXECryptor not us.
Your log appears to have gotten mangles also with multiple messages running into each other with no newline.
However, this is the same problem you had before. None of these macros are valid GNY in-line assembler syntax.
> As you can see, I have GNUC and _asm defined as asm
That makes no difference, you need a GNUC conditional block in EXECryptor.h too, and the previous asm fix is not visible here in this file.
GNU assembler syntax is described here: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html , Follow the same pattern as for the PElock.h macros. If you cannot abstarct such patterns or extrapolate solutions and apply them to other situations, you are not programming! Or at least you did not understand the previous solution.
Clifford
Thanks Clifford
Actually in the previous thread I was discussing PELock .
With this thread, I'm trying to see if another solution EXECryptor will work. I was just wondering if this was different somehow.
Well I'll make the modifications, try it and report the results.
Stephen
> Actually in the previous thread I was discussing PELock .
Yes, but it is the same problem. The reference would have been helpful. Had I not picked up your thread, someone else may have answered duplicating effort.
Here, because I had a little time to kill, copy and paste this and place the existing CRYPT_xxxx macros in the bottom half of the #if/else construct where indicated.
if defined GNU
define CRYPT_START {asm( ".byte\t 0xEB,0x06,0xEB,0xFC,0xEB,0xFC,0xFF,0xF8");{
define CRYPT_START_UNSAFE asm( ".byte\t0xEB,0x06,0xEB,0xFC,0xEB,0xFC,0xFF,0xF8")
define CRYPT_END } asm( ".byte\t0xEB,0x06,0xEB,0xFC,0xEB,0xFC,0xFF,0xFF"); }
define CRYPT_END_UNSAFE asm( ".byte\t0xEB,0x06,0xEB,0xFC,0xEB,0xFC,0xFF,0xFF")
ifdef USE_CRYPT_REG
define CRYPT_REG {asm( ".byte\t0xEB,0x06,0xEB,0xFC,0xEB,0xFC,0xFF,0xF9");{
define CRYPT_REG_UNSAFE asm( ".byte\t0xEB,0x06,0xEB,0xFC,0xEB,0xFC,0xFF,0xF9")
define CRYPT_UNREG {asm( ".byte\t0xEB,0x06,0xEB,0xFC,0xEB,0xFC,0xFF,0xFA");{
define CRYPT_UNREG_UNSAFE asm( ".byte\t0xEB,0x06,0xEB,0xFC,0xEB,0xFC,0xFF,0xFA")
endif
else
// place existing macros here ...
endif
Clifford
Thanks very much I'll try it and see what happens.
This is one of those areas where I have no idea what's going on .
I just know the basics of c++ , classes and algorithms.
Perhaps I should study that link you sent me on the gnu compiler.
I'm going to try this out and tell you how it goes.
Thanks very much
> Perhaps I should study that link you sent me on the gnu compiler.
That is why I sent it! ;-\