惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CERT Recently Published Vulnerability Notes
K
Kaspersky official blog
S
Schneier on Security
Latest news
Latest news
Cisco Talos Blog
Cisco Talos Blog
T
Threatpost
T
Tor Project blog
T
Tenable Blog
The Register - Security
The Register - Security
T
Threat Research - Cisco Blogs
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
H
Help Net Security
博客园_首页
I
Intezer
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
Project Zero
Project Zero
Recorded Future
Recorded Future
C
Cybersecurity and Infrastructure Security Agency CISA
Vercel News
Vercel News
A
Arctic Wolf
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Know Your Adversary
Know Your Adversary
P
Privacy & Cybersecurity Law Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Proofpoint News Feed
P
Privacy International News Feed
G
GRAHAM CLULEY
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
Simon Willison's Weblog
Simon Willison's Weblog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
C
Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog

十二的编程笔记

26 年新年前 vibe coding 感慨 - 随便写写 社区驱动型流量的转化效能与质量特征分析 - AI - 计算机科学 ClawdBot 祛魅 2 小时安装 + 实际体验 还需再练练 - AI - 计算机科学 golang 标准库源码解析 - runtime2 GMP - Lib - GO - 计算机科学 BCTF2025-AI - BCTF2025 - CTF - 计算机科学 BCTF2025-MISC-01~08 - BCTF2025 - CTF - 计算机科学 golang 标准库源码解析 - channel - Lib - GO - 计算机科学 golang 标准库源码解析 - Context - Lib - GO - 计算机科学 golang 多版本环境控制 - GO - 计算机科学 cloudflare connect 踩坑记录 - Project - 计算机科学 BCTF2024-WEB-01~08 - BCTF2024 - CTF - 计算机科学 Hexo 使用 github Action 进行发布 - Project - 计算机科学 BCTF2024-IOT - BCTF2024 - CTF - 计算机科学 BCTF2024-REVERSE - BCTF2024 - CTF - 计算机科学 分布式事务 - 高可用 - 计算机科学 分布式 CAP 和 BASE 理论 简介 - 高可用 - 计算机科学 搭建使用 Cloudflare Worker 的 Docker 镜像 - Project - 计算机科学 GitHub Copilot 封号及退款过程 - Project - 计算机科学 记录一次 innodb 全表 update - MySQL - Database - 计算机科学
BCTF2024-MISC - BCTF2024 - CTF - 计算机科学
本文作者: Twelveeee @十二的编程笔记 · 2024-10-12 · via 十二的编程笔记
keycode_map = {
    0x04: 'a', 0x05: 'b', 0x06: 'c', 0x07: 'd', 0x08: 'e',
    0x09: 'f', 0x0A: 'g', 0x0B: 'h', 0x0C: 'i', 0x0D: 'j',
    0x0E: 'k', 0x0F: 'l', 0x10: 'm', 0x11: 'n', 0x12: 'o',
    0x13: 'p', 0x14: 'q', 0x15: 'r', 0x16: 's', 0x17: 't',
    0x18: 'u', 0x19: 'v', 0x1A: 'w', 0x1B: 'x', 0x1C: 'y',
    0x1D: 'z', 0x1E: '1', 0x1F: '2', 0x20: '3', 0x21: '4',
    0x22: '5', 0x23: '6', 0x24: '7', 0x25: '8', 0x26: '9',
    0x27: '0', 0x28: 'Enter', 0x29: 'Esc', 0x2A: 'Backspace', 0x2B: 'Tab',
    0x2C: 'Space', 0x2D: '-', 0x2E: '=', 0x2F: '[', 0x30: ']',
    0x31: '\\', 0x32: '#', 0x33: ';', 0x34: '\'', 0x35: '`',
    0x36: ',', 0x37: '.', 0x38: '/', 0x39: 'CapsLock'
}
shifted_keycode_map = {
    0x04: 'A', 0x05: 'B', 0x06: 'C', 0x07: 'D', 0x08: 'E',
    0x09: 'F', 0x0A: 'G', 0x0B: 'H', 0x0C: 'I', 0x0D: 'J',
    0x0E: 'K', 0x0F: 'L', 0x10: 'M', 0x11: 'N', 0x12: 'O',
    0x13: 'P', 0x14: 'Q', 0x15: 'R', 0x16: 'S', 0x17: 'T',
    0x18: 'U', 0x19: 'V', 0x1A: 'W', 0x1B: 'X', 0x1C: 'Y',
    0x1D: 'Z', 0x1E: '!', 0x1F: '@', 0x20: '#', 0x21: '$',
    0x22: '%', 0x23: '^', 0x24: '&', 0x25: '*', 0x26: '(',
    0x27: ')', 0x2D: '_', 0x2E: '+', 0x2F: '{', 0x30: '}',
    0x31: '|', 0x32: '~', 0x33: ':', 0x34: '"', 0x35: '~',
    0x36: '<', 0x37: '>', 0x38: '?'
}
def parse_hid_report(report):
    
    bytes_data = report.split(':')
    
    modifier = int(bytes_data[0], 16)
    
    key_codes = [int(byte, 16) for byte in bytes_data[2:]]
    
    shift_pressed = (modifier & 0x02) != 0 or (modifier & 0x20) != 0
    
    keys = []
    for code in key_codes:
        if code == 0:
            continue
        if shift_pressed:
            keys.append(shifted_keycode_map.get(code, ''))
        else:
            keys.append(keycode_map.get(code, ''))
    if len(keys) == 0 :
        return ""
    print(''.join(keys) + "\t:"+ report)
    return ''.join(keys)
reports = [
"01:00:00:09:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00",
]
for report in reports:
    parse_hid_report(report)