pbd
1.0.0
PBD เป็นโมดูล Python ในการแยกชิ้นส่วนบัฟเฟอร์โปรโตคอลแบบอนุกรม (https://developers.google.com/protocol-buffers/)
ตัวอย่าง:
> python -m pbd -f examples t est.ser
_ | _ | _ | _ | _ |
_ | _ | _ | _ | _ | _ | _ | _ |
_ | _ | _ | _ | _ | _ | _ |
_ | _ | _ | _ | _ |
_ | _ | _ | _ | _ | _ | _ |
ver 0.9
[+] Paring file test.ser
[+] Proto file saved as . t est.proto
> type test.proto
// Reversed by pbd (https://github.com/rsc-dev/pbd)
// Package not defined
message Person {
required string name = 1 ;
required int32 id = 2 ;
optional string email = 3 ;
}pip install pbdหรือ
python setup.py install import pbd
input_file_name = 'test.protoc'
proto = Pbd ( input_file_name )
proto . disassemble ()
proto . dump ()สำหรับหลาย ๆ ไฟล์ที่มีการนำเข้า:
import os
import pbd
input_dir = 'input \ ' # Input directory with serialized descriptors
output_dir = 'output \ ' # Output direcotry for proto files
input_files = [ f for f in os . listdir ( input_dir ) if os . path . isfile ( os . path . join ( input_dir , f ))]
proto = []
for f in files :
p = Pbd ( f )
p . disassemble ()
proto . append ( p )
for p in proto :
p . find_imports ( proto )
p . dump ( output_dir )ตรวจสอบความช่วยเหลือสำหรับตัวเลือกที่มีอยู่:
python -m pbd -hdisasm ไฟล์เดียว
python -m pbd -f test.serdisasm ไฟล์ทั้งหมดในไดเรกทอรีที่กำหนดและแก้ไขการนำเข้า
python -m pbd -i input_dir -o output_dirรหัสถูกเผยแพร่ภายใต้ใบอนุญาต MIT © Radoslaw '[RSC]' Matusiak