如何让其它程序报错

云满笔记 2014-06-04 01:34:11
我现在想让其它程序报错,就是让指定的进程崩溃,怎么做?

注意:是让其它程序进程,不是自身,自身好做啊。

最好附上源码,谢谢!
...全文
420 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2014-06-05
  • 打赏
  • 举报
回复
引用 9 楼 ForestDB 的回复:
Linux下,可以向任一进程发信号,使之crash或者core dump; Windows下可以搜搜有无类似的消息。
ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.vssdk.v90/dv_vsdbgsdk/html/1f4096a8-f7aa-4dfa-84e1-6d59263e70bb.htm Collapse AllExpand All Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: J# Code: JScript Visual Basic C# Visual C++ J# JScript Visual Studio SDK Visual Studio Debugger SDK Roadmap See Also Send Feedback [Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.] Updated: November 2007 This documentation provides guide and reference information for the Microsoft Visual Studio Debugger SDK. Visual Studio debugging documentation includes samples, a comprehensive reference, and several representative scenarios that demonstrate typical ways to customize the debugger. Your compiler and its output determine what you need to do to implement debugging in your product. If your compiler: Targets the Windows native operating system and writes a .PDB file, you can debug programs with the native code debug engine (DE), which is integrated into Visual Studio. You do not need to implement a DE or expression evaluator. The expression evaluator is written for the syntax of the C++ programming language. Produces Microsoft intermediate language (MSIL) output, you can debug programs with the managed code debug engine DE, which is also integrated into Visual Studio. Thus, you need only implement an expression evaluator. A sample expression evaluator is provided for you. For more information, see the following topics: Expression Evaluation Evaluating Expressions Expression Evaluation Context Expression Evaluation in Break Mode Writing a Common Language Runtime Expression Evaluator Targets a proprietary operating system or some other run-time environment, you need to write your own DE. A tutorial that creates a simple DE using ATL COM is provided. For more information, see the following topics: Creating a Custom Debug Engine Tutorial: Building a Debug Engine Using ATL COM Implementing a Port Supplier Visual Studio Debugging Samples See Also Other Resources Getting Started (Visual Studio Debugging SDK) Send feedback on this topic to Microsoft.
ForestDB 2014-06-04
  • 打赏
  • 举报
回复
Linux下,可以向任一进程发信号,使之crash或者core dump; Windows下可以搜搜有无类似的消息。
云满笔记 2014-06-04
  • 打赏
  • 举报
回复
引用 5 楼 zhao4zhong1 的回复:
[quote=引用 4 楼 sd530842780 的回复:] [quote=引用 3 楼 zhao4zhong1 的回复:] [quote=引用 2 楼 sd530842780 的回复:] 打开进程,修改进程权限,然后Writeporcessmemory就可以了
先杀猪还是先杀驴?[/quote] 我去,赵老师您英明,您决定吧[/quote] 我本来是想回复“我也是这么想的。”不知怎么就想起赵本山的小品了。[/quote]? 赵老师 看看我的问题吧 我真不知道如何使指定进程报错 有没有什么万能的“代码方法” 别跟我说拆硬盘什么之类的 就是那种 只影响指定进程而不会影响到其它进程的方法 我上面附带的WriteProcessMemory代码好像不行 不知道为什么
云满笔记 2014-06-04
  • 打赏
  • 举报
回复
引用 2 楼 sd530842780 的回复:
打开进程,修改进程权限,然后Writeporcessmemory就可以了
我的代码如下:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>

int main()
{
    int iChoice; // Store users choice.

    DWORD dwProcId; // Store Star Sonata Process ID
    HWND hStarSonata; //
    HANDLE hProcess; // Handle to Star Sonata process

    // Always do error checking, even if it takes a few seconds more to type!
    if ((hStarSonata = FindWindow(NULL, "Star Sonata")) == NULL) { // Try to find the Star Sonata window.
        printf("Cannot find Star Sonata window!"); // We couldn't find it
        exit(1); // So let the user know and exit.
    }

    if (! GetWindowThreadProcessId(hStarSonata, &dwProcId)) { // Try to get the Process ID for use in OpenProcess
        printf("Cannot retrieve process Id!"); // Let them know we cant get it
        exit(1); // Exit...
    }

    // Now we are going to get a process handle to the game
    if ((hProcess = OpenProcess(PROCESS_VM_WRITE, FALSE, dwProcId)) == NULL) { // Call OpenProcess to get VM Write access
        printf("Cannot open process!"); // Failed to open process. Wrong priviliges?
        exit(1);
    }

    printf("Star Sonata Speed Hack (Noz3001)\n\n(1)Enable Speed Hack\t(2)Disable Speed Hack\t(3)Quit\n\n"); // Show Options

    while(iChoice != 3) { // Whilst option is not 3
        printf("NOZ> _\b");
        scanf("%i", &iChoice); // Get next option

        switch(iChoice) {
            case 1:
                // Enable speed hack
                if (! WriteProcessMemory(hProcess, (void*)0x00463de0, 0x75, 1, NULL)) { // Try to write 0x75 (jne) to 0x00463de0 (my address)
                    printf("Failed to write to memory!\n");
                }
                printf("Speed hack enabled.\n");
                break;

            case 2:
                // Disable speed hack
                if (! WriteProcessMemory(hProcess, (void*)0x00463de0, 0x74, 1, NULL)) { // 0x74 is (je). The original opcode.
                    printf("Failed to write to memory!\n");
                }
                printf("Speed hack disabled.\n");
                break;

            case 3:
                printf("Leaving...\n");
                continue;

            default:
                printf("No such option!\n");
                break;
        }
    }

    CloseHandle(hProcess);
    exit(0);
}
提示:Failed to write to memory 我用GetLastError获取的结果是998 为什么??
ForestDB 2014-06-04
  • 打赏
  • 举报
