Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qqwry手动解压错误 #5

Closed
GoGoogle opened this issue Jul 29, 2020 · 27 comments
Closed

qqwry手动解压错误 #5

GoGoogle opened this issue Jul 29, 2020 · 27 comments
Labels
question Further information is requested

Comments

@GoGoogle
Copy link

➜  doc nali 8.8.8.8
panic: runtime error: slice bounds out of range [:4] with capacity 0

goroutine 1 [running]:
github.com/zu1k/nali/pkg/qqwry.(*QQwry).searchIndex(0x4000097b28, 0x8080808, 0x10)
        github.com/zu1k/nali/pkg/qqwry/qqwry.go:124 +0x360
github.com/zu1k/nali/pkg/qqwry.QQwry.Find(0x400002d170, 0x1ae419277acaa757, 0x7fcaa9e413, 0x7, 0x0, 0x0)
        github.com/zu1k/nali/pkg/qqwry/qqwry.go:66 +0xb0
github.com/zu1k/nali/internal/app.ParseIPs(0x400005da80, 0x1, 0x1)
        github.com/zu1k/nali/internal/app/parse.go:48 +0xe0
github.com/zu1k/nali/cmd.glob..func3(0x76bce0, 0x400005da80, 0x1, 0x1)
        github.com/zu1k/nali/cmd/root.go:72 +0x1d0
github.com/spf13/cobra.(*Command).execute(0x76bce0, 0x400000c090, 0x1, 0x1, 0x76bce0, 0x400000c090)
        github.com/spf13/cobra@v1.0.0/command.go:846 +0x1c4
github.com/spf13/cobra.(*Command).ExecuteC(0x76bce0, 0x42d1c, 0x40000240b8, 0x0)
        github.com/spf13/cobra@v1.0.0/command.go:950 +0x260
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.0.0/command.go:887
github.com/zu1k/nali/cmd.Execute()
        github.com/zu1k/nali/cmd/root.go:79 +0x30
main.main()
        github.com/zu1k/nali/main.go:14 +0x24
➜  doc
@GoGoogle
Copy link
Author

nali-linux-armv8-v0.2.1.gz

@zu1k
Copy link
Owner

zu1k commented Jul 29, 2020

你好,我这里没有arm设备来进行测试,你能够测试一下其他的IP吗?还有IPv6也有这个问题吗?

@GoGoogle
Copy link
Author

你好,我这里没有arm设备来进行测试,你能够测试一下其他的IP吗?还有IPv6也有这个问题吗?

可以正常查IPv6

@zu1k
Copy link
Owner

zu1k commented Jul 29, 2020

我目前测试过linux amd64和windows版本,都没有出现这个问题,所以对这个问题出现的原因不太清楚,也没有使用cgo

猜测原因可能有两种:

  • 数据库文件部分出错(手动下载复制进去看看)
  • golang官方的交叉编译出了问题

@zu1k zu1k added the help wanted Extra attention is needed label Jul 30, 2020
@GoGoogle
Copy link
Author

  • 手动下载复制进去看看
    数据库我都是手动下载的,因为它不能自动下载(可能这就是个Bug?

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

都是手动下载的,解压了吗?
无法自动下载可能是你网络的原因,你可以设备里面看一下 qqwry.mirror.noc.one 的可达性

@GoGoogle
Copy link
Author

都是手动下载的,解压了吗?
无法自动下载可能是你网络的原因,你可以设备里面看一下 qqwry.mirror.noc.one 的可达性

解压了
是所有的都不能自动下载,ipv6\json文件都不行,我看也不是同一个地址,我用wget可以下载。

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

奇怪啊,看来不是网络的原因
我没有arm设备进行调试,如果方便的话你能不能调试看一下什么原因?

@GoGoogle
Copy link
Author

奇怪啊,看来不是网络的原因
我没有arm设备进行调试,如果方便的话你能不能调试看一下什么原因?

如何调试呢?

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

可参照:

如果不懂调试或者没时间也不必强求,后面我问问我同学有没有时间,他有树莓派

@GoGoogle
Copy link
Author

可参照:

如果不懂调试或者没时间也不必强求,后面我问问我同学有没有时间,他有树莓派

这个还真不会,我以为就在设备上加参数。

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

刚刚租了台华为鲲鹏服务器(arm架构)

测试 linux armv8 版本没有问题啊

root@ecs-f0df:~# ls
nali-linux-armv8
root@ecs-f0df:~# ./nali-linux-armv8
2020/07/30 08:32:24 文件不存在,尝试从网络获取最新纯真 IP 库
2020/07/30 08:32:39 已将最新的 纯真IP库 保存到本地: /root/.nali/qqwry.dat
2020/07/30 08:32:39 文件不存在,尝试从网络获取最新ZX IPv6数据库
2020/07/30 08:32:46 已将最新的 ZX IPv6数据库 保存到本地: /root/.nali/ipv6wry.db
2020/07/30 08:32:46 文件不存在,尝试从网络获取最新CDN数据库
2020/07/30 08:32:47 CDN数据库下载失败,请手动下载解压后保存到本地: /root/.nali/cdn.json
2020/07/30 08:32:47 下载链接: https://raw.githubusercontent.com/SukkaLab/cdn/master/dist/cdn.json
root@ecs-f0df:~# ./nali-linux-armv8 8.8.8.8
8.8.8.8 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器]

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

