Update spp from git and fix integration with rasm2

This commit is contained in:
pancake 2016-12-19 03:05:42 +01:00
parent e7e4c86910
commit 329e093192
34 changed files with 249 additions and 446 deletions

View File

@ -353,10 +353,56 @@ static int __lib_anal_cb(RLibPlugin *pl, void *user, void *data) {
return true;
}
static int __lib_anal_dt(struct r_lib_plugin_t *pl, void *p, void *u) {
static int __lib_anal_dt(RLibPlugin *pl, void *p, void *u) {
return true;
}
static char *replace_directives_for(char *str, char *token) {
RStrBuf *sb = r_strbuf_new ("");
char *q = str;
bool changes = false;
for (;;) {
char *p = strstr (q, token);
if (p) {
char *nl = strchr (p, '\n');
if (nl) {
*nl ++ = 0;
}
char _ = *p;
*p = 0;
r_strbuf_append (sb, q);
*p = _;
r_strbuf_appendf (sb, "<{%s}>\n", p + 1);
q = nl;
changes = true;
} else {
r_strbuf_append (sb, q);
break;
}
}
if (changes) {
free (str);
return r_strbuf_drain (sb);
}
r_strbuf_free (sb);
return str;
}
static char *replace_directives(char *str) {
char *o = replace_directives_for (str, ".include");
o = replace_directives_for (o, ".warning");
o = replace_directives_for (o, ".error");
o = replace_directives_for (o, ".echo");
o = replace_directives_for (o, ".if");
o = replace_directives_for (o, ".ifeq");
o = replace_directives_for (o, ".endif");
o = replace_directives_for (o, ".else");
o = replace_directives_for (o, ".set");
o = replace_directives_for (o, ".get");
// eprintf ("(%s)\n", o);
return o;
}
int main (int argc, char *argv[]) {
const char *path;
const char *env_arch = r_sys_getenv ("RASM2_ARCH");
@ -598,7 +644,7 @@ int main (int argc, char *argv[]) {
out.cout = r_strbuf_new ("");
r_strbuf_init (out.cout);
struct Proc proc;
spp_proc_set (&proc, "asm", 1);
spp_proc_set (&proc, "spp", 1);
if (content) {
if (len && len > 0 && len < length)
@ -616,6 +662,7 @@ int main (int argc, char *argv[]) {
} else if (analinfo) {
ret = show_analinfo ((const char *)buf, offset);
} else {
content = replace_directives (content);
spp_eval (content, &out);
char *spp_out = strdup (r_strbuf_get (out.cout));
ret = rasm_asm (spp_out, offset, length, a->bits, bin);

View File

@ -16,7 +16,9 @@ R_API void r_strbuf_init(RStrBuf *sb) {
R_API bool r_strbuf_set(RStrBuf *sb, const char *s) {
int l;
if (!sb) return false;
if (!sb) {
return false;
}
if (!s) {
r_strbuf_init (sb);
return true;
@ -26,7 +28,9 @@ R_API bool r_strbuf_set(RStrBuf *sb, const char *s) {
char *ptr = sb->ptr;
if (!ptr || l+1 > sb->ptrlen) {
ptr = malloc (l + 1);
if (!ptr) return false;
if (!ptr) {
return false;
}
sb->ptrlen = l + 1;
sb->ptr = ptr;
}

View File

@ -282,10 +282,13 @@ www-sync-t sync-www-t:
sync-www www-sync: www-sync-m www-sync-p www-sync-t
@echo webui sync done
spp-sync:
spp-sync sync-spp:
-git rm -r spp
rm -rf spp
git clone --depth 1 ${SPP_URL} spp
rm -rf spp/.git*
rm -rf spp/t
git add spp
spp: spp-sync
cd spp ; $(MAKE)

3
shlr/spp/.gitignore vendored
View File

@ -1,3 +0,0 @@
out.php
test.php
config.h

View File

@ -1,11 +1,12 @@
override CFLAGS+=-g -Wall -MD
PREFIX?=/usr
BINDIR=${DESTDIR}${PREFIX}/bin
INSTALL_BIN=install -m 0755
OBJ=spp.o main.o p/strbuf.o
OBJ=spp.o main.o r_api.o
ODF=$(subst .o,.d,$(OBJ))
BIN=spp
CFLAGS?=-Wall -O2
all: ${BIN}
config.h:

View File

@ -3,7 +3,6 @@
#include "p/acr.h"
#include "p/pod.h"
#include "p/cpp.h"
#include "p/asm.h"
struct Proc *procs[] = {
&spp_proc,
@ -11,7 +10,6 @@ struct Proc *procs[] = {
&pod_proc,
&acr_proc,
&sh_proc,
&asm_proc,
NULL
};

View File

@ -1,65 +0,0 @@
TAG_CALLBACK(asm_default)
{
do_printf (out, "%s", buf);
return 0;
}
TAG_CALLBACK(asm_include)
{
if (echo[ifl]) {
spp_file(buf, out);
}
return 0;
}
TAG_CALLBACK(asm_arch)
{
do_printf (out, ".arch %s\n", buf);
return 0;
}
TAG_CALLBACK(asm_bits)
{
do_printf (out, ".bits %s\n", buf);
return 0;
}
TAG_CALLBACK(asm_string)
{
do_printf (out, ".string %s\n", buf);
return 0;
}
PUT_CALLBACK(asm_fputs)
{
do_printf (out, "%s", buf);
return 0;
}
struct Tag asm_tags[] = {
{ "include", asm_include },
{ "arch", asm_arch },
{ "bits", asm_bits },
{ "string", asm_string },
{ NULL, asm_default },
{ NULL }
};
struct Arg asm_args[] = {
{ NULL }
};
struct Proc asm_proc = {
.name = "asm",
.tags = (struct Tag **)asm_tags,
.args = (struct Arg **)asm_args,
.token = " ",
.eof = NULL,
.tag_pre = ".",
.tag_post = "\n",
.multiline = "\\\n",
.default_echo = 1,
.fputs = asm_fputs,
.chop = 0,
.tag_begin = 0,
};

View File

@ -11,7 +11,7 @@ TAG_CALLBACK(cpp_error)
do_printf (out,"\n");
if (echo[ifl] && buf != NULL) {
do_printf (out, "ERROR: %s (line=%d)\n", buf, lineno);
return 1;
return -1;
}
return 0;
}
@ -38,24 +38,20 @@ TAG_CALLBACK(cpp_if)
TAG_CALLBACK(cpp_ifdef)
{
char *var = getenv (buf);
if (var) {
echo[ifl + 1] = 1;
} else {
echo[ifl + 1] = 0;
}
echo[ifl + 1] = var? 1: 0;
return 1;
}
TAG_CALLBACK(cpp_else)
{
echo[ifl] = echo[ifl]?0:1;
echo[ifl] = echo[ifl]? 0: 1;
return 0;
}
TAG_CALLBACK(cpp_ifndef)
{
cpp_ifdef(buf, out);
cpp_else(buf, out);
cpp_ifdef (buf, out);
cpp_else (buf, out);
return 1;
}
@ -64,6 +60,7 @@ static struct cpp_macro_t {
char *args;
char *body;
} cpp_macros[10];
static int cpp_macros_n = 0;
static void cpp_macro_add(char *name, char *args, char *body)
@ -71,9 +68,10 @@ static void cpp_macro_add(char *name, char *args, char *body)
char *ptr;
cpp_macros[cpp_macros_n].args = strdup(args);
cpp_macros[cpp_macros_n].body = strdup(body);
ptr = strchr(name, '(');
if (ptr)
ptr[1]='\0';
ptr = strchr (name, '(');
if (ptr) {
ptr[1] = '\0';
}
cpp_macros[cpp_macros_n].name = strdup(name);
cpp_macros_n++;
}
@ -100,8 +98,8 @@ TAG_CALLBACK(cpp_define)
*eq = '\0';
if (macro) {
/*macro[0]='\0'; */
ptr = strchr(macro+1, ')');
if (ptr==NULL) {
ptr = strchr (macro + 1, ')');
if (!ptr) {
fprintf(stderr, "Invalid syntax\n");
return 1;
}

View File

@ -1,52 +1,51 @@
/* Mini MCMS :: renamed to 'spp'? */
static char *spp_var_get(char *var)
{
// fprintf(stderr, "GET(%s)\n", var);
#include <unistd.h>
static char *spp_var_get(char *var) {
return getenv(var);
}
static int spp_var_set(const char *var, const char *val)
{
// fprintf(stderr, "SET(%s)(%s)\n", var, val);
static int spp_var_set(const char *var, const char *val) {
return r_sys_setenv(var, val);
}
/* Should be dynamic buffer */
static char *cmd_to_str(const char *cmd)
{
char *out = (char *)malloc(4096);
static char *cmd_to_str(const char *cmd) {
char *out = (char *)calloc (4096, 0);
int ret = 0, len = 0, outlen = 4096;
FILE *fd = popen(cmd, "r");
while(fd) {
FILE *fd = popen (cmd, "r");
while (fd) {
len += ret;
ret = fread(out+len, 1, 1023, fd);
if (ret<1) {
pclose(fd);
ret = fread (out + len, 1, 1023, fd);
if (ret < 1) {
pclose (fd);
fd = NULL;
}
if (ret+1024>outlen) {
if (ret + 1024 > outlen) {
outlen += 4096;
out = realloc (out, outlen);
}
}
out[len]='\0';
out[len] = '\0';
return out;
}
TAG_CALLBACK(spp_set)
{
char *eq, *val = "";
if (!echo[ifl]) return 0;
for(eq=buf;eq[0];eq++) {
switch(eq[0]) {
if (!echo[ifl]) {
return 0;
}
for (eq=buf; eq[0]; eq++) {
switch (eq[0]) {
case '-':
case '.':
eq[0]='_';
eq[0] = '_';
break;
}
}
eq = strchr(buf, ' ');
eq = strchr (buf, ' ');
if (eq) {
*eq = '\0';
val = eq + 1;
@ -59,8 +58,10 @@ TAG_CALLBACK(spp_set)
TAG_CALLBACK(spp_get)
{
char *var;
if (!echo[ifl]) return 0;
var = spp_var_get(buf);
if (!echo[ifl]) {
return 0;
}
var = spp_var_get (buf);
if (var) {
do_printf (out, "%s", var);
}
@ -70,11 +71,13 @@ TAG_CALLBACK(spp_get)
TAG_CALLBACK(spp_getrandom)
{
int max;
if (!echo[ifl]) return 0;
srandom(getpid()); // TODO: change this to be portable
max = atoi(buf);
if (!echo[ifl]) {
return 0;
}
srandom (getpid()); // TODO: change this to be portable
max = atoi (buf);
max = (int)(rand()%max);
do_printf(out, "%d", max);
do_printf (out, "%d", max);
return 0;
}
@ -134,9 +137,19 @@ TAG_CALLBACK(spp_echo)
TAG_CALLBACK(spp_error)
{
if (!echo[ifl]) return 0;
fprintf(stderr, "ERROR: %s (line=%d)\n", buf, lineno);
exit(1);
if (!echo[ifl]) {
return 0;
}
fprintf (stderr, "ERROR: %s (line=%d)\n", buf, lineno);
return -1;
}
TAG_CALLBACK(spp_warning)
{
if (!echo[ifl]) {
return 0;
}
fprintf (stderr, "WARNING: %s (line=%d)\n", buf, lineno);
return 0;
}
@ -275,9 +288,12 @@ TAG_CALLBACK(spp_endif)
TAG_CALLBACK(spp_default)
{
if (!echo[ifl]) return 0;
if (buf[-1] != ';') /* commented tag */
fprintf (stderr, "WARNING: invalid command(%s) at line %d\n", buf, lineno);
if (!echo[ifl]) {
return 0;
}
if (buf[-1] != ';') { /* commented tag */
fprintf (stderr, "WARNING: invalid command: '%s' at line %d\n", buf, lineno);
}
return 0;
}
@ -359,6 +375,7 @@ struct Tag spp_tags[] = {
{ "endswitch", spp_endswitch },
{ "echo", spp_echo },
{ "error", spp_error },
{ "warning", spp_warning },
{ "trace", spp_trace },
{ "ifin", spp_ifin },
{ "ifnot", spp_ifnot },

View File

@ -1,8 +1,8 @@
/* radare - LGPL - Copyright 2013-2014 - pancake */
#if NO_UTIL
/* radare - LGPL - Copyright 2013-2016 - pancake */
#include "r_strbuf.h"
#if !HAVE_R_UTIL
#include "r_api.h"
RStrBuf *r_strbuf_new(const char *str) {
RStrBuf *s = R_NEW0 (RStrBuf);
@ -86,4 +86,24 @@ void r_strbuf_fini(RStrBuf *sb) {
R_FREE (sb->ptr);
}
#endif // NO_UTIL
/* --------- */
int r_sys_setenv(const char *key, const char *value) {
#if __UNIX__ || __CYGWIN__ && !defined(MINGW32)
if (!key) {
return 0;
}
if (!value) {
unsetenv (key);
return 0;
}
return setenv (key, value, 1);
#elif __WINDOWS__
SetEnvironmentVariable (key, (LPSTR)value);
return 0; // TODO. get ret
#else
#warning r_sys_setenv : unimplemented for this platform
return 0;
#endif
}
#endif // NO_UTIL

View File

@ -1,4 +1,4 @@
#if NO_UTIL
#if !HAVE_R_UTIL
#ifndef R_STRBUF_H
#define R_STRBUF_H
@ -9,6 +9,27 @@
#include <stdlib.h>
#include <stdarg.h>
#if defined(EMSCRIPTEN) || defined(__linux__) || defined(__APPLE__) || defined(__GNU__) || defined(__ANDROID__) || defined(__QNX__)
#define __BSD__ 0
#define __UNIX__ 1
#endif
#if __KFBSD__ || defined(__NetBSD__) || defined(__OpenBSD__)
#define __BSD__ 1
#define __UNIX__ 1
#endif
#if __WIN32__ || __CYGWIN__ || MINGW32
#define __addr_t_defined
#include <windows.h>
#endif
#if __WIN32__ || MINGW32 && !__CYGWIN__
#include <winsock.h>
typedef int socklen_t;
#undef USE_SOCKETS
#define __WINDOWS__ 1
#undef __UNIX__
#undef __BSD__
#endif
typedef struct {
int len;
char *ptr;
@ -29,4 +50,4 @@ void r_strbuf_fini(RStrBuf *sb);
void r_strbuf_init(RStrBuf *sb);
#endif // R_STRBUF_H
#endif // NO_UTIL
#endif // NO_UTIL

View File

@ -1,28 +1,30 @@
/* MIT (C) pancake (at) nopcode (dot) org */
/* MIT (C) pancake (at) nopcode (dot) org - 2009-2016 */
#include "spp.h"
#include "config.h"
char *lbuf = NULL;
int lbuf_s = 1024;
int lbuf_n = 0;
int incmd = 0;
// TODO: avoid globals
static char *lbuf = NULL;
static int lbuf_s = 1024;
static int lbuf_n = 0;
static int incmd = 0;
static int printed = 0;
static char *tag_pre, *tag_post, *token = NULL;
int lineno = 1;
int printed = 0;
char *tag_pre, *tag_post, *token;
int tag_begin, echo[MAXIFL];
int ifl = 0; /* conditional nest level */
void spp_run(char *buf, Output *out) {
int i, ret;
int spp_run(char *buf, Output *out) {
int i, ret = 0;
char *tok;
D fprintf(stderr, "SPP_RUN(%s)\n", buf);
D fprintf (stderr, "SPP_RUN(%s)\n", buf);
if (proc->chop) {
for (; IS_SPACE (*buf); buf++);
for (tok = buf + strlen(buf) - 1; IS_SPACE (*tok); tok--) {
*tok='\0';
*tok = '\0';
}
}
@ -39,39 +41,46 @@ void spp_run(char *buf, Output *out) {
}
for (i = 0; tags[i].callback; i++) {
D fprintf (stderr, "NAME=(%s)\n", tok);
if ((tags[i].name == NULL) || (!strcmp (buf, tags[i].name))) {
if ((!tags[i].name) || (!strcmp (buf, tags[i].name))) {
if (out->fout) {
fflush (out->fout);
}
ret = tags[i].callback (tok, out);
if (ret == -1) {
break;
}
if (ret) {
ifl += ret;
if (ifl < 0 || ifl >= MAXIFL) {
fprintf (stderr, "Nested conditionals parsing error.\n");
return;
break;
}
}
break;
}
}
return ret;
}
/* XXX : Do not dump to temporally files!! */
char *spp_run_str(char *buf) {
static char *spp_run_str(char *buf, int *rv) {
char *b;
Output tmp;
tmp.fout = NULL;
tmp.cout = r_strbuf_new("");
spp_run (buf, &tmp);
tmp.cout = r_strbuf_new ("");
int rc = spp_run (buf, &tmp);
b = strdup (r_strbuf_get (tmp.cout));
r_strbuf_free (tmp.cout);
if (rv) {
*rv = rc;
}
return b;
}
void lbuf_strcat(char *dst, char *src) {
int len = strlen (src);
if ((len + lbuf_n) > lbuf_s)
if (!lbuf || (len + lbuf_n) > lbuf_s) {
lbuf = realloc (lbuf, lbuf_s << 1);
}
memcpy (lbuf + lbuf_n, src, len + 1);
lbuf_n += len;
}
@ -86,33 +95,12 @@ void do_printf(Output *out, char *str, ...) {
vsnprintf (tmp, sizeof (tmp), str, ap);
r_strbuf_append (out->cout, tmp);
}
va_end(ap);
va_end (ap);
}
#if NO_UTIL
int r_sys_setenv(const char *key, const char *value) {
#if __UNIX__ || __CYGWIN__ && !defined(MINGW32)
if (!key) {
return 0;
}
if (!value) {
unsetenv (key);
return 0;
}
return setenv (key, value, 1);
#elif __WINDOWS__
SetEnvironmentVariable (key, (LPSTR)value);
return 0; // TODO. get ret
#else
#warning r_sys_setenv : unimplemented for this platform
return 0;
#endif
}
#endif
void do_fputs(Output *out, char *str) {
int i;
for (i = 0;i <= ifl; i++) {
for (i = 0; i <= ifl; i++) {
if (!echo[i]) {
return;
}
@ -122,8 +110,7 @@ void do_fputs(Output *out, char *str) {
}
if (proc->fputs) {
proc->fputs (out, str);
}
else {
} else {
if (out->fout) {
fprintf (out->fout, "%s", str);
}
@ -138,7 +125,7 @@ void spp_eval(char *buf, Output *out) {
printed = 0;
retry:
/* per word */
if (tag_pre == NULL) {
if (!tag_pre && token) {
do {
ptr = strstr (buf, token);
if (ptr) {
@ -156,7 +143,7 @@ retry:
return;
}
if (tag_post == NULL) {
if (!tag_post) {
/* handle per line here ? */
return;
}
@ -165,16 +152,13 @@ retry:
delta = strlen (tag_post);
/* (pre) tag */
if (!buf) {
return;
}
ptr = strstr (buf, tag_pre);
if (ptr) {
D printf ("==> 0.0 (%s)\n", ptr);
incmd = 1;
if (!tag_begin || (tag_begin && ptr == buf)) {
*ptr = '\0';
ptr = ptr + strlen (tag_pre);;
ptr = ptr + strlen (tag_pre);
do_fputs (out, buf);
D printf ("==> 0 (%s)\n", ptr);
}
@ -185,18 +169,17 @@ retry:
if (!ptr) {
do_fputs (out, buf);
return;
} else {
ptr2 = strstr (ptr, tag_post);
}
ptr2 = strstr (ptr, tag_post);
if (ptr2) {
*ptr2 = '\0';
if (ptrr) {
if (ptrr < ptr2) {
char *p = strdup (ptr2 + 2);
char *s = spp_run_str (ptrr + strlen (tag_pre));
D fprintf(stderr, "strcpy(%s)(%s)\n",ptrr, s);
strcpy(ptrr, s);
free(s);
char *s = spp_run_str (ptrr + strlen (tag_pre), NULL);
D fprintf (stderr, "strcpy(%s)(%s)\n",ptrr, s);
strcpy (ptrr, s);
free (s);
ptr[-2] = tag_pre[0]; // XXX -2 check underflow?
D fprintf(stderr, "strcat(%s)(%s)\n",ptrr, p);
@ -243,7 +226,7 @@ retry:
if (ptr) {
lbuf_strcat (lbuf, ptr);
} else {
if (lbuf == NULL) {
if (!lbuf) {
// XXX should never happen
fprintf (stderr, "syntax error?\n");
return;
@ -251,8 +234,7 @@ retry:
if (buf[0]) {
if (incmd) {
lbuf_strcat (lbuf, buf);
}
else {
} else {
do_fputs (out, buf);
}
} else {
@ -266,16 +248,16 @@ retry:
void spp_io(FILE *in, Output *out) {
char buf[4096];
int lines;
if (lbuf == NULL) {
lbuf = malloc (4096);
if (!lbuf) {
lbuf = calloc (1, 4096);
}
if (lbuf == NULL) {
if (!lbuf) {
fprintf (stderr, "Out of memory.\n");
return;
}
lbuf[0]='\0';
while(!feof(in)) {
buf[0]='\0'; // ???
lbuf[0] = '\0';
while (!feof (in)) {
buf[0] = '\0'; // ???
fgets (buf, 1023, in);
if (feof (in)) break;
lines = 1;
@ -288,11 +270,15 @@ void spp_io(FILE *in, Output *out) {
while (1) {
char *eol = buf + strlen (buf) - strlen (proc->multiline);
if (!strcmp (eol, proc->multiline)) {
D fprintf(stderr, "Multiline detected!\n");
D fprintf (stderr, "Multiline detected!\n");
fgets (eol, 1023, in);
if (feof(in)) break;
if (feof (in)) {
break;
}
lines++;
} else break;
} else {
break;
}
}
}
spp_eval (buf, out);
@ -303,24 +289,26 @@ void spp_io(FILE *in, Output *out) {
int spp_file(const char *file, Output *out) {
FILE *in = fopen (file, "r");
D fprintf(stderr, "SPP-FILE(%s)\n", file);
D fprintf (stderr, "SPP-FILE(%s)\n", file);
if (in) {
spp_io (in, out);
fclose (in);
return 1;
} else fprintf (stderr, "Cannot find '%s'\n", file);
}
fprintf (stderr, "Cannot find '%s'\n", file);
return 0;
}
void spp_proc_list_kw() {
int i;
for (i = 0; tags[i].name; i++)
for (i = 0; tags[i].name; i++) {
printf ("%s\n", tags[i].name);
}
}
void spp_proc_list() {
int i;
for (i=0;procs[i];i++) {
for (i=0; procs[i]; i++) {
printf ("%s\n", procs[i]->name);
}
}
@ -339,15 +327,16 @@ void spp_proc_set(struct Proc *p, char *arg, int fail) {
fprintf (stderr, "Invalid preprocessor name '%s'\n", arg);
return;
}
if (proc == NULL)
if (!proc) {
proc = p;
if (proc != NULL) {
}
if (proc) {
// TODO: wtf!
tag_pre = proc->tag_pre;
tag_post = proc->tag_post;
for (i = 0; i < MAXIFL; i++)
for (i = 0; i < MAXIFL; i++) {
echo[i] = proc->default_echo;
}
token = proc->token;
tag_begin = proc->tag_begin;
args = (struct Arg*)proc->args;

View File

@ -5,11 +5,11 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#if NO_UTIL
#include "p/r_strbuf.h"
int r_sys_setenv(const char *key, const char *value);
#else
#if HAVE_R_UTIL
#include <r_util.h>
#else
#include "r_api.h"
int r_sys_setenv(const char *key, const char *value);
#endif
#ifdef __WINDOWS__
@ -77,7 +77,7 @@ struct Proc {
int spp_file(const char *file, Output *out);
void spp_run(char *buf, Output *out);
int spp_run(char *buf, Output *out);
void spp_eval(char *buf, Output *out);
void spp_io(FILE *in, Output *out);
void do_printf(Output *out, char *str, ...) __attribute__ ((format (printf, 2, 3)));

View File

@ -1 +0,0 @@
mov eax, 0x44

View File

@ -1,5 +0,0 @@
PKGNAME spp
VERSION 0.1
CONTACT pancake ; pancake@nopcode.org
LANG_C

View File

@ -1,2 +0,0 @@
.include t/asminc
add eax, 0x1

View File

@ -1,34 +0,0 @@
This is a hello cpp world
#include t/hello2.cpp
#define visible 1
#if visible
This text is visible
#endif
#if !visible
This text is not visible
#endif
#ifdef SECRET
UG
BUGB B GBUG
UG G BU
BUGBUGBUGBU
BUG BUGBUGBUGBUGBUGBUG
BUGBUGBUGBUGBUGBUGBUGBUG
BUGBUGBUGBUGBUGBUGBUGBUG
BUG BUGBUGBUGBUGBUGBUG
BUGBUGBUGBU
UG G BU
BUGB B GBUG
UG
#endif
#error Oops
this will not be visible

View File

@ -1,10 +0,0 @@
This is a pod file
=head1 Title of the article
this really rocks
OMG this is another line
=cut
fuck :)

View File

@ -1,9 +0,0 @@
hello {{echo world}}
This is a multiline test {{\
\
for a in hello world ; do\
echo $a ;\
done\
\
}}

View File

@ -1,17 +0,0 @@
---
<{ set arch x86-32 }>
hello <{echo world}>
path=<{system echo $PATH}>
arch = <{ get arch }>
<{ ifeq arch x86-32 }>
FOO IS ENABLED
<{ endif }>
<{ pipe perl -ne 's/World/Stupid/g;print;' }>
Hello World
<{ endpipe }>
---
Hello <{echo world <{echo :D}> ==}>-->

View File

@ -1 +0,0 @@
This message is from hello2.cpp

View File

@ -1,3 +0,0 @@
Binary: <{hex 41 42 43}>
<{set line 34}>
GrepLine: <{grepline /etc/services <{get line}>}>

View File

@ -1,7 +0,0 @@
#define FOO 1
#define MAX(x,y) (x>y)?x:y
main()
{
printf("%d\n", MAX(3,10));
}

View File

@ -1,5 +0,0 @@
#define FOO \
Hello \
World
FOO

View File

@ -1,2 +0,0 @@
{{ for a in hello \
world; do echo $a; done }}

View File

@ -1,2 +0,0 @@
#define FOO hello \
world

View File

@ -1,12 +0,0 @@
#define ONE 1
#define TWO 0
#if ONE
HELLO WORLD
#if TWO
BUG: Nested conditionals
#endif
THIS IS NICE
#endif

View File

@ -1,46 +0,0 @@
Hello <{echo world <{echo :D}> ==}>-->
<{set a secret message}>
<{system echo $a}>
<{ifeq a <{get a}>}> /* always true */
<{set var <{get PATH}>}>
Path is <{get var}>
Path is <{get PATH}>
Path is <{system echo $var}>
<{echo Path is <{get PATH}>}>
<{endif}>
<{set yes 1}>
<{set no 0}>
<{if yes}>
1 INNER VISIBLE TEXT
<{if no}>
2 BUG: INVISIBLE TEXT
<{if no}>
BUG fuck
<{if yes}>
BUG TRAP
<{endif}>
BUG fuck
<{endif}>
BUG: no one loves me
<{endif}>
<{if yes}>
HELLO WORLD
<{endif}>
3 INNER VISIBLE TEXT
<{endif}>
VISIBLE TEXT
<{if yes}>
YES DO IT
<{endif}>
<{if no}>
<{if yes}>
BUG: THIS IS A TRAP
<{endif}>
BUG: NO DONT DO IT
<{endif}>

View File

@ -1,22 +0,0 @@
<{set foo 2}>
<{set bar 3}>
<{ifeq foo 3}>
BUG 1
<{ifeq bar 4}>
BUG 2
<{else}>
BUG 3
<{endif}>
BUG 4
<{endif}>
<{ifeq foo 2}>
Fine!
<{ifeq bar 3}>
Perfect
<{else}>
BUG 5
<{endif}>
Cool :D
<{endif}>

View File

@ -1,12 +0,0 @@
<{set foo 2}>
<{set bar 2}>
<{ifeq foo 3}>
BUG 1
<{switch bar}>
<{case 1}>
BUG 2
<{case 3}>
BUG 3
<{endswitch}>
<{endif}>

View File

@ -1 +0,0 @@
<{set var 1}><{ifeq var 1}>its true<{else}>BUG: false conditional check in oneliner ifeq<{endif}>

View File

@ -1,10 +0,0 @@
<{set var <{getrandom 2}>}>
Value: <{get var}>
<{ifeq var 0}>
Zero value
<{endif}>
<{ifeq var 1}>
One value
<{endif}>

View File

@ -1,32 +0,0 @@
#!/usr/bin/spp
Content-Type: text/html
Status: 200 OK
<html>
<head>
<title>radare</title>
</head>
<body>
Hello <{system echo beep }>
<br />
hello <{system echo world}>
<{switch QUERY_STRING}>
<{case foo}>
foo
<{case bar}>
bar
<{endswitch}>
<{ifeq QUERY_STRING foo}>
<a href="?">go back</a> <br />
<{else}>
<a href="?foo">click here</a> <br />
<{endif}>
<br />
<{system export | perl -ne 's/\n/<br>/ ;print'}>
</html>

View File

@ -52,7 +52,12 @@ RebuildCapstone() {
RebuildSdb() {
Rebuild shlr/sdb
Rebuild libr/db
Rebuild libr/util
}
RebuildSpp() {
Rebuild shlr/spp
Rebuild libr/util
}
RebuildBin() {
@ -70,6 +75,7 @@ case "$1" in
bin) RebuildBin ; ;;
gdb) RebuildGdb ; ;;
sdb) RebuildSdb ; ;;
spp) RebuildSpp ; ;;
bin) RebuildBin ; ;;
java) RebuildJava ; ;;
iosdbg) RebuildIOSDebug ; ;;