remove old backstage injection and remove all legacy code
This commit is contained in:
@@ -1750,12 +1750,8 @@ func findReflectiveLoaderOffset(pe []byte) (uint32, error) {
|
||||
// BackstageInjection reflective loader entry. The loader entry is exported
|
||||
// under a per-build random name of the form "x" + six lowercase hex digits
|
||||
// (generated by the DLL's build.rs), so a fixed string cannot be used to
|
||||
// find it. The legacy fixed name is still accepted so DLL artifacts produced
|
||||
// by older builds keep working.
|
||||
// find it.
|
||||
func isBackstageLoaderExport(name string) bool {
|
||||
if name == "ReflectiveLoader" {
|
||||
return true
|
||||
}
|
||||
if len(name) != 7 || name[0] != 'x' {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -115,13 +115,13 @@ func TestGetProcessesLockingFileShortPathDoesNotPanic(t *testing.T) {
|
||||
_ = getProcessesLockingFile("a")
|
||||
}
|
||||
|
||||
func TestIsBackstageLoaderExportSupportsBothCommandVersions(t *testing.T) {
|
||||
for _, name := range []string{"ReflectiveLoader", "x012abc", "xffffff"} {
|
||||
func TestIsBackstageLoaderExportAcceptsRandomizedExport(t *testing.T) {
|
||||
for _, name := range []string{"x012abc", "xffffff"} {
|
||||
if !isBackstageLoaderExport(name) {
|
||||
t.Fatalf("expected loader export %q to be accepted", name)
|
||||
}
|
||||
}
|
||||
for _, name := range []string{"reflectiveloader", "x012ABc", "x12345", "x1234567", "other"} {
|
||||
for _, name := range []string{"ReflectiveLoader", "reflectiveloader", "x012ABc", "x12345", "x1234567", "other"} {
|
||||
if isBackstageLoaderExport(name) {
|
||||
t.Fatalf("expected loader export %q to be rejected", name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user