Skip to content
Snippets Groups Projects
Commit 53de0443 authored by Nguyen Anh Quynh's avatar Nguyen Anh Quynh
Browse files

Merge pull request #155 from practicalswift/invalid-scale

Add crash case triggering "Invalid scale!" assertion failure.
parents fc2eb0af 32c763c2
No related branches found
No related tags found
No related merge requests found
CFLAGS = -Wall
CFLAGS = -Wall -Werror -std=c99 -pedantic
LDLIBS = -l$(LIBNAME)
LIBNAME = keystone
PROGS = $(patsubst %.c, %, $(wildcard crash-??-*.c))
......
#include <keystone/keystone.h>
int main(int argc, char **argv) {
int ks_arch = KS_ARCH_X86, ks_mode = KS_MODE_64;
char *assembly = "{[x*mm0";
ks_engine *ks;
ks_err err = ks_open(ks_arch, ks_mode, &ks);
if (!err) {
size_t count, size;
unsigned char *insn;
if (ks_asm(ks, assembly, 0, &insn, &size, &count))
printf("ERROR: failed on ks_asm() with error = %s, code = %u\n", ks_strerror(ks_errno(ks)), ks_errno(ks));
ks_free(insn);
}
ks_close(ks);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment