sourcepawn/decompiler/main.cpp
author GoD-Tony <aangione@gmail.com>
Sun Aug 04 10:03:40 2013 -0400 (2013-08-04)
changeset 3971 d2e8100b2814
parent 2325 7a24ee5557fb
permissions -rw-r--r--
Added ISDKHooks interface with entity listeners (bug 5602, r=psychonic).
     1 #include <stdio.h>
     2 #include <stdlib.h>
     3 #include "decompiler.h"
     4 
     5 int main()
     6 {
     7 	int err;
     8 	sp_decomp_t *dc;
     9 
    10 	const char *file = "../../plugins/test.smx";
    11 
    12 	if ((dc = Sp_InitDecomp(file, &err)) == NULL)
    13 	{
    14 		fprintf(stderr, "Could not parse plugin (error %d)\n", err);
    15 		exit(1);
    16 	}
    17 
    18 	if ((err = Sp_DecompFunction(dc, dc->plugin->publics[0].code_offs, true)) != SP_ERROR_NONE)
    19 	{
    20 		fprintf(stderr, "Failed to decode function (error %d)\n", err);
    21 	}
    22 
    23 	Sp_FreeDecomp(dc);
    24 }