The EX4 and the MQ4 files are associated with the MetaTrader 4 trading platform. They both are vital in the online trading at FOREX market. These files can contain program code of expert advisors (EA), indicators or scripts.
PermalinkJoin GitHub today
GitHub is home to over 36 million designers working jointly to sponsor and critique code, deal with projects, and develop software jointly.
Indication upFind fileDuplicate path
1factor
#defineWIN32WINNT0x0501 |
#consist oflt;windows.lgt; |
#includelt;shlobj.hgt; |
#includelt;objbase.hgt; |
#includelt;objidl.lgt; |
#consist oflt;olectlid.hgt; |
#consist oflt;tchar.lgt; |
#includelt;wchar.lgt; |
#include'scit/scit.l' |
#definenullNULL |
#defineaccurate1 |
#definefake0 |
#defineAPPNAME'ex4tomq4auto' |
//T'D:prjcl workspaceex4tomq4autoDebugFoo.former mate4' |
#defineWNDNAME'EX4-TO-MQ4 Decompiler (https://purebeam.biz)' |
#defineEXENAME'ex4tomq4.exe' |
//#define WNDNAME 'NotePAD' |
//#define EXENAME 'notepad.exe' |
typedefUINT WINAPIDragQueryFileWt(HDROP,UINT,LPWSTR,UINT); |
DragQueryFileWt.oldDragQueryFileW; |
wcharttmpWcBuff1024; |
HWND WINAPIFindWindow(LPCTSTR lpClassName, LPCTSTR lpWindowName) |
HWND hWnd; |
hWnd =FindWindow(lpClassName, null); |
if(hWnd) |
returnhWnd; |
hWnd =FindWindow(null, lpWindowName); |
if(hWnd) |
returnhWnd; |
come back0; |
/. |
. http://msdn.microsoft.com/en-us/library/windows/desktop/bb776408(v=vs.85).aspx |
./ |
UINT WINAPImyDragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch) |
if(iFile -1) |
return1; |
if((int)hDrop123amp;amp; iFile0) |
wcsncpy(lpszFile, tmpWcBuff, cch); |
returnwcslen(tmpWcBuff); |
returnoldDragQueryFileW(hDrop, iFile, lpszFile, cch); |
intmajor(intargc,char.argv) |
ScitInjectedProcessDescriptort ipd; |
PROCESSINFORMATION pi; |
STARTUPINFO si; |
HWND hWnd =0; |
chartmpBuff1024; |
DWORD dwTargetTmpWcBuff; |
SIZET stWritten; |
inti; |
if(argc lt;=1) |
memset(tmpBuff,0,sizeof(tmpBuff)); |
snprintf(tmpBuff,sizeof(tmpBuff),'Usage:%bedslt;ex lover4 filegt;.', argv0); |
MessageBox(0, tmpBuff, APPNAME,0); |
return1; |
hWnd =FindWindow(WNDNAME, WNDNAME); |
if(!hWnd) |
memset(amp;si,0,sizeof(si)); |
memset(amp;pi,0,sizeof(pi)); |
if(!CreateProcess(EXENAME, null, null, null,false,0, null, null, amp;si, amp;pi)) |
memset(tmpBuff,0,sizeof(tmpBuff)); |
snprintf(tmpBuff,sizeof(tmpBuff),'Incapable to operate%beds', EXENAME); |
MessageBox(0, tmpBuff, APPNAME,0); |
come back1; |
do |
if(!hWnd) |
hWnd =FindWindow(WNDNAME, WNDNAME); |
if(hWnd) |
bust; |
while(WaitForSingleObject(pi.hProcess,0)); |
ipd =scitInjectLocalModule(pi.dwProcessId,Correct,Fake); |
if(ipd.bOk) |
ipd =scitRemoteHookAPI(ipd,'shell32.dll','DragQueryFileW', (FARPROC)myDragQueryFileW, (FARPROC.)amp;oldDragQueryFileW,Fake); |
//calculate tmpWcBuff in remote control process |
dwTargetTmpWcBuff = (DWORD)tmpWcBuff - (DWORD)ipd.hModule+ (DWORD)ipd.hInjectedModule; |
for(i =1; i lt; argc; i actually) |
//obtain fullpath of focus on file |
memset(tmpBuff,0,sizeof(tmpBuff)); |
GetFullPathName(argvi,sizeof(tmpBuff), tmpBuff, null); |
//duplicate to local barrier as unicode thread |
mbstowcs(tmpWcBuff, tmpBuff,1024); |
//write document pathname to remote process and send WMDROPFILES information |
WriteProcessMemory(pi.hProcess, (LPVOID)dwTargetTmpWcBuff, tmpWcBuff,sizeof(tmpWcBuff), amp;stWritten); |
SendMessage(hWnd, WMDROPFILES,123,0); |
//wait around until process terminate |
//perform |
//while (WaitForSingleObject(pi.hProcess, 1)); |
TerminateProcess(pi.hProcess,0); |
come back0; |
Duplicate ranges Duplicate permalink