C/C++/Delphi 调用命令并且显示执行结果

C/C++ 代码:

void ExecutCmd()
{
	SECURITY_ATTRIBUTES sa;
	HANDLE hRead,hWrite;
	wchar_t * lpCommandLine =_T("ping.exe www.h4ck.org.cn ");
	sa.nLength = sizeof(SECURITY_ATTRIBUTES);
	sa.lpSecurityDescriptor = NULL;
	sa.bInheritHandle = TRUE;

	TCHAR temp[255] = {0};
	_tcscpy(temp,lpCommandLine);
	if (!CreatePipe(&hRead,&hWrite,&sa,0)) {
		MessageBox(_T("Error On CreatePipe()"));
		return;
	}

	STARTUPINFO si;
	PROCESS_INFORMATION pi;
	si.cb = sizeof(STARTUPINFO);
	GetStartupInfo(&si);
	si.hStdError = hWrite;
	si.hStdOutput = hWrite;
	si.wShowWindow = SW_HIDE;
	si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
	if (!CreateProcess(NULL,temp
		,NULL,NULL,TRUE,NULL,NULL,NULL,&si,&pi)) {
			MessageBox(_T("Error on CreateProcess()"));
			return;
	}
	CloseHandle(hWrite);

	char buffer[4096] = {0};
	DWORD bytesRead;
	while (true) {

		if (ReadFile(hRead,buffer,0x3FFu,&bytesRead,NULL) == NULL)
			break;
		outputstr += buffer;//m_outputstr is CString
		OutputDebugString(outputstr);
		UpdateData(false);
		Sleep(200);
		
	}
}
Continue Reading

Let them drag and drop files on your program

unit dropfile;
 interface
 uses
   Windows, Messages, SysUtils, Classes,
   Graphics, Controls, Forms, Dialogs;
 type
   TForm1 = class(TForm)
     procedure FormCreate(Sender: TObject);
   private
     { Private declarations }
   public
     { Public declarations }
     // declare our DROPFILES message handler
     procedure AcceptFiles( var msg : TMessage );
     message WM_DROPFILES;
   end;
 var
   Form1: TForm1;
 implementation
 uses
   // this unit contains certain functions that we'll be using
   ShellAPI;
 {$R *.DFM}
Continue Reading

OD Unicode String Format Convert v0.1

就像我们所熟知的那样,IDA对于Unicode和中文的串式参考并没有太好的处理,在这一方面不管是从插件还是ida自身的功能来看都要比OD的Unicode字符串搜索差得多。但是OD的字符串参考却不太好导入到IDA中于是就先是写了个idc的脚本,用来导入数据。今天又写了个小工具用来处理od解析出来的中文字符串参考。效果就是上面的样子,也许那天实在无聊了会改下OD的中文字符串搜索插件,让其可以直接导出数据。

Continue Reading

Embarcadero.Delphi.XE2.RTM.v16.0.4256.43595.Lite.v5.0

Embarcadero.Delphi.XE2.RTM.v16.0.4256.43595.Lite.v5.0
——————————————————————————–

作者:lsuper
——————————————————————————–
发布历史:
2011.09.09 – v5.0
1、根据 RTM v16.0.4256.43595 原版制作
2011.08.08 – v5.0 Beta8
1、根据 beta8 v16.0.4223.41907 原版制作
2、为便于大家试用,写了一个 XE2Resetter 外挂
——————————————————————————–

Continue Reading