sourcepawn/decompiler/main.cpp
author Asher Baker <asherkin@gmail.com>
Wed Aug 22 23:23:31 2012 +0100 (2012-08-22)
changeset 3623 3fd87cb487f8
parent 2325 7a24ee5557fb
permissions -rw-r--r--
Updated cstrike gamedata.
     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 }