问题标签 [codecave]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
3129 浏览

c# - C# 理论:将 JMP 写入 asm 中的 codecave

假设我已经分配了放置我的 codecave 的地址VirtualAllocEx(它返回地址),并且我使用WriteProcessMemory().

这是问题:

我如何写一个跳转到我的codecave?我知道跳转以“ E9”开头,但是如何将返回的地址转换VirtualAllocEx为正确的 UInt32(dword),以便调试器/编译器理解指令?

例如:

我在地址00402020(本机应用程序的 OEP)。我写了一个跳转到004028CF(空白处)“ JMP 004028CF”。以字节为单位的指令如下所示:

E9”是我们表示 JMP 的方式。那么“ AA080000”呢,我如何生成这个?

我需要做一些类似的事情,这样我就可以将 JMP 初始化到我的 codecave,它将位于由VirtualAllocEx().

任何帮助将不胜感激!

提前致谢。

0 投票
9 回答
16100 浏览

assembly - 什么是代码洞穴,是否有任何合法用途?

我在 StackOverflow 问题“ C# Theoretical: Write a JMP to a codecave in asm ”中第一次遇到这个词。我看到根据维基词典,代码洞穴是:

一个未使用的内存块,通常是软件破解者,可以用来注入自定义编程代码来修改程序的行为。

我找到正确的定义了吗?如果是这样,代码洞穴是否有任何合法用途?

0 投票
2 回答
297 浏览

c++ - 我正在尝试创建的培训师的问题(出于教育目的)

我正在尝试为 Icy Tower 1.4 创建一个培训师用于教育目的。

我写了一个函数来缩短 WriteProcessMemory 函数,如下所示:

这就是应该停止冰塔时钟的功能:

在 else 语句中有操作码的原始 AOB。当我在 status 参数设置为 1 的情况下调用 ClockHack 函数时,游戏崩溃了。

在 Cheat Engine 中,我为此编写了一个脚本,该脚本并不完全写入同一个地址,因为我做了 Code Cave,而且效果很好。

有人知道为什么吗?谢谢你。

顺便说一句:它仅用于教育目的

0 投票
2 回答
803 浏览

winapi - 导出表是否包含 Win32 Exe 函数的所有条目?

我需要知道其导出表中包含的所有 Win32(PE 文件)函数或类方法。我在哪里可以获得这些信息?我了解 PE 文件格式的每个部分,但我不知道如何进行。

0 投票
5 回答
1646 浏览

c++ - 使用 codecave 注入线程

通过使用“codecave”技术将代码注入另一个进程;是否可以注入代码来创建一个新线程(并为新线程注入代码)并让该线程与目标进程主线程并行执行?

我可以通过 dll 注入来管理它,但我想知道是否可以通过纯代码注入来实现。

目的首先是了解不同的注入技术,但最终为随机进程创建心跳功能以监督执行(高可用性)。Windows 是目标操作系统,语言是 C/C++(需要时使用内联 ASM)。

谢谢。

0 投票
3 回答
2339 浏览

c++ - VirtualAlloc C++,注入 dll,asm

我想在应用程序中为我的 codecave 保留空间。我使用 VirtualAlloc 函数来保留这个空间。我有 X 个问题。

  1. 我应该使用哪些参数(位置类型和保护)来为代码洞穴分配内存?

  2. 作为返回值,我得到了我的 codecave 的地址。在程序的其他部分,我想 JMP 到那个 codecave。怎么做?我知道(如果我错了,请纠正我)JMP 将其作为从当前位置偏移的 agument nuber。但我想 JMP 到 ma codecave。如何计算这个偏移量。

在此处输入图像描述

0 投票
2 回答
2358 浏览

.net - 如何挂钩 MANAGED(.NET) 进程并在该进程内收集信息?

我需要挂钩托管(C#、C++/CLI)进程,我需要查找并发送有关它有多少个窗口(其关联的控件及其属性)的信息到用 C# 托管代码编写的目标应用程序。

为此我需要做什么?我是否需要探索该托管进程的 IAT(导入地址表)和 EAT(导出地址表)?我需要用 C++ 编写注入器 DLL 吗?除了改变 IAT 和 EAT 之外,我还需要什么?

[编辑] 我需要将托管运行进程附加到应用程序(它将托管或附加其他进程)。附加进程后,我需要获取与该进程的窗口关联的所有控件的属性。

我将逐个迭代该附加进程的窗口,将枚举与该窗口关联的所有控件(将获取控件的 id、名称、颜色、位置、大小等),并将整个信息发送到其他应用程序或应用程序它附加了其他应用程序(实际上该应用程序作为主机再次需要使用该信息重绘相同的控件,不要问我为什么需要这样做:-))

问候乌斯曼

