Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d44940cc
Commit
d44940cc
authored
Sep 13, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added bytecode decompiler implementation.
parent
d028453f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
1 deletion
+42
-1
compile.c
dlls/vbscript/compile.c
+42
-1
No files found.
dlls/vbscript/compile.c
View file @
d44940cc
...
...
@@ -25,6 +25,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
vbscript
);
WINE_DECLARE_DEBUG_CHANNEL
(
vbscript_disas
);
typedef
struct
{
parser_ctx_t
parser
;
...
...
@@ -45,14 +46,51 @@ static HRESULT compile_expression(compile_ctx_t*,expression_t*);
static
HRESULT
compile_statement
(
compile_ctx_t
*
,
statement_t
*
);
static
const
struct
{
const
char
*
op_str
;
instr_arg_type_t
arg1_type
;
instr_arg_type_t
arg2_type
;
}
instr_info
[]
=
{
#define X(n,a,b,c) {b,c},
#define X(n,a,b,c) {
#n,
b,c},
OP_LIST
#undef X
};
static
void
dump_instr_arg
(
instr_arg_type_t
type
,
instr_arg_t
*
arg
)
{
switch
(
type
)
{
case
ARG_STR
:
case
ARG_BSTR
:
TRACE_
(
vbscript_disas
)(
"
\t
%s"
,
debugstr_w
(
arg
->
str
));
break
;
case
ARG_INT
:
TRACE_
(
vbscript_disas
)(
"
\t
%d"
,
arg
->
uint
);
break
;
case
ARG_UINT
:
case
ARG_ADDR
:
TRACE_
(
vbscript_disas
)(
"
\t
%u"
,
arg
->
uint
);
break
;
case
ARG_DOUBLE
:
TRACE_
(
vbscript_disas
)(
"
\t
%lf"
,
*
arg
->
dbl
);
break
;
case
ARG_NONE
:
break
;
default:
assert
(
0
);
}
}
static
void
dump_code
(
compile_ctx_t
*
ctx
)
{
instr_t
*
instr
;
for
(
instr
=
ctx
->
code
->
instrs
;
instr
<
ctx
->
code
->
instrs
+
ctx
->
instr_cnt
;
instr
++
)
{
TRACE_
(
vbscript_disas
)(
"%d:
\t
%s"
,
instr
-
ctx
->
code
->
instrs
,
instr_info
[
instr
->
op
].
op_str
);
dump_instr_arg
(
instr_info
[
instr
->
op
].
arg1_type
,
&
instr
->
arg1
);
dump_instr_arg
(
instr_info
[
instr
->
op
].
arg2_type
,
&
instr
->
arg2
);
TRACE_
(
vbscript_disas
)(
"
\n
"
);
}
}
static
inline
void
*
compiler_alloc
(
vbscode_t
*
vbscode
,
size_t
size
)
{
return
vbsheap_alloc
(
&
vbscode
->
heap
,
size
);
...
...
@@ -670,6 +708,9 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, vbscode_t **ret)
parser_release
(
&
ctx
.
parser
);
if
(
TRACE_ON
(
vbscript_disas
))
dump_code
(
&
ctx
);
list_add_tail
(
&
script
->
code_list
,
&
ctx
.
code
->
entry
);
*
ret
=
ctx
.
code
;
return
S_OK
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment