Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
weak1337 committed Jan 3, 2023
1 parent 0f479df commit 88f92f0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
19 changes: 7 additions & 12 deletions Alcatraz/obfuscator/obfuscator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,20 +516,20 @@ void obfuscator::run(PIMAGE_SECTION_HEADER new_section) {
for (auto func = functions.begin(); func != functions.end(); func++) {

//Obfuscate control flow
//this->flatten_control_flow(func);
this->flatten_control_flow(func);

for (auto instruction = func->instructions.begin(); instruction != func->instructions.end(); instruction++) {


/*

//Obfuscate IAT
if (instruction->isjmpcall && instruction->relative.target_inst_id == -1)
this->obfuscate_iat_call(func, instruction);


//Obfuscate 0xFF instructions to throw off disassemblers
if (instruction->raw_bytes.data()[0] == 0xFF)
this->obfuscate_ff(func, instruction);
//if (instruction->raw_bytes.data()[0] == 0xFF)
//this->obfuscate_ff(func, instruction);

//Obfuscate ADD
if (instruction->zyinstr.mnemonic == ZYDIS_MNEMONIC_ADD)
Expand All @@ -549,17 +549,12 @@ void obfuscator::run(PIMAGE_SECTION_HEADER new_section) {
i++;
}
}
*/


int randval = rand() % 20 + 1;
this->add_junk(func, instruction);

if (randval == 1) {

}
else if (randval == 2) {

//this->add_junk(func, instruction);
}

}

}
Expand Down
2 changes: 0 additions & 2 deletions Alcatraz/obfuscator/passes/antidisassembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ bool obfuscator::add_junk(std::vector<obfuscator::function_t>::iterator& functio
instruction = function->instructions.insert(instruction + 1, jnz);
instruction = function->instructions.insert(instruction + 1, garbage);

printf("%i %i %x\n", (instruction - 1)->isjmpcall, (instruction - 2)->isjmpcall, *(BYTE*)&instruction->raw_bytes.data()[0]);

(instruction - 2)->relative.target_func_id = function->func_id;
(instruction - 1)->relative.target_func_id = function->func_id;

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ Alcatraz is a x64 binary obfuscator that is able to obfuscate various different
+ [Obfuscation of immediate moves](#obfuscation-of-immediate-moves)
+ [Control flow flattening](#control-flow-flattening)
+ [ADD mutation](#add-mutation)
+ [Entrypoint obfuscation](#entrypoint-obfuscation)
+ [Lea obfuscation](#lea-obfuscation)
+ [Anti disassembly](#anti-disassembly)
+ [Import obfuscation](#import-obfuscation)
+ [Opaque predicates](#opaque-predicates)
+ [Mixed boolean arithmetic](#mixed-boolean-arithmetic)

<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>


# Features
In the following showcase all features (besides the one being showcased) are disabled.
### Obfuscation of immediate moves
Expand Down Expand Up @@ -82,3 +81,7 @@ IDA will try to decode the 0xE8 (call) but won't have any success:
### Import obfuscation
There is no "proper" IAT obfuscation at the moment. The 0xFF anti disassembly trick takes care of it for now. Proper implementation is planned here:
[iat.cpp](Alcatraz/obfuscator/misc/iat.cpp)

###Final result
This is a snippet of our `main` function with everything except anti disassembly enabled (so IDA can create a function):
![imgfinal](images/final.PNG)
Binary file added images/final.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 88f92f0

Please sign in to comment.