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

The same name for BasicBlock #147

Open
liushengahn opened this issue Apr 25, 2024 · 0 comments
Open

The same name for BasicBlock #147

liushengahn opened this issue Apr 25, 2024 · 0 comments

Comments

@liushengahn
Copy link

Hello, I've encountered an issue with basic block renaming in the latest version of AFLGo. I noticed the previous issue #116 regarding this matter, and I think the fix applied should have addressed it. However, I'm still experiencing problems with basic block renaming when running it. I would appreciate your assistance. Thank you.

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int foo(char *arr, int t1) {
  int i = 0;

  if (arr[i++] == 'c') return 0;
  if (arr[i++] == 'd') return 1;
  if (arr[i++] == 'c') return 2;
  if (arr[i++] == 'c') return 3;
  if (arr[i++] == 's') return 4;
  if (arr[i++] == 'b') return 5;
  if (arr[i++] == 's') return 6;
  if (arr[i++] == 'g') return 7;

  if (*(int *)arr != 0xdeadbeef) return 0;

  // Can we trigger this code?
  return (int)(20 / t1);
}

int main(int argc, char *argv[]) {
  // open file
  FILE *f = fopen(argv[1], "rb");

  // get file size
  fseek(f, 0, SEEK_END);
  long fsize = ftell(f);

  // read file contents
  fseek(f, 0, SEEK_SET);
  char *string = malloc(fsize + 1);
  fread(string, 1, fsize, f);
  fclose(f);

  // pass string to foo
  int retval = foo(string, argc - 2);

  free(string);
  return retval;
}
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

1 participant