* Remove -l flag in rarc2
- Replaced by rarc2 -a * Fix build
This commit is contained in:
parent
8f9dbbd0d1
commit
01b56da424
|
@ -711,11 +711,11 @@ static int parsechar(char c) {
|
||||||
static void showhelp() {
|
static void showhelp() {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Usage: r2rc [-alh] [files] > file.S\n"
|
"Usage: r2rc [-alh] [files] > file.S\n"
|
||||||
" -A Show current architecture\n"
|
|
||||||
" -l List all supported architectures\n"
|
|
||||||
" -s use at&t syntax instead of intel\n"
|
" -s use at&t syntax instead of intel\n"
|
||||||
" -m add 'call main prefix\n"
|
" -m add 'call main prefix\n"
|
||||||
" -h Display this help\n"
|
" -h display this help\n"
|
||||||
|
" -A show default architecture\n"
|
||||||
|
" -a list all supported architectures\n"
|
||||||
" -ax86 use x86-32\n"
|
" -ax86 use x86-32\n"
|
||||||
" -ax64 use x86-64\n"
|
" -ax64 use x86-64\n"
|
||||||
" -aarm use ARM\n");
|
" -aarm use ARM\n");
|
||||||
|
@ -725,16 +725,22 @@ static void parseflag(const char *arg) {
|
||||||
int i;
|
int i;
|
||||||
switch (*arg) {
|
switch (*arg) {
|
||||||
case 'a':
|
case 'a':
|
||||||
emit = NULL;
|
if (arg[1]) {
|
||||||
for (i=0; emits[i]; i++)
|
emit = NULL;
|
||||||
if (!strcmp (emits[i]->arch, arg+1)) {
|
for (i=0; emits[i]; i++)
|
||||||
emit = emits[i];
|
if (!strcmp (emits[i]->arch, arg+1)) {
|
||||||
syscallbody = emit->syscall ();
|
emit = emits[i];
|
||||||
break;
|
syscallbody = emit->syscall ();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (emit == NULL) {
|
||||||
|
eprintf ("Invalid architecture: '%s'\n", arg+1);
|
||||||
|
exit (1);
|
||||||
}
|
}
|
||||||
if (emit == NULL) {
|
} else {
|
||||||
eprintf ("Invalid architecture: '%s'\n", arg+1);
|
for (i=0; emits[i]; i++)
|
||||||
exit (1);
|
printf ("%s\n", emits[i]->arch);
|
||||||
|
exit (0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
|
@ -746,10 +752,6 @@ static void parseflag(const char *arg) {
|
||||||
case 'A':
|
case 'A':
|
||||||
printf ("%s\n", emit->arch);
|
printf ("%s\n", emit->arch);
|
||||||
exit (0);
|
exit (0);
|
||||||
case 'l':
|
|
||||||
for (i=0; emits[i]; i++)
|
|
||||||
printf ("%s\n", emits[i]->arch);
|
|
||||||
exit (0);
|
|
||||||
case 'h':
|
case 'h':
|
||||||
showhelp ();
|
showhelp ();
|
||||||
exit (0);
|
exit (0);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
printf@alias(0x804400);
|
||||||
main@global(,32) {
|
main@global(,32) {
|
||||||
printf("Hello World\n");
|
printf("Hello World\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -756,7 +756,7 @@ static void *gdbwrap_writememory(gdbwrap_t *desc, la32 linaddr,
|
||||||
static void *gdbwrap_writememory2(gdbwrap_t *desc, la32 linaddr,
|
static void *gdbwrap_writememory2(gdbwrap_t *desc, la32 linaddr,
|
||||||
void *value, unsigned bytes)
|
void *value, unsigned bytes)
|
||||||
{
|
{
|
||||||
char *rec *packet;
|
char *rec, *packet;
|
||||||
u_char *val = value;
|
u_char *val = value;
|
||||||
u_short i;
|
u_short i;
|
||||||
u_int len;
|
u_int len;
|
||||||
|
@ -764,7 +764,7 @@ static void *gdbwrap_writememory2(gdbwrap_t *desc, la32 linaddr,
|
||||||
packet = malloc (2*bytes+MSG_BUF);
|
packet = malloc (2*bytes+MSG_BUF);
|
||||||
if (packet == NULL) {
|
if (packet == NULL) {
|
||||||
eprintf ("Cannot allocate %d bytes\n", 2*bytes+MSG_BUF);
|
eprintf ("Cannot allocate %d bytes\n", 2*bytes+MSG_BUF);
|
||||||
return;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(packet, MSG_BUF, "%s%x%s%x%s", GDBWRAP_MEMWRITE2,
|
snprintf(packet, MSG_BUF, "%s%x%s%x%s", GDBWRAP_MEMWRITE2,
|
||||||
|
|
Loading…
Reference in New Issue