Skip to content

Commit aae5389

Browse files
committed
feat iptables & update
Signed-off-by: aLinChe <1129332011@qq.com>
1 parent 4ef63c9 commit aae5389

8 files changed

Lines changed: 408 additions & 5 deletions

File tree

src/content/posts/OS/memory/mmap.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ Entry point 0x1100:
154154
现在我们来谈谈几个非常有趣的应用场景,这些场景完美诠释了 `pmap` 不仅仅是一个诊断工具,更是进行运行时分析、逆向工程和系统维护的强大起点。
155155

156156
#### **场景一:按键精灵**
157-
158157
一个游戏外挂或按键精灵需要与游戏进程进行交互,比如修改内存中的金币数量,或者调用游戏内部的某个函数来执行特定动作。要做到这一点,首先必须知道:
159158
1. 目标数据(如金币)在内存的哪个地址?
160159
2. 目标函数(如“使用技能”)的入口地址在哪里?
@@ -164,7 +163,6 @@ Entry point 0x1100:
164163
一旦获得了地址,就可以通过`ptrace`等工具向目标进程注入代码或者直接修改内存数据,从而实现“按键”效果。
165164

166165
#### **场景二:变速齿轮 (欺骗进程时钟)**
167-
168166
这个技术的核心是**API Hooking**,即拦截并篡改函数的行为。要欺骗进程的时间,就是要让它调用的时间相关函数(如`sleep`, `alarm`, `gettimeofday`)返回一个被“加速”或“减速”过的值。
169167

170168
实现步骤如下:
@@ -178,7 +176,6 @@ Entry point 0x1100:
178176
这样一来,当游戏调用`sleep(10)`时,实际上会跳转到我们的“假”`sleep`,我们的代码可能会执行`original_sleep(1)`,从而实现了游戏时间的加速。这个过程非常凶险,因为它直接修改了正在运行的代码。
179177

180178
#### **场景三:软件热补丁 (mprotect)**
181-
182179
软件热补丁指的是在不重启服务的情况下,动态地修复正在运行程序中的BUG。`mprotect`系统调用是实现这一技术的关键。
183180

184181
通常,进程的代码段是只读和可执行的(`r-x`)。如果你试图写入代码段,会立即引发段错误(Segmentation Fault)。而热补丁需要在运行时修改代码。

src/content/posts/docker/docker.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ draft: false
6161
docker port <CONTAINER_ID>
6262
docker top <CONTAINER_ID>
6363
docker logs -tf --tail 10 <CONTAINER_ID>
64-
docker inspect --format='{{.State.Pid}}' <CONTAINER_ID> # JSON格式底层元数据
64+
docker logs <CONTAINER_ID> | grep -i error
65+
docker inspect --format='{{.State.Pid}}' <CONTAINER_ID> # JSON格式底层元数据
66+
docker inspect --format='{{.Config.Cmd}}' <CONTAINER_ID> # 查看完整的启动命令参数
6567
docker stats --all
6668
docker info
6769

src/content/posts/envs.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,51 @@ sudo hostnamectl set-hostname aLinChe
123123
sudo vim /etc/netplan/50-cloud-init.yaml
124124
# systemctl
125125
systemctl --user list-unit-files --type=service --state=enabled
126+
127+
## Linux Kernal
128+
make menuconfig
129+
grep "=m" .config
130+
grep "=y" .config
131+
132+
bear -- make -n
133+
make ARCH=x86_64 compile_commands.json -j$(nproc) # x86_64
134+
make -j$(nproc)
135+
sudo make modules_install
136+
sudo make install
137+
138+
make -j$(nproc) bzImage
139+
cp arch/x86/boot/bzImage vmlinuz-x86_64
140+
# if ARM aarch64: make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc) # arch/arm64/boot/Image
141+
142+
# make menuconfig
143+
Kernel hacking --->
144+
Compile-time checks and compiler options --->
145+
[*] Compile the kernel with debug info
146+
[*] Provide GDB scripts for kernel debugging
147+
Device Drivers --->
148+
Network device support --->
149+
[*] Network core driver support
150+
<*> Virtual eXtensible Local Area Network (VXLAN)
151+
<*> Universal TUN/TAP device driver support
152+
[*] Ethernet driver support --->
153+
-*- PHY Device support and infrastructu --->
154+
-*- MDIO bus device drivers --->
155+
# ​​USB网卡:
156+
<*> USB Network Adapters --->
157+
# ​无线网卡​​:
158+
[*] Wireless LAN --->
159+
# 虚拟机网卡​​:
160+
<*> VMware VMXNET3 ethernet driver
161+
<M> Simulated networking device
162+
<M> Failover driver
163+
Virtio drivers --->
164+
Networking support --->
165+
Networking options --->
166+
[*] TCP/IP networking
167+
[*] IP: advanced router
168+
[*] IP: policy routing
169+
<*> The IPv6 protocol --->
170+
<*> 802.1d Ethernet Bridging
126171
```
127172

128173

@@ -430,6 +475,13 @@ sudo tailscale up --exit-node=""
430475
```
431476
432477
478+
## Sunshine & Moonlight
479+
```sh
480+
https://github.com/LizardByte/Sunshine/
481+
https://github.com/moonlight-stream/
482+
483+
https://github.com/Axixi2233/moonlight-android/ # 阿西西安卓端修改版
484+
```
433485
434486
435487
## Termux

src/content/posts/git/git.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,20 @@ git clone --recurse-submodules https://github.com/user/repo.git # 克隆包含
146146
git submodule update --init --recursive # 更新子模块
147147
```
148148

149+
## 修改历史二进制文件以减小clone大小
150+
```sh
151+
pip install git-filter-repo # ~/.local/bin/git-filter-repo
152+
git filter-repo --file-info-callback '
153+
if filename == b"vmlinuz":
154+
with open("bin/vmlinuz/vmlinuz", "rb") as f:
155+
new_content = f.read()
156+
new_blob_id = value.insert_file_with_contents(new_content)
157+
return (filename, mode, new_blob_id)
158+
else:
159+
return (filename, mode, blob_id)
160+
'
161+
```
162+
149163
## 最佳实践总结
150164
1. 提交规范​​:使用语义化提交信息(feat:, fix:, docs:, 等)
151165
2. ​分支策略​​:
1.52 MB
Loading
475 KB
Loading

0 commit comments

Comments
 (0)