Add more examples

This commit is contained in:
pancake 2023-11-07 21:20:06 +01:00
parent 5247617a26
commit cb27a1f73a
5 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,3 @@
all:
r2 -e cfg.fortunes=false -q -i train.r2 /bin/ls > ops.kv
cat test.txt | r2pm -r r2ai

View File

@ -0,0 +1,3 @@
-m Undi95/Utopia-13B-GGUF
-i ops.kv read this as bytes=disassembly for an arm64 program, and tell me how can i encode a nop
decode every bit of the mov instruction

View File

@ -0,0 +1,4 @@
e asm.offset=0
e asm.flags=0
e asm.sub.names=0
pId $SS| sort -u | awk '{$1=$1;print}' | sed -e 's, ,=,'

16
examples/srcdoc.r2.js Normal file
View File

@ -0,0 +1,16 @@
(function() {
const dir = r2.cmd("%SRCDIR").trim();
if (dir === "") {
console.error("Environment %SRCDIR not defined");
return;
}
const ai = new R2AI()
ai.setRole("You are developer writing documentation for Frida scripts to be read by users. Your explanation shouldn't be longer than one paragraphs");
// console.log(ai.query("Hello World"))
const files = r2.callj("ls -j " + dir);
const listing = files.map ((x) => x.name).filter((x) => x.endsWith('.ts')).map((x) => dir + '/' + x);
for (let fileName of listing) {
const desc = ai.queryFile(fileName, "explain in few words what's this probe doing").split(/\n/)[0];
console.log(fileName + ":\n " + desc);
}
})();

3
examples/translator.txt Normal file
View File

@ -0,0 +1,3 @@
-m Undi95/Utopia-13B-GGUF
-r act as a translator tool that takes my sentences in english and you translate it to japanese phoneme transcription instead of kanjis. this is not a conversation. you should also tell me how can i pronunce it using english phonemes
good morning