-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Generate a const array #62
Comments
There is no good support right now. There are several similar cases. The best thing you can do now is:
If my math is correct, pad size must be 11, not 10. |
I tried with what you suggested. It panics: |
That's due to old programs in your corpus that still use the old signature. Ideally, the argument type mismatch should be detected and these programs automatically deleted. Filed #63 for this. For now delete all program with syscalls that reference this type from corpus with:
|
I want to generate a const array for the following struct in sys/tun.txt, for instance, "wlan0"
ifreq {
name array[int8, 16]
u ifr_ifru
}
I tried with strconst as the following, but it does not work as expected. The expected output should be a const char array filled "wlan0", But it generate a pointer to a buffer that contains the string.
ifreq {
name strconst["wlan0"]
pad array[const[0, int8], 10]
u ifr_ifru
}
The generated output is:
r[1] = syscall(SYS_mmap, 0x20000000ul, 0x1000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul);
(uint64_t)0x20000000 = (uint64_t)0x20000b81;
(uint64_t)0x20000008 = (uint64_t)0x0;
(uint16_t)0x20000010 = (uint16_t)0x0;
(uint64_t)0x20000020 = (uint64_t)0x20000ff0; // the address to ifr_ifru
memcpy((void*)0x20000b81, "\x77\x6c\x61\x6e\x30\x00", 6);
The expected output should be:
r[1] = syscall(SYS_mmap, 0x20000000ul, 0x1000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul);
memcpy((void_)0x20000000, "\x77\x6c\x61\x6e\x30\x00", 6);
*(uint64_t_)0x20000006 = (uint64_t)0x0;
(uint16_t)0x2000000e = (uint16_t)0x0;
(uint64_t)0x20000010 = (uint64_t)0x20000ff0;
Any suggestion? Thanks.
The text was updated successfully, but these errors were encountered: