Comments (4)
Change all the lines with:
print("cmpl "); emit_kid(p,1,nt); print(", "); emit_kid(p,0,nt); print("\n");
To:
print("movl "); emit_kid(p,0,nt); print(", %%eax\n");
print("cmpl "); emit_kid(p,1,nt); print(", %%eax\n");
jump+v does not work either as
print("jmp "); emit_kid(p,0,nt); print("\n");
Should be:
if (p->kids[0]->syms[0]) {
print("jmp %s\n", p->kids[0]->syms[0]->x.name);
} else {
print("movl "); emit_kid(p,0,nt); print(", %%eax\n");
print("jmp *%%eax\n");
}
"cmpl (%s), 1\n" should be changed to "cmpl $1, (%s)\n" also in cc_branch. Almost certain this code was sketched out only and never tested...
Secondly, unfortunately the C libraries are precompiled when you build movfuscator. emit_start is called in each build, but the result discarded. The library version is what is used. But unfortunately that is using the mov_flow flag, the default. This is one way to do the job by changing default in c code, or much better is to change build.sh to pass --no-mov-flow to the libraries when they are precompiled.
static int mov_flow= 0;
Better approach in build.sh:
"$BUILDDIR/movcc" movfuscator/crt*.c -o "$BUILDDIR/crt*.c" -c -Wf--crt* -Wf--q -Wf--no-mov-flow where * is 0, f and d.
After all of this, it works flawlessly though :). Hope the author will commit these changes. I can submit a pull request if need be.
from movfuscator.
Fixed with 6342ae7. Thanks @GregoryMorse for the change suggestions.
from movfuscator.
Thanks for the fixes, I'll get this committed shortly. That flag worked at one point, but seems to have broken along the way.
from movfuscator.
Any chance this will get fixed at some point? Having the same problem still.
from movfuscator.
Related Issues (20)
- maybe it is taking too long ... ?
- doom.patch not found
- Cannot run movcc compiled files HOT 3
- Fails to build softfloat.c on OS/X HOT 1
- make: *** [Makefile:21: timesoftfloat.o] Error 1 HOT 3
- Enhancement: Leave some instructions as-is
- /usr/include/stdio.h:253: too many errors HOT 10
- "Mov is Turing complete" link broken in readme HOT 2
- LLC not able to compile C++ code into C HOT 1
- Binary representation of constants is unsupported: 0b10101 HOT 1
- Compiling with movcc fails HOT 4
- make: *** [Makefile:24: timesoftfloat] Error 1
- ld error HOT 1
- Bad variable name on ubuntu sub system for windows 10
- Failed build and install when current working directory path contains spaces.
- Not able to compile using movcc HOT 1
- movfuscator/build/rcc: unknown target `x86/mov'; must specify one of
- relocation in read-only section .text'
- invalid URL HOT 1
- I want to build a corresponding movfuscator on the ARM architecture. How should I pay attention to it or how to carry out this project HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from movfuscator.