精易论坛

标题: golangji验混淆还原 [打印本页]

作者: 小明无敌    时间: 2023-8-2 01:26
标题: golangji验混淆还原
本帖最后由 小明无敌 于 2023-8-2 01:51 编辑

golang后端 实现ji验反混淆 图片
文件太大了 发网盘了https://wwot.lanzouw.com/iDiQy14594ed
注意 需要图片先转换为 jpeg 然后base64编码之后 提交格式为
地址:http://127.0.0.1:8082/getapi
提交内容为{"type":"geetest","msg":"data:image/jpeg;base64,*****"}*****替换为base64数据
返回内容为{"msg":base64}
返回内容也为base64  易语言再编码转图片 就是反混淆之后的结果
主要为学习gin框架和 for循环 图片复制
网页JavaScript源码部分
主要代码实现
[Golang] 纯文本查看 复制代码
func geetest(base64 string) (string, error) {
        array := []int{39, 38, 48, 49, 41, 40, 46, 47, 35, 34, 50, 51, 33, 32, 28, 29, 27, 26, 36, 37, 31, 30, 44, 45, 43, 42, 12, 13, 23, 22, 14, 15, 21, 20, 8, 9, 25, 24, 6, 7, 3, 2, 0, 1, 11, 10, 4, 5, 19, 18, 16, 17}

        originalImage, err := base64toimage(base64)
        fmt.Println(err)
        if err != nil {
                // 处理解码错误

                return "", errors.New("error")
        }
        convertedImage := image.NewRGBA(image.Rect(0, 0, 312, 160))
        //

        for i := 0; i < len(array); i++ {
                c := array%26*12 + 1
                fmt.Println(c)
                u := 0
                db := 0

                if array > 25 {
                        u = 80
                } else {
                        u = 0
                }

                if i > 25 {
                        db = 80
                } else {
                        db = 0
                }
                copyImage(convertedImage, originalImage, i%26*10, db, c, u, 10, 80)
                // 使用 array 进行操作
        }

        base64Result := imagetobase64(convertedImage)
        return base64Result, nil

}
func copyImage(dest *image.RGBA, src image.Image, dx, dy, sx, sy, width, height int) {

        for y := 0; y < height; y++ {
                for x := 0; x < width; x++ {
                        convertedPixel := color.RGBAModel.Convert(src.At(x+sx, y+sy))
                        dest.SetRGBA(x+dx, y+dy, convertedPixel.(color.RGBA))
                }
        }
}


作者: qqmqqg    时间: 2023-8-2 07:56
  感谢发布原创作品,精易因你更精彩
作者: renjianhong48we    时间: 2023-8-2 09:30
感谢分享
作者: 君九    时间: 2023-8-2 10:11

感谢分享
作者: 一指温柔    时间: 2023-8-2 12:47
感谢分享
作者: pipicool    时间: 2023-8-2 17:53
学习一下
作者: 396384183    时间: 2023-8-3 20:29
感谢分享感谢分享
作者: xiaosep123    时间: 2023-8-3 22:02
楼主辛苦了,谢谢楼主,感谢楼主分享,楼主好人一生平安!!!




欢迎光临 精易论坛 (https://125.confly.eu.org/) Powered by Discuz! X3.4