Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code similarity preprocessing : extract_obj.py: error: ambiguous option: -a could match -asm_t, -asm #1

Closed
smartappcoder opened this issue Jan 30, 2021 · 3 comments

Comments

@smartappcoder
Copy link

I have troubles to run Binary code similarity measures by following the README instructions:

Binary code similarity measures
1. Download dataset                                                                                      
    . Download POJ-104 datasets from here and extract them into data/.

2. Compile and preprocess                                                                         
    Run python extract_obj.py -a data/obj (clang++-3.7.1 required)`

I downloaded the datasets and put it under nberf/data. Since there is no extract_obj.py under nberf, I changed the command to

  (py3_env): python preprocess/extract_obj.py -a data/obj` 

I got

usage: extract_obj.py [-h] [--poj-dir POJ_DIR] [--filter-list FILTER_LIST] [--asm_type {x86,mips}] [--output-asm-dir OUTPUT_ASM_DIR]
                                   [--num-workers NUM_WORKERS]
extract_obj.py: error: ambiguous option: -a could match -asm_t, -asm  

Look at the parse_args in extract_obj.py, there is no '-a' argument, it seems to be a typo of -asm.
If I copy data to preprocessing and run the command:

  (py3_env) nberf: cp -r data preprocess/data
  (py3_env) nberf: cd preprocess
  (py3_env) nberf/preprocess: python extract_obj.py -asm data/obj` 

now I got

Traceback (most recent call last):
  File "extract_obj.py", line 218, in <module>
    main()
  File "extract_obj.py", line 181, in main
    with open(args.filter_list) as f:
FileNotFoundError: [Errno 2] No such file or directory: './preprocess/filter_list.txt'

My env

Ubuntu 20.04.2 LTS
Python 3.8.5

Any steps I misunderstood or missed? Any help is greatly appreciated.

Dennis

@darkskytechnology
Copy link

darkskytechnology commented Jan 31, 2021

I got the same thing, and typed python extract_obj.py -j ./data/obj -f ./filter_list.txt to get around both of those errors.

@ChengFu0118
Copy link

Hi Dennis,

Sorry for the typo in README. You should preprocess the code by running:
python preprocess/extract_obj.py -asm data/obj

@yuandong-tian
Copy link
Contributor

yuandong-tian commented Feb 25, 2021

ok @smartappcoder, README is updated
Thanks @ChengFu0118 , who is the first author of N-Bref.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants