Code Monkey home page Code Monkey logo

movfuscator's People

Contributors

xoreaxeaxeax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

movfuscator's Issues

Integer multiplication error

Hello, I'm getting a multiplication error when trying to compile this code:

#include <stdio.h>

void main() {
	int a = 1501;
	int b = 6754;
	int calc = a * b;

	printf("calculated value: %d\n", calc);
}

Expected 10137754, calculated 10072218.

relocation in read-only section .text'

Hello.
I am using gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
I created a library and called it in main.
I want to compile my main with gcc (using gcc -m32 -c main.c -o main.o)
and compile my library with movcc (using movcc -m32 -c library.c -o library.o).
These two procedures have been done correctly,
My problem is with creating an executable file (using gcc -m32 main.o library.o -o main)
it returns a warning /usr/bin/ld: library.o: warning: relocation in read-only section .text'
and also there are so many parameters that seem undefined to the compiler, like:
/usr/bin/ld: (.text+0xb): undefined reference to 'alu_x'
...
finally there are these two warning and error:
/usr/bin/ld: warning: creating DT_TEXTREL in PIE
collect2: error: ld returned 1 exit status

Is there any solution to solve this problem?
Thanks for any help in advance.

Compiling with movcc fails

I've tried
movcc -s ./validation/prime.c -o prime_mov
movcc validation/aes/aes.c validation/aes/test.c -o validation/aes/aes -s
movcc -s hello_world.c -o hello_world with the program "#include <stdio.h>
int main(){ printf("Hello World"); return 0;}"

All of them fail with errors like (but with different c files):

`M/o/Vfuscation started...

hello_world.c: /usr/include/bits/alltypes.h:6: syntax error; found va_list' expecting ;'

M/o/Vfuscation failed.`

I'm using Void Linux with MUSL as libc on a 64bit system

Cannot run movcc compiled files

i managed to compile a simple HelloWorld program with movcc.

#include <stdio.h>

int main()
{
    printf("Hello World");
    return 0;
}

when i compile it with gcc it just works, but when using movcc i get the following error:

bash: ./program: cannot execute binary file: Exec format error

i checked the format of both files, which are indeed different:

gcc produces an elf64-x86-64 binary

movcc produces an elf32-i386 binary

i tried to pass "-m elf_x86_64" with -Wl but then i get another error:

/usr/bin/ld: Incompatible /mnt/d/TMP/C/git/movfuscator/build//gcc/32/libgcc.a skipped search of -lgcc

What am i doing wrong?

make: *** [Makefile:24: timesoftfloat] Error 1

Hello, i am trying build movfuscator on arch linux x64 with intalled multilib-devel but make error written
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm

/usr/include/stdio.h:253: too many errors

host info

Linux rebellion 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

running build.sh

/home/rebellion/tools/movfuscator-master/build/movcc -c -I. -I.. -o timesoftfloat.o -Wf--q timesoftfloat.c
timesoftfloat.c: /usr/include/stdlib.h:117: syntax error; found `__nptr' expecting `)'
timesoftfloat.c: /usr/include/stdlib.h:117: skipping `__nptr' `,'
timesoftfloat.c: /usr/include/stdlib.h:118: syntax error; found `char' expecting `{'
timesoftfloat.c: /usr/include/stdlib.h:118: redeclaration of `restrict' previously declared at /usr/include/stdlib.h:117
timesoftfloat.c: /usr/include/stdlib.h:118: syntax error; found `__endptr' expecting `;'
timesoftfloat.c: /usr/include/stdlib.h:118: undeclared identifier `__endptr'
timesoftfloat.c: /usr/include/stdlib.h:118: warning: expression with no effect elided
timesoftfloat.c: /usr/include/stdlib.h:118: syntax error; found `)' expecting `;'
timesoftfloat.c: /usr/include/stdlib.h:118: illegal statement termination
timesoftfloat.c: /usr/include/stdlib.h:118: skipping `)'
timesoftfloat.c: /usr/include/stdlib.h:123: illegal statement termination
timesoftfloat.c: /usr/include/stdlib.h:123: skipping `extern' `float'
timesoftfloat.c: /usr/include/stdlib.h:123: illegal expression
timesoftfloat.c: /usr/include/stdlib.h:123: syntax error; found `char' expecting `)'
timesoftfloat.c: /usr/include/stdlib.h:123: syntax error; found `char' expecting `;'
timesoftfloat.c: /usr/include/stdlib.h:123: illegal statement termination
timesoftfloat.c: /usr/include/stdlib.h:123: skipping `char'
timesoftfloat.c: /usr/include/stdlib.h:123: warning: expression with no effect elided
timesoftfloat.c: /usr/include/stdlib.h:123: syntax error; found `__nptr' expecting `;'
timesoftfloat.c: /usr/include/stdlib.h:123: undeclared identifier `__nptr'
timesoftfloat.c: /usr/include/stdlib.h:124: illegal expression
timesoftfloat.c: /usr/include/stdlib.h:124: operands of * have illegal types `int' and `pointer to char'
timesoftfloat.c: /usr/include/stdlib.h:124: warning: expression with no effect elided
timesoftfloat.c: /usr/include/stdlib.h:124: warning: expression with no effect elided
timesoftfloat.c: /usr/include/stdlib.h:124: too many errors
Makefile:21: recipe for target 'timesoftfloat.o' failed
make: *** [timesoftfloat.o] Error 1
make: Leaving directory '/home/rebellion/tools/movfuscator-master/softfloat'

Dictionary für equalities

Hello there,
its not realy an issue with your compiler, its more a question if
you would share the equality dictionary for e.g. add <-> mov, comp <->mov
etc

At the end I came to the result that it would be interesting to build such a thing for windows as well.
But instead of making a real compiler, I tought more about writing an translator, which reads the
executeable opcodes, translates them and writes a new executeable. On this way its possible to use
good compilers which already exist and apply the mov-only theory

,greetings

cannot find -lgcc -lc -lm

Whenever I try to compile something i got this:

/usr/bin/ld: impossibile trovare -lgcc
/usr/bin/ld: impossibile trovare -lc
/usr/bin/ld: impossibile trovare -lm

./check.sh failed ...

validation/aes/test.c:101: illegal statement termination
validation/aes/test.c:101: skipping struct' validation/aes/test.c:101: undeclared identifier AES_ctx'
validation/aes/test.c:101: warning: expression with no effect elided
validation/aes/test.c:101: syntax error; found ctx' expecting ;'
validation/aes/test.c:101: undeclared identifier ctx' validation/aes/test.c:101: warning: expression with no effect elided validation/aes/test.c:102: warning: type error in argument 1 to AES_init_ctx'; found pointer to int' expected pointer to struct AES_ctx'
validation/aes/test.c:106: warning: type error in argument 1 to AES_ECB_encrypt'; found pointer to int' expected `pointer to struct AES_ctx'

M/o/Vfuscation failed.

maybe the have changed the source code at https://github.com/kokke/tiny-AES128-C
I think you should include a version that worked ... (for all external stuff too, they might get changed)

arm, mips, and asic?

hi, im not an hardware expert by any means, i saw your presentations on black hat about how you can run any program using only mov instructions, and i'm curious:
this principle aply to any processor or its an x86 only thing?

its possible to build an processor with only the mov instruction?
i heard that build an processor with a lot of instructions and reduce its size is complex ,its smarter focus on an small set of instrctions running fast than try to make tons of instructions and end up with something harder to reduce the size to improve the clock.
so maybe an asic that only does mov instructions could be faster than an traditional computer cpu?

make: *** [Makefile:21: timesoftfloat.o] Error 1

Hello,

I got this error building on LFS system, snip

Create movcc

ln -sfn "$BUILDDIR/lcc" "$BUILDDIR/movcc"

Build the M/o/Vfuscator crt libraries

"$BUILDDIR/movcc" movfuscator/crt0.c -o "$BUILDDIR/crt0.o" -c -Wf--crt0 -Wf--q
movfuscator/crt0.c:0: warning: empty input file
"$BUILDDIR/movcc" movfuscator/crtf.c -o "$BUILDDIR/crtf.o" -c -Wf--crtf -Wf--q
movfuscator/crtf.c:0: warning: empty input file
"$BUILDDIR/movcc" movfuscator/crtd.c -o "$BUILDDIR/crtd.o" -c -Wf--crtd -Wf--q
movfuscator/crtd.c:0: warning: empty input file

Build the M/o/Vfuscator soft float library

These may give warnings about overflows, they are (mostly) safe to ignore

make -C softfloat clean && make -C softfloat CC="$BUILDDIR/movcc"
make: Entering directory '/home/jacks/movfuscator/softfloat'
rm -f *.o *.a timesoftfloat
make: Leaving directory '/home/jacks/movfuscator/softfloat'
make: Entering directory '/home/jacks/movfuscator/softfloat'
/home/jacks/movfuscator/build/movcc -c -I. -I.. -o softfloat32.o -Wf--q softfloat.c -DFLOAT64=0 -DTRIM=1
softfloat.c: softfloat_specialize.c:36: warning: overflow in converting constant expression from unsigned long' to int'
softfloat.c: softfloat_specialize.c:43: warning: overflow in converting constant expression from unsigned long' to int'
softfloat.c:782: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:898: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:906: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:955: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:967: warning: overflow in converting constant expression from int' to unsigned int'
/tmp/lcc130821.s: Assembler messages:
/tmp/lcc130821.s:143881: Warning: end of file not at end of a line; newline inserted
/home/jacks/movfuscator/build/movcc -c -I. -I.. -o softfloat64.o -Wf--q softfloat.c -DFLOAT64=1 -DTRIM=1
softfloat.c: softfloat_specialize.c:36: warning: overflow in converting constant expression from unsigned long' to int'
softfloat.c: softfloat_specialize.c:43: warning: overflow in converting constant expression from unsigned long' to int'
softfloat.c:782: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:898: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:906: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:955: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:967: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1330: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1332: warning: unsigned operand of unary -
softfloat.c:1338: warning: unsigned operand of unary -
softfloat.c:1475: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1648: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1778: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1847: warning: overflow in converting constant expression from int' to unsigned int'
/tmp/lcc130871.s: Assembler messages:
/tmp/lcc130871.s:368343: Warning: end of file not at end of a line; newline inserted
/home/jacks/movfuscator/build/movcc -c -I. -I.. -o softfloatfull.o -Wf--q softfloat.c -DFLOAT64=1 -DTRIM=0
softfloat.c: softfloat_specialize.c:36: warning: overflow in converting constant expression from unsigned long' to int'
softfloat.c: softfloat_specialize.c:43: warning: overflow in converting constant expression from unsigned long' to int'
softfloat.c:782: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:898: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:906: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:955: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:967: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1023: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1032: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1053: warning: unsigned operand of unary -
softfloat.c:1078: warning: unsigned operand of unary -
softfloat.c:1103: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1108: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1330: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1332: warning: unsigned operand of unary -
softfloat.c:1338: warning: unsigned operand of unary -
softfloat.c:1396: warning: unsigned operand of unary -
softfloat.c:1475: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1648: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1778: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1847: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1928: warning: overflow in converting constant expression from int' to unsigned int'
softfloat.c:1980: warning: type error in argument 5 to add64'; found pointer to int' expected pointer to unsigned int' softfloat.c:2023: warning: overflow in converting constant expression from int' to unsigned int' /home/jacks/movfuscator/build/movcc -c -I. -I.. -o timesoftfloat.o -Wf--q timesoftfloat.c timesoftfloat.c: /usr/include/stdlib.h:117: syntax error; found __nptr' expecting )' timesoftfloat.c: /usr/include/stdlib.h:117: skipping __nptr' ,' timesoftfloat.c: /usr/include/stdlib.h:118: syntax error; found char' expecting {' timesoftfloat.c: /usr/include/stdlib.h:118: redeclaration of restrict' previously declared at /usr/include/stdlib.h:117
timesoftfloat.c: /usr/include/stdlib.h:118: syntax error; found __endptr' expecting ;'
timesoftfloat.c: /usr/include/stdlib.h:118: undeclared identifier __endptr' timesoftfloat.c: /usr/include/stdlib.h:118: warning: expression with no effect elided timesoftfloat.c: /usr/include/stdlib.h:118: syntax error; found )' expecting ;' timesoftfloat.c: /usr/include/stdlib.h:118: illegal statement termination timesoftfloat.c: /usr/include/stdlib.h:118: skipping )'
timesoftfloat.c: /usr/include/stdlib.h:123: illegal statement termination
timesoftfloat.c: /usr/include/stdlib.h:123: skipping extern' float'
timesoftfloat.c: /usr/include/stdlib.h:123: illegal expression
timesoftfloat.c: /usr/include/stdlib.h:123: syntax error; found char' expecting )'
timesoftfloat.c: /usr/include/stdlib.h:123: syntax error; found char' expecting ;'
timesoftfloat.c: /usr/include/stdlib.h:123: illegal statement termination
timesoftfloat.c: /usr/include/stdlib.h:123: skipping char' timesoftfloat.c: /usr/include/stdlib.h:123: warning: expression with no effect elided timesoftfloat.c: /usr/include/stdlib.h:123: syntax error; found __nptr' expecting ;' timesoftfloat.c: /usr/include/stdlib.h:123: undeclared identifier __nptr'
timesoftfloat.c: /usr/include/stdlib.h:124: illegal expression
timesoftfloat.c: /usr/include/stdlib.h:124: operands of * have illegal types int' and pointer to char'
timesoftfloat.c: /usr/include/stdlib.h:124: warning: expression with no effect elided
timesoftfloat.c: /usr/include/stdlib.h:124: warning: expression with no effect elided
timesoftfloat.c: /usr/include/stdlib.h:124: too many errors
make: *** [Makefile:21: timesoftfloat.o] Error 1
make: Leaving directory '/home/jacks/movfuscator/softfloat'
mkdir -p movfuscator/lib
cp softfloat/softfloat32.o movfuscator/lib/softfloat32.o
cp softfloat/softfloat64.o movfuscator/lib/softfloat64.o
cp softfloat/softfloatfull.o movfuscator/lib/softfloatfull.o

maybe it is taking too long ... ?

hi
the first example I tried never print out anything. maybe movcc does not work with argc,argv,atoi etc, so I got rid of them all, and set the number of primes to a constant 10, and use only one external function "printf". still, it never print out anything. maybe you should give it a try. what is the speed normally like?
main()
{
int n, i = 3, count, c;

//n=10000;
//printf("Enter the number of prime numbers required\n");
//scanf("%d",&n);

n=10;

if ( n >= 1 )
{
// printf("First %d prime numbers are :\n",n);
printf("2\n");
}

for ( count = 2 ; count <= n ; )
{
for ( c = 2 ; c <= i - 1 ; c++ )
{
if ( i%c == 0 )
break;
}
if ( c == i )
{
printf("%d\n",i);
count++;
}
i++;
}

}

// original version
#include <stdio.h>

int main(int argc,char** argv)
{
int n, i = 3, count, c;

//n=10000;
//printf("Enter the number of prime numbers required\n");
//scanf("%d",&n);

if (argc<2) {printf("%s number.of.primes\n",argv[0]);return 1;}
n=atoi(argv[1]);

if ( n >= 1 )
{
// printf("First %d prime numbers are :\n",n);
printf("2\n");
}

for ( count = 2 ; count <= n ; )
{
for ( c = 2 ; c <= i - 1 ; c++ )
{
if ( i%c == 0 )
break;
}
if ( c == i )
{
printf("%d\n",i);
count++;
}
i++;
}

return 0;
}

Bad variable name on ubuntu sub system for windows 10

So i tried installing this compiler on a windows 10 system using the linux subsystem, but in build.sh at line 10 and install.sh at line 3 I get a bad variable name error. Here is the complete Log:

git clone https://github.com/xoreaxeaxeax/movfuscator
Cloning into 'movfuscator'...
remote: Enumerating objects: 319, done.
Receiving objects:  15% (48/319)
remote: Total 319 (delta 0), reused 0 (delta 0), pack-reused 319
Receiving objects: 100% (319/319), 11.96 MiB | 4.48 MiB/s, done.
Resolving deltas: 100% (123/123), done.
root@DESKTOP-5FIGTCF:... # cd movfuscator
cd movfuscator
root@DESKTOP-5FIGTCF:... # ./build.sh
./build.sh

# grab the frontend
[ ! -d "lcc" ] && git clone https://github.com/drh/lcc
Cloning into 'lcc'...
remote: Enumerating objects: 51, done.
remote: Counting objects: 100% (51/51), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 2459 (delta 13), reused 48 (delta 12), pack-reused 2408
Receiving objects: 100% (2459/2459), 2.55 MiB | 4.26 MiB/s, done.
Resolving deltas: 100% (1127/1127), done.
cd lcc && git reset --hard 3b3f01b4103cd7b519ae84bd1122c9b03233e687 && cd -
HEAD is now at 3b3f01b Fix issues 11 and 12 reported by Martin Ettl.
...

# create a build directory
export BUILDDIR=`pwd`/build
./build.sh: 10: export: python/movfuscator/build: bad variable name
root@DESKTOP-5FIGTCF:... # sudo ./install.sh
sudo ./install.sh
export BUILDDIR=`pwd`/build
./install.sh: 3: export: python/movfuscator/build: bad variable name
root@DESKTOP-5FIGTCF:... #```

Static compilation isssue

The static compilation flag does not seem to work, or I don't understand the compilation options.

From the help menu:

-static	specify static libraries (default is dynamic)

For example, using the following basic code:

#include<stdio.h>
main(){ printf("Hello World"); }

Compiling as follows:

movcc -static test.c -o test

Testing dependencies:

ldd test
	linux-gate.so.1 =>  (0xf778d000)
	libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf75a3000)
	libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7556000)
	/lib/ld-linux.so.2 (0x565a4000)

doom.patch not found

Hi!
I'm a fairly new to Ubuntu. When I run the patch command I get the following
bash: doom.patch: No such file or directory

support C++?

Dear sir,
Do you have any plans to support C++?

thx a lot!

softfloat Build Errors

It appears as if the gcc directory isnt created when the build script is ran. So when it comes to building softfloat it errors out. Unsure if this matters, but just in case I should mention, I am trying to compile this on a 64 bit version of LMDE (Linux Mint Debian Edition)

movcc -c -I. -I.. -o softfloat32.o -Wf--q softfloat.c -DFLOAT64=0 -DTRIM=1
movcc: /home/joey/movfuscator/build/gcc/cpp: No such file or directory
Makefile:11: recipe for target 'softfloat32.o' failed

When I make the gcc directory and copy what its looking for into there softfloat fails to build.

movcc -c -I. -I.. -o softfloat32.o -Wf--q softfloat.c -DFLOAT64=0 -DTRIM=1
cpp: softfloat.c:28 Syntax error in #include
cpp: softfloat.c:29 Syntax error in #include
cpp: softfloat.c:30 Syntax error in #include
cpp: softfloat.c:31 Syntax error in #include
) in #if/#elsifc:205 Bad operator (
) in #if/#elsifc:217 Bad operator (
) in #if/#elsifc:228 Bad operator (
) in #if/#elsifc:239 Bad operator (
) in #if/#elsifc:256 Bad operator (
) in #if/#elsifc:299 Bad operator (
) in #if/#elsifc:331 Bad operator (
) in #if/#elsifc:415 Bad operator (
) in #if/#elsifc:464 Bad operator (
) in #if/#elsifc:564 Bad operator (
) in #if/#elsifc:602 Bad operator (
) in #if/#elsifc:632 Bad operator (
) in #if/#elsifc:1004 Bad operator (
) in #if/#elsifc:1089 Bad operator (
) in #if/#elsifc:1215 Bad operator (
) in #if/#elsifc:1235 Bad operator (
) in #if/#elsifc:1262 Bad operator (
) in #if/#elsifc:1291 Bad operator (
) in #if/#elsifc:1363 Bad operator (
) in #if/#elsifc:1414 Bad operator (
) in #if/#elsifc:1444 Bad operator (
) in #if/#elsifc:1546 Bad operator (
) in #if/#elsifc:1623 Bad operator (
) in #if/#elsifc:1705 Bad operator (
) in #if/#elsifc:1726 Bad operator (
) in #if/#elsifc:1747 Bad operator (
) in #if/#elsifc:1811 Bad operator (
) in #if/#elsifc:1893 Bad operator (
) in #if/#elsifc:1999 Bad operator (
) in #if/#elsifc:2071 Bad operator (
) in #if/#elsifc:2099 Bad operator (
) in #if/#elsifc:2131 Bad operator (
) in #if/#elsifc:2164 Bad operator (
) in #if/#elsifc:2193 Bad operator (
) in #if/#elsifc:2230 Bad operator (

ld error

when i try to compile any program all these errors come up:

M/o/Vfuscation started...

aa.c:4: warning: missing return value
emit/mov>addrgp4(5)
emit/mov>argp4(addrgp4(5))
emit/mov>addrgp4(5)
emit/mov>calli4(addrgp4(printf))
emit/mov>cnsti4(0)
emit/mov>cnsti4(0)
emit/mov>reti4(cnsti4(0))
emit/mov>labelv(4)

M/o/Vfuscation complete.

/usr/bin/ld: saltato /usr/lib/libc.so incompatibile durante la ricerca di -lc
/usr/bin/ld: saltato /usr/lib/libc.a incompatibile durante la ricerca di -lc
/usr/bin/ld: impossibile trovare -lc
/usr/bin/ld: saltato /usr/lib/libm.so incompatibile durante la ricerca di -lm
/usr/bin/ld: saltato /usr/lib/libm.a incompatibile durante la ricerca di -lm
/usr/bin/ld: impossibile trovare -lm

does anyone know how to fix it?

Obfuscate an assembly program?

I would like to obfuscate a x86 assembly program (preferably a fully-static ELF executable, but a x86 assembly file could maybe also work) by converting the full x86 instruction set into only mov instructions. Is this possible?

The reason why I want to do this is because I don't want to be limited to C. It is very easy to build fully-static Linux binaries in Rust (using the x86_64-unknown-linux-musl rustc compiler target for musl libc linking) and it would be great if I could apply the movfuscator on a program originally written in Rust.