的确没有问题,你再测试一下吧

root@ecs-f0df:~# uname -a
Linux ecs-f0df 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:10 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
root@ecs-f0df:~# arch
aarch64
root@ecs-f0df:~# ls -l
total 7552
-rwxrwxrwx 1 root root 7733248 Jul 30 08:32 nali-linux-armv8
root@ecs-f0df:~# ./nali-linux-armv8 114.114.114.114 8.8.8.8
114.114.114.114 [江苏省南京市 南京信风网络科技有限公司GreatbitDNS服务器]
8.8.8.8 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器]

@zu1k zu1k added question Further information is requested and removed help wanted Extra attention is needed labels Jul 30, 2020
@GoGoogle
Copy link
Author

我是在实体手机上用的

➜  ~ whereis nali
nali: /data/data/com.termux/files/usr/bin/nali
➜  ~ ls -lh /data/data/com.termux/files/usr/bin/nali
-rwx------ 1 u0_a167 u0_a167 6.8M Jul 30 00:38 /data/data/com.termux/files/usr/bin/nali
➜  ~ uname -a
Linux localhost 4.4.226-perf+ #1 SMP PREEMPT Thu Jul 23 04:47:47 UTC 2020 aarch64 Android
➜  ~ nali 1.2.3.4
panic: runtime error: slice bounds out of range [:4] with capacity 0

goroutine 1 [running]:
github.com/zu1k/nali/pkg/qqwry.(*QQwry).searchIndex(0x88fdbc, 0x1020304, 0x10)
        github.com/zu1k/nali/pkg/qqwry/qqwry.go:124 +0x3c4
github.com/zu1k/nali/pkg/qqwry.QQwry.Find(0x906e80, 0x7acaa757, 0x1ae41927, 0xff9253b4, 0x7, 0x0, 0x0)
        github.com/zu1k/nali/pkg/qqwry/qqwry.go:66 +0xac
github.com/zu1k/nali/internal/app.ParseIPs(0x904d98, 0x1, 0x1)
        github.com/zu1k/nali/internal/app/parse.go:48 +0xd4
github.com/zu1k/nali/cmd.glob..func3(0x6c4f48, 0x904d98, 0x1, 0x1)
        github.com/zu1k/nali/cmd/root.go:72 +0x1e4
github.com/spf13/cobra.(*Command).execute(0x6c4f48, 0x912018, 0x1, 0x1, 0x6c4f48, 0x912018)
        github.com/spf13/cobra@v1.0.0/command.go:846 +0x1e8
github.com/spf13/cobra.(*Command).ExecuteC(0x6c4f48, 0x902030, 0x0, 0x0)
        github.com/spf13/cobra@v1.0.0/command.go:950 +0x26c
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.0.0/command.go:887
github.com/zu1k/nali/cmd.Execute()
        github.com/zu1k/nali/cmd/root.go:79 +0x20
main.main()
        github.com/zu1k/nali/main.go:14 +0x18
➜  ~ nali 2400:3200::1
2400:3200::1 [中国浙江省杭州市 阿里云计算有限公司]
➜  ~

@GoGoogle
Copy link
Author

刚才是V7,我现在换成了V8

➜  ~ uname -a
Linux localhost 4.4.226-perf+ #1 SMP PREEMPT Thu Jul 23 04:47:47 UTC 2020 aarch64 Android
➜  ~ ls -l /data/data/com.termux/files/usr/bin/nali
-rwx------ 1 u0_a167 u0_a167 7733248 Jul 30 08:50 /data/data/com.termux/files/usr/bin/nali
➜  ~ nali 1.2.3.4
panic: runtime error: slice bounds out of range [:4] with capacity 0

goroutine 1 [running]:
github.com/zu1k/nali/pkg/qqwry.(*QQwry).searchIndex(0x400008fb28, 0x1020304, 0x10)
        github.com/zu1k/nali/pkg/qqwry/qqwry.go:124 +0x360
github.com/zu1k/nali/pkg/qqwry.QQwry.Find(0x4000107140, 0x1ae419277acaa757, 0x7fe19583b4, 0x7, 0x0, 0x0)
        github.com/zu1k/nali/pkg/qqwry/qqwry.go:66 +0xb0
github.com/zu1k/nali/internal/app.ParseIPs(0x4000105a70, 0x1, 0x1)
        github.com/zu1k/nali/internal/app/parse.go:48 +0xe0
