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

Untitled #1

Open
Naville opened this issue Jan 28, 2020 · 8 comments
Open

Untitled #1

Naville opened this issue Jan 28, 2020 · 8 comments

Comments

@Naville
Copy link
Contributor

Naville commented Jan 28, 2020

Hey:
Regarding the Post LLVM9 support. You'll just have to edit how you initialize Legacy PMB.
Example:
Remove Hikari's Obfuscation.cpp, register passes as-is into LegacyPassManagerBuilder and instead of createSwitchPass() and run it, just add lowerswitch pass before the pass calling it into the pipeline.

For example, the old method was MPM.add(createObfuscationPass()), instead of that , you should write MPM.add(createLowerSwitchPass()); MPM.add(createFlatteningPass())

@Naville
Copy link
Contributor Author

Naville commented Jan 28, 2020

Also I'm more than willing to open-up permissions with the master for you folks to operate on it instead of this folk

@Naville
Copy link
Contributor Author

Naville commented Jan 28, 2020

From personal experience, injecting into Apple Clang sometimes results in other weird crashes related to uninitialized Apple Clang internal stuff (IIRC), not sure if this has been fixed in your build. -mllvm -load should works fine though

@woachk
Copy link
Member

woachk commented Jan 28, 2020

Hello,

We currently register the LegacyLowerSwitch pass from inside Flattening.cpp at

FunctionPass *lower = createLegacyLowerSwitchPass();

We did split Obfuscation.cpp as two separate parts, PassScheduler.cpp and two different ways to register, a Loader_Hook one for Apple Clang and a Register_Passes.cpp one for outside Apple Clang. We didn't have issues with that and Apple Clang for now. Both ways allow to just register with -Xclang -load, with no changes needed to the host Clang at all.

About removing the PassScheduler, it means that we would have to define the arguments to enable/disable a pass inside the passes themselves right?

Thanks,

@Naville
Copy link
Contributor Author

Naville commented Jan 28, 2020

We did split Obfuscation.cpp as two separate parts, PassScheduler.cpp and two different ways to register, a Loader_Hook one for Apple Clang and a Register_Passes.cpp one for outside Apple Clang. We didn't have issues with that and Apple Clang for now. Both ways allow to just register with -Xclang -load, with no changes needed to the host Clang at all.

Should be good enough. I personally hate duplicating LowerSwitchPass which already exists in LLVM upstream, although that's probably just me.

About removing the PassScheduler, it means that we would have to define the arguments to enable/disable a pass inside the passes themselves right?

Yes, or put them in PassManagerBuilder

@nullpixel
Copy link
Collaborator

@Naville: hi, love your work on hikari. i’d be happy to port over our changes back into master on your original repo if you’re fine with that! do you have anywhere we can reach you to discuss things better?

@Naville
Copy link
Contributor Author

Naville commented Jan 28, 2020

@nullpixel Yes pwn20 should have my Discord.

@nullpixel
Copy link
Collaborator

just sent you a friend request!

@Naville
Copy link
Contributor Author

Naville commented Jan 30, 2020

@woachk Hey I've sent out invitation for master access. You can also use this link https://github.com/HikariObfuscator if you didn't receive it

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

No branches or pull requests

3 participants