Menu

EXECryptor to Compile with Dev C++ 4.9.9.2

stev
2008-09-26
2012-09-26
  • stev

    stev - 2008-09-26

    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 -DDEBUG -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

    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

     
    • stev

      stev - 2008-10-06

      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

       
    • cpns

      cpns - 2008-09-26

      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

       
    • stev

      stev - 2008-09-26

      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

       
    • cpns

      cpns - 2008-09-27

      > 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

       
    • stev

      stev - 2008-10-01

      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

       
    • cpns

      cpns - 2008-10-01

      > Perhaps I should study that link you sent me on the gnu compiler.

      That is why I sent it! ;-\

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.