summaryrefslogtreecommitdiff
path: root/config00.py
blob: c3327f2b0a485ea4c6d7c03d1616c0559a0c5c22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48


__SYSTEM__PROMPT__ = None


__FIRST_INSTRUCTIONS__ = '''
Write me a bunch of valid Android smali bytecode. Your goal is to write a demonstration of the Dalvik bytecode features.

Try to use one function per instruction set category. Pick one target from the list below:
- Data handling
- Arithmetic and logic operations
- Control flow operations
- Specific instructions for highest Dex files versions (038 or 039)

Include all the created functions into one class only.

Try to make sure that a lot of different Dalvik mnemonics are used. Mix as much different mnemonics as possible.

Ensure that each instruction is used according its proper format.

Do not write explainations. Do not write comments in generated Dalvik code. Use only plain hexdecimal integers for numbers. Break long high level statements into several Dalvik instructions as much as possible.

For instance, call to System.out.println has to translate to instructions relying on sget-object and invoke-virtual mnemonics.

The result code HAS TO BE able to get assembled using the smali assembler without modification.
'''


__ERROR_PROLOGUE__ = '''
The smali assembler encountered errors with the previously generated code.

Here is the error list with location and bug origin:
'''


__ERROR_EPILOGUE__ = '''
Please fix your code and provide an updated version of smali assembly code!

Focus on name suffixes and operands while solving errors. Check if used instructions actually exist according to the Dalvik bytecode specifications. For instance, there is no mul-int/lit16 mnemonic.

Remember to use only plain hexdecimal integers for numbers. Break long high level statements into several Dalvik instructions as much as possible.

For instance, call to System.out.println has to translate to instructions relying on sget-object and invoke-virtual mnemonics.

Line counter starts at 1.

If you do not know how to fix the generated bytecode, rewrite it completely or remove the relative line. Do not hesitate to remove an entire function if there are too much issues inside it.
'''