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

推荐订阅源

博客园 - 三生石上(FineUI控件)
L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
T
Tailwind CSS Blog
T
The Blog of Author Tim Ferriss
U
Unit 42
B
Blog
N
Netflix TechBlog - Medium
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
O
OpenAI News
M
MIT News - Artificial intelligence
D
DataBreaches.Net
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
L
LINUX DO - 热门话题
C
CERT Recently Published Vulnerability Notes
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic
Vercel News
Vercel News
T
Tenable Blog
Security Latest
Security Latest
C
Check Point Blog
云风的 BLOG
云风的 BLOG
PCI Perspectives
PCI Perspectives
月光博客
月光博客
TaoSecurity Blog
TaoSecurity Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Project Zero
Project Zero
雷峰网
雷峰网
IT之家
IT之家
H
Hacker News: Front Page
Microsoft Security Blog
Microsoft Security Blog
B
Blog RSS Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Last Week in AI
Last Week in AI
G
Google Developers Blog
Forbes - Security
Forbes - Security
The Register - Security
The Register - Security
Cyberwarzone
Cyberwarzone
小众软件
小众软件
Martin Fowler
Martin Fowler
K
Kaspersky official blog
P
Proofpoint News Feed
T
Threatpost
Google Online Security Blog
Google Online Security Blog
Microsoft Azure Blog
Microsoft Azure Blog

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