吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 140|回复: 0
收起左侧

[经验求助] c# 调用dll问题,来个大神

[复制链接]
jerrywen 发表于 2024-5-24 15:52
200吾爱币
调用的是有米的单窗口单ip dll,在易语言里面测试正常可以工作,c#里面可以调用,返回值也是true,但是没有效果 ,下面是c#代码


// DLL 导入定义
[DllImport ("D:\\XYDcapSDK2.dll")
public static extern IntPtr YouMiIp_init ([MarshalAs (UnmanagedType.LPStr) string driverName, [MarshalAs (UnmanagedType.LPStr) string bindIp, [MarshalAs (UnmanagedType.LPStr) string loopbackIpv4, [MarshalAs (UnmanagedType.LPStr) string loopbackIpv6, bool compatibilityMode);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)
public static extern bool YouMiIp_interceptMode (int interceptMode);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)
public static extern int YouMiIp_addRule (int toHead, int protocol, int pid, int direction, int localPort, int remotePort, int ipFamily, string localIpAddress, string localIpMask, string remoteIpAddress, string remoteIpMask, int filteringFlag, string processName);
[DllImport ("D:\\XYDcapSDK2.dll")
public static extern bool YouMiIp_addPidProxy (int pid, int proxyMode, [MarshalAs (UnmanagedType.LPStr) string proxyUrl, int targetFilter, [MarshalAs (UnmanagedType.LPStr) string targetFilterList, int dnsMode, [MarshalAs (UnmanagedType.LPStr) string dnsModeList, int speedLimitId);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi)
public static extern void YouMiIp_free ();
[DllImport ("D:\\XYDcapSDK2.dll")
public static extern long YouMiIp_getSendFlow (int pid);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)
public static extern long YouMiIp_getRecvFlow (int pid);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)
public static extern int YouMiIp_getNumConnections (int pid);
public IntPtr Init (string driverName, string bindIp, string loopbackIpv4, string loopbackIpv6, bool compatibilityMode)
{
return YouMiIp_init (driverName, bindIp, loopbackIpv4, loopbackIpv6, compatibilityMode);
}
public bool AddPidProxy (int pid, int proxyMode, string proxyUrl, int targetFilter, string targetFilterList, int dnsMode, string dnsModeList, int speedLimitId)
{
return YouMiIp_addPidProxy (pid, proxyMode, proxyUrl, targetFilter, targetFilterList, dnsMode, dnsModeList, speedLimitId);
}
public void close ()
{
YouMiIp_free ();
}

下面是e语言源码带核心挨揍云地址
https://wwm.lanzoue.com/iwacU1zksr4b

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-6-17 13:30

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表