找回密码
 注册

QQ登录

只需一步,快速开始

查看: 454|回复: 5

hw_ctree.xml configuration in .bin?

[复制链接]
发表于 2024-11-13 23:45:40 | 显示全部楼层 |阅读模式
can i put hw_ctree.xml in .bin file flasher to make epon at the same time load the configuration?
发表于 2024-11-14 03:11:26 | 显示全部楼层
本人不懂英文;顶贴。
发表于 2024-11-14 03:24:24 | 显示全部楼层
you need to convert file content in hw_ctree.xml to binary data as output.bin

Python:

import struct

# to write in
data_to_write = "file content"  #file content of hw_ctree.xml

# open .bin to write
with open("output.bin", "wb") as bin_file:
# to binary
   binary_data = data_to_write.encode('utf-8')

# to .bin
    bin_file.write(binary_data)

#So do game over
发表于 2024-11-14 03:35:33 | 显示全部楼层
import struct
with open('hw_ctree.xml', 'r') as file:
    content = file.read()

binary_data = content.encode('utf-8')

with open('output.bin', 'wb') as bin_file:
    bin_file.write(binary_data)
 楼主| 发表于 2024-11-14 04:02:26 | 显示全部楼层
zhang260gt 发表于 2024-11-14 03:35
import struct
with open('hw_ctree.xml', 'r') as file:
    content = file.read()

whats this what app
发表于 2024-11-14 09:47:28 | 显示全部楼层
python 转二进制。厉害了
*滑块验证:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|宽带技术网 |网站地图 粤公网安备44152102000001号

GMT+8, 2025-7-12 15:10 , Processed in 0.023064 second(s), 4 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表