├── README.md
└── xclibc
/README.md:
--------------------------------------------------------------------------------
1 | # xclibc
2 |
3 |
4 |
5 | 一个在CTF比赛中用于切换题目运行libc环境的工具,支持目前所有版本
6 |
7 | ## 安装
8 | 安装patchelf
9 | ```
10 | sudo apt install patchelf
11 | ```
12 |
13 | 安装最新版的[glibc-all-in-one](https://github.com/matrix1001/glibc-all-in-one),我建议你将其安装到`~`目录
14 |
15 | ```bash
16 | git clone https://github.com/matrix1001/glibc-all-in-one
17 | cd glibc-all-in-one
18 | ./update_list
19 | ```
20 |
21 | xclibc脚本配置
22 |
23 | ```bash
24 | git clone https://github.com/ef4tless/xclibc.git
25 | cd xclibc
26 | sudo rm /usr/local/bin/xclibc
27 | sudo mv ./xclibc /usr/local/bin
28 | sudo chmod +x /usr/local/bin/xclibc
29 | ```
30 |
31 | ## 使用
32 |
33 | 快速上手
34 | ```bash
35 | xclibc [选项] [参数]
36 | -s 查看libc文件的版本
37 | -x 和 -c 是配置版本的主要功能
38 | e.g.
39 | ➜ ~ xclibc -x ./main ./libc.so.6 读取版本自动配置
40 |
41 | ➜ ~ xclibc -c ./main 2.35
42 | /home/ef4tless/glibc-all-in-one/libs/2.35-0ubuntu3_amd64
43 | /home/ef4tless/glibc-all-in-one/libs/2.35-0ubuntu3.3_i386
44 | /home/ef4tless/glibc-all-in-one/libs/2.35-0ubuntu3.3_amd64
45 | /home/ef4tless/glibc-all-in-one/libs/2.35-0ubuntu3_i386
46 | /home/ef4tless/glibc-all-in-one/libs/2.35-0ubuntu3.1_i386
47 | /home/ef4tless/glibc-all-in-one/libs/2.35-0ubuntu3.1_amd64
48 | Please specify the directory
49 | ➜ ~ xclibc -c ./main 2.35 /home/ef4tless/glibc-all-in-one/libs/2.35-0ubuntu3.1_i386
50 |
51 | -r 可以恢复原本的题目状态
52 | ➜ ~ xclibc -r ./main
53 | [+]restore!
54 |
55 | -d 主要是 glibc-all-in-one 的libc库管理
56 | ➜ ~ xclibc -d
57 | [+]Select the version you want to download
58 | Blue is downloadable Green is already downloaded
59 |
60 | 2.17-93ubuntu4_amd64 2.19-0ubuntu3_i386 2.19-0ubuntu6.4_amd64 ......
61 | ➜ ~ xclibc -d 2.19-0ubuntu6.4_amd64
62 |
63 | ```
64 |
65 | 详细参数
66 | ```bash
67 | xclibc [选项] [参数]
68 | -s [libc文件] # 查看libc文件版本
69 | -x [-n] [文件] [libc文件] # 一键给文件配置libc文件相应版本的环境(添加-n选项可以使用修改--replace-needed的方式实现)
70 | -c [-n] [文件] [libc大版本号] [libc小版本环境路径] # 给文件配置指定的libc环境,输入大版本号后回车,可自由选择复制libc小版本环境路径(添加-n选项可以使用修改--replace-needed的方式实现)
71 | -d [ENTER] 可以查看所有可下载的libc版本
72 | # -d -r [version] 删除相应的libc版本库
73 | # -d all 下载 glibc_all_in_one 最新的所有libc版本
74 | # -d [version] 下载对应版本的libc
75 | -e [deb包] # 解压相应的libc_deb包至glibc_all_in_one路径,通常一个版本需要解压一份本体deb和一份debug_deb包
76 | -r [文件] # 恢复修改过的文件至初始状态
77 | -h # 展示帮助提示
78 | -v # 显示版本号
79 | ```
80 |
81 | ## 添加libc版本
82 |
83 | 可以在脚本头部数组中添加新的版本和下载链接,一个libc版本需要一份本体和debug版本共2份下载链接
84 |
85 | 例如:2.31-0ubuntu1_amd64版本需要,libc6_2.31-0ubuntu1_amd64.deb 和 libc6-dbg_2.31-0ubuntu1_amd64.deb
86 |
87 | 
88 |
89 |
90 | ## 更新
91 | v1.8: 整合优化了代码(ai),处理了在多个库依赖情况下的层次依赖patch,优化了下载libc的命令和表现效果
92 |
93 | v1.6: 修复了在下载2.39版本时获取不到debug信息的问题
94 |
95 | v1.5: 修复了`xclibc -x -n`时出现的bug
96 |
97 | v1.3: 更新了代码逻辑修复了一些bug,简化了操作,删除了-e功能,将下载所有的libc版本集成到了`-d -u`命令中
98 |
99 | v1.0: 增加了旧的下架版本的匹配,现在-x功能能匹配更多的版本了,完善了-d libc包管理功能,优化了部分逻辑处理方式
100 |
101 | v0.9: 添加了-d下载libc版本库的功能,修复了2.31-0ubuntu9.10_amd64/i386不能加载的问题
102 |
103 | v0.7: 修复了一个bug,该bug曾导致2.31-0ubuntu9.9_amd64/i386 版本在加载后不能正常debug
104 |
105 | v0.5: 重定义了选项命令
106 |
107 | v0.3: 添加了解压deb包的功能
108 |
109 | ## 警告
110 |
111 | 这个脚本在patch过程中将会删除`/usr/lib/debug/.build/`,如果你介意这一点,请先备份本机文件。
112 |
113 | ## 最后
114 |
115 | 如果你在使用脚本中遇到任何的问题,请尽快联系我。
116 |
117 | 感谢cnitlrt师傅最初的脚本思路。
118 |
--------------------------------------------------------------------------------
/xclibc:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Author: e4l4
3 |
4 | declare -A urls
5 | urls=(
6 | ["libc6_2.27-3ubuntu1.4_amd64.deb"]="http://launchpadlibrarian.net/510434953/libc6_2.27-3ubuntu1.4_amd64.deb"
7 | ["libc6_2.27-3ubuntu1.3_amd64.deb"]="http://launchpadlibrarian.net/497108893/libc6_2.27-3ubuntu1.3_amd64.deb"
8 | ["libc6_2.27-3ubuntu1.2_amd64.deb"]="http://launchpadlibrarian.net/482990870/libc6_2.27-3ubuntu1.2_amd64.deb"
9 | ["libc6_2.27-3ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/365856922/libc6_2.27-3ubuntu1_amd64.deb"
10 | ["libc6_2.27-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/363027601/libc6_2.27-0ubuntu3_amd64.deb"
11 | ["libc6_2.27-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/358234306/libc6_2.27-0ubuntu2_amd64.deb"
12 | ["libc6_2.26-0ubuntu2.1_amd64.deb"]="http://launchpadlibrarian.net/353428822/libc6_2.26-0ubuntu2.1_amd64.deb"
13 | ["libc6_2.26-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/355198200/libc6_2.26-0ubuntu4_amd64.deb"
14 | ["libc6_2.26-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/353888159/libc6_2.26-0ubuntu3_amd64.deb"
15 | ["libc6_2.26-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/340569656/libc6_2.26-0ubuntu2_amd64.deb"
16 | ["libc6-dbg_2.27-3ubuntu1.4_amd64.deb"]="http://launchpadlibrarian.net/510434945/libc6-dbg_2.27-3ubuntu1.4_amd64.deb"
17 | ["libc6-dbg_2.27-3ubuntu1.3_amd64.deb"]="http://launchpadlibrarian.net/497108885/libc6-dbg_2.27-3ubuntu1.3_amd64.deb"
18 | ["libc6-dbg_2.27-3ubuntu1.2_amd64.deb"]="http://launchpadlibrarian.net/482990856/libc6-dbg_2.27-3ubuntu1.2_amd64.deb"
19 | ["libc6-dbg_2.27-3ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/365856914/libc6-dbg_2.27-3ubuntu1_amd64.deb"
20 | ["libc6-dbg_2.27-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/363027592/libc6-dbg_2.27-0ubuntu3_amd64.deb"
21 | ["libc6-dbg_2.27-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/358234297/libc6-dbg_2.27-0ubuntu2_amd64.deb"
22 | ["libc6-dbg_2.26-0ubuntu2.1_amd64.deb"]="http://launchpadlibrarian.net/353428813/libc6-dbg_2.26-0ubuntu2.1_amd64.deb"
23 | ["libc6-dbg_2.26-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/355198192/libc6-dbg_2.26-0ubuntu4_amd64.deb"
24 | ["libc6-dbg_2.26-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/353888151/libc6-dbg_2.26-0ubuntu3_amd64.deb"
25 | ["libc6-dbg_2.26-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/340569642/libc6-dbg_2.26-0ubuntu2_amd64.deb"
26 | ["libc6_2.27-3ubuntu1.4_i386.deb"]="http://launchpadlibrarian.net/510430286/libc6_2.27-3ubuntu1.4_i386.deb"
27 | ["libc6_2.27-3ubuntu1.3_i386.deb"]="http://launchpadlibrarian.net/497108431/libc6_2.27-3ubuntu1.3_i386.deb"
28 | ["libc6_2.27-3ubuntu1.2_i386.deb"]="http://launchpadlibrarian.net/482991847/libc6_2.27-3ubuntu1.2_i386.deb"
29 | ["libc6_2.27-3ubuntu1_i386.deb"]="http://launchpadlibrarian.net/365893745/libc6_2.27-3ubuntu1_i386.deb"
30 | ["libc6_2.27-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/363028246/libc6_2.27-0ubuntu3_i386.deb"
31 | ["libc6_2.27-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/358271059/libc6_2.27-0ubuntu2_i386.deb"
32 | ["libc6_2.26-0ubuntu2.1_i386.deb"]="http://launchpadlibrarian.net/353428882/libc6_2.26-0ubuntu2.1_i386.deb"
33 | ["libc6_2.26-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/355198504/libc6_2.26-0ubuntu4_i386.deb"
34 | ["libc6_2.26-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/353884091/libc6_2.26-0ubuntu3_i386.deb"
35 | ["libc6_2.26-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/340569286/libc6_2.26-0ubuntu2_i386.deb"
36 | ["libc6-dbg_2.27-3ubuntu1.4_i386.deb"]="http://launchpadlibrarian.net/510430279/libc6-dbg_2.27-3ubuntu1.4_i386.deb"
37 | ["libc6-dbg_2.27-3ubuntu1.3_i386.deb"]="http://launchpadlibrarian.net/497108424/libc6-dbg_2.27-3ubuntu1.3_i386.deb"
38 | ["libc6-dbg_2.27-3ubuntu1.2_i386.deb"]="http://launchpadlibrarian.net/482991840/libc6-dbg_2.27-3ubuntu1.2_i386.deb"
39 | ["libc6-dbg_2.27-3ubuntu1_i386.deb"]="http://launchpadlibrarian.net/365893738/libc6-dbg_2.27-3ubuntu1_i386.deb"
40 | ["libc6-dbg_2.27-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/363028238/libc6-dbg_2.27-0ubuntu3_i386.deb"
41 | ["libc6-dbg_2.27-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/358271050/libc6-dbg_2.27-0ubuntu2_i386.deb"
42 | ["libc6-dbg_2.26-0ubuntu2.1_i386.deb"]="http://launchpadlibrarian.net/353428865/libc6-dbg_2.26-0ubuntu2.1_i386.deb"
43 | ["libc6-dbg_2.26-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/355198497/libc6-dbg_2.26-0ubuntu4_i386.deb"
44 | ["libc6-dbg_2.26-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/353884083/libc6-dbg_2.26-0ubuntu3_i386.deb"
45 | ["libc6-dbg_2.26-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/340569275/libc6-dbg_2.26-0ubuntu2_i386.deb"
46 | ["libc6_2.31-0ubuntu9.2_amd64.deb"]="http://launchpadlibrarian.net/511639304/libc6_2.31-0ubuntu9.2_amd64.deb"
47 | ["libc6_2.31-0ubuntu9.3_amd64.deb"]="http://launchpadlibrarian.net/530777699/libc6_2.31-0ubuntu9.3_amd64.deb"
48 | ["libc6_2.31-0ubuntu9.1_amd64.deb"]="http://launchpadlibrarian.net/496035825/libc6_2.31-0ubuntu9.1_amd64.deb"
49 | ["libc6_2.31-0ubuntu9_amd64.deb"]="http://launchpadlibrarian.net/474699081/libc6_2.31-0ubuntu9_amd64.deb"
50 | ["libc6_2.31-0ubuntu8_amd64.deb"]="http://launchpadlibrarian.net/473640372/libc6_2.31-0ubuntu8_amd64.deb"
51 | ["libc6_2.31-0ubuntu7_amd64.deb"]="http://launchpadlibrarian.net/472714312/libc6_2.31-0ubuntu7_amd64.deb"
52 | ["libc6_2.31-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/469103322/libc6_2.31-0ubuntu6_amd64.deb"
53 | ["libc6_2.31-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/468754765/libc6_2.31-0ubuntu5_amd64.deb"
54 | ["libc6_2.31-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/468697875/libc6_2.31-0ubuntu4_amd64.deb"
55 | ["libc6_2.31-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/468409391/libc6_2.31-0ubuntu3_amd64.deb"
56 | ["libc6_2.31-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/468093987/libc6_2.31-0ubuntu2_amd64.deb"
57 | ["libc6_2.31-0ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/467985139/libc6_2.31-0ubuntu1_amd64.deb"
58 | ["libc6_2.30-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/453587373/libc6_2.30-0ubuntu3_amd64.deb"
59 | ["libc6_2.30-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/442988556/libc6_2.30-0ubuntu2_amd64.deb"
60 | ["libc6-dbg_2.31-0ubuntu9.2_amd64.deb"]="http://launchpadlibrarian.net/511639295/libc6-dbg_2.31-0ubuntu9.2_amd64.deb"
61 | ["libc6-dbg_2.31-0ubuntu9.3_amd64.deb"]="http://launchpadlibrarian.net/530777688/libc6-dbg_2.31-0ubuntu9.3_amd64.deb"
62 | ["libc6-dbg_2.31-0ubuntu9.1_amd64.deb"]="http://launchpadlibrarian.net/496035817/libc6-dbg_2.31-0ubuntu9.1_amd64.deb"
63 | ["libc6-dbg_2.31-0ubuntu9_amd64.deb"]="http://launchpadlibrarian.net/474699070/libc6-dbg_2.31-0ubuntu9_amd64.deb"
64 | ["libc6-dbg_2.31-0ubuntu8_amd64.deb"]="http://launchpadlibrarian.net/473640364/libc6-dbg_2.31-0ubuntu8_amd64.deb"
65 | ["libc6-dbg_2.31-0ubuntu7_amd64.deb"]="http://launchpadlibrarian.net/472714300/libc6-dbg_2.31-0ubuntu7_amd64.deb"
66 | ["libc6-dbg_2.31-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/469103311/libc6-dbg_2.31-0ubuntu6_amd64.deb"
67 | ["libc6-dbg_2.31-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/468754757/libc6-dbg_2.31-0ubuntu5_amd64.deb"
68 | ["libc6-dbg_2.31-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/468697865/libc6-dbg_2.31-0ubuntu4_amd64.deb"
69 | ["libc6-dbg_2.31-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/468409382/libc6-dbg_2.31-0ubuntu3_amd64.deb"
70 | ["libc6-dbg_2.31-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/468093977/libc6-dbg_2.31-0ubuntu2_amd64.deb"
71 | ["libc6-dbg_2.31-0ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/467985130/libc6-dbg_2.31-0ubuntu1_amd64.deb"
72 | ["libc6-dbg_2.30-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/453587361/libc6-dbg_2.30-0ubuntu3_amd64.deb"
73 | ["libc6-dbg_2.30-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/442988547/libc6-dbg_2.30-0ubuntu2_amd64.deb"
74 | ["libc6_2.31-0ubuntu9.2_i386.deb"]="http://launchpadlibrarian.net/511623696/libc6_2.31-0ubuntu9.2_i386.deb"
75 | ["libc6_2.31-0ubuntu9.3_i386.deb"]="http://launchpadlibrarian.net/530801531/libc6_2.31-0ubuntu9.3_i386.deb"
76 | ["libc6_2.31-0ubuntu9.1_i386.deb"]="http://launchpadlibrarian.net/496034463/libc6_2.31-0ubuntu9.1_i386.deb"
77 | ["libc6_2.31-0ubuntu9_i386.deb"]="http://launchpadlibrarian.net/474699915/libc6_2.31-0ubuntu9_i386.deb"
78 | ["libc6_2.31-0ubuntu8_i386.deb"]="http://launchpadlibrarian.net/473660642/libc6_2.31-0ubuntu8_i386.deb"
79 | ["libc6_2.31-0ubuntu7_i386.deb"]="http://launchpadlibrarian.net/472695990/libc6_2.31-0ubuntu7_i386.deb"
80 | ["libc6_2.31-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/469095363/libc6_2.31-0ubuntu6_i386.deb"
81 | ["libc6_2.31-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/468757030/libc6_2.31-0ubuntu5_i386.deb"
82 | ["libc6_2.31-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/468691825/libc6_2.31-0ubuntu4_i386.deb"
83 | ["libc6_2.31-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/468409470/libc6_2.31-0ubuntu3_i386.deb"
84 | ["libc6_2.31-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/468095010/libc6_2.31-0ubuntu2_i386.deb"
85 | ["libc6_2.31-0ubuntu1_i386.deb"]="http://launchpadlibrarian.net/467975423/libc6_2.31-0ubuntu1_i386.deb"
86 | ["libc6_2.30-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/453587260/libc6_2.30-0ubuntu3_i386.deb"
87 | ["libc6_2.30-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/442987832/libc6_2.30-0ubuntu2_i386.deb"
88 | ["libc6-dbg_2.31-0ubuntu9.2_i386.deb"]="http://launchpadlibrarian.net/511623689/libc6-dbg_2.31-0ubuntu9.2_i386.deb"
89 | ["libc6-dbg_2.31-0ubuntu9.3_i386.deb"]="http://launchpadlibrarian.net/530801524/libc6-dbg_2.31-0ubuntu9.3_i386.deb"
90 | ["libc6-dbg_2.31-0ubuntu9.1_i386.deb"]="http://launchpadlibrarian.net/496034456/libc6-dbg_2.31-0ubuntu9.1_i386.deb"
91 | ["libc6-dbg_2.31-0ubuntu9_i386.deb"]="http://launchpadlibrarian.net/474699905/libc6-dbg_2.31-0ubuntu9_i386.deb"
92 | ["libc6-dbg_2.31-0ubuntu8_i386.deb"]="http://launchpadlibrarian.net/473660635/libc6-dbg_2.31-0ubuntu8_i386.deb"
93 | ["libc6-dbg_2.31-0ubuntu7_i386.deb"]="http://launchpadlibrarian.net/472695983/libc6-dbg_2.31-0ubuntu7_i386.deb"
94 | ["libc6-dbg_2.31-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/469095353/libc6-dbg_2.31-0ubuntu6_i386.deb"
95 | ["libc6-dbg_2.31-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/468757022/libc6-dbg_2.31-0ubuntu5_i386.deb"
96 | ["libc6-dbg_2.31-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/468691817/libc6-dbg_2.31-0ubuntu4_i386.deb"
97 | ["libc6-dbg_2.31-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/468409462/libc6-dbg_2.31-0ubuntu3_i386.deb"
98 | ["libc6-dbg_2.31-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/468095000/libc6-dbg_2.31-0ubuntu2_i386.deb"
99 | ["libc6-dbg_2.31-0ubuntu1_i386.deb"]="http://launchpadlibrarian.net/467975415/libc6-dbg_2.31-0ubuntu1_i386.deb"
100 | ["libc6-dbg_2.30-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/453587253/libc6-dbg_2.30-0ubuntu3_i386.deb"
101 | ["libc6-dbg_2.30-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/442987822/libc6-dbg_2.30-0ubuntu2_i386.deb"
102 | ["libc6_2.19-0ubuntu6.15_amd64.deb"]="http://launchpadlibrarian.net/416685715/libc6_2.19-0ubuntu6.15_amd64.deb"
103 | ["libc6_2.19-0ubuntu6.14_amd64.deb"]="http://launchpadlibrarian.net/353606314/libc6_2.19-0ubuntu6.14_amd64.deb"
104 | ["libc6_2.19-0ubuntu6.13_amd64.deb"]="http://launchpadlibrarian.net/324303878/libc6_2.19-0ubuntu6.13_amd64.deb"
105 | ["libc6_2.19-0ubuntu6.11_amd64.deb"]="http://launchpadlibrarian.net/311779684/libc6_2.19-0ubuntu6.11_amd64.deb"
106 | ["libc6_2.19-0ubuntu6.10_amd64.deb"]="http://launchpadlibrarian.net/309945315/libc6_2.19-0ubuntu6.10_amd64.deb"
107 | ["libc6_2.19-0ubuntu6.9_amd64.deb"]="http://launchpadlibrarian.net/261740884/libc6_2.19-0ubuntu6.9_amd64.deb"
108 | ["libc6_2.19-0ubuntu6.7_amd64.deb"]="http://launchpadlibrarian.net/239099297/libc6_2.19-0ubuntu6.7_amd64.deb"
109 | ["libc6_2.19-0ubuntu6.8_amd64.deb"]="http://launchpadlibrarian.net/253297185/libc6_2.19-0ubuntu6.8_amd64.deb"
110 | ["libc6_2.19-0ubuntu6.6_amd64.deb"]="http://launchpadlibrarian.net/198723917/libc6_2.19-0ubuntu6.6_amd64.deb"
111 | ["libc6_2.19-0ubuntu6.5_amd64.deb"]="http://launchpadlibrarian.net/191853533/libc6_2.19-0ubuntu6.5_amd64.deb"
112 | ["libc6_2.19-0ubuntu6.4_amd64.deb"]="http://launchpadlibrarian.net/191626563/libc6_2.19-0ubuntu6.4_amd64.deb"
113 | ["libc6_2.19-0ubuntu6.3_amd64.deb"]="http://launchpadlibrarian.net/183374351/libc6_2.19-0ubuntu6.3_amd64.deb"
114 | ["libc6_2.19-0ubuntu6.2_amd64.deb"]="http://launchpadlibrarian.net/183251024/libc6_2.19-0ubuntu6.2_amd64.deb"
115 | ["libc6_2.19-0ubuntu6.1_amd64.deb"]="http://launchpadlibrarian.net/180923099/libc6_2.19-0ubuntu6.1_amd64.deb"
116 | ["libc6_2.19-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/172657656/libc6_2.19-0ubuntu6_amd64.deb"
117 | ["libc6_2.19-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/172507221/libc6_2.19-0ubuntu5_amd64.deb"
118 | ["libc6_2.19-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/172335536/libc6_2.19-0ubuntu4_amd64.deb"
119 | ["libc6_2.19-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/170525723/libc6_2.19-0ubuntu3_amd64.deb"
120 | ["libc6_2.19-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/167413954/libc6_2.19-0ubuntu2_amd64.deb"
121 | ["libc6_2.19-0ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/167162297/libc6_2.19-0ubuntu1_amd64.deb"
122 | ["libc6_2.18-0ubuntu7_amd64.deb"]="http://launchpadlibrarian.net/166491656/libc6_2.18-0ubuntu7_amd64.deb"
123 | ["libc6_2.18-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/162592045/libc6_2.18-0ubuntu6_amd64.deb"
124 | ["libc6_2.18-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/162475177/libc6_2.18-0ubuntu5_amd64.deb"
125 | ["libc6_2.18-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/162205900/libc6_2.18-0ubuntu4_amd64.deb"
126 | ["libc6_2.18-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/162198013/libc6_2.18-0ubuntu3_amd64.deb"
127 | ["libc6_2.18-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/160268315/libc6_2.18-0ubuntu2_amd64.deb"
128 | ["libc6_2.18-0ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/159895958/libc6_2.18-0ubuntu1_amd64.deb"
129 | ["libc6_2.17-93ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/153554145/libc6_2.17-93ubuntu4_amd64.deb"
130 | ["libc6-dbg_2.19-0ubuntu6.15_amd64.deb"]="http://launchpadlibrarian.net/416685711/libc6-dbg_2.19-0ubuntu6.15_amd64.deb"
131 | ["libc6-dbg_2.19-0ubuntu6.14_amd64.deb"]="http://launchpadlibrarian.net/353606308/libc6-dbg_2.19-0ubuntu6.14_amd64.deb"
132 | ["libc6-dbg_2.19-0ubuntu6.13_amd64.deb"]="http://launchpadlibrarian.net/324303874/libc6-dbg_2.19-0ubuntu6.13_amd64.deb"
133 | ["libc6-dbg_2.19-0ubuntu6.11_amd64.deb"]="http://launchpadlibrarian.net/311779680/libc6-dbg_2.19-0ubuntu6.11_amd64.deb"
134 | ["libc6-dbg_2.19-0ubuntu6.10_amd64.deb"]="http://launchpadlibrarian.net/309945305/libc6-dbg_2.19-0ubuntu6.10_amd64.deb"
135 | ["libc6-dbg_2.19-0ubuntu6.9_amd64.deb"]="http://launchpadlibrarian.net/261740878/libc6-dbg_2.19-0ubuntu6.9_amd64.deb"
136 | ["libc6-dbg_2.19-0ubuntu6.7_amd64.deb"]="http://launchpadlibrarian.net/239099293/libc6-dbg_2.19-0ubuntu6.7_amd64.deb"
137 | ["libc6-dbg_2.19-0ubuntu6.8_amd64.deb"]="http://launchpadlibrarian.net/253297180/libc6-dbg_2.19-0ubuntu6.8_amd64.deb"
138 | ["libc6-dbg_2.19-0ubuntu6.6_amd64.deb"]="http://launchpadlibrarian.net/198723929/libc6-dbg_2.19-0ubuntu6.6_amd64.deb"
139 | ["libc6-dbg_2.19-0ubuntu6.5_amd64.deb"]="http://launchpadlibrarian.net/191853545/libc6-dbg_2.19-0ubuntu6.5_amd64.deb"
140 | ["libc6-dbg_2.19-0ubuntu6.4_amd64.deb"]="http://launchpadlibrarian.net/191626582/libc6-dbg_2.19-0ubuntu6.4_amd64.deb"
141 | ["libc6-dbg_2.19-0ubuntu6.3_amd64.deb"]="http://launchpadlibrarian.net/183374363/libc6-dbg_2.19-0ubuntu6.3_amd64.deb"
142 | ["libc6-dbg_2.19-0ubuntu6.2_amd64.deb"]="http://launchpadlibrarian.net/183251049/libc6-dbg_2.19-0ubuntu6.2_amd64.deb"
143 | ["libc6-dbg_2.19-0ubuntu6.1_amd64.deb"]="http://launchpadlibrarian.net/180923112/libc6-dbg_2.19-0ubuntu6.1_amd64.deb"
144 | ["libc6-dbg_2.19-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/172657668/libc6-dbg_2.19-0ubuntu6_amd64.deb"
145 | ["libc6-dbg_2.19-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/172507234/libc6-dbg_2.19-0ubuntu5_amd64.deb"
146 | ["libc6-dbg_2.19-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/172335567/libc6-dbg_2.19-0ubuntu4_amd64.deb"
147 | ["libc6-dbg_2.19-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/170525760/libc6-dbg_2.19-0ubuntu3_amd64.deb"
148 | ["libc6-dbg_2.19-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/167413976/libc6-dbg_2.19-0ubuntu2_amd64.deb"
149 | ["libc6-dbg_2.19-0ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/167162310/libc6-dbg_2.19-0ubuntu1_amd64.deb"
150 | ["libc6-dbg_2.18-0ubuntu7_amd64.deb"]="http://launchpadlibrarian.net/166491668/libc6-dbg_2.18-0ubuntu7_amd64.deb"
151 | ["libc6-dbg_2.18-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/162592059/libc6-dbg_2.18-0ubuntu6_amd64.deb"
152 | ["libc6-dbg_2.18-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/162475189/libc6-dbg_2.18-0ubuntu5_amd64.deb"
153 | ["libc6-dbg_2.18-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/162205913/libc6-dbg_2.18-0ubuntu4_amd64.deb"
154 | ["libc6-dbg_2.18-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/162198025/libc6-dbg_2.18-0ubuntu3_amd64.deb"
155 | ["libc6-dbg_2.18-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/160268328/libc6-dbg_2.18-0ubuntu2_amd64.deb"
156 | ["libc6-dbg_2.18-0ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/159895970/libc6-dbg_2.18-0ubuntu1_amd64.deb"
157 | ["libc6-dbg_2.17-93ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/153554157/libc6-dbg_2.17-93ubuntu4_amd64.deb"
158 | ["libc6_2.19-0ubuntu6.15_i386.deb"]="http://launchpadlibrarian.net/416683181/libc6_2.19-0ubuntu6.15_i386.deb"
159 | ["libc6_2.19-0ubuntu6.14_i386.deb"]="http://launchpadlibrarian.net/353620296/libc6_2.19-0ubuntu6.14_i386.deb"
160 | ["libc6_2.19-0ubuntu6.13_i386.deb"]="http://launchpadlibrarian.net/324303718/libc6_2.19-0ubuntu6.13_i386.deb"
161 | ["libc6_2.19-0ubuntu6.11_i386.deb"]="http://launchpadlibrarian.net/311781625/libc6_2.19-0ubuntu6.11_i386.deb"
162 | ["libc6_2.19-0ubuntu6.10_i386.deb"]="http://launchpadlibrarian.net/309945477/libc6_2.19-0ubuntu6.10_i386.deb"
163 | ["libc6_2.19-0ubuntu6.9_i386.deb"]="http://launchpadlibrarian.net/261743624/libc6_2.19-0ubuntu6.9_i386.deb"
164 | ["libc6_2.19-0ubuntu6.7_i386.deb"]="http://launchpadlibrarian.net/239076441/libc6_2.19-0ubuntu6.7_i386.deb"
165 | ["libc6_2.19-0ubuntu6.8_i386.deb"]="http://launchpadlibrarian.net/253296598/libc6_2.19-0ubuntu6.8_i386.deb"
166 | ["libc6_2.19-0ubuntu6.6_i386.deb"]="http://launchpadlibrarian.net/198724094/libc6_2.19-0ubuntu6.6_i386.deb"
167 | ["libc6_2.19-0ubuntu6.5_i386.deb"]="http://launchpadlibrarian.net/191854268/libc6_2.19-0ubuntu6.5_i386.deb"
168 | ["libc6_2.19-0ubuntu6.4_i386.deb"]="http://launchpadlibrarian.net/191626722/libc6_2.19-0ubuntu6.4_i386.deb"
169 | ["libc6_2.19-0ubuntu6.3_i386.deb"]="http://launchpadlibrarian.net/183374272/libc6_2.19-0ubuntu6.3_i386.deb"
170 | ["libc6_2.19-0ubuntu6.2_i386.deb"]="http://launchpadlibrarian.net/183251277/libc6_2.19-0ubuntu6.2_i386.deb"
171 | ["libc6_2.19-0ubuntu6.1_i386.deb"]="http://launchpadlibrarian.net/180923468/libc6_2.19-0ubuntu6.1_i386.deb"
172 | ["libc6_2.19-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/172658236/libc6_2.19-0ubuntu6_i386.deb"
173 | ["libc6_2.19-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/172507582/libc6_2.19-0ubuntu5_i386.deb"
174 | ["libc6_2.19-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/172335810/libc6_2.19-0ubuntu4_i386.deb"
175 | ["libc6_2.19-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/170526514/libc6_2.19-0ubuntu3_i386.deb"
176 | ["libc6_2.19-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/167416599/libc6_2.19-0ubuntu2_i386.deb"
177 | ["libc6_2.19-0ubuntu1_i386.deb"]="http://launchpadlibrarian.net/167158545/libc6_2.19-0ubuntu1_i386.deb"
178 | ["libc6_2.18-0ubuntu7_i386.deb"]="http://launchpadlibrarian.net/166493615/libc6_2.18-0ubuntu7_i386.deb"
179 | ["libc6_2.18-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/162594269/libc6_2.18-0ubuntu6_i386.deb"
180 | ["libc6_2.18-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/162478995/libc6_2.18-0ubuntu5_i386.deb"
181 | ["libc6_2.18-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/162207798/libc6_2.18-0ubuntu4_i386.deb"
182 | ["libc6_2.18-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/162200414/libc6_2.18-0ubuntu3_i386.deb"
183 | ["libc6_2.18-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/160266182/libc6_2.18-0ubuntu2_i386.deb"
184 | ["libc6_2.18-0ubuntu1_i386.deb"]="http://launchpadlibrarian.net/159898397/libc6_2.18-0ubuntu1_i386.deb"
185 | ["libc6_2.17-93ubuntu4_i386.deb"]="http://launchpadlibrarian.net/153556377/libc6_2.17-93ubuntu4_i386.deb"
186 | ["libc6-dbg_2.19-0ubuntu6.15_i386.deb"]="http://launchpadlibrarian.net/416683177/libc6-dbg_2.19-0ubuntu6.15_i386.deb"
187 | ["libc6-dbg_2.19-0ubuntu6.14_i386.deb"]="http://launchpadlibrarian.net/353620292/libc6-dbg_2.19-0ubuntu6.14_i386.deb"
188 | ["libc6-dbg_2.19-0ubuntu6.13_i386.deb"]="http://launchpadlibrarian.net/324303714/libc6-dbg_2.19-0ubuntu6.13_i386.deb"
189 | ["libc6-dbg_2.19-0ubuntu6.11_i386.deb"]="http://launchpadlibrarian.net/311781619/libc6-dbg_2.19-0ubuntu6.11_i386.deb"
190 | ["libc6-dbg_2.19-0ubuntu6.10_i386.deb"]="http://launchpadlibrarian.net/309945473/libc6-dbg_2.19-0ubuntu6.10_i386.deb"
191 | ["libc6-dbg_2.19-0ubuntu6.9_i386.deb"]="http://launchpadlibrarian.net/261743620/libc6-dbg_2.19-0ubuntu6.9_i386.deb"
192 | ["libc6-dbg_2.19-0ubuntu6.7_i386.deb"]="http://launchpadlibrarian.net/239076422/libc6-dbg_2.19-0ubuntu6.7_i386.deb"
193 | ["libc6-dbg_2.19-0ubuntu6.8_i386.deb"]="http://launchpadlibrarian.net/253296594/libc6-dbg_2.19-0ubuntu6.8_i386.deb"
194 | ["libc6-dbg_2.19-0ubuntu6.6_i386.deb"]="http://launchpadlibrarian.net/198724109/libc6-dbg_2.19-0ubuntu6.6_i386.deb"
195 | ["libc6-dbg_2.19-0ubuntu6.5_i386.deb"]="http://launchpadlibrarian.net/191854280/libc6-dbg_2.19-0ubuntu6.5_i386.deb"
196 | ["libc6-dbg_2.19-0ubuntu6.4_i386.deb"]="http://launchpadlibrarian.net/191626734/libc6-dbg_2.19-0ubuntu6.4_i386.deb"
197 | ["libc6-dbg_2.19-0ubuntu6.3_i386.deb"]="http://launchpadlibrarian.net/183374284/libc6-dbg_2.19-0ubuntu6.3_i386.deb"
198 | ["libc6-dbg_2.19-0ubuntu6.2_i386.deb"]="http://launchpadlibrarian.net/183251294/libc6-dbg_2.19-0ubuntu6.2_i386.deb"
199 | ["libc6-dbg_2.19-0ubuntu6.1_i386.deb"]="http://launchpadlibrarian.net/180923480/libc6-dbg_2.19-0ubuntu6.1_i386.deb"
200 | ["libc6-dbg_2.19-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/172658250/libc6-dbg_2.19-0ubuntu6_i386.deb"
201 | ["libc6-dbg_2.19-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/172507594/libc6-dbg_2.19-0ubuntu5_i386.deb"
202 | ["libc6-dbg_2.19-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/172335830/libc6-dbg_2.19-0ubuntu4_i386.deb"
203 | ["libc6-dbg_2.19-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/170526529/libc6-dbg_2.19-0ubuntu3_i386.deb"
204 | ["libc6-dbg_2.19-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/167416613/libc6-dbg_2.19-0ubuntu2_i386.deb"
205 | ["libc6-dbg_2.19-0ubuntu1_i386.deb"]="http://launchpadlibrarian.net/167158558/libc6-dbg_2.19-0ubuntu1_i386.deb"
206 | ["libc6-dbg_2.18-0ubuntu7_i386.deb"]="http://launchpadlibrarian.net/166493628/libc6-dbg_2.18-0ubuntu7_i386.deb"
207 | ["libc6-dbg_2.18-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/162594282/libc6-dbg_2.18-0ubuntu6_i386.deb"
208 | ["libc6-dbg_2.18-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/162479008/libc6-dbg_2.18-0ubuntu5_i386.deb"
209 | ["libc6-dbg_2.18-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/162207811/libc6-dbg_2.18-0ubuntu4_i386.deb"
210 | ["libc6-dbg_2.18-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/162200428/libc6-dbg_2.18-0ubuntu3_i386.deb"
211 | ["libc6-dbg_2.18-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/160266195/libc6-dbg_2.18-0ubuntu2_i386.deb"
212 | ["libc6-dbg_2.18-0ubuntu1_i386.deb"]="http://launchpadlibrarian.net/159898410/libc6-dbg_2.18-0ubuntu1_i386.deb"
213 | ["libc6-dbg_2.17-93ubuntu4_i386.deb"]="http://launchpadlibrarian.net/153556390/libc6-dbg_2.17-93ubuntu4_i386.deb"
214 | ["libc6_2.23-0ubuntu11.3_amd64.deb"]="http://launchpadlibrarian.net/534747115/libc6_2.23-0ubuntu11.3_amd64.deb"
215 | ["libc6_2.23-0ubuntu11.2_amd64.deb"]="http://launchpadlibrarian.net/482985942/libc6_2.23-0ubuntu11.2_amd64.deb"
216 | ["libc6_2.23-0ubuntu11_amd64.deb"]="http://launchpadlibrarian.net/409875491/libc6_2.23-0ubuntu11_amd64.deb"
217 | ["libc6_2.23-0ubuntu10_amd64.deb"]="http://launchpadlibrarian.net/353523729/libc6_2.23-0ubuntu10_amd64.deb"
218 | ["libc6_2.23-0ubuntu9_amd64.deb"]="http://launchpadlibrarian.net/324305509/libc6_2.23-0ubuntu9_amd64.deb"
219 | ["libc6_2.23-0ubuntu7_amd64.deb"]="http://launchpadlibrarian.net/311784970/libc6_2.23-0ubuntu7_amd64.deb"
220 | ["libc6_2.23-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/309946895/libc6_2.23-0ubuntu6_amd64.deb"
221 | ["libc6_2.23-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/293727143/libc6_2.23-0ubuntu5_amd64.deb"
222 | ["libc6_2.23-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/289526913/libc6_2.23-0ubuntu4_amd64.deb"
223 | ["libc6_2.23-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/253857233/libc6_2.23-0ubuntu3_amd64.deb"
224 | ["libc6_2.23-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/249648112/libc6_2.23-0ubuntu2_amd64.deb"
225 | ["libc6_2.23-0ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/249034097/libc6_2.23-0ubuntu1_amd64.deb"
226 | ["libc6_2.21-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/239453009/libc6_2.21-0ubuntu6_amd64.deb"
227 | ["libc6_2.21-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/228543889/libc6_2.21-0ubuntu5_amd64.deb"
228 | ["libc6_2.21-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/201272319/libc6_2.21-0ubuntu4_amd64.deb"
229 | ["libc6-dbg_2.23-0ubuntu11.3_amd64.deb"]="http://launchpadlibrarian.net/534747094/libc6-dbg_2.23-0ubuntu11.3_amd64.deb"
230 | ["libc6-dbg_2.23-0ubuntu11.2_amd64.deb"]="http://launchpadlibrarian.net/482985919/libc6-dbg_2.23-0ubuntu11.2_amd64.deb"
231 | ["libc6-dbg_2.23-0ubuntu11_amd64.deb"]="http://launchpadlibrarian.net/409875473/libc6-dbg_2.23-0ubuntu11_amd64.deb"
232 | ["libc6-dbg_2.23-0ubuntu10_amd64.deb"]="http://launchpadlibrarian.net/353523709/libc6-dbg_2.23-0ubuntu10_amd64.deb"
233 | ["libc6-dbg_2.23-0ubuntu9_amd64.deb"]="http://launchpadlibrarian.net/324305490/libc6-dbg_2.23-0ubuntu9_amd64.deb"
234 | ["libc6-dbg_2.23-0ubuntu7_amd64.deb"]="http://launchpadlibrarian.net/311784936/libc6-dbg_2.23-0ubuntu7_amd64.deb"
235 | ["libc6-dbg_2.23-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/309946877/libc6-dbg_2.23-0ubuntu6_amd64.deb"
236 | ["libc6-dbg_2.23-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/293727124/libc6-dbg_2.23-0ubuntu5_amd64.deb"
237 | ["libc6-dbg_2.23-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/289526885/libc6-dbg_2.23-0ubuntu4_amd64.deb"
238 | ["libc6-dbg_2.23-0ubuntu3_amd64.deb"]="http://launchpadlibrarian.net/253857215/libc6-dbg_2.23-0ubuntu3_amd64.deb"
239 | ["libc6-dbg_2.23-0ubuntu2_amd64.deb"]="http://launchpadlibrarian.net/249648074/libc6-dbg_2.23-0ubuntu2_amd64.deb"
240 | ["libc6-dbg_2.23-0ubuntu1_amd64.deb"]="http://launchpadlibrarian.net/249034077/libc6-dbg_2.23-0ubuntu1_amd64.deb"
241 | ["libc6-dbg_2.21-0ubuntu6_amd64.deb"]="http://launchpadlibrarian.net/239452943/libc6-dbg_2.21-0ubuntu6_amd64.deb"
242 | ["libc6-dbg_2.21-0ubuntu5_amd64.deb"]="http://launchpadlibrarian.net/228543855/libc6-dbg_2.21-0ubuntu5_amd64.deb"
243 | ["libc6-dbg_2.21-0ubuntu4_amd64.deb"]="http://launchpadlibrarian.net/201272336/libc6-dbg_2.21-0ubuntu4_amd64.deb"
244 | ["libc6_2.23-0ubuntu11.3_i386.deb"]="http://launchpadlibrarian.net/534757989/libc6_2.23-0ubuntu11.3_i386.deb"
245 | ["libc6_2.23-0ubuntu11.2_i386.deb"]="http://launchpadlibrarian.net/483000140/libc6_2.23-0ubuntu11.2_i386.deb"
246 | ["libc6_2.23-0ubuntu11_i386.deb"]="http://launchpadlibrarian.net/409874056/libc6_2.23-0ubuntu11_i386.deb"
247 | ["libc6_2.23-0ubuntu10_i386.deb"]="http://launchpadlibrarian.net/353525843/libc6_2.23-0ubuntu10_i386.deb"
248 | ["libc6_2.23-0ubuntu9_i386.deb"]="http://launchpadlibrarian.net/324303245/libc6_2.23-0ubuntu9_i386.deb"
249 | ["libc6_2.23-0ubuntu7_i386.deb"]="http://launchpadlibrarian.net/311784686/libc6_2.23-0ubuntu7_i386.deb"
250 | ["libc6_2.23-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/309944022/libc6_2.23-0ubuntu6_i386.deb"
251 | ["libc6_2.23-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/293727477/libc6_2.23-0ubuntu5_i386.deb"
252 | ["libc6_2.23-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/289528512/libc6_2.23-0ubuntu4_i386.deb"
253 | ["libc6_2.23-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/253862443/libc6_2.23-0ubuntu3_i386.deb"
254 | ["libc6_2.23-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/249647492/libc6_2.23-0ubuntu2_i386.deb"
255 | ["libc6_2.23-0ubuntu1_i386.deb"]="http://launchpadlibrarian.net/249033821/libc6_2.23-0ubuntu1_i386.deb"
256 | ["libc6_2.21-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/239433966/libc6_2.21-0ubuntu6_i386.deb"
257 | ["libc6_2.21-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/228545013/libc6_2.21-0ubuntu5_i386.deb"
258 | ["libc6_2.21-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/201272252/libc6_2.21-0ubuntu4_i386.deb"
259 | ["libc6-dbg_2.23-0ubuntu11.3_i386.deb"]="http://launchpadlibrarian.net/534757972/libc6-dbg_2.23-0ubuntu11.3_i386.deb"
260 | ["libc6-dbg_2.23-0ubuntu11.2_i386.deb"]="http://launchpadlibrarian.net/483000123/libc6-dbg_2.23-0ubuntu11.2_i386.deb"
261 | ["libc6-dbg_2.23-0ubuntu11_i386.deb"]="http://launchpadlibrarian.net/409874040/libc6-dbg_2.23-0ubuntu11_i386.deb"
262 | ["libc6-dbg_2.23-0ubuntu10_i386.deb"]="http://launchpadlibrarian.net/353525827/libc6-dbg_2.23-0ubuntu10_i386.deb"
263 | ["libc6-dbg_2.23-0ubuntu9_i386.deb"]="http://launchpadlibrarian.net/324303227/libc6-dbg_2.23-0ubuntu9_i386.deb"
264 | ["libc6-dbg_2.23-0ubuntu7_i386.deb"]="http://launchpadlibrarian.net/311784665/libc6-dbg_2.23-0ubuntu7_i386.deb"
265 | ["libc6-dbg_2.23-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/309943986/libc6-dbg_2.23-0ubuntu6_i386.deb"
266 | ["libc6-dbg_2.23-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/293727455/libc6-dbg_2.23-0ubuntu5_i386.deb"
267 | ["libc6-dbg_2.23-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/289528489/libc6-dbg_2.23-0ubuntu4_i386.deb"
268 | ["libc6-dbg_2.23-0ubuntu3_i386.deb"]="http://launchpadlibrarian.net/253862427/libc6-dbg_2.23-0ubuntu3_i386.deb"
269 | ["libc6-dbg_2.23-0ubuntu2_i386.deb"]="http://launchpadlibrarian.net/249647473/libc6-dbg_2.23-0ubuntu2_i386.deb"
270 | ["libc6-dbg_2.23-0ubuntu1_i386.deb"]="http://launchpadlibrarian.net/249033803/libc6-dbg_2.23-0ubuntu1_i386.deb"
271 | ["libc6-dbg_2.21-0ubuntu6_i386.deb"]="http://launchpadlibrarian.net/239433896/libc6-dbg_2.21-0ubuntu6_i386.deb"
272 | ["libc6-dbg_2.21-0ubuntu5_i386.deb"]="http://launchpadlibrarian.net/228544996/libc6-dbg_2.21-0ubuntu5_i386.deb"
273 | ["libc6-dbg_2.21-0ubuntu4_i386.deb"]="http://launchpadlibrarian.net/201272263/libc6-dbg_2.21-0ubuntu4_i386.deb"
274 | )
275 |
276 | show_help() {
277 | echo "Usage: xclibc [OPTION] ..."
278 | echo ""
279 | echo " -s show libc version"
280 | echo " -x [-n] switch libc for ELF (-n: replace-needed)"
281 | echo " -c [-n] [dir] patch ELF to specified libc version"
282 | echo " -d download specified libc"
283 | echo " -d all download all libc versions"
284 | echo " -d -r remove specified libc version"
285 | echo " -r restore original ELF"
286 | echo " -h display help"
287 | echo " -v show version"
288 | echo ""
289 | }
290 |
291 | if [ $# -eq 0 ]; then
292 | show_help
293 | exit 1
294 | fi
295 |
296 | usage_dowload() {
297 | echo >&2 "Usage: $0 id"
298 | exit 2
299 | }
300 |
301 | usage_extract() {
302 | echo -e >&2 "Usage: $0 deb output"
303 | exit 2
304 | }
305 |
306 | die() {
307 | echo >&2 $1
308 | exit 1
309 | }
310 |
311 | get_arch() {
312 | local x86="X86-64"
313 | local x32="80386"
314 | local data=$(readelf -h $1)
315 | if [[ $data =~ $x86 ]];then
316 | arch='amd64'
317 | elif [[ $data =~ $x32 ]];then
318 | arch='i386'
319 | else
320 | echo "no"
321 | exit 1
322 | fi
323 | }
324 |
325 | get_ver() {
326 | buf=$(strings $libcname |grep "GNU C Library" |awk '{print $6}')
327 | libcversion=${buf%*)}
328 | buf=$(strings $libcname |grep "GNU C Library" |awk '{print $6}')
329 | version=${buf%-*}
330 | }
331 |
332 | extract() {
333 | if [[ $# -ne 2 ]]; then
334 | usage_extract
335 | fi
336 | local deb=`readlink -f $1`
337 | local out=$2
338 | if [ ! -d "$out" ]; then
339 | mkdir $out
340 | fi
341 | local tmp=`mktemp -d`
342 | cd $tmp
343 | ar xv $deb || die "ar failed"
344 | if [ -f "data.tar.zst" ];then
345 | tar -I zstd -xf data.tar.* || die "tar failed"
346 | else
347 | tar xf data.tar.* || die "tar failed"
348 | fi
349 | cd -
350 |
351 | cp -rP $tmp/lib/*/* $out 2>/dev/null \
352 | || cp -rP $tmp/lib32/* $out 2>/dev/null \
353 | || cp -rP $tmp/usr/lib/*/* $out 2>/dev/null \
354 | || cp -rP $tmp/usr/lib/debug/lib/*/* $out 2>/dev/null \
355 | || cp -rP $tmp/usr/lib/debug/lib32/* $out 2>/dev/null \
356 | || cp -rP $tmp/usr/lib/debug/.build-id $out 2>/dev/null \
357 | || die "Failed to save. Check it manually $tmp"
358 |
359 | rm -rf $tmp
360 | }
361 |
362 | download() {
363 | if [ ! -d "$HOME/glibc-all-in-one/libs" ]; then
364 | mkdir $HOME/glibc-all-in-one/libs
365 | fi
366 |
367 | if [ ! -d "$HOME/glibc-all-in-one/debs" ]; then
368 | mkdir $HOME/glibc-all-in-one/debs
369 | fi
370 | local id=$1
371 | local LIBC_PREFIX="libc6_"
372 | local LIBC_DBG_PREFIX="libc6-dbg_"
373 | local deb_name=$LIBC_PREFIX$id.deb
374 | local dbg_name=$LIBC_DBG_PREFIX$id.deb
375 | echo "Getting $id"
376 | if [ -d "libs/$id" ]; then
377 | echo " --> Downloaded before. Remove it to download again."
378 | fi
379 |
380 | SOURCE="https://mirror.tuna.tsinghua.edu.cn/ubuntu/pool/main/g/glibc"
381 | # Use the source below if you feel slow, or change it on your own.
382 | # SOURCE="http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/"
383 | local url="$SOURCE/$deb_name"
384 |
385 | echo " -> Location: $url"
386 | echo " -> Downloading libc binary package"
387 | wget "$url" 2>/dev/null -O $HOME/glibc-all-in-one/debs/$deb_name || die "Failed to download package from $url"
388 | echo " -> Extracting libc binary package"
389 |
390 | mkdir -p $HOME/glibc-all-in-one/libs/$id
391 | extract $HOME/glibc-all-in-one/debs/$deb_name $HOME/glibc-all-in-one/libs/$id
392 | echo " -> Package saved to $HOME/glibc-all-in-one/libs/$id"
393 |
394 | # download debug info package
395 | local dbg_url="$SOURCE/$dbg_name"
396 | echo " -> Location: $dbg_url"
397 | echo " -> Downloading libc debug package"
398 | wget "$dbg_url" 2>/dev/null -O $HOME/glibc-all-in-one/debs/$dbg_name || die "Failed to download package from $url"
399 | echo " -> Extracting libc debug package"
400 |
401 | mkdir -p $HOME/glibc-all-in-one/libs/$id/.debug
402 | extract $HOME/glibc-all-in-one/debs/$dbg_name $HOME/glibc-all-in-one/libs/$id/.debug
403 | echo " -> Package saved to $HOME/glibc-all-in-one/libs/$id/.debug"
404 | }
405 |
406 | download_old() {
407 | if [ ! -d "$HOME/glibc-all-in-one/libs" ]; then
408 | mkdir $HOME/glibc-all-in-one/libs
409 | fi
410 |
411 | if [ ! -d "$HOME/glibc-all-in-one/debs" ]; then
412 | mkdir $HOME/glibc-all-in-one/debs
413 | fi
414 | local id=$1
415 | local LIBC_PREFIX="libc6_"
416 | local LIBC_DBG_PREFIX="libc6-dbg_"
417 | local deb_name=$LIBC_PREFIX$id.deb
418 | local dbg_name=$LIBC_DBG_PREFIX$id.deb
419 | echo "Getting $id"
420 | if [ -d "libs/$id" ]; then
421 | echo " --> Downloaded before. Remove it to download again."
422 | fi
423 |
424 | SOURCE="http://old-releases.ubuntu.com/ubuntu/pool/main/g/glibc"
425 | local url="$SOURCE/$deb_name"
426 |
427 | echo " -> Location: $url"
428 | echo " -> Downloading libc binary package"
429 | wget "$url" 2>/dev/null -O $HOME/glibc-all-in-one/debs/$deb_name || die "Failed to download package from $url"
430 | echo " -> Extracting libc binary package"
431 |
432 | mkdir -p $HOME/glibc-all-in-one/libs/$id
433 | extract $HOME/glibc-all-in-one/debs/$deb_name $HOME/glibc-all-in-one/libs/$id
434 | echo " -> Package saved to $HOME/glibc-all-in-one/libs/$id"
435 |
436 | # download debug info package
437 | local dbg_url="$SOURCE/$dbg_name"
438 | echo " -> Location: $dbg_url"
439 | echo " -> Downloading libc debug package"
440 | wget "$dbg_url" 2>/dev/null -O $HOME/glibc-all-in-one/debs/$dbg_name || die "Failed to download package from $url"
441 | echo " -> Extracting libc debug package"
442 |
443 | mkdir -p $HOME/glibc-all-in-one/libs/$id/.debug
444 | extract $HOME/glibc-all-in-one/debs/$dbg_name $HOME/glibc-all-in-one/libs/$id/.debug
445 | echo " -> Package saved to $HOME/glibc-all-in-one/libs/$id/.debug"
446 | }
447 |
448 | # 核心:mode = rpath / replace
449 | _xclibc_core() {
450 | local mode="$1" # rpath / replace
451 | local FILE_NAME="$2" # 要 patch 的 ELF
452 | local LIBC_VERSION="$3" # 比如 2.39
453 | local TARGET_DIR="$4" # 比如 /home/.../glibc-all-in-one/libs/2.39-0ubuntu8.4_amd64
454 |
455 | local LIBC_DIR="$HOME/glibc-all-in-one"
456 | local libc_dir
457 |
458 | # 必须先有版本号,否则不去 find,直接提示
459 | if [ -z "$LIBC_VERSION" ]; then
460 | echo "Usage: xclibc -c [libc_dir]"
461 | echo " libc_version example: 2.39"
462 | return 1
463 | fi
464 |
465 | # 只在有版本号的前提下去找目录,顺便限制一下深度,避免把所有子树都扫一遍
466 | libc_dir=$(find "$LIBC_DIR" -maxdepth 3 -type d -name "${LIBC_VERSION}*")
467 |
468 | if [ -z "$libc_dir" ]; then
469 | echo "Not support version or your $LIBC_DIR doesn't have libc for $LIBC_VERSION"
470 | return 1
471 | fi
472 |
473 | # 判定架构(根据 TARGET_DIR 字符串里有没有 amd64 / i386)
474 | local ARCH=""
475 | if [[ $TARGET_DIR =~ amd64 ]]; then
476 | ARCH="amd64"
477 | elif [[ $TARGET_DIR =~ i386 ]]; then
478 | ARCH="i386"
479 | fi
480 |
481 | if [ -n "$TARGET_DIR" ]; then
482 | # 版本号解析
483 | local version_number
484 | version_number="${TARGET_DIR##*2.31-0ubuntu9.}"
485 | version_number="${version_number%%_*}"
486 |
487 | Record "$FILE_NAME"
488 |
489 | # 1) 先统一只设置 interpreter
490 | if [ "$ARCH" == "i386" ]; then
491 | patchelf --set-interpreter "$TARGET_DIR/ld-linux.so.2" "$FILE_NAME"
492 | else
493 | patchelf --set-interpreter "$TARGET_DIR/ld-linux-x86-64.so.2" "$FILE_NAME"
494 | fi
495 |
496 | # rpath 模式:额外给主程序设 RUNPATH
497 | if [ "$mode" = "rpath" ]; then
498 | patchelf --set-rpath "$TARGET_DIR" "$FILE_NAME"
499 | fi
500 |
501 | # 2) 复制 .build-id
502 | if [[ $(echo "$LIBC_VERSION >= 2.34" | bc) -eq 1 ]] \
503 | || { [[ "$TARGET_DIR" == "$HOME/glibc-all-in-one/libs/2.31-0ubuntu9."* ]] && [[ "$version_number" -ge 9 ]]; }; then
504 | sudo rm -rf /usr/lib/debug/.build-id/
505 | sudo cp -r "$TARGET_DIR/.debug/.build-id/" /usr/lib/debug
506 | fi
507 |
508 | # 3) 读主程序 NEEDED,要求库都在 TARGET_DIR 里,然后按模式处理
509 | echo "[*] Checking NEEDED libraries for $FILE_NAME ..."
510 | local needed_libs
511 | needed_libs=$(readelf -d "$FILE_NAME" 2>/dev/null | \
512 | awk '/NEEDED/ {print $5}' | tr -d '[]' | sort -u)
513 |
514 | local missing_flag=0
515 | local libs_present=() # rpath 模式下:记录在 TARGET_DIR 中存在的一级依赖
516 | local lib
517 |
518 | # rpath 模式下用来去重:同一个 base 只 set-rpath 一次
519 | local -A rpath_patched=()
520 |
521 | for lib in $needed_libs; do
522 | local base
523 | base=$(basename "$lib")
524 |
525 | # 跳过 ld-linux 自身
526 | case "$base" in
527 | ld-linux*|ld-linux.so.2|ld-linux-x86-64.so.2)
528 | continue
529 | ;;
530 | esac
531 |
532 | if [ ! -f "$TARGET_DIR/$base" ]; then
533 | echo -e "\033[33m[!] Missing $base in $TARGET_DIR\033[0m"
534 | echo -e "\033[33m -> Please copy $base to $TARGET_DIR\033[0m"
535 | missing_flag=1
536 | else
537 | if [ "$mode" = "rpath" ]; then
538 | libs_present+=("$TARGET_DIR/$base")
539 | # 去重:只对第一次出现的 base 设 RUNPATH / 打印
540 | if [ -z "${rpath_patched[$base]}" ]; then
541 | echo -e "\033[32m[+] Found $base in $TARGET_DIR, set RUNPATH for it ...\033[0m"
542 | patchelf --set-rpath "$TARGET_DIR" "$TARGET_DIR/$base"
543 | rpath_patched[$base]=1
544 | fi
545 | else
546 | echo -e "\033[32m[+] Found $base in $TARGET_DIR, replace-needed in main ...\033[0m"
547 | patchelf --replace-needed "$lib" "$TARGET_DIR/$base" "$FILE_NAME"
548 | fi
549 | fi
550 | done
551 |
552 | # 3.5) rpath 模式:检查「库的库」,并给找到的次级依赖打 RUNPATH + 提示 found(去重)
553 | if [ "$mode" = "rpath" ] && [ "${#libs_present[@]}" -gt 0 ]; then
554 | echo "[*] Checking transitive dependencies in $TARGET_DIR ..."
555 | local so
556 | for so in "${libs_present[@]}"; do
557 | local sub_needed
558 | sub_needed=$(readelf -d "$so" 2>/dev/null | \
559 | awk '/NEEDED/ {print $5}' | tr -d '[]' | sort -u)
560 |
561 | local sub
562 | for sub in $sub_needed; do
563 | local subbase
564 | subbase=$(basename "$sub")
565 |
566 | case "$subbase" in
567 | ld-linux*|ld-linux.so.2|ld-linux-x86-64.so.2)
568 | continue
569 | ;;
570 | esac
571 |
572 | if [ ! -f "$TARGET_DIR/$subbase" ]; then
573 | echo -e "\033[33m[!] Missing $subbase (needed by $(basename "$so")) in $TARGET_DIR\033[0m"
574 | echo -e "\033[33m -> Please copy $subbase to $TARGET_DIR\033[0m"
575 | missing_flag=1
576 | else
577 | # 同样用 rpath_patched 去重:次级依赖如果之前已经处理过,就不再打印/patch
578 | if [ -z "${rpath_patched[$subbase]}" ]; then
579 | echo -e "\033[32m[+] Found $subbase in $TARGET_DIR (needed by $(basename "$so")), set RUNPATH for it ...\033[0m"
580 | patchelf --set-rpath "$TARGET_DIR" "$TARGET_DIR/$subbase"
581 | rpath_patched[$subbase]=1
582 | fi
583 | fi
584 | done
585 | done
586 | fi
587 |
588 | # 4) 根据是否缺库决定输出
589 | if [ "$missing_flag" -ne 0 ]; then
590 | echo -e "\033[31m[!] Missing dependencies detected. Please add them and rerun.\033[0m"
591 | return 1
592 | fi
593 |
594 | die "[+] success"
595 | else
596 | # 有版本号但没给 TARGET_DIR:只打印匹配到的目录
597 | printf '%s\n' "$libc_dir"
598 | echo -e '\033[32mPlease specify the directory \033[0m'
599 | return 1
600 | fi
601 | }
602 |
603 | # 正常模式(set-rpath + 依赖检查 + 给依赖 .so 打 RUNPATH,并检查次级依赖)
604 | clibc() {
605 | _xclibc_core "rpath" "$@"
606 | }
607 |
608 | # replace 模式:同样检查主程序 NEEDED,要求库在目录里,然后用 --replace-needed 绑到绝对路径,不做层级检查
609 | clibc_replace_needed() {
610 | _xclibc_core "replace" "$@"
611 | }
612 |
613 | Record() {
614 | local file="$1"
615 | if [ ! -e "$file.bak" ]; then
616 | cp "$file" "$file.bak"
617 | echo "[*] Backup created: $file.bak"
618 | fi
619 | }
620 |
621 | Restore() {
622 | local file="$1"
623 | if [ -e "$file.bak" ]; then
624 | cp "$file.bak" "$file"
625 | echo "[+] Restore $file from backup"
626 | else
627 | echo "[!] No backup found for $file"
628 | fi
629 | }
630 |
631 | # mode: "rpath" 使用 clibc,"need" 使用 clibc_replace_needed
632 | download_libc_and_patch() {
633 | local mode="$1" # rpath / need
634 | local id="${libcversion}_${arch}"
635 | local LIBC_PREFIX="libc6_"
636 | local LIBC_DBG_PREFIX="libc6-dbg_"
637 | local deb_name="${LIBC_PREFIX}${id}.deb"
638 | local dbg_name="${LIBC_DBG_PREFIX}${id}.deb"
639 |
640 | echo "Getting $id"
641 |
642 | # 已有缓存则直接 patch
643 | if [ -d "$LIBC_DIR/libs/$id" ]; then
644 | if [ "$mode" = "need" ]; then
645 | clibc_replace_needed "$filename" "$version" "$LIBC_DIR/libs/$id"
646 | else
647 | clibc "$filename" "$version" "$LIBC_DIR/libs/$id"
648 | fi
649 | return
650 | fi
651 |
652 | mkdir -p "$LIBC_DIR/debs"
653 | mkdir -p "$LIBC_DIR/libs"
654 |
655 | # ------- 下载 libc 二进制包 -------
656 | local url="${urls[$deb_name]}"
657 | local dbg_url="${urls[$dbg_name]}"
658 |
659 | if [ -z "$url" ]; then
660 | url="$SOURCE/$deb_name"
661 | fi
662 | if [ -z "$dbg_url" ]; then
663 | dbg_url="$SOURCE/$dbg_name"
664 | fi
665 |
666 | echo " -> Location: $url"
667 | echo " -> Downloading libc binary package"
668 | if ! sudo wget "$url" -q -O "$LIBC_DIR/debs/$deb_name"; then
669 | url="$OLD_SOURCE/$deb_name"
670 | echo " -> Fallback: $url"
671 | sudo wget "$url" -q -O "$LIBC_DIR/debs/$deb_name" || die "Failed to download package from $url"
672 | fi
673 |
674 | echo " -> Extracting libc binary package"
675 | mkdir -p "$LIBC_DIR/libs/$id"
676 | extract "$LIBC_DIR/debs/$deb_name" "$LIBC_DIR/libs/$id"
677 | echo " -> Package saved to $LIBC_DIR/libs/$id"
678 |
679 | # ------- 下载 libc debug 包 -------
680 | echo " -> Location: $dbg_url"
681 | echo " -> Downloading libc debug package"
682 | if ! sudo wget "$dbg_url" -q -O "$LIBC_DIR/debs/$dbg_name"; then
683 | dbg_url="$OLD_SOURCE/$dbg_name"
684 | echo " -> Fallback: $dbg_url"
685 | sudo wget "$dbg_url" -q -O "$LIBC_DIR/debs/$dbg_name" || die "Failed to download package from $dbg_url"
686 | fi
687 |
688 | echo " -> Extracting libc debug package"
689 | mkdir -p "$LIBC_DIR/libs/$id/.debug"
690 | extract "$LIBC_DIR/debs/$dbg_name" "$LIBC_DIR/libs/$id/.debug"
691 | echo " -> Package saved to $LIBC_DIR/libs/$id/.debug"
692 |
693 | # ------- 下载完成后进行 patch -------
694 | if [ "$mode" = "need" ]; then
695 | clibc_replace_needed "$filename" "$version" "$LIBC_DIR/libs/$id"
696 | else
697 | clibc "$filename" "$version" "$LIBC_DIR/libs/$id"
698 | fi
699 | }
700 |
701 |
702 |
703 | Download_libc(){
704 | if [ -z "$1" ]; then
705 | echo -e '\033[32m[+]Select the version you want to download \033[0m'
706 | echo -e '\033[34mBlue\033[0m is downloadable \033[32mGreen\033[0m is already downloaded'
707 | echo ''
708 |
709 | # blue
710 | light_blue=$(tput setaf 4)
711 | # green
712 | green=$(tput setaf 2)
713 |
714 | reset=$(tput sgr0)
715 |
716 | mkdir -p "$HOME/glibc-all-in-one/libs"
717 |
718 | for key in "${!urls[@]}"; do
719 | if [[ ! "$key" =~ libc6-dbg_ ]]; then
720 | version=$(echo "$key" | grep -oP 'libc6_\K.*(?=\.deb)')
721 | echo "$version" >> $HOME/glibc-all-in-one/libs/urls_versions.txt
722 | fi
723 | done
724 |
725 | find "$HOME/glibc-all-in-one/libs" -maxdepth 1 -type d -exec sh -c '[ "$(basename {})" != "libs" ] && echo "$(basename {})"' \; > $HOME/glibc-all-in-one/libs/libs.txt
726 |
727 | sort -u "$HOME/glibc-all-in-one/list" "$HOME/glibc-all-in-one/old_list" $HOME/glibc-all-in-one/libs/libs.txt $HOME/glibc-all-in-one/libs/urls_versions.txt | while read line
728 | do
729 | if grep -Fxq "$line" $HOME/glibc-all-in-one/libs/libs.txt
730 | then
731 | echo "${green}${line}${reset}"
732 | else
733 | echo "${light_blue}${line}${reset}"
734 | fi
735 | done | column
736 |
737 | # 清理临时文件
738 | rm $HOME/glibc-all-in-one/libs/libs.txt $HOME/glibc-all-in-one/libs/urls_versions.txt
739 | else
740 | if [ "$1" ]; then
741 | if grep -Fxq "$1" "$HOME/glibc-all-in-one/list"
742 | then
743 | download "$1"
744 | if [ -f "$HOME/glibc-all-in-one/libs/$1/libc.so.6" ] && [ -d "$HOME/glibc-all-in-one/libs/$1/.debug" ]; then
745 | chmod 755 -R $HOME/glibc-all-in-one/libs/$1
746 | else
747 | echo -e "\033[31m$1 The libc directory file is missing a file and has now been removed! \033[0m"
748 | rm -rf $HOME/glibc-all-in-one/libs/$1
749 | exit
750 | fi
751 | elif grep -Fxq "$1" "$HOME/glibc-all-in-one/old_list"
752 | then
753 | download_old "$1"
754 | if [ -f "$HOME/glibc-all-in-one/libs/$1/libc.so.6" ] && [ -d "$HOME/glibc-all-in-one/libs/$1/.debug" ]; then
755 | chmod 755 -R $HOME/glibc-all-in-one/libs/$1
756 | else
757 | echo -e "\033[31m$1 The libc directory file is missing a file and has now been removed! \033[0m"
758 | rm -rf $HOME/glibc-all-in-one/libs/$1
759 | exit
760 | fi
761 | elif [ -d "$HOME/glibc-all-in-one/libs/$1" ]
762 | then
763 | if [ -f "$HOME/glibc-all-in-one/libs/$1/libc.so.6" ] && [ -d "$HOME/glibc-all-in-one/libs/$1/.debug" ]; then
764 | echo "This version already exists and there is no download method。"
765 | else
766 | echo -e "\033[31m$1 The libc directory file is missing a file and has now been removed! \033[0m"
767 | rm -rf $HOME/glibc-all-in-one/libs/$1
768 | exit
769 | fi
770 | elif [ "${urls["libc6_$1.deb"]}" ]
771 | then
772 | download_url "$1"
773 | if [ -f "$HOME/glibc-all-in-one/libs/$1/libc.so.6" ] && [ -d "$HOME/glibc-all-in-one/libs/$1/.debug" ]; then
774 | chmod 755 -R $HOME/glibc-all-in-one/libs/$1
775 | else
776 | echo -e "\033[31m$1 The libc directory file is missing a file and has now been removed! \033[0m"
777 | rm -rf $HOME/glibc-all-in-one/libs/$1
778 | exit
779 | fi
780 | else
781 | echo "Unknown version: $1"
782 | fi
783 | fi
784 | fi
785 | }
786 |
787 |
788 |
789 | download_url() {
790 | LIBC_DIR=$HOME/glibc-all-in-one
791 | local id=$1
792 | local LIBC_PREFIX="libc6_"
793 | local LIBC_DBG_PREFIX="libc6-dbg_"
794 | local deb_name=$LIBC_PREFIX$id.deb
795 | local dbg_name=$LIBC_DBG_PREFIX$id.deb
796 | echo "Getting $id"
797 | if [ -d "$LIBC_DIR/libs/$id" ]; then
798 | die " --> Downloaded before. Remove it to download again."
799 | fi
800 | # download binary package
801 | url="${urls[$deb_name]}"
802 | dbg_url="${urls[$dbg_name]}"
803 |
804 | if [ -z "$url" ]; then
805 | url="$SOURCE/$deb_name"
806 | dbg_url="$SOURCE/$dbg_name"
807 | fi
808 | echo " -> Location: $url"
809 | echo " -> Downloading libc binary package"
810 | sudo wget -c "$url" -O $LIBC_DIR/debs/$deb_name
811 | echo " -> Extracting libc binary package"
812 | mkdir $LIBC_DIR/libs/$id
813 | extract $LIBC_DIR/debs/$deb_name $LIBC_DIR/libs/$id
814 | echo " -> Package saved to $LIBC_DIR/libs/$id"
815 |
816 | # download debug info package
817 | echo " -> Location: $dbg_url"
818 | echo " -> Downloading libc debug package"
819 | sudo wget -c "$dbg_url" -O $LIBC_DIR/debs/$dbg_name
820 | echo " -> Extracting libc debug package"
821 | mkdir $LIBC_DIR/libs/$id/.debug
822 | extract $LIBC_DIR/debs/$dbg_name $LIBC_DIR/libs/$id/.debug
823 | echo " -> Package saved to $LIBC_DIR/libs/$id/.debug"
824 | die "[+]success"
825 | }
826 |
827 | download_old_libc(){
828 | for deb in "${!urls[@]}"; do
829 | url="${urls[$deb]}"
830 | target="$HOME/glibc-all-in-one/debs/$deb"
831 |
832 | fondername0=${deb#*_}
833 | fondername=${fondername0%.*}
834 | echo "Getting $fondername"
835 | # if [ -d $HOME/glibc-all-in-one/libs/$fondername ];then
836 | # echo "--> Downloaded before. Remove it to download again."
837 | # continue
838 | # fi
839 | wget -c "$url" -O "$target"
840 | "$0" -e "$target"
841 | done
842 | echo -e '\033[32m[+]Successfully download '"$1"'\033[0m'
843 | }
844 |
845 |
846 | remove_libc(){
847 | if [ $1 ];then
848 | if [ -d "$HOME/glibc-all-in-one/libs/$1" ];then
849 | rm -rf "$HOME/glibc-all-in-one/libs/$1"
850 | echo -e '\033[32m[+]Successfully deleted '"$1"'\033[0m'
851 | else
852 | echo -e '\033[31m[!]'"$1"' not exist \033[0m'
853 | fi
854 | else
855 | echo -e '\033[31m[!]Please enter the version \033[0m'
856 | fi
857 | }
858 |
859 |
860 | progress_bar() {
861 | local index=$1 # 当前索引(从 1 开始)
862 | local total=$2 # 总数
863 | local extra="$3" # 当前版本号
864 |
865 | (( total == 0 )) && return
866 |
867 | local percent=$((100 * index / total))
868 | local width=40
869 | local filled=$((percent * width / 100))
870 |
871 | local bar
872 | bar=$(printf '%0.s#' $(seq 1 $filled))
873 | local spaces
874 | spaces=$(printf '%0.s ' $(seq 1 $((width - filled))))
875 |
876 | # \r 回到行首,\033[K 清除到行尾,避免残留字符
877 | printf "\r\033[Kprogress:[%s%s] %3d%% (%d/%d) %s" \
878 | "$bar" "$spaces" "$percent" "$index" "$total" "$extra"
879 | }
880 |
881 |
882 |
883 | while getopts 's:x:hvc:e:r:d' OPT
884 | do
885 | case $OPT in
886 | s)
887 | libcname=$OPTARG
888 | get_ver
889 | echo -e "\033[32mLIBC_VERSION: \033[0m"$libcversion
890 | ;;
891 | x)
892 | LIBC_DIR=$HOME/glibc-all-in-one
893 | SOURCE="https://mirror.tuna.tsinghua.edu.cn/ubuntu/pool/main/g/glibc"
894 | OLD_SOURCE="http://old-releases.ubuntu.com/ubuntu/pool/main/g/glibc"
895 |
896 | if [ "$2" = "-n" ]; then
897 | filename=$3
898 | libcname=$4
899 | else
900 | filename=$2
901 | libcname=$3
902 | fi
903 | if [ ! -f "$filename" ]; then
904 | die "[!] ELF not found: $filename"
905 | fi
906 |
907 | get_arch "$libcname"
908 | get_ver
909 |
910 | if [ "$2" = "-n" ]; then
911 | download_libc_and_patch "need"
912 | else
913 | download_libc_and_patch "rpath"
914 | fi
915 | ;;
916 | c)
917 | if [ "$2" = "-n" ];then
918 | clibc_replace_needed $3 $4 $5
919 | else
920 | clibc $2 $3 $4
921 | fi
922 | ;;
923 | e)
924 | LIBC_PREFIX="libc6_"
925 | LIBC_DBG_PREFIX="libc6-dbg_"
926 | LIBC_DIR=$HOME/glibc-all-in-one/
927 | deb=$2
928 | fondername0=${deb#*_}
929 | fondername=${fondername0%.*}
930 | if [ -d $HOME/glibc-all-in-one/libs/$fondername ];then
931 | echo -e "[-]already exists"
932 | else
933 | mkdir $LIBC_DIR/libs/$fondername
934 | mkdir $LIBC_DIR/libs/$fondername/.debug
935 | echo -e "[+]create folder finish"
936 | fi
937 | if [[ $2 =~ $LIBC_DBG_PREFIX ]];then
938 | extract $2 $LIBC_DIR/libs/$fondername/.debug
939 | sudo chmod 755 -R $LIBC_DIR/libs/$fondername/.debug
940 | else
941 | extract $2 $LIBC_DIR/libs/$fondername
942 | sudo chmod 755 -R $LIBC_DIR/libs/$fondername
943 | fi
944 | ;;
945 | r)
946 | Restore "$2"
947 | ;;
948 | d)
949 | if [ "$2" = "-r" ]; then
950 | remove_libc "$3"
951 | elif [ "$2" = "all" ]; then
952 | echo "[+] update glibc_all_in_one list"
953 | cd "$HOME/glibc-all-in-one" || exit 1
954 | "$HOME/glibc-all-in-one/update_list"
955 |
956 | version_count=$(cat "$HOME/glibc-all-in-one/list" "$HOME/glibc-all-in-one/old_list" | wc -l)
957 | version_index=0
958 | echo
959 | while IFS= read -r version; do
960 | if grep -Fxq "$version" "$HOME/glibc-all-in-one/list"; then
961 | if [ -f "$HOME/glibc-all-in-one/libs/$version/libc.so.6" ] && \
962 | [ -d "$HOME/glibc-all-in-one/libs/$version/.debug" ]; then
963 | :
964 | else
965 | download "$version"
966 | if [ -f "$HOME/glibc-all-in-one/libs/$version/libc.so.6" ] && \
967 | [ -d "$HOME/glibc-all-in-one/libs/$version/.debug" ]; then
968 | chmod 755 -R "$HOME/glibc-all-in-one/libs/$version"
969 | else
970 | echo -e "\033[31m$version The libc directory file is missing a file and has now been removed! \033[0m"
971 | rm -rf "$HOME/glibc-all-in-one/libs/$version"
972 | exit 1
973 | fi
974 | fi
975 | elif grep -Fxq "$version" "$HOME/glibc-all-in-one/old_list"; then
976 | if [ -f "$HOME/glibc-all-in-one/libs/$version/libc.so.6" ] && \
977 | [ -d "$HOME/glibc-all-in-one/libs/$version/.debug" ]; then
978 | :
979 | else
980 | download_old "$version"
981 | if [ -f "$HOME/glibc-all-in-one/libs/$version/libc.so.6" ] && \
982 | [ -d "$HOME/glibc-all-in-one/libs/$version/.debug" ]; then
983 | chmod 755 -R "$HOME/glibc-all-in-one/libs/$version"
984 | else
985 | echo -e "\033[31m$version The libc directory file is missing a file and has now been removed! \033[0m"
986 | rm -rf "$HOME/glibc-all-in-one/libs/$version"
987 | exit 1
988 | fi
989 | fi
990 | fi
991 |
992 | version_index=$((version_index + 1))
993 | progress_bar "$version_index" "$version_count" "$version"
994 |
995 | done < <(cat "$HOME/glibc-all-in-one/list" "$HOME/glibc-all-in-one/old_list")
996 |
997 | echo # 进度条结束后换一行
998 | echo
999 |
1000 | read -p "Do you want to download additional libc? (y/n): " choice
1001 | choice=$(echo "$choice" | tr '[:upper:]' '[:lower:]')
1002 | if [ "$choice" = "y" ]; then
1003 | echo "Downloading additional libc..."
1004 | download_old_libc
1005 | fi
1006 | exit 0
1007 | else
1008 | Download_libc "$2"
1009 | fi
1010 | ;;
1011 | v)
1012 | echo "xclibc v1.8"
1013 | echo "------------------------"
1014 | echo "|Update based on xclibc|"
1015 | echo "|Writen by E4L4 |"
1016 | echo "------------------------"
1017 | exit -1
1018 | ;;
1019 | h)
1020 | show_help
1021 | exit 0
1022 | ;;
1023 | esac
1024 | done
1025 |
--------------------------------------------------------------------------------