后门程序dll释放出错(痛苦+郁闷..........帮帮我吧!......)(77分)

  • 主题发起人 主题发起人 jack011
  • 开始时间 开始时间
J

jack011

Unregistered / Unconfirmed
GUEST, unregistred user!
程序如下:
procedure DLLEntryPoint(dwReason: DWord);
begin
case dwReason of
DLL_PROCESS_ATTACH:CoInitialize(nil);//初始化
DLL_PROCESS_DETACH:CoUninitialize;//释放
end;
end;

function DllRegisterServer: HResult; stdcall;
begin
try
InstallService;
Result := S_OK;
except
Result := E_FAIL;
end;
end;

function DllUnregisterServer: HResult; stdcall;
begin
try
UninstallService;
Result := S_OK;
except
Result := E_FAIL;
end;
end;

function DllCanUnloadNow: HResult; stdcall;
begin
Result := S_OK;
end;

// 导出函数列表
exports
ServiceMain,
DllRegisterServer,
DllUnregisterServer,
InstallService,
UninstallService;

{ dll入口点 }
begin
DllProc := @DllEntryPoint;
DllEntryPoint(DLL_PROCESS_ATTACH);
end.

为什么我的外部加载程序退出时,程序报地址错误呢?
不知咋个释放这个东东,参考了不少办法,可是都没成功!
郁闷啊......我看过以前的帖子,好象此类问题最终都没有圆满解决,
希望各路高手帮帮我吧!
 
procedure DLLEntryPoint(dwReason: DWord);
begin
case dwReason of
DLL_PROCESS_ATTACH:
;
DLL_PROCESS_DETACH:
;
DLL_THREAD_ATTACH:
;
DLL_THREAD_DETACH:
;
end;
end;

function DllRegisterServer: HResult; stdcall;
begin
try
InstallService;
Result := S_OK;
except
Result := E_FAIL;
end;
end;

function DllUnregisterServer: HResult; stdcall;
begin
try
UninstallService;
Result := S_OK;
except
Result := E_FAIL;
end;
end;

function DllCanUnloadNow: HResult; stdcall;
begin
Result := S_OK;
end;

// 导出函数列表
exports
ServiceMain,
DllRegisterServer,
DllUnregisterServer,
InstallService,
UninstallService;

{ dll入口点 }
begin
DllProc := @DLLEntryPoint;
end.
主程序加异常:
try

...
except
..
end;

基本没事了!(网上也有现成的DEMO)
 
接受答案了.
 
后退
顶部