惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
Simon Willison's Weblog
Simon Willison's Weblog
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
S
SegmentFault 最新的问题
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
量子位
SecWiki News
SecWiki News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
爱范儿
爱范儿
S
Secure Thoughts
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
D
Docker
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
F
Fortinet All Blogs
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
Recent Announcements
Recent Announcements
Recent Commits to openclaw:main
Recent Commits to openclaw:main
G
GRAHAM CLULEY
Recorded Future
Recorded Future
罗磊的独立博客
Forbes - Security
Forbes - Security
Security Latest
Security Latest
NISL@THU
NISL@THU
T
The Exploit Database - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
T
Tenable Blog
C
Cybersecurity and Infrastructure Security Agency CISA
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
K
Kaspersky official blog
月光博客
月光博客
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic

博客园 - SuperCai

Leaf'n Joy 隐私政策 Leaf'n Joy (植物灯IOSAPP) WndProc(ref Message m) [转]DllImport属性详解 [转]C#自定义控件背景色透明的方法 对C#插件接口应用的一些理解 日期时间格式化(到毫秒) [转]使用foreach 循环删除DataRow的时候的问题 UTC时间与WINDOWS时间互换 [转]C# Telnet [原]电子工程师工具箱 电缆电压降计算 红外对射探测器的安装方法 红外对射调试 终于想起了密码~~汗~~ 解决 Win2003 SP1 无法安装 - SuperCai .net创建windows Service步骤 用netsh自动切换IP
动态内存中加载DLL的问题
SuperCai · 2008-02-28 · via 博客园 - SuperCai

Private Sub RunMain(ByVal Dllpath As String, ByVal types As String)
        Dim str(1) As String
        Try
            Dim asm As [Assembly]
            '加载DLL
            '这里要检测文件是否存在
            Dim FS As New System.IO.FileStream(Dllpath, FileMode.Open) 'Application.StartupPath & "\jad.dll"

            Dim ms As New MemoryStream

            Dim data As Byte()

            ReDim data(FS.Length)

            FS.Read(data, 0, FS.Length)

            FS.Close()

            asm = System.Reflection.Assembly.Load(data)

            Dim myType As System.Type = asm.GetType(types) '获得Class1的Type  '"JcAppDll.ClassMain"
            Dim obj As Object = Activator.CreateInstance(myType) '获得Class1的实例
            ' Application.Run(obj)
            obj.Main()

        Catch ex As Exception
            Dim writer As IO.StreamWriter = New IO.StreamWriter(Application.StartupPath & "\UpdateMainLOG.log")
            writer.WriteLine(Err.Number)
            writer.WriteLine(Err.Description)
            writer.Close()
        End Try
        Dim writerA As IO.StreamWriter = New IO.StreamWriter(Application.StartupPath & "\UpdateMainLOG.log")
        writerA.WriteLine("Run Seccedd!")
        writerA.Close()
    End Sub

'///////////////////////////////////
以上代码加载是成功的
但无法在DLL调用HOOK一类的东西.
把DLL加载到内存中再Assembly.Load的这种方法使用不了HOOK,直接Load则可以.
不知有没朋友遇到过这种情况?
知道的帮帮忙