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

推荐订阅源

The Cloudflare Blog
T
Tenable Blog
V
Vulnerabilities – Threatpost
T
Troy Hunt's Blog
SecWiki News
SecWiki News
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Secure Thoughts
Cyberwarzone
Cyberwarzone
A
Arctic Wolf
H
Heimdal Security Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
N
News and Events Feed by Topic
The Hacker News
The Hacker News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
Forbes - Security
Forbes - Security
Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
T
Tor Project blog
WordPress大学
WordPress大学
AWS News Blog
AWS News Blog
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
Cloudbric
Cloudbric
O
OpenAI News
U
Unit 42
Google DeepMind News
Google DeepMind News
Simon Willison's Weblog
Simon Willison's Weblog
Recorded Future
Recorded Future
N
News | PayPal Newsroom
S
Schneier on Security
F
Full Disclosure
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
P
Privacy International News Feed
L
LINUX DO - 最新话题
F
Fortinet All Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements

博客园 - 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则可以.
不知有没朋友遇到过这种情况?
知道的帮帮忙