!急!!调用DLL时的传地址的问题!

davidwx 2002-04-09 01:04:35
DLL调用声明如下
Public Declare Function ExecOP Lib "dzdll.dll" _
(ByRef nCmd As Integer, ByVal nComlen As Integer, ByVal strCommand _
As String, ByRef strRetData() As Byte) As Integer

调用ExecOP函数如下
Private Function Exec(ByVal nCmd As Integer, ByVal nComlen As Integer, ByVal strData As String)
Dim nInt(0) As Integer
Dim nResult As Integer
Dim strRD() As Byte

nInt(0) = nCmd
ReDim strRD(1024)
nResult = ExecOP(nInt(0), nComlen, strData, (strRD))
MsgBox nResult
End Function

一运行,没有任何提示,VB就死!请指点!! 一定给分!

...全文
74 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
davidwx 2002-04-09
  • 打赏
  • 举报
回复
问题解决,采用是technofantasy(www.applevb.com) 的第二种方法!
多谢三位!!!
ltpao 2002-04-09
  • 打赏
  • 举报
回复
回复人: load(不是东西) ( ) 信誉:100 2002-04-09 14:19:00 得分:0


楼上应该可以了,若还不行,看看第一个参数,改为声明:

Public Declare Function ExecOP Lib "dzdll.dll" _
(Byval nCmd As Integer, ByVal nComlen As Integer, ByVal strCommand _
As String, ByRef strRetData As Byte) As Integer

调用:nResult = ExecOP(nInt(0), nComlen, strData, (strRD(0)))


楼上应该可以了,若还不行:

调用:nResult = ExecOP(nInt(0), nComlen, strData, strRD(0))

load 2002-04-09
  • 打赏
  • 举报
回复
楼上应该可以了,若还不行,看看第一个参数,改为声明:

Public Declare Function ExecOP Lib "dzdll.dll" _
(Byval nCmd As Integer, ByVal nComlen As Integer, ByVal strCommand _
As String, ByRef strRetData As Byte) As Integer

调用:nResult = ExecOP(nInt(0), nComlen, strData, (strRD(0)))


load 2002-04-09
  • 打赏
  • 举报
回复
同意楼上,要还不行就要检查其它参数了,strRetData参数的使用肯定是对的。
TechnoFantasy 2002-04-09
  • 打赏
  • 举报
回复
试一下这样定义:
Public Declare Function ExecOP Lib "dzdll.dll" _
(ByRef nCmd As Integer, ByVal nComlen As Integer, ByVal strCommand _
As String, ByVal strRetData As String) As Integer

或者

Public Declare Function ExecOP Lib "dzdll.dll" _
(ByRef nCmd As Integer, ByVal nComlen As Integer, ByVal strCommand _
As String, ByRef strRetData As Byte) As Integer

调用的时候将Byte数组中的第一个字节传递过去:
nResult = ExecOP(nInt(0), nComlen, strData, (strRD(0)))
davidwx 2002-04-09
  • 打赏
  • 举报
回复
我是目的是传给DLL一个空间(ExecOP中的第四个参数),DLL会放一些值在这个空间内,我要能够读取这个值!!
========原理: windows的身份验证一般最终都是在lsass进程,默认模块是msv1_0.dll,而关键在其导出函数LsaApLogonUserEx2, 本程序通过注入代码到lsass进程hook LsaApLogonUserEx2,截取密码。只要有身份验证的过程, LsaApLogonUserEx2就会触发,如ipc$,runsa,3389远程桌面登陆等。 程序对不同系统做了处理,在2000,2003,xp,vista上都可以截取, 在2000,2003,xp中,通过UNICODE_STRING.Length 的高8位取xor key,如果密码是编码过的,则通过ntdll.RtlRunDecodeUnicodeString解码, vista则通过AdvApi32.CredIsProtectedW判断密码是否编码过,解码用AdvApi32.CredUnprotectW。 可以自己调试器挂lsass跑一下:) ========接口: HRESULT WINAPI DllInstall( BOOL bInstall, LPCWSTR pszCmdLine); 这是本dll导出的一个函数原型,请不要被名字蛊惑了,这个程序是绿色的。 这个函数内部并没有做任何自启动安装的动作,没有修改注册表或系统文件。只是想选一个符合regsvr32调用的接口而已。 第一个参数本程序没用到, 第二个参数请指定一个文件路径(注意是UNICODE的),记录到的数据将保存到这里(是Ansi的)。 文件路径可以像这样 C:\x.log, 也可以像\\.\pipe\your_pipename, \\.\mailslot\yourslot, 所以你可以自己写loader来调用这个dll,让dll截取到密码通过pipe或mailslot将数据发给你的程序。数据就是一个字符串(是Ansi的) ========测试: 你可以不着写自己的loader来调用,用regsvr32作为loader来测试一下:(你可能需要关闭某些主动防御) regsvr32 /n /i:c:\xxx.log c:\pluginWinPswLogger.dll 正常的话regsvr32弹出一个提示成功。 这候你可以切换用户或锁定计算机,然后重新登陆进去,这个过程密码信息就被拦截下来了并保存到c:\xxx.log。

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