c# - C# 导入 dll 文件 - 文件有坏图像... msb3246
问题描述
我尝试导入 DLL 库,但是当我想这样做时,我收到了警告
已解决的文件有错误的图像、没有元数据或无法访问。(MSB3246)
我使用 SharpDevelop。dll文件在工作目录中,我也尝试添加参考,但这对我没有帮助。我搜索了很多关于这个问题的信息,但我没有找到任何有意义的解决方案,这可以帮助我。
/*
* Created by SharpDevelop.
* User: Tomek
* Date: 2019-04-04
* Time: 02:47
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Runtime.InteropServices;
using System.IO;
using System.Drawing;
using System.Windows.Forms;
namespace deobfuscator
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
OpenFileDialog obfuscated_script = new OpenFileDialog();
string obf_name;
[DllImport("C:\\Users\\Tomek\\Documents\\SharpDevelop Projects\\deobfuscator\\deobfuscator\\netc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool DeobfuscateScript(string inbuff, long insize, string outbuff, long outsize, string fname);
void Button1Click(object sender, EventArgs e)
{
obfuscated_script.Filter = "LUAC|*luac|LUA|*lua";
if (obfuscated_script.ShowDialog() == DialogResult.OK)
{
textBox1.Text = obfuscated_script.FileName;
obf_name = obfuscated_script.SafeFileName;
}
}
void Button2Click(object sender, EventArgs e)
{
if(textBox1.Text.Length > 0)
{
button2.Enabled = false;
button1.Enabled = false;
string appPath = Application.ExecutablePath;
long size = new FileInfo(textBox1.Text).Length;
//DeobfuscateScript(textBox1.Text, size, textBox1.Text + "decrypt", size, obf_name);
if(checkBox1.Checked)
{
}
}
}
void Label1Click(object sender, EventArgs e)
{
}
void MainFormLoad(object sender, EventArgs e)
{
}
}
}
我在那里导入dll
[DllImport("C:\\Users\\Tomek\\Documents\\SharpDevelop Projects\\deobfuscator\\deobfuscator\\netc.dll", CallingConvention = CallingConvention.Cdecl)]
解决方案
推荐阅读
- forms - 商店用品 6 表格
- prolog - 为什么这会给出 NonGroundProbabilisticClause 错误,而不是确定性对应错误?
- javascript - 如何将方法性能误差与最大值拼接起来
- css - Div 在 Code Pen 桌面上工作但在移动设备上打开时不工作的背景图像
- r - R中逻辑回归模型的ConfusionMatrix
- javascript - 使用 discord.js 获取 Giphy Api 时出错
- java - 为什么 char 重载不适用于三元表达式中的整数和字符?
- java - 将数据从文本映射到列表
- python - matplotlib用极坐标绘制pdf错误
- python - 删除张量切片作为 TensorFlow 层的一部分