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

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - jasonM

真是郁闷,团队中居然出了这样的骗子!! C++反汇编揭秘1 – 一个简单C++程序反汇编解析 函数调用堆栈变化分析 - jasonM - 博客园 为什么要下断bpSend,原理分析。 做挂第一步:如何找基址(以热血传奇为例) 一步步学外挂(二).CALL的原理。 - jasonM - 博客园 开发企业直销软件需求分析 开发旺旺群发软件,难点及重要技术点分析(一) 正则表达式系列文章整理 群发软件开发原理分析 通俗解释socket(并附上注释Socket源代码) CMainFrame::PreCreateWindow这个函数执行了两次 一步步学破解-sdk用实例讲解GDI映射机制 一步步学破解-sdk用实例讲解GDI(含各个消息的调用时机) 一步步学破解-sdk进程间传递信息 一步步学破解-在已有的主窗口上创建按钮(三) 一步步学破解-windows消息循环原理实例总结(二) 一步步学破解-函数调用堆栈变化分析 (一) 老王最新壳试脱时遇到的问题,详细表述如下
.net调用vc++写的dll
jasonM · 2009-06-03 · via 博客园 - jasonM

1.vc做的win32的dll,其中dll2.cpp文件代码如下:

int add(int a,int b)
{

 return a+b+1;
}

int subtract(int a,int b)
{
 return a-b;
}

2.dll2.def代码如下:

LIBRARY dll2
EXPORTS
add
subtract

3.将dll2.lib和dll2.dll拷到c#当前目录下

4.建立测试用的.net程序,代码如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;   

namespace WindowsApplication1
{


    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {


        }

        private void button1_Click(object sender, EventArgs e)
        {
           int nindex=Name1.add(2,0);
        }
    }

    public class Name1
    {

        //导入dll

        [DllImport("dll2.dll", CallingConvention = CallingConvention.StdCall)]

        //声明接口函数

        public static extern int add(int a, int b);

    }
}