ejschwartz commited on
Commit
000c947
·
verified ·
1 Parent(s): 3725f6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -9,7 +9,7 @@ model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.bfloa
9
 
10
  @spaces.GPU
11
  def predict(input_asm):
12
-
13
  before = f"# This is the assembly code:\n"#prompt
14
  after = "\n# What is the source code?\n"#prompt
15
  input_prompt = before+input_asm.strip()+after
@@ -21,7 +21,27 @@ def predict(input_asm):
21
  return c_func_decompile
22
 
23
  demo = gr.Interface(fn=predict,
24
- examples=["void ioabs_tcp_pre_select(int *param_1,int *param_2,long param_3) { *param_1 = *param_2; *param_2 = *param_2 + 1; *(int *)((long)*param_1 * 8 + param_3 + 4) = param_1[4]; *(uint *)(param_3 + (long)*param_1 * 8) = *(uint *)(param_3 + (long)*param_1 * 8) | 1; if (((**(int **)(param_1 + 2) + *(int *)(*(long *)(param_1 + 2) + 4)) - *(int *)(*(long *)(param_1 + 2) + 8)) % *(int *)(*(long *)(param_1 + 2) + 4) != 0) { *(uint *)(param_3 + (long)*param_1 * 8) = *(uint *)(param_3 + (long)*param_1 * 8) | 4; } return; }"],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  inputs="text", outputs="text")
26
  demo.queue()
27
  demo.launch()
 
9
 
10
  @spaces.GPU
11
  def predict(input_asm):
12
+ input_asm = '\n'.join(c_func).strip()
13
  before = f"# This is the assembly code:\n"#prompt
14
  after = "\n# What is the source code?\n"#prompt
15
  input_prompt = before+input_asm.strip()+after
 
21
  return c_func_decompile
22
 
23
  demo = gr.Interface(fn=predict,
24
+ examples=["""undefined4 func0(float param_1,long param_2,int param_3)
25
+ {
26
+ int local_28;
27
+ int local_24;
28
+
29
+ local_24 = 0;
30
+ do {
31
+ local_28 = local_24;
32
+ if (param_3 <= local_24) {
33
+ return 0;
34
+ }
35
+ while (local_28 = local_28 + 1, local_28 < param_3) {
36
+ if ((double)((ulong)(double)(*(float *)(param_2 + (long)local_24 * 4) -
37
+ *(float *)(param_2 + (long)local_28 * 4)) &
38
+ SUB168(_DAT_00402010,0)) < (double)param_1) {
39
+ return 1;
40
+ }
41
+ }
42
+ local_24 = local_24 + 1;
43
+ } while( true );
44
+ }"""],
45
  inputs="text", outputs="text")
46
  demo.queue()
47
  demo.launch()