-
Notifications
You must be signed in to change notification settings - Fork 111
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
rename short identifiers #21
Comments
found another tool that works:
|
there's currently the |
if the variable already has a "normal" name such as |
When I was exploring this concept in my own deobfuscation PoC project, I was exploring to make the variable names unique + have them add sort of semantic information about their source/scope. Eg. if it was an arg to a function, it might be It looks like most of the PoC code I was playing with was local/in a pretty messy/hacky state, but I did find a link in it to an online REPL I was playing around with some of it in. Not sure how outdated that code is, but it might be useful: There were a number of different AST parsers I was playing around with, but I think that this babel code may have been the latest (not sure which one):
Within those files, I believe the functions Edit: Came across this in another issue here:
And looking at it's
A more generalised summary/overview (via ChatGPT):
|
And for an even cooler/more extreme version of improving variable naming; I just came across this blog post / project from @jehna that makes use of
|
I came across another tool today that seemed to have a start on implementing some 'smart rename' features: Digging through the code lead me to this:
There's also an issue there that seems to be exploring how to improve 'unmangling variable names' as well: Which I wrote the following extra thoughts on:
|
Another link from my reference notes that I forgot to include earlier; my thoughts on how to rename otherwise unknown variables are based on similar concepts that are used in reverse engineering tools such as IDA:
|
Tangentially related to this issue, and in line with how Based on how all of the functions containing JSX seem to be named a variation of Regardless, the specific case I wanted to suggest here was when a React component sets the Unminifying this source file (Ref), in // 63390.js, lines 191-194
var _Component67 = forwardRef(function (e, t) {
return <div ref={t} className={_Z("relative flex h-full w-full overflow-hidden", e.className)}>{e.children}</div>;
});
_Component67.displayName = "CarouselContainer"; Contrasting this against DetailsSource (unpacked) // module-63390.js, lines 279-283
var er = (0, d.forwardRef)(function (e, t) {
return (0,
o.jsx)("div", { ref: t, className: (0, l.Z)("relative flex h-full w-full overflow-hidden", e.className), children: e.children });
});
er.displayName = "CarouselContainer"; Transformed (unminified) // module-63390.js, lines 309-320
const CarouselContainer = forwardRef((props, ref) => (
<div
ref={ref}
className={Z$0(
"relative flex h-full w-full overflow-hidden",
props.className
)}
>
{props.children}
</div>
));
CarouselContainer.displayName = "CarouselContainer"; |
|
Continued context from above, it seems that this is implemented via a VSCode proposed API
|
is it possible to correct short variable names? for example with JADX, it has this option:
which will turn short variables such as
a
intoa1234
or something, for easier searchingThe text was updated successfully, but these errors were encountered: