Anti- EX5-MQ5 Decompiler: The method to write mq5 code to dll

http://www.Jmi8.com/english

(Just for demo version)

 

 

The sample of write CCI.mq5 to DLL

 

The origin int OnCalculate() of CCI.mq5 as below:

//+------------------------------------------------------------------+

 

int OnCalculate(const int rates_total, const int prev_calculated,
                                 const int begin, const double &price[])

  {

//--- variables
              int i,j;
             double dTmp,dMul=0.015/ExtCCIPeriod;
       //--- start calculation
             int StartCalcPosition=(ExtCCIPeriod-1)+begin;
       //--- check for bars count
             if(rates_total<StartCalcPosition)
             return(0);
       //--- correct draw begin
             if(begin>0) PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,StartCalcPosition+

                                                                    (ExtCCIPeriod-1));
       //--- calculate position
             int pos=prev_calculated-1;
             if(pos<StartCalcPosition)
             pos=StartCalcPosition;
       //--- main cycle
             for(i=pos;i<rates_total;i++)
             {
       //--- SMA on price buffer
             ExtSPBuffer[i]=SimpleMA(i,ExtCCIPeriod,price);
       //--- calculate D
             dTmp=0.0;
             for(j=0;j<ExtCCIPeriod;j++) dTmp+=MathAbs(price[i-j]-ExtSPBuffer[i]);
             ExtDBuffer[i]=dTmp*dMul;
       //--- calculate M
             ExtMBuffer[i]=price[i]-ExtSPBuffer[i];
       //--- calculate CCI
             if(ExtDBuffer[i]!=0.0) ExtCCIBuffer[i]=ExtMBuffer[i]/ExtDBuffer[i];
             else ExtCCIBuffer[i]=0.0;
       //---
             }
       //---- OnCalculate done. Return new prev_calculated.
             return(rates_total);
        }  

//+------------------------------------------------------------------+

 

When we write it to DLL, it will be:

//+------------------------------------------------------------------+

int OnCalculate(const int rates_total, const int prev_calculated,
                                 const int begin, const double &price[])
         {
          if(begin>0) PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,(ExtCCIPeriod-1)+

                                                      begin+(ExtCCIPeriod-1));
      
  Jmi8_dll_mq5(rates_total, prev_calculated, begin, price, ExtCCIPeriod,

                                  ExtSPBuffer, ExtDBuffer, ExtMBuffer, ExtCCIBuffer);
         
return(rates_total);
         }

//+------------------------------------------------------------------+

We use one row code ( red ) take the place of original 15 rows code. Thus, if someone turns the ex5 to mq5 by EX5-MQ5 decompiler, he will not understand how the Jmi8_dll_mq5() to work, and the function Jmi8_dll_mq5() can’t work if it not been registered.

 

If you want to protect your mq5 by this method, you must give me your all or part of mq5 files. I can write a special DLL function for your mq5 code. Please trust to me, I will not use or sold your mq5 code.

 

 
     
 

Zhang Yufei

                     http://www.Jmi8.com/english

                     e-mail: Ok@Jmi8.com  Jmi8@live.cn

                     Tel: 86-538-6222485

MSN: Jmi8@live.cn
Skype: Jmi8.com