James's Blog


  • Home

  • Tags

  • Categories

  • Archives

2021 Week8 Notes

Posted on 2022-02-23 | In Weekly Notes

windows docker机器学习:

  1. 升级到21H2或win11
  2. 安装对应的nVidia显卡驱动
  3. 直接使用docker desktop

docker使用的几个注意实现

docker create 是从镜像create一个容器,要有对应的命令,不然启动不了

docker run是从镜像直接run一个容器,执行对应的命令

使用-v选项挂载宿主机目录,docker中间的目录会自动创建

在docker中间使用jupyter的时候要是定ip和端口,不然在宿主机上无法访问

1
jupyter notebook --notebook-dir=/opt/notebooks --ip='0.0.0.0' --port=8888 --no-browser --allow-root

解决gdb和实际shell运行地址不一致问题

  1. 使用core dump file

    1
    ulimit -c unlimited
  2. 使用env,感觉不怎么起作用

    https://www.cnblogs.com/yhjoker/p/9161716.html

默认gdb也可以显示各种界面

1
dashboard -layout source assembly registers stack

2021_week7_notes

Posted on 2022-02-16 | In Weekly Notes

latex设置表格列宽

https://blog.csdn.net/YhL_Leo/article/details/50532269

2021 Week6 Notes

Posted on 2022-02-09 | In Weekly Notes

linux 可以使用history命令查看历史命令记录

Linux可以使用cmp命令查看两个binary文件不同的byte

使用-l选项时第一个列表示编号,时十进制,第二三列表示对应的bytes,是八进制

linux创建制定大小全0文件

1
dd if=/dev/zero of=upload_test bs=file_size count=1

https://stackoverflow.com/questions/139261/how-to-create-a-file-with-a-given-size-in-linux

linux修改某个文件从某个byte开始的几个位置

1
printf '\x31\xc0\xc3' | dd of=test_blob bs=1 seek=100 count=3 conv=notrunc 

https://stackoverflow.com/questions/4783657/write-byte-at-address-hexedit-modify-binary-from-the-command-line

2021 Week5 Notes

Posted on 2022-01-31 | In Weekly Notes

Email tracking的功能:

gmail有插件

outlook也可以,但是受到邮件要点击确认收到对话框

关于内外网用同一个地址访问,在内网dns服务器(路由器)里添加一条记录应该就可以

直接端口映射可以,但是要做好防护,ssh之类得还是得通过vpn连接比较好

使用群晖作为内网服务器

https://www.swack.cn/wiki/001557409799713ca16fa7271334e4cadbf9cc76fd0d933000/0015885079392072ef0df065b7642089514078069e4d58d000

https://cshihong.github.io/2018/10/15/DNS%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%90%AD%E5%BB%BA%E4%B8%8E%E9%85%8D%E7%BD%AE/

https://www.cnblogs.com/nomil9/articles/12924354.html

2021 Week4 Notes

Posted on 2022-01-25 | In Weekly Notes

llvm学习

load pass in clang

leagcy mode:

in source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//-----------------------------------------------------------------------------
// Legacy PM Registration
//-----------------------------------------------------------------------------
// The address of this variable is used to uniquely identify the pass. The
// actual value doesn't matter.
char LegacyHelloWorld::ID = 0;

// This is the core interface for pass plugins. It guarantees that 'opt' will
// recognize LegacyHelloWorld when added to the pass pipeline on the command
// line, i.e. via '--legacy-hello-world'
static RegisterPass<LegacyHelloWorld>
X("legacy-hello-world", "Hello World Pass",
true, // This pass doesn't modify the CFG => true
false // This pass is not a pure analysis pass => false
);

//register pass to clang
static void registerMyPass(const PassManagerBuilder &,
llvm::legacy::PassManagerBase &PM) {
PM.add(new LegacyHelloWorld()); // PM 用于添加 Pass
}
static RegisterStandardPasses
RegisterMyPass(PassManagerBuilder::EP_EarlyAsPossible,
registerMyPass);

usage in command line

1
clang -Xclang -load -Xclang ../BlockMatch/build/libHelloWorld.so test.c insert.c

new pass manager

no idea now, may be work in llvm and clang 13

usage in command line

1
clang -fpass-plugin=libMyPass.so file.cpp

使用wrapper解决了clang使用pass, -load参数被误解的问题

LLVM Pass入门导引

CTF

chunk extend

chunk extend

后向合并

就是通过修改chunk的size导致chunk的size的变大然后先后合并,这样重新分配出来就获得一个更长的区块,然后对中间free的部分做修改即可进行诸如fast bin attack之类的攻击

前向合并则是通过修改pre_inuse和pre_size来通过unlink的时候和前面进行合并

Linux

云服务器虚拟机除了设置的网络组的安全权限以外,如不能访问,还要注意本机防火墙iptables的配置,具体开关及配置方法参考网络博客

make -j参数表示可以进行多线程编译

静态库编译先编译成xxx.o文件,然后再用ar -r libxxx.a xxx.o编译成静态库

链接的时候要放在编译命令的结尾处

https://blog.csdn.net/x_studying/article/details/53561101

clangd配置在任何环境下使用bear compilecommand即可完成配置

2021 Week3 Notes

Posted on 2022-01-17 | In Weekly Notes

vscode+clangd开发环境配置

主要想要充分利用自动补全功能,不然写大项目或者用到诸如LLVM或者Pin这样比较大的库就很费劲

主要参考:

https://mp.weixin.qq.com/s?__biz=MzIzMDk0Njc1Nw==&mid=2247484414&idx=1&sn=6d742d7d0c97f8079a8ceea1089fdcf3&scene=21#wechat_redirect

https://blog.csdn.net/weixin_43862847/article/details/119274382

https://clangd.llvm.org/installation.html

Surface各种系统体验

Posted on 2021-10-04 | In 硬件捣鼓 , Surface捣鼓

捣鼓起因:

因为服役多年的surface pro 4已经难以胜任较为繁重的编程工作,我换了台新的笔记本,这台陪伴多年的苏菲也就闲置了下来,为了让她充分发挥剩余价值,我决定给他刷入一些对硬件配置要求较低的操作系统。另一方面,基于surface的触屏,我又想将其进一步发展为一台安卓平板。为此我进行了一番搜索,查找了一圈符合我要求的系统,基本有如下几个。

  • deepin 20
  • PhoenixOs(凤凰os)
  • JingOs
  • Fydeos

接下来我将一一介绍各个系统的安装捣鼓,使用体验及互相组合。

7 posts
3 categories
2 tags
© 2022 James YAO
Powered by Hexo
|
Theme — NexT.Muse v5.1.4
0%