JS Graphing

Author: David Zimmer
Date: 05.30.15 - 7:17am

as a malware analyst you spend a lot of time looking at obsfuscated JavaScript. the JavaScript_UI feature in PDF stream dumper has a fair amount of tools for cutting through the crap. as other users have noted its tools can be used for other JavaScript analysis needs such as malicious webpages and flash action script. I myself use it a lot for this task.

note that if you are analyzing flash action script, you should remove some of the flash specific keywords such as protected, final, etc for the formatter (and subsequently function extractor to work). also remove the outter class{} wrapper.

when analyzing html remove the html and leave just the script. Also web browser DOM objects are not supported, but I have added support for document.write[ln] as a convenience. You can add support for more DOM objects by editing userlib.js.

even if you cant use the run feature, the navigation and cleanup features are still worth keeping it in mind.

if you are not familiar here are some quick features:
  • syntax highlighting
  • auto code formatting
  • parsed function list for navigation
  • word highlighting
  • basic refactoring

  • strip inline function calls
  • simplify numeric expansions
  • simplify strings
anyway the reason for this post, is that I just added another small but handy feature. A right click Graph Xrefs to/from that works the same way as its namesake in IDA. I also added a lines of code (loc) column to the function list so you can see at a glance which functions are significant)

If you're not familiar with the "strip in-line function calls", or "simplify numeric expansions" features, below is a screenshot of them in action. I don't think I ever publicly mentioned them before but they have been in there for a while

Comments: (0)

Leave Comment:
Email: (not shown)
Message: (Required)
Math Question: 5 + 54 = ? followed by the letter: W 

About Me
More Blogs
Main Site
Posts: (year)
2024 (1)
     vbdec backstory
2023 (4)
     Yara Workbench Automation
     VS linker versions
     IDA decompiler comments
2022 (5)
     VB6 Implements
     VB6 Stubs BS
     VB6 TypeInfo
     VB6 VTable Layout
     Yara isPCode rule
2021 (2)
     VB6 Gosub
2020 (5)
     AutoIT versions
     IDA JScript 2
     Using VB6 Obj files from C
     Yara Corrupt Imports
     Yara Undefined values
2019 (6)
     Yara WorkBench
     vb6 API and call backs
     UConnect Disable Cell Modem
2017 (5)
     IDA python over IPC
     dns wildcard blocking
     64bit IDA Plugins
     anterior lines
     misc news/updates
2016 (4)
     KANAL Mod
     Decoders again
     CDO.Message Breakpoints
     SysAnalyzer Updates
2015 (5)
     SysAnalyzer and Site Updates
     crazy decoder
     ida js w/dbg
     flash patching #2
     JS Graphing
2014 (5)
     Delphi IDA Plugin
     scdbg IDA integration
     API Hash Database
     Winmerge plugin
     IDACompare Updates
2013 (9)
     Guest Post @ hexblog
     TCP Stream Reassembly
     SysAnalyzer Updates
     Apilogger Video
     Shellcode2Exe trainer
     scdbg updates
     IDA Javascript w/IDE
     Rop Analysis II
     scdbg vrs ROP
2012 (13)
     flash patching
     x64 Hooks
     micro hook
     jmp api+5 *2
     SysAnalyzer Updates
     InjDll runtime config
     C# Asm/Dsm Library
     Shellcode Hook Detection
     Updates II
     Java Hacking
     Windows 8
     Win7 x64
2011 (19)
     Graphing ideas
     .Net Hacking
     Old iDefense Releases
     hll shellcode
     ActionScript Tips
     -patch fu
     scdbg ordinal lookup
     scdbg -api mode
     Peb Module Lists
     scdbg vrs Process Injection
     GetProcAddress Scanner
     scdbg fopen mode
     scdbg findsc mode
     scdbg MemMonitor
     demo shellcodes
     scdbg download
     api hashs redux
     Api hash gen
2010 (11)
     Retro XSS Chat Codes
     Exe as DLL
     Olly Plugins
     Debugging Explorer
     Attach to hidden process
     JS Refactoring
     Asm and Shellcode in CSharp
     Fancy Return Address
     PDF Stream Dumper
     Malcode Call API by Hash
     WinDbg Cheat Sheet
2009 (1)
     GPG Automation