我是C的新手,使用Mingw32编译器.现在我正在创建从IL到C(Native)的反编译器
生成的代码(没有System.Object):
DecompileTestApplication_Program.c
#include "DecompileTestApplication_Program.h"
DecompileTestApplication_Program* DecompileTestApplication_Program__ctor( ) {
if (array__DecompileTestApplication_Program == 0) {
array__DecompileTestApplication_Program=(void**)malloc(sizeof(void*)*(capacity__DecompileTestApplication_Program=4));
}
DecompileTestApplication_Program* this;
//error: 'this' undeclared (first use in this function)
if (count__DecompileTestApplication_Program==0) {
this=(DecompileTestApplication_Program*)malloc(sizeof(DecompileTestApplication_Program));
goto RealConstructor;
}
this=(DecompileTestApplication_Program*)array__DecompileTestApplication_Program[--count__DecompileTestApplication_Program];
RealConstructor:
this->ind = 0;
this->a = 1;
this->b = 3;
//this._inherit_object_( ); //this is OOP tests ,still working on it
return this;
}
void DecompileTestApplication_Program_Main( ) {
int var_0_02;
var_0_02 = 0;
var_0_02 = ( var_0_02 + 1 );
int var_1_08;
var_1_08 = 1;
int var_2_0A; …Run Code Online (Sandbox Code Playgroud) 我正在从IL(Compiled C#\ VB代码)创建一个反编译器.有没有办法在C中创建引用?
编辑:
我想要比堆栈之类的指针更快的东西.有这样的事吗?
我正在尝试创建能够快速运行的代码.为此,我在需要时对一些变量进行了初始化.例如:(我无法更改标签\ goto部分,我必须在这种情况下使用它)
bool Func(bool BooleanParameter) {
if (BooleanParameter)
goto _true;
else
goto _false;
_true:
string str; //Some code after that one that does with this variable
return false;
_false:
return true; //Exception because str doesn't initialized
}
Run Code Online (Sandbox Code Playgroud)
但是有一个例外,因为有一种方法可以不初始化变量,并且变量最终会破坏.