马上推出 断点美化 断点绘制 断点自瞄 断点功能 断点拦截 断点全防 断点格机 预计1月32日发布 请耐心等待🤪
Please open Telegram to view this post
VIEW IN TELEGRAM
#include <stdio.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <sys/user.h>
#include <unistd.h>
// 断点拦截核心函数
void breakpoint_trace(pid_t target_pid, unsigned long addr) {
// 附加目标进程
if (ptrace(PTRACE_ATTACH, target_pid, NULL, NULL) < 0) {
perror("ptrace attach failed");
return;
}
waitpid(target_pid, NULL, 0);
// 读取原始指令(ARM 32位为4字节)
unsigned long orig_insn = ptrace(PTRACE_PEEKTEXT, target_pid, addr, NULL);
// 构造 int 3 断点指令(ARM 下为 0xe7f001f0)
unsigned long breakpoint_insn = 0xe7f001f0;
// 写入断点指令
ptrace(PTRACE_POKETEXT, target_pid, addr, breakpoint_insn);
// 继续进程运行
ptrace(PTRACE_CONT, target_pid, NULL, NULL);
int status;
while (1) {
waitpid(target_pid, &status, 0);
if (WIFSTOPPED(status)) {
struct user_regs_struct regs;
ptrace(PTRACE_GETREGS, target_pid, NULL, ®s);
// 检查是否命中断点(PC 寄存器指向断点地址+4)
if (regs.ARM_pc == addr + 4) {
printf("Breakpoint hit at 0x%lx\n", addr);
// ========== 自定义拦截逻辑 ==========
// 例如:修改寄存器值、读写内存
regs.ARM_r0 = 0x1; // 篡改 r0 寄存器返回值
ptrace(PTRACE_SETREGS, target_pid, NULL, ®s);
// ====================================
// 恢复原始指令
ptrace(PTRACE_POKETEXT, target_pid, addr, orig_insn);
// 回退 PC 寄存器,重新执行原始指令
regs.ARM_pc -= 4;
ptrace(PTRACE_SETREGS, target_pid, NULL, ®s);
// 单步执行一次
ptrace(PTRACE_SINGLESTEP, target_pid, NULL, NULL);
waitpid(target_pid, &status, 0);
// 重新写入断点,持续拦截
ptrace(PTRACE_POKETEXT, target_pid, addr, breakpoint_insn);
}
}
ptrace(PTRACE_CONT, target_pid, NULL, NULL);
}
ptrace(PTRACE_DETACH, target_pid, NULL, NULL);
}
int main(int argc, char *argv[]) {
if (argc != 3) {
printf("Usage: %s <pid> <address>\n", argv[0]);
return 1;
}
pid_t target_pid = atoi(argv[1]);
unsigned long addr = strtoul(argv[2], NULL, 16);
breakpoint_trace(target_pid, addr);
return 0;
}
泛滥断点拦截
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <sys/user.h>
#include <unistd.h>
// 断点拦截核心函数
void breakpoint_trace(pid_t target_pid, unsigned long addr) {
// 附加目标进程
if (ptrace(PTRACE_ATTACH, target_pid, NULL, NULL) < 0) {
perror("ptrace attach failed");
return;
}
waitpid(target_pid, NULL, 0);
// 读取原始指令(ARM 32位为4字节)
unsigned long orig_insn = ptrace(PTRACE_PEEKTEXT, target_pid, addr, NULL);
// 构造 int 3 断点指令(ARM 下为 0xe7f001f0)
unsigned long breakpoint_insn = 0xe7f001f0;
// 写入断点指令
ptrace(PTRACE_POKETEXT, target_pid, addr, breakpoint_insn);
// 继续进程运行
ptrace(PTRACE_CONT, target_pid, NULL, NULL);
int status;
while (1) {
waitpid(target_pid, &status, 0);
if (WIFSTOPPED(status)) {
struct user_regs_struct regs;
ptrace(PTRACE_GETREGS, target_pid, NULL, ®s);
// 检查是否命中断点(PC 寄存器指向断点地址+4)
if (regs.ARM_pc == addr + 4) {
printf("Breakpoint hit at 0x%lx\n", addr);
// ========== 自定义拦截逻辑 ==========
// 例如:修改寄存器值、读写内存
regs.ARM_r0 = 0x1; // 篡改 r0 寄存器返回值
ptrace(PTRACE_SETREGS, target_pid, NULL, ®s);
// ====================================
// 恢复原始指令
ptrace(PTRACE_POKETEXT, target_pid, addr, orig_insn);
// 回退 PC 寄存器,重新执行原始指令
regs.ARM_pc -= 4;
ptrace(PTRACE_SETREGS, target_pid, NULL, ®s);
// 单步执行一次
ptrace(PTRACE_SINGLESTEP, target_pid, NULL, NULL);
waitpid(target_pid, &status, 0);
// 重新写入断点,持续拦截
ptrace(PTRACE_POKETEXT, target_pid, addr, breakpoint_insn);
}
}
ptrace(PTRACE_CONT, target_pid, NULL, NULL);
}
ptrace(PTRACE_DETACH, target_pid, NULL, NULL);
}
int main(int argc, char *argv[]) {
if (argc != 3) {
printf("Usage: %s <pid> <address>\n", argv[0]);
return 1;
}
pid_t target_pid = atoi(argv[1]);
unsigned long addr = strtoul(argv[2], NULL, 16);
breakpoint_trace(target_pid, addr);
return 0;
}
泛滥断点拦截
❤2
北掂-公益数据号查询器.sh
384.2 KB
北掂-公益数据号查询器.sh
💠 公益查询器💠
➡️ 接口是抓包获取别人的👈
➡️ 支持批量处理 写入本地文件👈
➡️ 格式清晰 简单明了👈
➡️ 点击 复制你数据号的完整目录👈
➡️ 全自动处理分析过滤结果👈
频道 @TencentHit
频道 @TencentHit
Please open Telegram to view this post
VIEW IN TELEGRAM