mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-23 19:39:40 +00:00
3aa380090f
Add a second mode that extracts constant values from ELF object, instead of running the executable. This allows to not (1) link binaries, (2) use proper cross-compiler. It finally fixes 386/arm extracts for my distro. Hopefully not makes things worse for others, should generally be safer/more reliable. The current mode is left b/c I can't test all OSes, windows binaries are not ELF, so we may need it anyway. But later we may switch more OSes to this new mode if they break (fuchsia?).
26 lines
623 B
Go
26 lines
623 B
Go
// Copyright 2017 syzkaller project authors. All rights reserved.
|
|
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/google/syzkaller/pkg/compiler"
|
|
)
|
|
|
|
type windows struct{}
|
|
|
|
func (*windows) prepare(sourcedir string, build bool, arches []string) error {
|
|
return nil
|
|
}
|
|
|
|
func (*windows) prepareArch(arch *Arch) error {
|
|
return nil
|
|
}
|
|
|
|
func (*windows) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint64, map[string]bool, error) {
|
|
params := &extractParams{
|
|
DeclarePrintf: true,
|
|
}
|
|
return extract(info, "cl", nil, params)
|
|
}
|