他们是否混淆了C#代码?

问题描述 投票:1回答:2

这些代码行是否被混淆(C#)?

HWND__* ptr = <Module>.FindWindowW(null, (char*)(&<Module>.??_C@_19HAIJKKDJ@?$AA7?$AA5?$AA5?$AA4?$AA?$AA@));        
<Module>.SendNotifyMessageW(ptr, 1024u, (uint)num, 0);

如果是,是否有消除混淆的软件?

完整方法(代码由ILSpy反编译器反编译):

// My7554_Launcher.Form1
protected unsafe override void WndProc(ref Message m)
{
    IntPtr wParam = m.WParam;
    IntPtr lParam = m.LParam;
    if (m.Msg == 1024)
    {
        if (wParam.ToInt32() == 1)
        {
            <Module>.LicenseServices.UnlockExecute();
            <Module>.LicenseServices.CloseSession();
            base.Close();
        }
        if (wParam.ToInt32() == 3 || wParam.ToInt32() == 4 || wParam.ToInt32() == 5)
        {
            if (<Module>.LicenseServices.LockExecute() == null)
            {
                base.Close();
            }
            else
            {
                int num;
                if (wParam.ToInt32() == 3)
                {
                    num = this.EGLiDecode1(lParam.ToInt32());
                }
                if (wParam.ToInt32() == 4)
                {
                    num = this.EGLiDecode2(lParam.ToInt32());
                }
                if (wParam.ToInt32() == 5)
                {
                    num = this.EGLiDecode3(lParam.ToInt32());
                }
                HWND__* ptr = <Module>.FindWindowW(null, (char*)(&<Module>.??_C@_19HAIJKKDJ@?$AA7?$AA5?$AA5?$AA4?$AA?$AA@));
                <Module>.SendNotifyMessageW(ptr, 1024u, (uint)num, 0);
            }
        }
    }
    base.WndProc(ref m);
}

p / s:尽管有一些评论提到它不是用C#编写的,但是我发现它非常接近C#,例如:

private void InitializeComponent()
{
    ComponentResourceManager manager = null;
    manager = new ComponentResourceManager(typeof(Form1));
    base.SuspendLayout();
    SizeF ef = new SizeF(6f, 13f);
    base.AutoScaleDimensions = ef;
    base.AutoScaleMode = AutoScaleMode.Font;
    Color window = SystemColors.Window;
    this.BackColor = window;
    this.BackgroundImage = (Image) manager.GetObject("$this.BackgroundImage");
    this.BackgroundImageLayout = ImageLayout.Center;
    Size size = new Size(0x28c, 0x138);
    base.ClientSize = size;
    base.ControlBox = false;
    base.FormBorderStyle = FormBorderStyle.None;
    base.Icon = (Icon) manager.GetObject("$this.Icon");
    base.Name = "Form1";
    base.StartPosition = FormStartPosition.CenterScreen;
    this.Text = "Launcher";
    Color white = Color.White;
    base.TransparencyKey = white;
    base.Load += new EventHandler(this.Form1_Load);
    base.ResumeLayout(false);
}
c# obfuscation deobfuscation
2个回答
3
投票

这不是有效的C#。

[当您要求反汇编器/反编译器从最初以支持自由功能的语言编写的程序集生成C#时,可能会显示某些反汇编程序/反编译器(C ++ / CLI确实如此,我认为VB.NET也是如此)。

也许反编译器也提供了查找字符串文字的帮助。

消息号在原始编译过程中被替换,如果您想将其转换为WM_ *常量,则必须自己查找。编译器无法知道原始源中有多少等于1024u的常量中的哪个。对于.NET程序员,您可以引用this list of Window Messages而不是SDK头文件。

总体上,您将有更好的运气手动修复此代码。


0
投票

似乎是编译器生成的代码,可能是从混合模式程序集(C ++。Net)中获得的。但是,几乎没有机会应用字符串加密。我将反编译其他方法,并检查它们是否包含字符串(类似manager.GetObject(“ $ this.BackgroundImage”)之类的东西)。如果可以在其他方法中找到字符串,则代码肯定不会混淆。

© www.soinside.com 2019 - 2024. All rights reserved.