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

推荐订阅源

Latest news
Latest news
T
Troy Hunt's Blog
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
V
V2EX
博客园 - 司徒正美
B
Blog RSS Feed
AWS News Blog
AWS News Blog
MyScale Blog
MyScale Blog
Scott Helme
Scott Helme
Cisco Talos Blog
Cisco Talos Blog
Last Week in AI
Last Week in AI
NISL@THU
NISL@THU
博客园 - Franky
P
Proofpoint News Feed
博客园_首页
C
CERT Recently Published Vulnerability Notes
雷峰网
雷峰网
S
Schneier on Security
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
WordPress大学
WordPress大学
The Hacker News
The Hacker News
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Microsoft Azure Blog
Microsoft Azure Blog
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
罗磊的独立博客
T
The Blog of Author Tim Ferriss
D
Darknet – Hacking Tools, Hacker News & Cyber Security
I
Intezer
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
K
Kaspersky official blog
SecWiki News
SecWiki News
云风的 BLOG
云风的 BLOG
美团技术团队
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Security Latest
Security Latest
C
Cyber Attacks, Cyber Crime and Cyber Security
B
Blog
S
Security Affairs

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