The Witchcraft Compiler Collection
WCC
 All Data Structures Files Functions Variables Typedefs Macros
wsh_functions.h
Go to the documentation of this file.
1 
2 #ifndef WCC_DEFAULT_FUNCS
3 
4 #define WCC_DEFAULT_FUNCS 1
5 
6 char *default_options[] = {
7 "0x",
8 // Shell commands
9 "help",
10 "quit",
11 "exit",
12 "shell",
13 "exec",
14 "clear",
15 // Core WCC functions
16 "help",
17 "info",
18 "memory",
19 "memory:addr",
20 "memory:hex",
21 "memory:read",
22 "memory:strlen",
23 "memory:tostring",
24 "memory:usage",
25 "memory:write",
26 "man",
27 "bfmap",
28 "bsspolute",
29 "dumptable",
30 "dt",
31 "symbols",
32 "functions",
33 "utrace",
34 "unutrace",
35 "systrace",
36 "rtrace",
37 "unsystrace",
38 "unrtrace",
39 "sstrace",
40 "unsstrace",
41 "btrace",
42 "unbtrace",
43 "vtrace",
44 "unvtrace",
45 "objects",
46 "hex",
47 "hexdump",
48 "hex_dump",
49 "verbose",
50 "hollywood",
51 "loadbin",
52 "libs",
53 "libcall",
54 "breakpoint",
55 "bp",
56 "headers",
57 "search",
58 "searchobj",
59 "map",
60 "phdrs",
61 "shdrs",
62 "entrypoints",
63 "rescan",
64 "prototypes",
65 "procmap",
66 "testlib",
67 "testfunc",
68 "grep",
69 "grepptr",
70 "enableaslr",
71 "disableaslr",
72 "balloc",
73 "bset",
74 "bget",
75 "rdstr",
76 "memcpy",
77 "ralloc",
78 "strcpy",
79 "strcat",
80 "xalloc",
81 "xfree",
82 "script",
83 "enablecore",
84 "disablecore",
85 "gencore"
86 };
87 
88 // All lua 5.3 Functions and global variables
90 "_G",
91 "_VERSION",
92 "assert",
93 "collectgarbage",
94 "dofile",
95 "error",
96 "getmetatable",
97 "ipairs",
98 "load",
99 "loadfile",
100 "next",
101 "pairs",
102 "pcall",
103 "print",
104 "rawequal",
105 "rawget",
106 "rawlen",
107 "rawset",
108 "require",
109 "select",
110 "setmetatable",
111 "tonumber",
112 "tostring",
113 "type",
114 "xpcall",
115 "coroutine",
116 "coroutine.create",
117 "coroutine.isyieldable",
118 "coroutine.resume",
119 "coroutine.running",
120 "coroutine.status",
121 "coroutine.wrap",
122 "coroutine.yield",
123 "debug",
124 "debug.debug",
125 "debug.gethook",
126 "debug.getinfo",
127 "debug.getlocal",
128 "debug.getmetatable",
129 "debug.getregistry",
130 "debug.getupvalue",
131 "debug.getuservalue",
132 "debug.sethook",
133 "debug.setlocal",
134 "debug.setmetatable",
135 "debug.setupvalue",
136 "debug.setuservalue",
137 "debug.traceback",
138 "debug.upvalueid",
139 "debug.upvaluejoin",
140 "io",
141 "io.close",
142 "io.flush",
143 "io.input",
144 "io.lines",
145 "io.open",
146 "io.output",
147 "io.popen",
148 "io.read",
149 "io.stderr",
150 "io.stdin",
151 "io.stdout",
152 "io.tmpfile",
153 "io.type",
154 "io.write",
155 "file:close",
156 "file:flush",
157 "file:lines",
158 "file:read",
159 "file:seek",
160 "file:setvbuf",
161 "file:write",
162 "math",
163 "math.abs",
164 "math.acos",
165 "math.asin",
166 "math.atan",
167 "math.ceil",
168 "math.cos",
169 "math.deg",
170 "math.exp",
171 "math.floor",
172 "math.fmod",
173 "math.huge",
174 "math.log",
175 "math.max",
176 "math.maxinteger",
177 "math.min",
178 "math.mininteger",
179 "math.modf",
180 "math.pi",
181 "math.rad",
182 "math.random",
183 "math.randomseed",
184 "math.sin",
185 "math.sqrt",
186 "math.tan",
187 "math.tointeger",
188 "math.type",
189 "math.ult",
190 "os",
191 "os.clock",
192 "os.date",
193 "os.difftime",
194 "os.execute",
195 "os.exit",
196 "os.getenv",
197 "os.remove",
198 "os.rename",
199 "os.setlocale",
200 "os.time",
201 "os.tmpname",
202 "package",
203 "package.config",
204 "package.cpath",
205 "package.loaded",
206 "package.loadlib",
207 "package.path",
208 "package.preload",
209 "package.searchers",
210 "package.searchpath",
211 "string",
212 "string.byte",
213 "string.char",
214 "string.dump",
215 "string.find",
216 "string.format",
217 "string.gmatch",
218 "string.gsub",
219 "string.len",
220 "string.lower",
221 "string.match",
222 "string.pack",
223 "string.packsize",
224 "string.rep",
225 "string.reverse",
226 "string.sub",
227 "string.unpack",
228 "string.upper",
229 "table",
230 "table.concat",
231 "table.insert",
232 "table.move",
233 "table.pack",
234 "table.remove",
235 "table.sort",
236 "table.unpack",
237 "utf8",
238 "utf8.char",
239 "utf8.charpattern",
240 "utf8.codepoint",
241 "utf8.codes",
242 "utf8.len",
243 "utf8.offset",
244 "LUA_CPATH",
245 "LUA_CPATH_5_3",
246 "LUA_INIT",
247 "LUA_INIT_5_3",
248 "LUA_PATH",
249 "LUA_PATH_5_3"
250 };
251 
252 // Function names blacklisted in lua
253 char *lua_blacklist[] = {
254 "and",
255 "break",
256 "do",
257 "else",
258 "elseif",
259 "end",
260 "false",
261 "for",
262 "function",
263 "if",
264 "in",
265 "local",
266 "nil",
267 "not",
268 "or",
269 "repeat",
270 "return",
271 "then",
272 "true",
273 "until",
274 "while"
275 };
276 
278 {libcall, "libcall"},
279 {map, "map"},
280 {ltrace,"ltrace"},
281 {procmap_lua,"procmap"},
282 {rescan,"rescan"},
283 {grep,"grep"},
284 {grepptr,"grepptr"},
285 {hexdump,"lhexdump"},
286 {bfmap,"bfmap"},
287 {phdrs,"phdrs"},
288 {shdrs,"shdrs"},
289 {entrypoints, "entrypoints"},
290 {alloccharbuf,"balloc"},
291 {setcharbuf,"bset"},
292 {getcharbuf,"bget"},
293 {execlib,"lexeclib"},
294 {help,"help"},
295 {headers,"headers"},
296 {info,"info"},
297 {man,"man"},
298 {disable_aslr,"disableaslr"},
299 {enable_aslr,"enableaslr"},
300 {breakpoint,"breakpoint"},
301 {breakpoint,"bp"},
302 {verbose,"verbose"},
303 {hollywood,"hollywood"},
304 {print_symbols,"symbols"},
305 {print_functions,"functions"},
306 {print_objects,"objects"},
307 {print_libs,"libs"},
308 {loadbin,"loadbin"},
309 {ralloc,"ralloc"},
310 {xalloc,"xalloc"},
311 {xfree,"xfree"},
312 {prototypes,"prototypes"},
313 {traceunaligned,"utrace"},
314 {untraceunaligned,"unutrace"},
315 {singlestep,"sstrace"},
316 {systrace,"systrace"},
317 {rtrace,"rtrace"},
318 {unsystrace,"unsystrace"},
319 {unrtrace,"unrtrace"},
320 {unsinglestep,"unsstrace"},
321 {singlebranch,"btrace"},
322 {unsinglebranch,"unbtrace"},
323 {verbosetrace,"vtrace"},
324 {unverbosetrace,"unvtrace"},
325 {bsspolute,"bsspolute"},
326 {priv_memcpy,"memcpy"},
327 {priv_strcpy,"strcpy"},
328 {priv_strcat,"strcat"},
329 {rdstr,"rdstr"},
330 {rdnum,"rdnum"},
331 {script,"lscript"},
332 {enable_core,"enablecore"},
333 {disable_core,"disablecore"},
334 {rawmemread, "rawmemread"},
335 {rawmemwrite, "rawmemwrite"},
336 {rawmemstr, "rawmemstr"},
337 {rawmemusage, "rawmemusage"},
338 {rawmemaddr, "rawmemaddr"},
339 {rawmemstrlen, "rawmemstrlen"},
340 {gencore,"gencore"}
341 };
342 
344  {0x00000000, 0x100000000},
345 #ifdef __amd64__
346  {0x7f0000000000, 0x800000000000},
347  {0xffffffffff600000, 0xffffffffff610000},
348  {0x000000000000, 0x000000000000}
349 #endif
350 };
351 
352 unsigned int global_xalloc = 0;
353 
354 #endif /* WCC_DEFAULT_FUNCS */
355 
void hexdump(unsigned char *data, size_t size)
Definition: wcc.c:2346
int print_libs(lua_State *L)
Definition: wsh.c:1308
int rawmemstr(lua_State *L)
Definition: wsh.c:4797
void verbosetrace(lua_State *L)
Definition: wsh.c:3937
int gencore(lua_State *L)
Definition: wsh.c:4340
int shdrs(lua_State *L)
Definition: wsh.c:1459
void traceunaligned(lua_State *L)
Definition: wsh.c:3891
int ralloc(lua_State *L)
Definition: wsh.c:3755
int breakpoint(lua_State *L)
Definition: wsh.c:4218
int headers(lua_State *L)
Definition: wsh.c:931
int rawmemaddr(lua_State *L)
Definition: wsh.c:4833
int map(lua_State *L)
Definition: wsh.c:3658
int libcall(lua_State *L)
Definition: wsh.c:2087
void systrace(lua_State *L)
Definition: wsh.c:3916
int print_functions(lua_State *L)
Definition: wsh.c:1176
range_t ranges[]
unsigned int global_xalloc
int getcharbuf(lua_State *L)
Definition: wsh.c:1657
unsigned int ltrace(void)
Definition: wsh.c:328
char * default_options[]
Definition: wsh_functions.h:6
void singlestep(lua_State *L)
Definition: wsh.c:3903
void script(char *path)
Definition: wsh.c:166
void unsystrace(lua_State *L)
Definition: wsh.c:3926
int bfmap(lua_State *L)
Definition: wsh.c:100
int man(lua_State *L)
Definition: wsh.c:1478
int info(lua_State *L)
Definition: wsh.c:1495
int setcharbuf(lua_State *L)
Definition: wsh.c:1603
int phdrs(lua_State *L)
Definition: wsh.c:859
int disable_core(lua_State *L)
Definition: wsh.c:4351
int rawmemstrlen(lua_State *L)
Definition: wsh.c:4845
void untraceunaligned(lua_State *L)
Definition: wsh.c:3897
Definition: wsh.h:433
void xfree(lua_State *L)
Definition: wsh.c:3868
int hollywood(lua_State *L)
Definition: wsh.c:3632
int rawmemwrite(lua_State *L)
Definition: wsh.c:4778
int enable_aslr(void)
Definition: wsh.c:473
void rescan(void)
Definition: wsh.c:2752
int grepptr(lua_State *L)
Definition: wsh.c:3979
int bsspolute(lua_State *L)
Definition: wsh.c:3712
int priv_strcat(lua_State *L)
Definition: wsh.c:4197
int grep(lua_State *L)
Definition: wsh.c:4069
int priv_memcpy(lua_State *L)
Definition: wsh.c:4154
int print_symbols(lua_State *L)
Definition: wsh.c:1108
int rdnum(lua_State *L)
Definition: wsh.c:1642
void unrtrace(lua_State *L)
Definition: wsh.c:3931
char * lua_blacklist[]
void unverbosetrace(lua_State *L)
Definition: wsh.c:3941
int help(lua_State *L)
Definition: wsh.c:574
char * lua_default_functions[]
Definition: wsh_functions.h:89
int verbose(lua_State *L)
Definition: wsh.c:3618
int loadbin(lua_State *L)
Definition: wsh.c:4054
int disable_aslr(void)
Definition: wsh.c:455
void unsinglebranch(lua_State *L)
Definition: wsh.c:3967
int rawmemread(lua_State *L)
Definition: wsh.c:4759
int procmap_lua(void)
Definition: wsh.c:2787
int xalloc(lua_State *L)
Definition: wsh.c:3807
int rawmemusage(lua_State *L)
Definition: wsh.c:4811
int prototypes(lua_State *L)
Definition: wsh.c:1885
void rtrace(lua_State *L)
Definition: wsh.c:3921
int enable_core(lua_State *L)
Definition: wsh.c:4359
void singlebranch(lua_State *L)
Definition: wsh.c:3945
int entrypoints(lua_State *L)
Definition: wsh.c:1469
void unsinglestep(lua_State *L)
Definition: wsh.c:3909
int alloccharbuf(lua_State *L)
Definition: wsh.c:1590
tuple_t exposed[]
int priv_strcpy(lua_State *L)
Definition: wsh.c:4176
Definition: wsh.h:610
int rdstr(lua_State *L)
Definition: wsh.c:1621
int execlib(lua_State *L)
Definition: wsh.c:2792
int print_objects(lua_State *L)
Definition: wsh.c:1255