
c++
文章平均质量分 77
esrrhs
http://www.esrrhs.xyz/
展开
-
动态链接库的注入修改查找工具hookso
hooksohookso是一个linux动态链接库的注入修改查找工具,用来修改其他进程的动态链接库行为。hookso是一个linux动态链接库的注入修改查找工具,用来修改其他进程的动态链接库行为。https://github.com/esrrhs/hooksogithub.com功能让某个进程执行系统调用 让某个进程执行.so的某个函数 给某个进程挂接新的.so 卸载某个进程的.so 把旧.so的函数替换为新.so的函数 复原.so的函数替换 查找.so的函数地址编译.原创 2020-05-20 15:20:55 · 746 阅读 · 0 评论 -
win32的hook
int myprintf ( const char *format, ... ){ return 0;}int main(){ printf("a\n"); char * target_function = (char *)&printf; DWORD old_target_function_protect = 0; BOOL succeeded = ::Virtua原创 2014-05-29 14:35:49 · 681 阅读 · 0 评论 -
ptrace截获其他进程系统调用
int main(int argc, char *argv[]){ if (net_init() != 0) { printf("net init fail\n"); MYLOG("net init fail"); return -1; } pid_t traced_process; struct user_regs_struct regs; long ins原创 2014-07-29 14:03:36 · 763 阅读 · 0 评论 -
解决方案: scp/ssh 的登陆提示很慢 (Linux)
看着用 windows 的 scp 命令很快很是羡慕. 这个问题让我实实郁闷了好几天. 在 Linux 下不管是用 ssh 还是用 scp, 连接速度都很慢 (登陆提示框的弹出时间).确切地讲, 每次的登陆连接平均消耗了 30 秒! 言归正传. 如何找出究竟是什么导致了 ssh 或是 scp 的登陆很慢? 如何修复该所谓的登陆 "慢" 或 "延迟"?今天 Google 了一转载 2014-07-11 14:33:02 · 1211 阅读 · 0 评论 -
vs64位下不能内嵌汇编
只能建个.asm文件,然后在生成规则里加上masm,注意得重新加asm文件到工程才能生效原创 2014-09-25 22:58:40 · 1881 阅读 · 0 评论 -
比lua更简单快捷的嵌入式脚本 : fakescript
https://bitbucket.org/esrrhs/fakescript原创 2014-11-13 19:03:47 · 1321 阅读 · 0 评论 -
stl map查找key周围的元素
std::map aa; for (int i = 1; i { aa[i] = i; } int key = 1; std::map::iterator it1 = aa.lower_bound(key); std::map::iterator it2 = it1; if (it1 == aa.end(原创 2014-12-19 10:13:31 · 952 阅读 · 0 评论 -
golang源代码——go编译器
go/src/pkg/runtime/proc.c:247go/src/cmd/go/main.go:111原创 2014-12-11 20:40:02 · 1387 阅读 · 0 评论 -
用正则全局替换new为自定义的new
notepad++里,替换正则new ([a-zA-Z]*)\(([^,\(\))]*)\)Pool::Instance()->New\((\2)\)如m_pModThreat = new OModuleThreat(this);替换为m_pModThreat = Pool::Instance->New(this);原创 2015-06-02 11:48:22 · 469 阅读 · 0 评论 -
vsix无法打开的问题
去到:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE目录运行VSIXInstaller.exe xxx.vsix如VSIXInstaller.exe "C:\Users\Administrator\Documents\Visual Studio 2015\Projects\VSPackage1\VSPack原创 2015-07-31 11:20:45 · 6901 阅读 · 0 评论 -
Failed to load platform plugin “windows”
这个奇葩的问题,其实是缺了platform子目录比如运行目录为:xxx.exeQt5Core.dllQt5Gui.dllQt5Widgets.dllplatforms(目录) qwindows.dll原创 2015-08-03 16:05:44 · 483 阅读 · 0 评论 -
wireshark-2.2.0编译插件
用cmake生成vs2015工程编译即可原创 2016-09-21 18:27:44 · 696 阅读 · 0 评论 -
memcpy和for循环复制的性能差距
char a[200]; char b[200]; timeval bt; gettimeofday(&bt, NULL); for (int z = 0; z < 1000; z++) { for (int j = 0; j < 1000000; j++) { //for (int i = 0; i < 10; i++) //{ // a[i] = b[i];原创 2014-07-02 14:11:37 · 4030 阅读 · 0 评论 -
wireshark插件
按照http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html 的提示下载源码包nmake -f Makefile.nmake plugins原创 2014-07-22 21:19:40 · 668 阅读 · 0 评论 -
linux下hook函数
#include #include #include #include #include #include #include #include void set_hook(void *to_mock_func, void *mock_func) { uint8_t machine_code[]转载 2014-06-27 10:34:55 · 1141 阅读 · 0 评论 -
linux代码获取某个进程的cpu、内存
struct CPUSnapShot{ CPUSnapShot() { char buff[256] = {0}; FILE原创 2014-01-16 22:58:26 · 990 阅读 · 0 评论 -
bat在不同目录下执行一系列bat并修改只读权限
cd wenjianjia1attrib -r ../src/xxx.cppcall aaa.batcd ../cd wenjianjia2attrib -r ../src/yyy.cppcall bbb.batcd ../原创 2014-02-10 14:48:10 · 1284 阅读 · 0 评论 -
python修改文件内容
def func(filename): input = open(filename) lines = input.readlines() input.close() output = open(filename,'w') for line in lines: if not line: break if (('appdef.h' in line) and ('include' in line) ):原创 2014-02-28 23:01:41 · 690 阅读 · 0 评论 -
简化移植google profiler
void StartProfiler(){ // 定时器 struct itimerval timer; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = 10000; // 0.01秒 timer.it_value = timer.it_interval; setitimer(IT原创 2014-04-12 22:41:18 · 752 阅读 · 0 评论 -
重载malloc
#include #include /* Prototypes for our hooks. */static void my_init_hook(void);static void *my_malloc_hook(size_t, const void *);/* Variables to save original hooks. */static void *(*old_mallo转载 2014-03-29 16:43:02 · 2077 阅读 · 0 评论 -
安全的str操作
template int STR_N_CMP(const char (&dest)[N], const char *src){ return strncmp(dest, src, sizeof(dest));}原创 2014-04-04 15:17:42 · 509 阅读 · 0 评论 -
golang解析xml文件头文件模板
/* This file is generated by genxml. *//* No manual modification is permitted. */#pragma once#include "Define.h"#include {{define "SetAttri"}}{{if eq .Type "int"}}m_i{{.Name}} = 0;{{end}}{{if e原创 2014-03-25 23:34:53 · 1896 阅读 · 0 评论 -
定长hashmap
hashmap由hashset组成hashset由固定数目的数组加原创 2014-04-23 16:40:52 · 1011 阅读 · 0 评论 -
google Profiler 原理
注册定时器,通过定时器SIGPROF的回调原创 2014-04-10 18:52:23 · 497 阅读 · 0 评论 -
Proxifier
Proxifier原创 2014-05-10 12:36:02 · 958 阅读 · 0 评论 -
网络消息代码生成gencode
通过xml定义生成代码,支持数组变长数组结构体嵌套等,能满足常用需求原创 2014-04-26 21:08:24 · 1113 阅读 · 0 评论 -
source insight 里编辑的时候,每次粘贴后,光标停留在粘贴内容的左面
在source insight 里编辑的时候,每次粘贴后,光标停留在粘贴内容的左面。我想把它设定为 粘贴后,光标移动倒粘贴内容的右面。该怎么做? 这是个设置问题,按照下面的步骤设定就可以了。Options->Preferences...->Typing->After pasting,select:at end of pasted text->确定。祝你好运!转载 2013-12-26 16:13:30 · 1074 阅读 · 0 评论