github.com/zu1k/nali/cmd.glob..func3(0x76bce0, 0x4000105a70, 0x1, 0x1)
        github.com/zu1k/nali/cmd/root.go:72 +0x1d0
github.com/spf13/cobra.(*Command).execute(0x76bce0, 0x4000114030, 0x1, 0x1, 0x76bce0, 0x4000114030)
        github.com/spf13/cobra@v1.0.0/command.go:846 +0x1c4
github.com/spf13/cobra.(*Command).ExecuteC(0x76bce0, 0x42d1c, 0x4000102058, 0x0)
        github.com/spf13/cobra@v1.0.0/command.go:950 +0x260
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.0.0/command.go:887
github.com/zu1k/nali/cmd.Execute()
        github.com/zu1k/nali/cmd/root.go:79 +0x30
main.main()
        github.com/zu1k/nali/main.go:14 +0x24
➜  ~ nali 2400:3200::1
2400:3200::1 [中国浙江省杭州市 阿里云计算有限公司]
➜  ~

结果一样。

@GoGoogle
Copy link
Author

我有个疑问,为什么用rar格式?而且这文件不能正常打开。
https://qqwry.mirror.noc.one/qqwry.rar

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

用的安卓呀

没有编译安卓版本,如果需要可以自行编译

ANDROID_CC=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang
ANDROID_CXX=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++
ANDROID_LD=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld
export GOARCH=arm64 
export GOOS=android 
export CXX=$ANDROID_CXX
export CC=$ANDROID_CC 
export LD=$ANDROID_LD 
export CGO_ENABLED=1
go build -ldflags " -w -s" -trimpath -o "android_arm64" .

@GoGoogle
Copy link
Author

GoGoogle commented Jul 30, 2020

那ipv6怎么可以用?这兼容性是不是太牛了……
我以为arm的话,手机也通用。

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

我有个疑问,为什么用rar格式?而且这文件不能正常打开。
https://qqwry.mirror.noc.one/qqwry.rar

人家数据库提供的就是这个后缀,需要解密后才能用

@GoGoogle
Copy link
Author

我有个疑问,为什么用rar格式?而且这文件不能正常打开。
https://qqwry.mirror.noc.one/qqwry.rar

人家数据库提供的就是这个后缀,需要解密后才能用

那是直接复制成 qqwry.dat ?

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

我有个疑问,为什么用rar格式?而且这文件不能正常打开。
https://qqwry.mirror.noc.one/qqwry.rar

人家数据库提供的就是这个后缀,需要解密后才能用

那是直接复制成 qqwry.dat ?

需要解密的,具体解密函数在pkg/qqwry/update里面有

你是怎么解密这个文件的?

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

那ipv6怎么可以用?这兼容性是不是太牛了……
我以为arm的话,手机也通用。

按理说应该是通用的,除非要在jni调用才会编译成安卓的才对

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

临时从这里下载正确的库,有效期到8月初:https://cowtransfer.com/s/cff2852398a34f

@GoGoogle
Copy link
Author

我有个疑问,为什么用rar格式?而且这文件不能正常打开。
https://qqwry.mirror.noc.one/qqwry.rar

人家数据库提供的就是这个后缀,需要解密后才能用

那是直接复制成 qqwry.dat ?

需要解密的,具体解密函数在pkg/qqwry/update里面有

你是怎么解密这个文件的?

我没解密,直接复制粘贴了,可能是这个原因吧。
我不知道怎么解密。

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

我有个疑问,为什么用rar格式?而且这文件不能正常打开。
https://qqwry.mirror.noc.one/qqwry.rar

人家数据库提供的就是这个后缀,需要解密后才能用

那是直接复制成 qqwry.dat ?

需要解密的,具体解密函数在pkg/qqwry/update里面有
你是怎么解密这个文件的?

我没解密,直接复制粘贴了,可能是这个原因吧。
我不知道怎么解密。

那就是了...原来没有正确解密

@GoGoogle
Copy link
Author

我有个疑问,为什么用rar格式?而且这文件不能正常打开。
https://qqwry.mirror.noc.one/qqwry.rar

人家数据库提供的就是这个后缀,需要解密后才能用

那是直接复制成 qqwry.dat ?

需要解密的,具体解密函数在pkg/qqwry/update里面有
你是怎么解密这个文件的?

我没解密,直接复制粘贴了,可能是这个原因吧。
我不知道怎么解密。

那就是了...原来没有正确解密

嗯,下了你给的数据库就正常了。
看来这个加密的数据库有点坑人了。

@zu1k
Copy link
Owner

zu1k commented Jul 30, 2020

其实在db目录下有正确的数据库的

@zu1k zu1k closed this as completed Jul 30, 2020
@zu1k zu1k changed the title armv8 qqwry手动解压错误 Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants