5.0.2 • Published 3 years ago

@pedroslopez/moduleraid v5.0.2

Weekly downloads
1,349
License
MIT
Repository
github
Last release
3 years ago

NOTE This package was modified from pixeldesu's original moduleRaid for compatibility with webpack v5 used in WhatsApp Web. No support will be given outside of anything strictly necessary to extract modules in WhatsApp Web.

You can get moduleRaid over npm

$ npm install moduleraid

Or if you directly want to use it in the browser

<script src="https://unpkg.com/moduleraid@4.0.1/moduleraid.js"></script>
<!-- minified -->
<script src="https://unpkg.com/moduleraid@4.0.1/moduleraid.min.js"></script>

Alternatively, just copy the script from moduleraid.js and run it in a devtool console on the site of your choosing.

Preparation

Using moduleRaid as a module, simply require and execute it somewhere where it will end up as a public facing script on a page that also includes a Webpack build!

const moduleRaid = require('moduleraid')

window.mR = moduleRaid()

If you a running the script from the console or loading it over a service like unpkg, no further need for preparations!

The moduleraid object

Once moduleRaid is run or included on a page that includes a Webpack build (usually noted by a webpackJsonp function), it will return a object, containing:

  • modules: An object containing all modules we could get from Webpack
  • constructors: An array containing all module constructor functions
  • get(id): Get the module from the specified id
  • findModule(query): Return the module that has query as a key in its exports
  • findFunction(query): Return functions that include query (query can be either a string or a function)

If you run the code in devtools or load it as external script from unpkg/etc. the moduleRaid object can be found in window.mR by default.

Note: If moduleRaid had to get modules through iteration, constructors will be empty and so findFunction will not work.

Debug Mode

If you call moduleRaid with an optional argument true, you will enable debug output. Debug output will show errors that are normally supressed.

In the version that is minified and you can't just add another argument easily, simply run window.mRdebug = true before adding the script and you should be fine!

There already was a script basically doing the same as moduleRaid some months earlier, called webcrack (made by no-boot-device), which was rendered obsolute due to structural changes in how you can access Webpack modules from the outside.

This library is an effort to bring back the ability to inspect all available modules, for debugging or userscript purposes.

As noted above, Webpack exposes a function webpackJsonp containing all the code that has been bundled with Webpack. The function takes three parameters, all of them being an array. The first two don't seem to really matter, the last one is interesting, it seems to directly return a module given an index.

So, in a brute-forcy manner we simply run a while over webpackJsonp([], [], [i]) until we get an exception from Webpack (trying to run call on undefined), and now we have all modules (or most of them)!

  • There seem to be a lot of empty modules, I'm not sure if these are padding or something is missing here

moduleRaid is licensed under the MIT License

@eduardo_atw/whatsapp-webforked-whatsapp-web.js@rhaimes/whatsapp-web.js@rhaimestech/whatsapp-web.jsajzchat-whatsappwhatsapp-webwhatsapp-web-take-zap@infinitebrahmanuniverse/nolb-_pedunknow-webkasimat-shira2eog_x1whatsapp-web.js-cloned-fixed@everything-registry/sub-chunk-710joulgs-whatsapp-web.jswawswi-whatsapp-web.js-cloned-fixedwhatsapp-jaenudin.jswhatsapp-lerianwhatsapp-web-aws-lambdawhatsapp-web-cogtecwhatsapp-web-electron.jswhatsapp-web-electron.js-vgowhatsapp-web-enigmawhatsapp-web-fix-fork.jswhatsapp-web-live.jswhatsapp-web-mariogalan.jswhatsapp-web-modified.jswhatsapp-web-stable-vm.jswhatsapp-web-tharak.jswhatsapp-web.jsweelluwhatsapp-web.js-fixwhatsapp-web.js-fixed-initwhatsapp-web.js-whatsivowhatsapp-web.js.zbswhatsapp-web.js_correctedwhatsapp-web.js_corrected100whatsapp-web.jspatchedwhatsapp-web1.jswa-bot-heroku-testwabusejswa-webjs-1221wpp-web.jswsweb.jswwebjswwebjs-electronwwjstewa.jsvikwajsumais-whatsapp-web.jstecsom-whatsapp-web.jsnups-whatsapp-web.jssharmaq-whatsapp-web.jsslim-whatsapp-web.js@marcotuliocnd/whatsapp-web.js@giancarlopro/whatsapp-web.js@farizhermawan/whatsapp-web.js@fisdo/whatsapp-web.js@grandchef/whatsapp-web-electron.js@juzi/whatsapp-web.js@juzi.bot/whatsapp-web.js@periskope/whatsapp-web.jsmywajs@d0v3riz/whatsapp-web.jscbnet-whatsapp-web.jspigz-whatsapp-web@rbxweb/whatsapp@ruiwei/whatsapp-web.js@verzach3/whatsapp-web.jsjeast-whatsapp-api@idham101/whatsapp-web.js@kumarvivek808/whatsapp-web.js@sleepinggautama/whatsapp-web.jsdugin-whatsapp-web@tots/whatsapp-web.jsdrumstock.whatsapp-web.js@semver/whatsapp-web.js@alleyhub/alley-whatsapp@anjianshi/whatsapp-web.jsfruxinfo-custom-appajzscrm-whatsappgegehprast-whatsapp-web.js@zetetic/whatsapp-web.js@zalastax/nolb-_pedfork-whatsapp-web@whatchat/whatsapp-chat.js@acampagnaro/whatsapp-web.jsape-whatsapp-web-electron.jsastro-web.jsaxowhatsappmodern-whatsapp-web.jsguptapi.js@chlou/whatsapp-web.jsbhavyasoftwares
5.0.2

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.1.0

4 years ago