If nothing like this is supported, how difficult would it possibly be to implement? I haven't looked at the movfuscator source code ...

rand.py does not include all available post processing steps

rand.py only reimplements adc, add, andor, rrrrr, sub, sbb, and xadd. This is missing xor, push/pop, cmpxchg/xchg, etc. To be fair, though, I don't expect every post processing step to be usable in such a random matter, such as xor, due to it manipulating state in a way that other instructions wouldn't be able to immediately compensate for. If one could preform a sequence of operations to bring it back to a usable state by other post-processing steps, though, then it could be added. (don't take my word for it, please, I'm just thinking out loud)

The other possibility would be modifying the existing compiler to keep track of ways to compensate for mixing these instructions. Going to rule that out for now, as that would be a new compiler, not a modification of a post-processing step.

Idealy, there would be no duplication of these implementations, either. This could be accomplished by turning each possible post-processing step into a module, which does the expected thing when run as a program, and exports a function implementing the post-processing step afterwards. Possibly adds it to a global array, if it exists.

Though, I don't expect this to happen. Just thinking too hard, too loud.

Fails to build softfloat.c on OS/X

softfloat.c: ./softfloat.h:45: invalid struct field declarations
softfloat.c: ./softfloat.h:45: syntax error; found /' expecting }'
softfloat.c: ./softfloat.h:45: skipping /' /' bits32' high'
softfloat.c: ./softfloat.h:45: empty declaration
softfloat.c: ./softfloat.h:45: syntax error; found ,' expecting ;'
softfloat.c: ./softfloat.h:45: skipping ,' softfloat.c: ./softfloat.h:47: redeclaration of low' previously declared at ./softfloat.h:45
softfloat.c: ./softfloat.h:49: unrecognized declaration
softfloat.c: ./softfloat.h:126: syntax error; found int32_to_float64' expecting ;'
softfloat.c: ./softfloat.h:138: syntax error; found float32_to_float64' expecting ;'
softfloat.c: ./softfloat.h:180: extraneous old-style parameter list
softfloat.c: ./softfloat.h:182: extraneous old-style parameter list
softfloat.c: ./softfloat.h:184: extraneous old-style parameter list
softfloat.c: ./softfloat.h:192: syntax error; found float64_round_to_int' expecting ;'
softfloat.c: ./softfloat.h:192: extraneous old-style parameter list
softfloat.c: ./softfloat.h:194: syntax error; found float64_add' expecting ;'
softfloat.c: ./softfloat.h:194: duplicate declaration for float64' previously declared at ./softfloat.h:194 softfloat.c: ./softfloat.h:194: extraneous old-style parameter list softfloat.c: ./softfloat.h:196: syntax error; found float64_sub' expecting ;' softfloat.c: ./softfloat.h:196: duplicate declaration for float64' previously declared at ./softfloat.h:196
softfloat.c: ./softfloat.h:196: too many errors

--no-mov-flow doesn't work

Hello!

Option --no-mov-flow seems not to work. I got these output:

M/o/Vfuscation complete.

