joaovarelas / Obfuscator-LLVM-16.0

GNU General Public License v3.0
84 stars 16 forks source link

conditional compilation #2

Open chuqingr opened 7 months ago

chuqingr commented 7 months ago

Hi, I've been studying this recently, and I've come across a tricky question。How do you use conditional compilation in rust? For example, attribute((annotate("annotation")) in c++?

joaovarelas commented 7 months ago

Hello, Im not sure how to do it. Maybe you can use #[cfg_attr] or similar in Rust. It would be useful to select functions to obfuscate but I dont know.

Similar question: https://users.rust-lang.org/t/custom-attribute-annotations/65063

Ysh @.***> escreveu no dia quarta, 13/12/2023 à(s) 09:11:

Hi, I've been studying this recently, and I've come across a tricky question。How do you use conditional compilation in rust? For example, attribute((annotate("annotation")) in c++?

— Reply to this email directly, view it on GitHub https://github.com/joaovarelas/Obfuscator-LLVM-16.0/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABREHBJVSYDGDV2V2YDMQWDYJFWMHAVCNFSM6AAAAABASZVO42VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZTSMRXGA2DEMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- João Varelas Security Researcher https://vrls.ws

chuqingr commented 7 months ago

Hello,Thanks for your reply. At present, it seems that #[cfg_attr] & #[cfg] can't take effect. proc_macro may be needed, but it is troublesome to use https://github.com/rust-lang/rfcs/blob/master/text/1566-proc-macros.md