Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable splitting #5

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

romainthomas
Copy link
Collaborator

Voici le début de ma contribution sur l'obfuscation : "Variable splitting". La passe marche avec des codes très simples (tests/ObfuscateVar/basic.c) et il y a encore un grand nombre d'ameliorations que je dois faire sur la structure de la passe et ses fonctionnalités.

	nouveau fichier : CMakeLists.txt
	nouveau fichier : cmake/Python.cmake
	nouveau fichier : llvm-passes/CMakeLists.txt
	nouveau fichier : llvm-passes/ObfuscateVar/ObfuscateVar.cpp
	nouveau fichier : llvm-passes/ObfuscateZero/ObfuscateZero.cpp
	nouveau fichier : tests/ObfuscateVar/basic.c
	nouveau fichier : tests/ObfuscateZero/basic_test.c
	nouveau fichier : tests/ObfuscateZero/check_openssl.sh
	nouveau fichier : tests/ObfuscateZero/check_zlib.sh
	nouveau fichier : tests/ObfuscateZero/null_pointer_test.c
	nouveau fichier : tests/ObfuscateZero/test_gep.c
	nouveau fichier : tests/ObfuscateZero/test_maxint.cpp
	nouveau fichier : tests/lit.cfg.in
	supprimé :        cmake/Python.cmake
@serge-sans-paille
Copy link
Contributor

I'll have a look at this tomorrow morning!

@@ -0,0 +1 @@
build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not, but this is specific to your configuration, so I would not add this entry (e.g. I a generally using _build, or _fastbuild etc, should we list all of them here?)

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you delete the LiCENSE?

@serge-sans-paille
Copy link
Contributor

There are two big issues in your PR 👍
1/ the commit is not atomic (there should be a single commit, nobody cares about your private things ;-))
2/ Your transformation algorithm is not correct. What you should do is start with an empty value_map, then fill it with the converted values of the function arguments when it's legal (i.e. integer type), then process each instruction. For each instruction if it's an add and the operands have been transformed (or are constants), then replace it by the splitted operation and store a new binding in your valuemap. If it's an illegal operation, for each operand that has a splitted value, unsplit it and replace the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants