mirror of
https://github.com/mandiant/capa.git
synced 2025-12-21 23:00:29 -08:00
adjust negative hex numbers in to_yaml
This commit is contained in:
@@ -14,7 +14,6 @@ Unless required by applicable law or agreed to in writing, software distributed
|
||||
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and limitations under the License.
|
||||
"""
|
||||
import re
|
||||
import sys
|
||||
import logging
|
||||
import argparse
|
||||
@@ -60,9 +59,6 @@ def main(argv=None):
|
||||
rule = capa.rules.Rule.from_yaml_file(args.path, use_ruamel=True)
|
||||
reformatted_rule = rule.to_yaml()
|
||||
|
||||
# fix negative numbers
|
||||
reformatted_rule = re.sub(r"!!int '0x-([0-9a-fA-F]+)'", r"-0x\1", reformatted_rule)
|
||||
|
||||
if args.check:
|
||||
if rule.definition == reformatted_rule:
|
||||
logger.info("rule is formatted correctly, nice! (%s)", rule.name)
|
||||
|
||||
Reference in New Issue
Block a user