[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DB2B976RZVE7HP4BVNK278":3,"skill-same:01M7DB2B976RZVE7HP4BVNK278":62},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7DB2B976RZVE7HP4BVNK278","performing-static-malware-analysis-with-pe-studio",null,"alicewe1\u002Falice_skill","alicewe1","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F102134151?v=4","01M7D9STCM8HAESM958JP0989K","Alice_we","01M7D9STDR22MTD9FTTWPAZNV8",64,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Fperforming-static-malware-analysis-with-pe-studio\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Fperforming-static-malware-analysis-with-pe-studio\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-static-malware-analysis-with-pe-studio\ndescription: >\n  Performs static analysis of Windows PE (Portable Executable) malware samples using\n  PEStudio to examine file headers, imports, strings, resources, and indicators without\n  executing the binary. Identifies suspicious characteristics including packing, anti-analysis\n  techniques, and malicious imports. Activates for requests involving static malware analysis,\n  PE file inspection, Windows executable analysis, or pre-execution malware triage.\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags: [malware, static-analysis, PE-analysis, PEStudio, reverse-engineering]\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nx-alice-class: reverse\n---# Performing Static Malware Analysis with PEStudio\n\n## When to Use\n\n- A suspicious Windows executable has been collected and needs initial triage before sandbox execution\n- You need to identify imports, strings, and resources that reveal malware functionality without running the sample\n- Determining whether a PE file is packed, obfuscated, or contains anti-analysis techniques\n- Extracting indicators of compromise (hashes, URLs, IPs, registry keys) embedded in a binary\n- Classifying a sample's capabilities based on its import table and section characteristics\n\n**Do not use** for dynamic behavioral analysis requiring execution; use a sandbox (Cuckoo, ANY.RUN) for runtime behavior observation.\n\n## Prerequisites\n\n- PEStudio (free edition from https:\u002F\u002Fwww.winitor.com\u002F) installed on an isolated analysis workstation\n- Python 3.8+ with `pefile` library for scripted PE analysis (`pip install pefile`)\n- CFF Explorer or PE-bear as supplementary PE analysis tools\n- Access to VirusTotal API for hash lookups and community intelligence\n- Isolated analysis VM with no network connectivity to production systems\n- FLOSS (FireEye Labs Obfuscated String Solver) for extracting obfuscated strings\n\n## Workflow\n\n### Step 1: Compute File Hashes and Verify Sample Integrity\n\nGenerate cryptographic hashes for identification and intelligence lookup:\n\n```bash\n# Generate MD5, SHA-1, and SHA-256 hashes\nmd5sum suspect.exe\nsha1sum suspect.exe\nsha256sum suspect.exe\n\n# Check hash against VirusTotal\ncurl -s -X GET \"https:\u002F\u002Fwww.virustotal.com\u002Fapi\u002Fv3\u002Ffiles\u002F$(sha256sum suspect.exe | cut -d' ' -f1)\" \\\n  -H \"x-apikey: $VT_API_KEY\" | jq '.data.attributes.last_analysis_stats'\n\n# Get file type with magic bytes verification\nfile suspect.exe\n```\n\n### Step 2: Examine PE Headers and Section Table\n\nOpen the sample in PEStudio and inspect structural properties:\n\n```\nPEStudio Analysis Points:\n━━━━━━━━━━━━━━━━━━━━━━━━━\nFile Header:       Compilation timestamp, target architecture (x86\u002Fx64)\nOptional Header:   Entry point address, image base, subsystem (GUI\u002Fconsole)\nSection Table:     Section names, virtual\u002Fraw sizes, entropy values\n                   High entropy (>7.0) in .text\u002F.rsrc suggests packing\nSignatures:        Authenticode signature presence and validity\n```\n\n**Scripted PE Header Analysis with pefile:**\n```python\nimport pefile\nimport hashlib\nimport math\n\npe = pefile.PE(\"suspect.exe\")\n\n# Compilation timestamp\nimport datetime\ntimestamp = pe.FILE_HEADER.TimeDateStamp\ncompile_time = datetime.datetime.utcfromtimestamp(timestamp)\nprint(f\"Compile Time: {compile_time} UTC\")\n\n# Section analysis with entropy calculation\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00')\n    entropy = section.get_entropy()\n    raw_size = section.SizeOfRawData\n    virtual_size = section.Misc_VirtualSize\n    ratio = virtual_size \u002F raw_size if raw_size > 0 else 0\n    print(f\"Section: {name:8s} Entropy: {entropy:.2f} Raw: {raw_size:>10} Virtual: {virtual_size:>10} Ratio: {ratio:.2f}\")\n    if entropy > 7.0:\n        print(f\"  [!] HIGH ENTROPY - likely packed or encrypted\")\n    if ratio > 10:\n        print(f\"  [!] HIGH V\u002FR RATIO - unpacking stub likely present\")\n```\n\n### Step 3: Analyze Import Address Table (IAT)\n\nIdentify suspicious API imports that indicate malware capabilities:\n\n```python\n# Extract and categorize imports\nsuspicious_imports = {\n    \"Process Injection\": [\"VirtualAllocEx\", \"WriteProcessMemory\", \"CreateRemoteThread\", \"NtCreateThreadEx\"],\n    \"Keylogging\": [\"GetAsyncKeyState\", \"SetWindowsHookExA\", \"GetKeyState\"],\n    \"Persistence\": [\"RegSetValueExA\", \"CreateServiceA\", \"SchTasksCreate\"],\n    \"Evasion\": [\"IsDebuggerPresent\", \"CheckRemoteDebuggerPresent\", \"NtQueryInformationProcess\"],\n    \"Network\": [\"InternetOpenA\", \"HttpSendRequestA\", \"URLDownloadToFileA\", \"WSAStartup\"],\n    \"File Operations\": [\"CreateFileA\", \"WriteFile\", \"DeleteFileA\", \"MoveFileA\"],\n    \"Crypto\": [\"CryptEncrypt\", \"CryptDecrypt\", \"CryptAcquireContextA\"],\n}\n\nfor entry in pe.DIRECTORY_ENTRY_IMPORT:\n    dll_name = entry.dll.decode()\n    for imp in entry.imports:\n        if imp.name:\n            func_name = imp.name.decode()\n            for category, funcs in suspicious_imports.items():\n                if func_name in funcs:\n                    print(f\"[!] {category}: {dll_name} -> {func_name}\")\n```\n\n### Step 4: Extract and Analyze Strings\n\nUse FLOSS for obfuscated strings and standard strings extraction:\n\n```bash\n# Standard strings extraction (ASCII and Unicode)\nstrings -a suspect.exe > strings_ascii.txt\nstrings -el suspect.exe > strings_unicode.txt\n\n# FLOSS for decoded\u002Fdeobfuscated strings\nfloss suspect.exe --output-json floss_output.json\n\n# Search for network indicators in strings\ngrep -iE \"(http|https|ftp):\u002F\u002F\" strings_ascii.txt\ngrep -iE \"([0-9]{1,3}\\.){3}[0-9]{1,3}\" strings_ascii.txt\ngrep -iE \"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\" strings_ascii.txt\n\n# Search for registry keys\ngrep -i \"HKLM\\\\|HKCU\\\\|SOFTWARE\\\\|CurrentVersion\\\\Run\" strings_ascii.txt\n\n# Search for file paths and extensions\ngrep -iE \"\\.(exe|dll|bat|ps1|vbs|tmp)\" strings_ascii.txt\n```\n\n### Step 5: Inspect Resources and Embedded Data\n\nExamine the PE resource section for embedded payloads or configuration:\n\n```python\n# Extract resources from PE file\nif hasattr(pe, 'DIRECTORY_ENTRY_RESOURCE'):\n    for resource_type in pe.DIRECTORY_ENTRY_RESOURCE.entries:\n        if hasattr(resource_type, 'directory'):\n            for resource_id in resource_type.directory.entries:\n                if hasattr(resource_id, 'directory'):\n                    for resource_lang in resource_id.directory.entries:\n                        data = pe.get_data(resource_lang.data.struct.OffsetToData,\n                                          resource_lang.data.struct.Size)\n                        entropy = calculate_entropy(data)\n                        print(f\"Resource Type: {resource_type.id} Size: {len(data)} Entropy: {entropy:.2f}\")\n                        if entropy > 7.0:\n                            print(f\"  [!] High entropy resource - possible embedded payload\")\n                        # Check for PE signature in resource (embedded executable)\n                        if data[:2] == b'MZ':\n                            print(f\"  [!] Embedded PE detected in resource\")\n                            with open(f\"extracted_resource_{resource_type.id}.bin\", \"wb\") as f:\n                                f.write(data)\n```\n\n### Step 6: Check for Packing and Protection\n\nDetermine if the binary is packed or protected:\n\n```bash\n# Detect packer with Detect It Easy (DIE)\ndiec suspect.exe\n\n# Check with PEiD signatures (command-line version)\npython3 -c \"\nimport pefile\npe = pefile.PE('suspect.exe')\n# Check for common packer section names\npacker_sections = {'.upx0': 'UPX', '.aspack': 'ASPack', '.adata': 'ASPack',\n                   '.nsp0': 'NsPack', '.vmprotect': 'VMProtect', '.themida': 'Themida'}\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00').lower()\n    if name in packer_sections:\n        print(f'[!] Packer detected: {packer_sections[name]} (section: {name})')\n\n# Check import table size (very few imports suggest packing)\nimport_count = sum(len(entry.imports) for entry in pe.DIRECTORY_ENTRY_IMPORT)\nif import_count \u003C 10:\n    print(f'[!] Only {import_count} imports - likely packed')\n\"\n```\n\n### Step 7: Generate Static Analysis Report\n\nCompile all findings into a structured triage report:\n\n```\nDocument the following for each analyzed sample:\n- File identification (hashes, file type, size, compile timestamp)\n- Packing\u002Fprotection status and identified packer\n- Suspicious imports categorized by capability\n- Network indicators extracted from strings (IPs, domains, URLs)\n- Embedded resources and their characteristics\n- Overall threat assessment and recommended next steps (sandbox execution, YARA rule creation)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **PE (Portable Executable)** | The file format for Windows executables (.exe, .dll, .sys) containing headers, sections, imports, and resources that define how the OS loads the binary |\n| **Import Address Table (IAT)** | PE structure listing external DLL functions the executable calls at runtime; reveals program capabilities and intent |\n| **Section Entropy** | Statistical measure of randomness in a PE section; values above 7.0 (out of 8.0) indicate compression, encryption, or packing |\n| **FLOSS** | FireEye Labs Obfuscated String Solver; automatically extracts and decodes obfuscated strings that standard `strings` misses |\n| **Packing** | Compression or encryption of a PE file's code section to hinder static analysis; requires runtime unpacking stub to execute |\n| **PE Resources** | Data section within a PE file that can contain icons, dialogs, version info, or attacker-embedded payloads and configuration data |\n| **Compilation Timestamp** | Timestamp in the PE header indicating when the binary was compiled; can be forged but often reveals development timeline |\n\n## Tools & Systems\n\n- **PEStudio**: Free Windows tool for static analysis of PE files providing indicators, imports, strings, and resource inspection in a single interface\n- **pefile (Python)**: Python library for parsing and analyzing PE file structures programmatically for automated analysis pipelines\n- **FLOSS**: FireEye tool that extracts obfuscated strings from malware using static analysis techniques including stack string decoding\n- **Detect It Easy (DIE)**: Packer and compiler detection tool that identifies protectors, compilers, and linkers used to build PE files\n- **CFF Explorer**: Advanced PE editor and viewer for detailed inspection of PE headers, sections, imports, and resource directories\n\n## Common Scenarios\n\n### Scenario: Triaging a Suspicious Email Attachment\n\n**Context**: SOC receives an alert on a suspicious executable attached to a phishing email. The file needs rapid triage to determine if it is malicious before committing sandbox resources.\n\n**Approach**:\n1. Compute SHA-256 hash and query VirusTotal for existing detections and community comments\n2. Open in PEStudio and check the indicators tab for red\u002Fyellow flagged items\n3. Verify compile timestamp (future dates or dates from 1970 indicate timestamp manipulation)\n4. Check imports for VirtualAllocEx, CreateRemoteThread (injection), URLDownloadToFileA (downloader)\n5. Extract strings and search for C2 URLs, IP addresses, and file paths\n6. Check resources for embedded PE files or high-entropy data blobs\n7. Assess packing status; if packed, note the packer and plan for unpacking before deeper analysis\n\n**Pitfalls**:\n- Trusting the PE compile timestamp without corroborating evidence (timestamps are trivially forged)\n- Concluding a file is benign because it has few suspicious imports (packed malware hides real imports)\n- Missing Unicode strings by only running ASCII string extraction\n- Not checking overlay data appended after the last PE section (common hiding spot for configuration data)\n\n## Output Format\n\n```\nSTATIC MALWARE ANALYSIS REPORT\n=================================\nSample:           suspect.exe\nMD5:              d41d8cd98f00b204e9800998ecf8427e\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nFile Size:        245,760 bytes\nFile Type:        PE32 executable (GUI) Intel 80386\nCompile Time:     2025-09-14 08:23:15 UTC\n\nPACKING STATUS\nPacker Detected:  None (native binary)\nSection Entropy:  .text=6.42 .rdata=4.89 .data=3.21 .rsrc=7.81\nNote:             .rsrc section entropy elevated - check resources\n\nSUSPICIOUS IMPORTS\n[INJECTION]       kernel32.dll -> VirtualAllocEx\n[INJECTION]       kernel32.dll -> WriteProcessMemory\n[INJECTION]       kernel32.dll -> CreateRemoteThread\n[EVASION]         kernel32.dll -> IsDebuggerPresent\n[NETWORK]         wininet.dll  -> InternetOpenA\n[NETWORK]         wininet.dll  -> HttpSendRequestA\n[PERSISTENCE]     advapi32.dll -> RegSetValueExA\n\nEXTRACTED INDICATORS\nURLs:             hxxps:\u002F\u002Fupdate.malicious[.]com\u002Fgate.php\nIPs:              185.220.101[.]42, 91.215.85[.]17\nRegistry Keys:    HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\svchost\nFile Paths:       C:\\Users\\Public\\svchost.exe\n\nEMBEDDED RESOURCES\nResource 101:     Size=98304 Entropy=7.89 [!] Embedded PE detected\nResource 102:     Size=4096  Entropy=2.14 (configuration XML)\n\nASSESSMENT\nThreat Level:     HIGH\nClassification:   Dropper with process injection capabilities\nRecommended:      Execute in sandbox, extract embedded PE for separate analysis\n```\n","## When to Use\n\n- A suspicious Windows executable has been collected and needs initial triage before sandbox execution\n- You need to identify imports, strings, and resources that reveal malware functionality without running the sample\n- Determining whether a PE file is packed, obfuscated, or contains anti-analysis techniques\n- Extracting indicators of compromise (hashes, URLs, IPs, registry keys) embedded in a binary\n- Classifying a sample's capabilities based on its import table and section characteristics\n\n**Do not use** for dynamic behavioral analysis requiring execution; use a sandbox (Cuckoo, ANY.RUN) for runtime behavior observation.\n\n## Prerequisites\n\n- PEStudio (free edition from https:\u002F\u002Fwww.winitor.com\u002F) installed on an isolated analysis workstation\n- Python 3.8+ with `pefile` library for scripted PE analysis (`pip install pefile`)\n- CFF Explorer or PE-bear as supplementary PE analysis tools\n- Access to VirusTotal API for hash lookups and community intelligence\n- Isolated analysis VM with no network connectivity to production systems\n- FLOSS (FireEye Labs Obfuscated String Solver) for extracting obfuscated strings\n\n## Workflow\n\n### Step 1: Compute File Hashes and Verify Sample Integrity\n\nGenerate cryptographic hashes for identification and intelligence lookup:\n\n```bash\n# Generate MD5, SHA-1, and SHA-256 hashes\nmd5sum suspect.exe\nsha1sum suspect.exe\nsha256sum suspect.exe\n\n# Check hash against VirusTotal\ncurl -s -X GET \"https:\u002F\u002Fwww.virustotal.com\u002Fapi\u002Fv3\u002Ffiles\u002F$(sha256sum suspect.exe | cut -d' ' -f1)\" \\\n  -H \"x-apikey: $VT_API_KEY\" | jq '.data.attributes.last_analysis_stats'\n\n# Get file type with magic bytes verification\nfile suspect.exe\n```\n\n### Step 2: Examine PE Headers and Section Table\n\nOpen the sample in PEStudio and inspect structural properties:\n\n```\nPEStudio Analysis Points:\n━━━━━━━━━━━━━━━━━━━━━━━━━\nFile Header:       Compilation timestamp, target architecture (x86\u002Fx64)\nOptional Header:   Entry point address, image base, subsystem (GUI\u002Fconsole)\nSection Table:     Section names, virtual\u002Fraw sizes, entropy values\n                   High entropy (>7.0) in .text\u002F.rsrc suggests packing\nSignatures:        Authenticode signature presence and validity\n```\n\n**Scripted PE Header Analysis with pefile:**\n```python\nimport pefile\nimport hashlib\nimport math\n\npe = pefile.PE(\"suspect.exe\")\n\n# Compilation timestamp\nimport datetime\ntimestamp = pe.FILE_HEADER.TimeDateStamp\ncompile_time = datetime.datetime.utcfromtimestamp(timestamp)\nprint(f\"Compile Time: {compile_time} UTC\")\n\n# Section analysis with entropy calculation\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00')\n    entropy = section.get_entropy()\n    raw_size = section.SizeOfRawData\n    virtual_size = section.Misc_VirtualSize\n    ratio = virtual_size \u002F raw_size if raw_size > 0 else 0\n    print(f\"Section: {name:8s} Entropy: {entropy:.2f} Raw: {raw_size:>10} Virtual: {virtual_size:>10} Ratio: {ratio:.2f}\")\n    if entropy > 7.0:\n        print(f\"  [!] HIGH ENTROPY - likely packed or encrypted\")\n    if ratio > 10:\n        print(f\"  [!] HIGH V\u002FR RATIO - unpacking stub likely present\")\n```\n\n### Step 3: Analyze Import Address Table (IAT)\n\nIdentify suspicious API imports that indicate malware capabilities:\n\n```python\n# Extract and categorize imports\nsuspicious_imports = {\n    \"Process Injection\": [\"VirtualAllocEx\", \"WriteProcessMemory\", \"CreateRemoteThread\", \"NtCreateThreadEx\"],\n    \"Keylogging\": [\"GetAsyncKeyState\", \"SetWindowsHookExA\", \"GetKeyState\"],\n    \"Persistence\": [\"RegSetValueExA\", \"CreateServiceA\", \"SchTasksCreate\"],\n    \"Evasion\": [\"IsDebuggerPresent\", \"CheckRemoteDebuggerPresent\", \"NtQueryInformationProcess\"],\n    \"Network\": [\"InternetOpenA\", \"HttpSendRequestA\", \"URLDownloadToFileA\", \"WSAStartup\"],\n    \"File Operations\": [\"CreateFileA\", \"WriteFile\", \"DeleteFileA\", \"MoveFileA\"],\n    \"Crypto\": [\"CryptEncrypt\", \"CryptDecrypt\", \"CryptAcquireContextA\"],\n}\n\nfor entry in pe.DIRECTORY_ENTRY_IMPORT:\n    dll_name = entry.dll.decode()\n    for imp in entry.imports:\n        if imp.name:\n            func_name = imp.name.decode()\n            for category, funcs in suspicious_imports.items():\n                if func_name in funcs:\n                    print(f\"[!] {category}: {dll_name} -> {func_name}\")\n```\n\n### Step 4: Extract and Analyze Strings\n\nUse FLOSS for obfuscated strings and standard strings extraction:\n\n```bash\n# Standard strings extraction (ASCII and Unicode)\nstrings -a suspect.exe > strings_ascii.txt\nstrings -el suspect.exe > strings_unicode.txt\n\n# FLOSS for decoded\u002Fdeobfuscated strings\nfloss suspect.exe --output-json floss_output.json\n\n# Search for network indicators in strings\ngrep -iE \"(http|https|ftp):\u002F\u002F\" strings_ascii.txt\ngrep -iE \"([0-9]{1,3}\\.){3}[0-9]{1,3}\" strings_ascii.txt\ngrep -iE \"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\" strings_ascii.txt\n\n# Search for registry keys\ngrep -i \"HKLM\\\\|HKCU\\\\|SOFTWARE\\\\|CurrentVersion\\\\Run\" strings_ascii.txt\n\n# Search for file paths and extensions\ngrep -iE \"\\.(exe|dll|bat|ps1|vbs|tmp)\" strings_ascii.txt\n```\n\n### Step 5: Inspect Resources and Embedded Data\n\nExamine the PE resource section for embedded payloads or configuration:\n\n```python\n# Extract resources from PE file\nif hasattr(pe, 'DIRECTORY_ENTRY_RESOURCE'):\n    for resource_type in pe.DIRECTORY_ENTRY_RESOURCE.entries:\n        if hasattr(resource_type, 'directory'):\n            for resource_id in resource_type.directory.entries:\n                if hasattr(resource_id, 'directory'):\n                    for resource_lang in resource_id.directory.entries:\n                        data = pe.get_data(resource_lang.data.struct.OffsetToData,\n                                          resource_lang.data.struct.Size)\n                        entropy = calculate_entropy(data)\n                        print(f\"Resource Type: {resource_type.id} Size: {len(data)} Entropy: {entropy:.2f}\")\n                        if entropy > 7.0:\n                            print(f\"  [!] High entropy resource - possible embedded payload\")\n                        # Check for PE signature in resource (embedded executable)\n                        if data[:2] == b'MZ':\n                            print(f\"  [!] Embedded PE detected in resource\")\n                            with open(f\"extracted_resource_{resource_type.id}.bin\", \"wb\") as f:\n                                f.write(data)\n```\n\n### Step 6: Check for Packing and Protection\n\nDetermine if the binary is packed or protected:\n\n```bash\n# Detect packer with Detect It Easy (DIE)\ndiec suspect.exe\n\n# Check with PEiD signatures (command-line version)\npython3 -c \"\nimport pefile\npe = pefile.PE('suspect.exe')\n# Check for common packer section names\npacker_sections = {'.upx0': 'UPX', '.aspack': 'ASPack', '.adata': 'ASPack',\n                   '.nsp0': 'NsPack', '.vmprotect': 'VMProtect', '.themida': 'Themida'}\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00').lower()\n    if name in packer_sections:\n        print(f'[!] Packer detected: {packer_sections[name]} (section: {name})')\n\n# Check import table size (very few imports suggest packing)\nimport_count = sum(len(entry.imports) for entry in pe.DIRECTORY_ENTRY_IMPORT)\nif import_count \u003C 10:\n    print(f'[!] Only {import_count} imports - likely packed')\n\"\n```\n\n### Step 7: Generate Static Analysis Report\n\nCompile all findings into a structured triage report:\n\n```\nDocument the following for each analyzed sample:\n- File identification (hashes, file type, size, compile timestamp)\n- Packing\u002Fprotection status and identified packer\n- Suspicious imports categorized by capability\n- Network indicators extracted from strings (IPs, domains, URLs)\n- Embedded resources and their characteristics\n- Overall threat assessment and recommended next steps (sandbox execution, YARA rule creation)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **PE (Portable Executable)** | The file format for Windows executables (.exe, .dll, .sys) containing headers, sections, imports, and resources that define how the OS loads the binary |\n| **Import Address Table (IAT)** | PE structure listing external DLL functions the executable calls at runtime; reveals program capabilities and intent |\n| **Section Entropy** | Statistical measure of randomness in a PE section; values above 7.0 (out of 8.0) indicate compression, encryption, or packing |\n| **FLOSS** | FireEye Labs Obfuscated String Solver; automatically extracts and decodes obfuscated strings that standard `strings` misses |\n| **Packing** | Compression or encryption of a PE file's code section to hinder static analysis; requires runtime unpacking stub to execute |\n| **PE Resources** | Data section within a PE file that can contain icons, dialogs, version info, or attacker-embedded payloads and configuration data |\n| **Compilation Timestamp** | Timestamp in the PE header indicating when the binary was compiled; can be forged but often reveals development timeline |\n\n## Tools & Systems\n\n- **PEStudio**: Free Windows tool for static analysis of PE files providing indicators, imports, strings, and resource inspection in a single interface\n- **pefile (Python)**: Python library for parsing and analyzing PE file structures programmatically for automated analysis pipelines\n- **FLOSS**: FireEye tool that extracts obfuscated strings from malware using static analysis techniques including stack string decoding\n- **Detect It Easy (DIE)**: Packer and compiler detection tool that identifies protectors, compilers, and linkers used to build PE files\n- **CFF Explorer**: Advanced PE editor and viewer for detailed inspection of PE headers, sections, imports, and resource directories\n\n## Common Scenarios\n\n### Scenario: Triaging a Suspicious Email Attachment\n\n**Context**: SOC receives an alert on a suspicious executable attached to a phishing email. The file needs rapid triage to determine if it is malicious before committing sandbox resources.\n\n**Approach**:\n1. Compute SHA-256 hash and query VirusTotal for existing detections and community comments\n2. Open in PEStudio and check the indicators tab for red\u002Fyellow flagged items\n3. Verify compile timestamp (future dates or dates from 1970 indicate timestamp manipulation)\n4. Check imports for VirtualAllocEx, CreateRemoteThread (injection), URLDownloadToFileA (downloader)\n5. Extract strings and search for C2 URLs, IP addresses, and file paths\n6. Check resources for embedded PE files or high-entropy data blobs\n7. Assess packing status; if packed, note the packer and plan for unpacking before deeper analysis\n\n**Pitfalls**:\n- Trusting the PE compile timestamp without corroborating evidence (timestamps are trivially forged)\n- Concluding a file is benign because it has few suspicious imports (packed malware hides real imports)\n- Missing Unicode strings by only running ASCII string extraction\n- Not checking overlay data appended after the last PE section (common hiding spot for configuration data)\n\n## Output Format\n\n```\nSTATIC MALWARE ANALYSIS REPORT\n=================================\nSample:           suspect.exe\nMD5:              d41d8cd98f00b204e9800998ecf8427e\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nFile Size:        245,760 bytes\nFile Type:        PE32 executable (GUI) Intel 80386\nCompile Time:     2025-09-14 08:23:15 UTC\n\nPACKING STATUS\nPacker Detected:  None (native binary)\nSection Entropy:  .text=6.42 .rdata=4.89 .data=3.21 .rsrc=7.81\nNote:             .rsrc section entropy elevated - check resources\n\nSUSPICIOUS IMPORTS\n[INJECTION]       kernel32.dll -> VirtualAllocEx\n[INJECTION]       kernel32.dll -> WriteProcessMemory\n[INJECTION]       kernel32.dll -> CreateRemoteThread\n[EVASION]         kernel32.dll -> IsDebuggerPresent\n[NETWORK]         wininet.dll  -> InternetOpenA\n[NETWORK]         wininet.dll  -> HttpSendRequestA\n[PERSISTENCE]     advapi32.dll -> RegSetValueExA\n\nEXTRACTED INDICATORS\nURLs:             hxxps:\u002F\u002Fupdate.malicious[.]com\u002Fgate.php\nIPs:              185.220.101[.]42, 91.215.85[.]17\nRegistry Keys:    HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\svchost\nFile Paths:       C:\\Users\\Public\\svchost.exe\n\nEMBEDDED RESOURCES\nResource 101:     Size=98304 Entropy=7.89 [!] Embedded PE detected\nResource 102:     Size=4096  Entropy=2.14 (configuration XML)\n\nASSESSMENT\nThreat Level:     HIGH\nClassification:   Dropper with process injection capabilities\nRecommended:      Execute in sandbox, extract embedded PE for separate analysis\n```\n",{},"main","19a54ac988e9929160334271f5c1924ddd9b227e","_modules\u002Fperforming-static-malware-analysis-with-pe-studio",19,"https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill","https:\u002F\u002Fgithub.com\u002Falicewe1","写一些自己用得上的工具，能自动化就绝不手动 · 自动化 \u002F 工程效率 \u002F Agent 技能生态 · 保持好奇，持续构建","2026-09-30 00:41:20",{"source":7,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add alicewe1\u002Falice_skill --skill performing-static-malware-analysis-with-pe-studio",{"tool":38,"command":39},"bunx","bunx skills add alicewe1\u002Falice_skill --skill performing-static-malware-analysis-with-pe-studio",{"tool":41,"command":42},"pnpm","pnpm dlx skills add alicewe1\u002Falice_skill --skill performing-static-malware-analysis-with-pe-studio","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Fperforming-static-malware-analysis-with-pe-studio\u002FSKILL.md",true,[46,50,56],{"path":47,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fapi-reference.md","REFERENCE","参考文档",2176,"https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Fperforming-static-malware-analysis-with-pe-studio\u002Freferences\u002Fapi-reference.md",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"scripts\u002Fagent.py","SCRIPT","脚本",7978,"https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Fperforming-static-malware-analysis-with-pe-studio\u002Fscripts\u002Fagent.py",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7DBMD9P6R27SWQCW5HYVWG0","alice","Alice 六类技能总路由。用户输入 Alice 或要求查看 Alice 技能菜单时，严格输出固定菜单；输入攻\u002F防模式、六类入口或直接描述任务时，按类别→领域→模块渐进路由。","GPL-3.0","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Faliceskill\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7DBM8X5M7YXPYBVFMWF8HRC","alice-reverse","逆向分析渐进路由（二进制 \u002F 移动端 \u002F 协议 \u002F 取证 \u002F 保护机制 \u002F 运行时观测）。触发词：二进制\u002F移动端\u002F反编译\u002FFrida\u002FIDA\u002FGhidra\u002FPE\u002FELF\u002FAPK\u002F协议\u002F取证；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-reverse\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7DBM630E2YKQP29194TT7HC","alice-pentest","web安全渐进路由（Web \u002F API \u002F 资产发现 \u002F 漏洞验证 \u002F 云与网络安全）。触发词：Web\u002FAPI\u002F资产发现\u002F端口\u002F漏洞验证\u002F云与网络安全；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-pentest\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7DBM20M2VDYV5D3MYDGBTQX","alice-game","游戏攻防渐进路由（游戏客户端 \u002F 内存 \u002F 图形 \u002F 反作弊 \u002F 安全研究）。触发词：游戏客户端\u002F内存\u002F图形\u002F偏移\u002F反作弊\u002F模拟器\u002F覆盖层；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-game\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7DBKXVEKB8931MZG23VACFN","alice-crack","卡密授权渐进路由（卡密 \u002F 激活 \u002F 授权验证 \u002F 许可证管理 \u002F 本地授权分析）。触发词：卡密\u002F激活\u002F授权验证\u002Flicense\u002F机器码\u002F试用状态；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-crack\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7DBKTMT90MGV2WP8K73TMQD","alice-assist","技能指令渐进路由（技能路由 \u002F 评分 \u002F 吸收 \u002F 迁移 \u002F 自动化 \u002F 文档与平台集成）。触发词：技能创建\u002F吸收\u002F评分\u002F迁移\u002F自动化\u002F文档\u002F平台指令；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-assist\u002FSKILL.md",[],[]]