回复
给其他进程发信号。
赵4老师 2014-06-04
  • 打赏
  • 举报
回复
引用 4 楼 sd530842780 的回复:
[quote=引用 3 楼 zhao4zhong1 的回复:] [quote=引用 2 楼 sd530842780 的回复:] 打开进程,修改进程权限,然后Writeporcessmemory就可以了
先杀猪还是先杀驴?[/quote] 我去,赵老师您英明,您决定吧[/quote] 我本来是想回复“我也是这么想的。”不知怎么就想起赵本山的小品了。
不要做咸鱼 2014-06-04
  • 打赏
  • 举报
回复
引用 3 楼 zhao4zhong1 的回复:
[quote=引用 2 楼 sd530842780 的回复:] 打开进程,修改进程权限,然后Writeporcessmemory就可以了
先杀猪还是先杀驴?[/quote] 我去,赵老师您英明,您决定吧
赵4老师 2014-06-04
  • 打赏
  • 举报
回复
引用 2 楼 sd530842780 的回复:
打开进程,修改进程权限,然后Writeporcessmemory就可以了
先杀猪还是先杀驴?
不要做咸鱼 2014-06-04
  • 打赏
  • 举报
回复
打开进程,修改进程权限,然后Writeporcessmemory就可以了
云满笔记 2014-06-04
  • 打赏
  • 举报
回复
自己先顶一个先 。。。
打开链接下载源码: https://pan.quark.cn/s/05da658a2377 在信息技术领域中,输入法作为操作系统的一个核心构成部分,赋予了用户利用键盘输入多语种文字的能力。"ime-日语输入法安装必须文件"这一资源是一套为日语输入法部署而设计、包含全部必要元素的集成包,对于那些需要在个人计算机上执行日语文字输入的操作者而言具有不可替代的作用。接下来将深入剖析其中所包含的核心概念。 IME(Input Method Editor,输入法编辑器)是操作系统内的一种软件支持服务,其功能在于为非拉丁字符环境提供文字输入方案,例如中文、日文、韩文等文字系统。在日本地区,IME通常被用来将罗马字(罗马拼音)形式的输入转换为平假名、片假名乃至汉字。此压缩文件内含的日语IME文件夹即为执行这一转换功能的关键要素。 kbdjpn.dll被视为一个关键的系统性文件,其意指“Japanese Keyboard Layout”(日语键盘布局)。该动态链接库文件负责设定日语键盘的排列方式及快捷操作组合,使用户能够借助常规的QWERTY键盘输入日语文字。倘若缺少这一文件,即便已经安装了日语输入法,依然无法正常显示及输入日语字符。 另外,imjp81k.dll同样是一个重要的系统性构成,它属于日语IME的范畴,全称为“Input Method Japanese for Windows 8.1 and later, Katakana mode”(适用于Windows 8.1及更新版本的日语输入法,片假名模式)。该文件支持日语的片假名输入,是处理日语输入的核心组成部分。在安装或升级日语输入法的过程中,保证imjp81k.dll的准确性与完整性显得尤为关键。 压缩包所含的"Window...
内容概要:本文研究了基于DPWMA调制与正负序分离的ANPC三电平并网逆变器前馈控制策略,旨在解决传统三电平逆变器在谐波抑制、电网不平衡适应性及动态响应方面的技术瓶颈。通过构建融合双极性倍频脉宽调制(DPWMA)、正负序分离锁相控制与电网电压前馈的一体化控制体系,全面优化逆变器的输出波形质量、相位同步精度与抗扰能力。文章深入分析了ANPC三电平拓扑的结构优势,如开关损耗均衡、中点电位可控性强和电压利用率高等特点,并设计了包含信号采集、核心控制与调制驱动三层架构的完整控制系统。通过Simulink仿真平台对稳态运行、电网不平衡及动态扰动等多种工况进行验证,结果表明该策略显著降低了总谐波畸变率,提升了锁相精度与系统动态稳定性,有效增强了逆变器在复杂电网环境下的适应能力和运行可靠性。; 适合人群:具备电力电子、自动控制及新能源并网相关基础知识,从事新能源发电、微电网、电力系统仿真等领域的科研人员与工程技术人员,特别适合研究生及以上层次的研究者。; 使用场景及目标:①用于提升大功率并网逆变器在电网电压不平衡、谐波干扰和动态扰动等复杂工况下的运行性能;②为高电能质量要求的应用场景提供先进控制解决方案;③支持科研仿真、论文复现与实际工程项目中的高性能并网控制系统设计与优化。; 阅读建议:建议结合提供的Simulink仿真模型进行实践操作,重点理解DPWMA调制机制、正负序分离锁相算法与电网电压前馈控制之间的协同作用,按照文档结构系统学习,并与传统控制策略进行对比分析,以深入掌握改进策略的技术优势与实现细节。

33,315

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