0 投票
0 回答
260 浏览

c# - 如何在 C# 和 C++/CLI 中为注入器的挂钩进程序列化数据?

我在序列化来自注入器的挂钩进程的数据时遇到了一个奇怪的问题(它将间谍 dll 注入到其他进程中)。我成功地将间谍 dll 登陆到其他托管进程中。但是当我想从那个 spyDll 序列化自定义对象(它实际上落在其他被钩住的托管进程中)时,就会出现问题。在这里,我想序列化数据和列表或 .NET 字典,例如 .NET 字典Dictionary<IntPtr,List<Objects>>。有时它会通过诸如“无法序列化Dictionary<IntPtr,List<Objects>>......”之类的异常,有时它会说将挂钩进程中的所有类和类型标记为可序列化。我也尝试过 Json 来做到这一点,但我以某种方式未能正确使用它。

任何有经验的人都可以成功地从 spy dll 获取数据到注入器,然后可以将其传输到使用注入器的模块,然后通过挂钩和注入从远程进程获取一些数据。序列化在简单的控制台基础中工作得很好应用程序,但是我想要获取数据的方式完全不同,因为有一个MessageHookProc函数负责将托管程序集加载到其他托管进程中。

有谁是 .NET 进程注入和挂钩方面的专家,并成功使用了挂钩进程的一些信息?

笔记 :

====

通过.NET远程处理作为进程间通信将数据从挂钩进程调度到挂钩进程(在注入器和间谍dll的帮助下挂钩其他进程的进程)所需的建议?如果有些没有解决方案将数据从挂钩进程序列化到挂钩进程......?

问候

乌斯曼

0 投票
2 回答
526 浏览

c++ - 如何挂钩导出功能不可用的Native进程?

我需要解决本机进程的逆向工程问题。我有非托管的.exe,上面有一些控件(例如TextBox、Buttons、TextAreas、ComboBoxes)。在控件上填写所有数据后,用户将按“打开”。

实际上它会打开调制解调器端口并发送 AT 命令。我想检查数据的格式以及它将发送到调制解调器 COM 端口的消息。

因此,我需要如何对流程进行逆向工程并挂钩功能(很可能是“打开”调制解调器端口的功能,当用户单击“打开”时,它将被调用)。

建议??我的方向是对的,我是否需要挂钩它的功能,然后注入后,我的目标就会实现。

笔记:

未检测到 EXPORTED 函数。为此,我使用了 CFF/PE Explorer。

问候乌斯曼

0 投票
1 回答
3579 浏览

c++ - Calling a function from a remote process using injected DLL

I saw a similar, but still different question to this, so just to clarify this is not a dupe of 13428881 (Calling a function in an injected DLL).

What I have at the minute: A DLL, injected into a target process, displaying a message box and fiddling around doing math.

What I want in the future: A DLL which can manipulate and toy with the internals of the target process.

The next step towards achieving the desired manipulation is to call a method in a remote thread within the process I'm injecting into.

Let's take an example: I have a C++ application, which has int main, let's say it looks like this:

Ok, so that's lovely, my target application is currently printing some text, and it seems to be doing so very happily. It's spamming it at an unbelievable rate, but I can slow it down using threads and sleeps etc if I need to. The fact is this isn't an issue, the code here hasn't been compiled or tested, and I've no intention of using this exact code. I'm actually working with a game.

Now, let's say I create a pointer to the method, PrintText, and that I know the address of it within that process. How do I go about calling it, externally, passing in arguments?

Locally, I believe it would look something like this:

I could then call this function using a reference, like so:

This should, by my theory, declare an integer called i, then define a pointer to a method which returns int, takes one string as a parameter, and the pointer stores the value of the pointer which was in PrintText. (Or something of that nature).

Very nice, so I can call my own functions via pointer, that's great, cracking in fact. I've truly astonished myself with this ability, and I do now feel like superman. I'll go save some babies or something, brb.

Back, so now I want to continue a little further, and take that next step. Let's say I know that the the method is at the address 100 in the target process (decimal, I will likely do it in hexadecimal, as I'm using CheatEngine / OllyDBG to find methods in the target process, but for this example we'll stay simple).

I presume that my injected DLL gets its own space entirely, does it have any higher access to the target process? How can I find this out?

Thanks for your time, Josh

Edit: A small note, I'm going through the C++ tutorial book, and it's proven so far to be very useful. I've noticed that I forgot to include my operation method, so apologies for that being missing. If it's required, let me know. Thanks!

Edit nr 2: I've just made some compilable code to test this out, since I wrote most of this free hand reading from the book without an IDE, and the IDE has finally configured itself, so here is the code I'm currently working with

Note I haven't yet made it run indefinitely, so yeah, please excuse that, I'll add it shortly.