Displaying 16 results from an estimated 16 matches for "swfdecconstantpool".
2007 Mar 13
0
2 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h
...ngs verbatim instead of printing "Pool x"
diff --git a/libswfdec/swfdec_debugger.c b/libswfdec/swfdec_debugger.c
index 7f3546d..c17c315 100644
--- a/libswfdec/swfdec_debugger.c
+++ b/libswfdec/swfdec_debugger.c
@@ -32,32 +32,138 @@
/*** SwfdecDebuggerScript ***/
+typedef struct {
+ SwfdecConstantPool * constant_pool; /* current constant pool */
+ GArray * commands; /* SwfdecDebuggerCommands parsed so far */
+} ScriptParser;
+
+static char *
+swfdec_debugger_print_push (ScriptParser *parser, const guint8 *data, guint len)
+{
+ gboolean first = TRUE;
+ SwfdecBits bits;
+ GString *string = g_...
2007 Apr 04
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h
...ecAsContext *cx, jsval val)
{
if (JSVAL_IS_BOOLEAN (val)) {
@@ -407,123 +398,121 @@ swfdec_action_wait_for_frame (SwfdecAsCo
swfdec_script_skip_actions (cx, jump);
}
-#if 0
static void
swfdec_action_constant_pool (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
SwfdecConstantPool *pool;
+ SwfdecAsFrame *frame;
+ frame = cx->frame;
pool = swfdec_constant_pool_new_from_action (data, len);
if (pool == NULL)
- return JS_FALSE;
- if (cx->fp->constant_pool)
- swfdec_constant_pool_free (cx->fp->constant_pool);
- cx->fp->constant_pool = pool;...
2007 Jan 18
0
Branch 'interpreter' - 4 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_tag.c
...@
#include "js/jscntxt.h"
#include "js/jsinterp.h"
-/*** SUPPORT FUNCTIONS ***/
-
+#include <string.h>
#include "swfdec_decoder.h"
#include "swfdec_movie.h"
#include "swfdec_root_movie.h"
+/*** CONSTANT POOLS ***/
+
+typedef GPtrArray SwfdecConstantPool;
+
+static SwfdecConstantPool *
+swfdec_constant_pool_new_from_action (const guint8 *data, guint len)
+{
+ guint8 *next;
+ guint i, n;
+ GPtrArray *pool;
+
+ if (len < 2) {
+ SWFDEC_ERROR ("constant pool too small");
+ return NULL;
+ }
+ n = GUINT16_FROM_LE (*((guint16*) da...
2007 Jun 06
0
Branch 'as' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...t_push (guint action,
g_string_append_c (string, '"');
g_string_append (string, s);
g_string_append_c (string, '"');
+ g_free (s);
break;
}
case 1: /* float */
@@ -2173,7 +2175,8 @@ swfdec_action_print_constant_pool (guint
GString *string;
SwfdecConstantPool *pool;
- pool = swfdec_constant_pool_new_from_action (data, len);
+ /* FIXME: version */
+ pool = swfdec_constant_pool_new_from_action (data, len, 6);
if (pool == NULL)
return g_strdup ("ConstantPool (invalid)");
string = g_string_new ("ConstantPool");
diff --git...
2007 Aug 09
0
Branch 'vivi' - 12 commits - libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec/Makefile.am libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_debugger.c
...swfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_bits.h>
+#include <libswfdec/swfdec_buffer.h>
G_BEGIN_DECLS
-//typedef struct _SwfdecScript SwfdecScript;
-typedef struct _SwfdecScriptArgument SwfdecScriptArgument;
-typedef struct _SwfdecConstantPool SwfdecConstantPool;
-
-typedef enum {
- SWFDEC_SCRIPT_PRELOAD_THIS = (1 << 0),
- SWFDEC_SCRIPT_SUPPRESS_THIS = (1 << 1),
- SWFDEC_SCRIPT_PRELOAD_ARGS = (1 << 2),
- SWFDEC_SCRIPT_SUPPRESS_ARGS = (1 << 3),
- SWFDEC_SCRIPT_PRELOAD_SUPER = (1 << 4),
- SWFDEC_SCRIPT_S...
2007 Mar 28
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...d?) */
+ SwfdecScript * script; /* script being executed */
+ SwfdecAsObject * scope; /* scope object coming after this */
+ SwfdecAsObject * var_object; /* new variables go here */
+ SwfdecAsValue * registers; /* the registers */
+ guint n_registers; /* number of allocated registers */
+ SwfdecConstantPool * constant_pool; /* constant pool currently in use */
+ //SwfdecAsStack * stack; /* variables on the stack */
+};
+
+struct _SwfdecAsFrameClass {
+ SwfdecAsObjectClass object_class;
+};
+
+GType swfdec_as_frame_get_type (void);
+
+SwfdecAsFrame * swfdec_as_frame_new (SwfdecAsContext * cont...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...d;
+ g_assert (loaded <= movie->n_frames);
+ } else {
+ loaded = movie->n_frames;
+ }
+ if (loaded < frame)
+ swfdec_script_skip_actions (cx, jump);
+}
+
+#if 0
+static void
+swfdec_action_constant_pool (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
+{
+ SwfdecConstantPool *pool;
+
+ pool = swfdec_constant_pool_new_from_action (data, len);
+ if (pool == NULL)
+ return JS_FALSE;
+ if (cx->fp->constant_pool)
+ swfdec_constant_pool_free (cx->fp->constant_pool);
+ cx->fp->constant_pool = pool;
+ return JS_TRUE;
+}
+
+static void
+swfdec_actio...
2007 Jul 13
0
3 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
...e chain or for SetVariable */
- SwfdecAsObject * original_target;/* original target (used when resetting target) */
- gboolean is_local; /* TRUE if this frame takes local variables */
- SwfdecAsValue * registers; /* the registers */
- guint n_registers; /* number of allocated registers */
- SwfdecConstantPool * constant_pool; /* constant pool currently in use */
- SwfdecBuffer * constant_pool_buffer; /* buffer containing the raw data for constant_pool */
- SwfdecAsValue * stack_begin; /* beginning of stack */
- guint8 * pc; /* program counter on stack */
- /* native function */
-};
-
-struct _Swfd...
2007 Mar 20
0
9 commits - configure.ac libswfdec/swfdec_bits.c libswfdec/swfdec_debug.c libswfdec/swfdec_js.c libswfdec/swfdec_script.c libswfdec/swfdec_sound.c
...e "js/jsscope.h"
+/* Define this to get SWFDEC_WARN'd about missing properties of objects.
+ * This can be useful to find out about unimplemented native properties,
+ * but usually just causes a lot of spam. */
+//#define SWFDEC_WARN_MISSING_PROPERTIES
+
/*** CONSTANT POOLS ***/
SwfdecConstantPool *
@@ -655,6 +660,11 @@ swfdec_action_get_variable (JSContext *c
if (s == NULL)
return JS_FALSE;
cx->fp->sp[-1] = swfdec_js_eval (cx, NULL, s);
+#ifdef SWFDEC_WARN_MISSING_PROPERTIES
+ if (cx->fp->sp[-1] == JSVAL_VOID) {
+ SWFDEC_WARNING ("no variable named %s",...
2007 Nov 22
0
5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
...ot;');
diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 2dd36be..ec73386 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -64,7 +64,7 @@ swfdec_constant_pool_new_from_action (const guint8 *data, guint len, guint versi
pool = g_malloc0 (sizeof (SwfdecConstantPool) + (n - 1) * sizeof (char *));
pool->n_strings = n;
for (i = 0; i < n; i++) {
- pool->strings[i] = swfdec_bits_get_string_with_version (&bits, version);
+ pool->strings[i] = swfdec_bits_get_string (&bits, version);
if (pool->strings[i] == NULL) {
SWFDE...
2007 Feb 01
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/swfdec_script.c libswfdec/swfdec_script.h player/swfdec_debug_stack.c test/trace
...x 46ba618..85e6f7c 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -97,6 +97,26 @@ swfdec_constant_pool_free (SwfdecConstan
g_ptr_array_free (pool, TRUE);
}
+/* FIXME: this is a bit hacky */
+static SwfdecBuffer *
+swfdec_constant_pool_get_area (SwfdecScript *script, SwfdecConstantPool *pool)
+{
+ guint8 *start;
+ SwfdecBuffer *buffer;
+ guint len;
+
+ if (pool->len == 0)
+ return NULL;
+ start = (guint8 *) g_ptr_array_index (pool, 0) - 5;
+ buffer = script->buffer;
+ g_assert (start >= buffer->data);
+ g_assert (start + 3 < buffer->data + buffer->...
2007 Aug 22
0
163 commits - autogen.sh configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec-gtk/swfdec_source.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c
...swfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_bits.h>
+#include <libswfdec/swfdec_buffer.h>
G_BEGIN_DECLS
-//typedef struct _SwfdecScript SwfdecScript;
-typedef struct _SwfdecScriptArgument SwfdecScriptArgument;
-typedef struct _SwfdecConstantPool SwfdecConstantPool;
-
-typedef enum {
- SWFDEC_SCRIPT_PRELOAD_THIS = (1 << 0),
- SWFDEC_SCRIPT_SUPPRESS_THIS = (1 << 1),
- SWFDEC_SCRIPT_PRELOAD_ARGS = (1 << 2),
- SWFDEC_SCRIPT_SUPPRESS_ARGS = (1 << 3),
- SWFDEC_SCRIPT_PRELOAD_SUPER = (1 << 4),
- SWFDEC_SCRIPT_S...
2007 Mar 29
0
Branch 'as' - 9 commits - configure.ac doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_stack.c
...wfdec_as_frame.h b/libswfdec/swfdec_as_frame.h
index f55cc8f..10825de 100644
--- a/libswfdec/swfdec_as_frame.h
+++ b/libswfdec/swfdec_as_frame.h
@@ -45,7 +45,8 @@ struct _SwfdecAsFrame {
SwfdecAsValue * registers; /* the registers */
guint n_registers; /* number of allocated registers */
SwfdecConstantPool * constant_pool; /* constant pool currently in use */
- //SwfdecAsStack * stack; /* variables on the stack */
+ SwfdecAsStack * stack; /* variables on the stack */
+ guint8 * pc; /* program counter on stack */
};
struct _SwfdecAsFrameClass {
diff --git a/libswfdec/swfdec_as_stack.c b/lib...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...x 46ba618..85e6f7c 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -97,6 +97,26 @@ swfdec_constant_pool_free (SwfdecConstan
g_ptr_array_free (pool, TRUE);
}
+/* FIXME: this is a bit hacky */
+static SwfdecBuffer *
+swfdec_constant_pool_get_area (SwfdecScript *script, SwfdecConstantPool *pool)
+{
+ guint8 *start;
+ SwfdecBuffer *buffer;
+ guint len;
+
+ if (pool->len == 0)
+ return NULL;
+ start = (guint8 *) g_ptr_array_index (pool, 0) - 5;
+ buffer = script->buffer;
+ g_assert (start >= buffer->data);
+ g_assert (start + 3 < buffer->data + buffer->...
2007 Jun 27
0
Branch 'as' - 16 commits - configure.ac libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_script_function.c
...e chain or for SetVariable */
+ SwfdecAsObject * original_target;/* original target (used when resetting target) */
+ gboolean is_local; /* TRUE if this frame takes local variables */
SwfdecAsValue * registers; /* the registers */
guint n_registers; /* number of allocated registers */
SwfdecConstantPool * constant_pool; /* constant pool currently in use */
diff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c
index 1f3bc2f..aee6b90 100644
--- a/libswfdec/swfdec_as_function.c
+++ b/libswfdec/swfdec_as_function.c
@@ -89,7 +89,7 @@ swfdec_as_function_call (SwfdecAsFunctio...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
...bjects.
* This can be useful to find out about unimplemented native properties,
@@ -116,6 +112,7 @@ swfdec_constant_pool_free (SwfdecConstan
g_ptr_array_free (pool, TRUE);
}
+#if 0
/* FIXME: this is a bit hacky */
static SwfdecBuffer *
swfdec_constant_pool_get_area (SwfdecScript *script, SwfdecConstantPool *pool)
@@ -140,6 +137,7 @@ swfdec_constant_pool_get_area (SwfdecScr
g_assert (start + len < buffer->data + buffer->length);
return swfdec_buffer_new_subbuffer (buffer, start - buffer->data, len);
}
+#endif
/*** SUPPORT FUNCTIONS ***/
@@ -152,46 +150,10 @@ swfdec_script_add_t...