NTVDM CPU 遇到非法指令

发布于 2024-07-11 01:08:07 字数 3103 浏览 4 评论 0原文

我遇到了一个我不明白的相当奇怪的错误。 我创建了一个 C# 控制台应用程序,旨在测试我的 Web 服务是否在网络外部正常工作。 它所做的只是尝试连接到 Web 服务,将每个阶段输出到控制台并将其写入文本文件,以便他们可以向我发送日志。

它在 3 台 XP 机器上完美运行(一台在我的网络内,两台在网络外)。 一台 Vista 机器(有一个清单文件),但在我老板的 XP 机器上(他是一名 IT 人员,所以知道他在做什么),它抛出了一个非常奇怪的错误。

C:\temp\testwe~1.exe NTVDM CPU遇到了非法指令

http://www.houseofhawkins.com/roger.jpg">

我做了一些谷歌搜索,看起来他的NTVDM可能被窃听了,或者有病毒什么的。这些都没有似乎是这种情况。我看不出会发生什么导致

使用 System; 失败。 使用 System.Collections.Generic; 使用系统文本; 使用系统.IO;

命名空间 testwebservice { 班级计划 { 文件流 theFile = null; StreamWriter 作家 = null;

    static void Main(string[] args)
    {
        Program p = new Program();
        p.testMe();
    }

    private void testMe()
    {
        Console.WriteLine("Entered main method about to create stream");            
        try
        {
            theFile = File.Create(@"jonTestWebService.log");
            writer = new StreamWriter(theFile);
            writer.AutoFlush = true;

            try
            {
                message("Starting test at: " + DateTime.Now.ToLongTimeString());

                Random rand = new Random();

                message("creating new instance of webservice");
                houseofhawkins.testweb webServ = new testwebservice.houseofhawkins.testweb();

                message("calling hello world");
                String helloResult = webServ.HelloWorld();
                message("hello world result = " + helloResult);

                int one = rand.Next(999);
                int two = rand.Next(999);
                message("calling maths method with " + one + " + " + two);
                String mathResult = webServ.mytestMethod(one, two);
                message("Math result is: " + mathResult);



                message("Creating instance of CSJawbreaker");
                CSJawbreaker.InformationService csj = new testwebservice.CSJawbreaker.InformationService();

                message("trying to get the latest version number");
                float version = csj.latestVersionNumber();
                message("Version number: " + version.ToString());

                message("");
                message("Finished all processing at: " + DateTime.Now.ToLongTimeString());
            }
            catch (Exception ex)
            {
                writer.WriteLine("");
                writer.WriteLine(ex.Message);
                writer.WriteLine("");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("could not create stream Writer, " + ex.Message);
        }

        message("");
        message("Press return to exit");
        Console.ReadLine();

        writer.Close();
        theFile.Close();
    }

    private void message(String message)
    {
        if (theFile != null && writer != null)
        {
            Console.WriteLine(message);
            writer.WriteLine(message);
        }
    }
}

很困惑为什么上面的代码可以/会这样做。 这只是我想知道的,部分是,这种情况是否会发生在真正的客户计算机上,或者只是我老板的计算机被感染了还是其他什么。

谢谢

I have encountered a rather odd error that I do not understand. I created a C# console application that was designed to just be a test to see if my web service was working from outside my network. All it did was try and connect to the webservice, output each stage to the console and write it to a text file so they could send me the logs.

It worked perfectly on 3 XP machines (one inside my network, 2 outside). A Vista machine (had a manifest file) but on my bosses XP machine (he is an IT guy so does know what he is doing), it threw a very odd error.

C:\temp\testwe~1.exe
The NTVDM CPU has encountered an illegal instruction

http://www.houseofhawkins.com/roger.jpg">

I did some googling and it seemed like his NTVDM might have been buggered, or there was a virus or something. None of these seem to be the case. I can not see what would be happening to cause this to fail in such a way.

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace testwebservice
{
class Program
{
FileStream theFile = null;
StreamWriter writer = null;

    static void Main(string[] args)
    {
        Program p = new Program();
        p.testMe();
    }

    private void testMe()
    {
        Console.WriteLine("Entered main method about to create stream");            
        try
        {
            theFile = File.Create(@"jonTestWebService.log");
            writer = new StreamWriter(theFile);
            writer.AutoFlush = true;

            try
            {
                message("Starting test at: " + DateTime.Now.ToLongTimeString());

                Random rand = new Random();

                message("creating new instance of webservice");
                houseofhawkins.testweb webServ = new testwebservice.houseofhawkins.testweb();

                message("calling hello world");
                String helloResult = webServ.HelloWorld();
                message("hello world result = " + helloResult);

                int one = rand.Next(999);
                int two = rand.Next(999);
                message("calling maths method with " + one + " + " + two);
                String mathResult = webServ.mytestMethod(one, two);
                message("Math result is: " + mathResult);



                message("Creating instance of CSJawbreaker");
                CSJawbreaker.InformationService csj = new testwebservice.CSJawbreaker.InformationService();

                message("trying to get the latest version number");
                float version = csj.latestVersionNumber();
                message("Version number: " + version.ToString());

                message("");
                message("Finished all processing at: " + DateTime.Now.ToLongTimeString());
            }
            catch (Exception ex)
            {
                writer.WriteLine("");
                writer.WriteLine(ex.Message);
                writer.WriteLine("");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("could not create stream Writer, " + ex.Message);
        }

        message("");
        message("Press return to exit");
        Console.ReadLine();

        writer.Close();
        theFile.Close();
    }

    private void message(String message)
    {
        if (theFile != null && writer != null)
        {
            Console.WriteLine(message);
            writer.WriteLine(message);
        }
    }
}

}

I am very stuck why the above code could / would do this. It is sort of just I want to know and partly, could this happen to a real clients machine, or just is my bosses machine infected or something.

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

摘星┃星的人 2024-07-18 01:08:07

如果您最终使用 NTVDM,那就大错特错了,因为这是 XP 的 16 位 DOS 模拟层。 如果您重新复制 EXE 后再次发生这种情况,我会调查您老板的 PC 上安装的软件(.NET Framework 版本等)。

我还会尝试在 WinDbg 中运行它,看看你最终会在哪里,一旦出现故障等就会获取调用堆栈,我敢打赌你会在堆栈上找到一个奇怪的模块(间谍软件等)。

Something is very wrong if you end up in NTVDM, as this is the 16-bit DOS emulation layer for XP. If this happens again after you recopy the EXE across, I'd investigate the software installed on your boss's PC (.NET framework version, etc).

I'd also try running this in WinDbg to see where you end up, get a call stack once it faults out etc, I bet you'll find a strange module on the stack (spyware, etc).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文