Debugging a DLL - page 2

 
7bit:
they did not change the protocol since they started using themida.
How do you know that? There would only need to be slight changes, accompanied by similar slight additions to the MT4 Server software. Hypothetically, MetaQuotes could use protocol A in builds up to 225, and then a totally different protocol B in 226 onwards, provided that the MT4 Server software was capable of handling both protocols.

The commercial issue is that all the big MT4 brokers want to reduce their reliance on MetaQuotes. If the MT4 protocol were both known and immutable, then it would raise the possibility of a bridge which accepts orders from MT4 Client into any dealing system. Brokers could potentially benefit from the millions of installed (and free) copies of MT4 Client without needing to pay for MT4 Server (and also without the need to pay the likes of Boston Technologies). Such a prospect is not hugely likely, but protecting the communication protocol is nevertheless prudent from MetaQuotes's point of view.
 

Coders working on DLLs may have noticed that some brokers have begun blocking Build 225, the last version that runs in a debugger. I'm sure Metaquotes is behind this.

Sorry, but my DLL is a monster and it is quite unreasonable to try debug it solely by writing messages to debug logs. I need to trap exceptions, to examine contents of variables, break when certain conditions occur, single step through code and so forth.

Metaquotes, you need to provide a solution to this.

Your management no doubt has decided that DLL developers form only a minor segment of your user population and therefore can be ignored. But this is false logic. There is a sizable market for third party EAs and the widespread availability of commercial trading systems for MetaTrader is a key factor that makes MetaTrader popular with users. Since there exist ways to decompile ex4 files, every commercial EA developer with a trading system worth protecting has to use a DLL to protect the core algorithms. By chopping off these developers you are chopping off your own right hand.

So I would like to propose a solution.

Release a "Developer" build of MetaTrader that protects Metaquotes intellectual property without the use of Themida. One way it might be done is to create a build that replaces OrderSend() with a function of the same name that does not send orders to the server but simply simulates the order send and response within the terminal. The Metaquotes proprietary protocols for communicating orders to the server are protected because they are not even present in the software. Any additional critical algorithms that have to be protected could similarly be replaced with a simulator. All other aspects of the terminal would work in the expected way. I think this compromise would be acceptable to DLL developers.

Slawa, or other moderator, would you please present this idea to Metaquotes on behalf of the third party developers so that a Developer build can be implemented? Thank you.

 

I think it is shocking to release a piece of software that as part of the feature set provides extensibility through their own c-style variant and allows dlls, but then to not allow you to attach a debugger to it. No developer in their right mind would want to attempt to develop something with only print statements.

Just to add to this, having looked around, it seems there are debuggers that provide functionality that is specifically tailored to bypassing themida checks, There is also a host of resource and tutorials available on unpacking applications with this protection. tuts4you seems like a good place to start.

This seems like a really poor decision that inflicts a lot of problems for programmers for little gain. This application is free anyway, and if anyone wants to bypass this protection mechanism, however hard, it is now possible and has been proved to be so.

 
+1 for a solution ASAP. I just begun writing EA (a profitable one) about 2 months ago and I just can't believe there's no way to debug crucial functions packed in my DLL running inside the MT4 terminal... And as far as I can see the number of EAs protected via moving proprietary code into its own DLL is growing. Also the lack of best practices using MQL<->DLL communication is a bit frustrating. Impossibility to allocate a memory for a string inside the DLL is also incredibly dumb as well as using prepared buffers in MQL and overwriting it from inside the DLL. But enough of complains - the need for debugger-enabled MT4 is a top priority.
 
...and while suggesting improvements a way to prevent FXT overwriting, or better using custom tickdata file together with 64bit file functions to get over the obsolete 2gb filesize limitation in StrategyTester would be a perfect gift for EA developers caring for high model quality of their backtests. Both modifications should be easy to fix in a new MT4 build. After all it's a few lines of code for god sake. Instead of it we're doomed, and we must use old 409 build with a process patching script or a paid TickDataSuite.. Again simple touches with far-reaching benefits.
Reason: