Move the brainfuck arch platform description into a script ##arch

This commit is contained in:
pancake 2023-09-12 17:50:22 +02:00 committed by pancake
parent 0c7f4e8d32
commit 5f95be9988
5 changed files with 35 additions and 1050 deletions

View File

@ -1,4 +1,4 @@
FILES=nes
FILES=nes bf
OPDIR=${DESTDIR}/$(DATADIR)/radare2/${VERSION}/platform
include ../../../config-user.mk

5
libr/arch/d/bf-fini.r2 Normal file
View File

@ -0,0 +1,5 @@
o-fd.stack; f-fd.stack
o-fd.screen; f-fd.screen
o-fd.input; f-fd.input
o-fd.data; f-fd.data
e cmd.vprompt=

25
libr/arch/d/bf-init.r2 Normal file
View File

@ -0,0 +1,25 @@
o malloc://128 0x3000
f input 128 0x3000
f fd.input=`oqq`
o malloc://80*25 0x4000
f fd.screen=`oqq`
f screen 80*25 0x4000
o malloc://0x200 0x5000
f fd.stack=`oqq`
f stack 0x200 0x5000
o malloc://0x1000 0x6000
f fd.data=`oqq`
f data 0x1000 0x6000
ar
ar brk=stack
ar scr=screen
ar kbd=input
ar ptr=data
"e cmd.vprompt=pxa 32@stack;pxa 32@screen;pxa 32@data"
s 0
e asm.bits=32
e cmd.vprompt=pxa 32@stack;pxa 32@screen;pxa 32@data

File diff suppressed because it is too large Load Diff

View File

@ -34,25 +34,6 @@ static RBinInfo *info(RBinFile *bf) {
ret->bits = 32; // 16?
ret->big_endian = 0;
ret->dbg_info = 0;
/* TODO: move this somewhere else */
eprintf ("f input 128 0x3000\n");
eprintf ("o malloc://128 0x3000\n");
eprintf ("f screen 80*25 0x4000\n");
eprintf ("o malloc://80*25 0x4000\n");
eprintf ("f stack 0x200 0x5000\n");
eprintf ("o malloc://0x200 0x5000\n");
eprintf ("f data 0x1000 0x6000\n");
eprintf ("o malloc://0x1000 0x6000\n");
eprintf ("ar\n"); // hack to init
eprintf ("ar brk=stack\n");
eprintf ("ar scr=screen\n");
eprintf ("ar kbd=input\n");
eprintf ("ar ptr=data\n");
eprintf ("\"e cmd.vprompt=pxa 32@stack;pxa 32@screen;pxa 32@data\"\n");
eprintf ("s 0\n");
eprintf ("e asm.bits=32\n");
eprintf ("e cmd.vprompt=pxa 32@stack;pxa 32@screen;pxa 32@data\n");
// eprintf ("dL bf\n");
return ret;
}