-
Notifications
You must be signed in to change notification settings - Fork 4
/
IDAScriptWriter.cs
54 lines (46 loc) · 1.26 KB
/
IDAScriptWriter.cs
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
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace NativeGenerator
{
/*
IDAScriptWriter class (C) 2016 Mark Ludwig
*/
public class IDAScriptWriter : IDAScriptWriterBase
{
protected override string FileExtension
{
get { return "idc"; }
}
public override void CloseMainBlock()
{
Dedent();
WriteLine("}");
}
public override void OpenMainBlock()
{
WriteLine("static main() {");
Indent();
}
public override void WritePreamble(string header = "")
{
if (!String.IsNullOrEmpty(header))
WriteLine("/*\n\t{0}\n*/\n", header);
WriteLine("#include <ida.idc>\n");
}
public override void WriteComment(string comment)
{
Write("// {0} ", comment);
}
public override void WriteMethodCall(string methodName)
{
Write("{0}(); ", methodName);
}
public override void WriteMethodCall(string methodName, params object[] arguments)
{
Write("{0}({1}); ", methodName, String.Join(", ", arguments));
}
}
}