1
0
mirror of https://github.com/fumiama/go-registry.git synced 2026-06-30 07:40:24 +08:00
This commit is contained in:
源文雨
2022-11-21 18:54:40 +08:00
parent 6ca18706de
commit aa39d5a1c9

4
reg.go
View File

@@ -50,6 +50,7 @@ func NewRegedit(addr, stor, pwd, sps string) *Regedit {
copy(tp[:], pwd)
copy(ts[:], sps)
s := tea.NewTeaCipherLittleEndian(ts[:])
if stor != "" {
f, err := os.Open(stor)
if err != nil {
f, err = os.Create(stor)
@@ -58,6 +59,7 @@ func NewRegedit(addr, stor, pwd, sps string) *Regedit {
}
}
_ = f.Close()
}
return &Regedit{addr: addr, stor: stor, tp: tea.NewTeaCipherLittleEndian(tp[:]), ts: &s}
}
@@ -67,6 +69,7 @@ func NewRegReader(addr, stor, pwd string) *Regedit {
pwd = pwd[:15]
}
copy(tp[:], pwd)
if stor != "" {
f, err := os.Open(stor)
if err != nil {
f, err = os.Create(stor)
@@ -75,6 +78,7 @@ func NewRegReader(addr, stor, pwd string) *Regedit {
}
}
_ = f.Close()
}
return &Regedit{addr: addr, stor: stor, tp: tea.NewTeaCipherLittleEndian(tp[:])}
}