/tmp/lcc61831.s: Assembler messages:
/tmp/lcc61831.s:1254: Error: too many memory references for `cmp'
/tmp/lcc61831.s:3293: Error: too many memory references for `cmp'
/tmp/lcc61831.s:5042: Error: too many memory references for `cmp'
/tmp/lcc61831.s:6292: Error: too many memory references for `cmp'
/tmp/lcc61831.s:9089: Error: too many memory references for `cmp'
/tmp/lcc61831.s:10983: Error: too many memory references for `cmp'
/tmp/lcc61831.s:12366: Error: too many memory references for `cmp'

To reproduce this bug, you can simply add -Wf--no-mov-flow at the end of 22nd line of check.sh

Not really working

I know it's pretty old fun project, but it would be nice if you can help me. It seems movfuscator can't link the final object file:

$ ./build.sh >/dev/null 2>&1 && echo "int main() {}" > tmp.c && ./build/movcc tmp.c
        ___     ___            ___    ___     ___     ___     ___          ___     ___      
       /\  \   /\  \    ___   /\__\  /\  \   /\__\   /\__\   /\  \        /\  \   /\  \    .
      |::\  \ /::\  \  /\  \ /:/ _/_ \:\  \ /:/ _/_ /:/  /  /::\  \  ___ /::\  \ /::\  \   .
      |:::\  \:/\:\  \ \:\  \:/ /\__\ \:\  \:/ /\  \:/  /  /:/\:\  \/\__\:/\:\  \:/\:\__\  .
    __|:|\:\  \  \:\  \ \:\  \ /:/  /  \:\  \ /::\  \  /  _:/ /::\  \/  //  \:\  \ /:/  /   
   /::::|_\:\__\/ \:\__\ \:\__\:/  / \  \:\__\:/\:\__\/  /\__\:/\:\__\_//__/ \:\__\:/__/___ 
   \:\~~\  \/__/\ /:/  / |:|  |/  /\  \ /:/  // /:/  /\ /:/  //  \/__/ \\  \ /:/  /::::/  / 
    \:\  \  \:\  /:/  / \|:|  |__/\:\  /:/  // /:/  /  /:/  //__/:/\:\  \\  /:/  //~~/~~~~  
     \:\  \  \:\/:/  /\__|:|__|  \ \:\/:/  //_/:/  /:\/:/  /:\  \/__\:\  \\/:/  /:\~~\     .
      \:\__\  \::/  /\::::/__/:\__\ \::/  /  /:/  / \::/  / \:\__\   \:\__\:/  / \:\__\    .
       \/__/   \/__/  ~~~~    \/__/  \/__/   \/__/   \/__/   \/__/    \/__/ __/   \/__/    2
                                                                                            
 
  M/o/Vfuscator2
 
  github.com/xoreaxeaxeax/movfuscator
  chris domas           @xoreaxeaxeax
 

M/o/Vfuscation started...

tmp.c:1: warning: missing return value
emit/mov>cnsti4(0)
emit/mov>cnsti4(0)
emit/mov>reti4(cnsti4(0))
emit/mov>labelv(1)

M/o/Vfuscation complete.

/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: cannot find -lm

Crackme is too easy

You should have used something that can't be trivially solved with instruction counting. A fixed memcmp would require more work.

Binary representation of constants is unsupported: 0b10101

Not an urgent issue, but something that seems like it may be an easy fix.

Source Code:

const gal8 min_poly  = 0b11101,     // Minimal polynomial x^8 + x^4 + x^3 + x^2 + 1
generator = 0b10;        // Generator of Galois field

movcc output:

galois.c:14:    `0b11101' is a preprocessing number but an invalid integer constant
galois.c:15:    `0b10' is a preprocessing number but an invalid integer constant

I'm just a cryptography student trying to obfuscate my algorithms for a ctf I'm working on. The problem is easily fixed when I make the change to decimal representation, but... it'd be nice to have more readable source code that is compatible with movcc.

working source:

const gal8 min_poly  = 39,     // Minimal polynomial x^8 + x^4 + x^3 + x^2 + 1
          generator = 2;        // Generator of Galois field

I have never contributed to a github project before, but I would be happy to take a look at the source, attempt an edit, and submit a pull request if you do that sort of thing..

Not able to compile using movcc

Operating system: Kubuntu
Architecture: 64-bit
Movfuscator was run with sudo

movfuscator test.c:
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}

console output:
M/o/Vfuscation started...

emit/mov>addrgp4(5)
emit/mov>argp4(addrgp4(5))
emit/mov>addrgp4(5)
emit/mov>calli4(addrgp4(printf))
emit/mov>cnsti4(0)
emit/mov>cnsti4(0)
emit/mov>reti4(cnsti4(0))
emit/mov>labelv(4)

M/o/Vfuscation complete.

/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.a when searching for -lm
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so when searching for -lm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.