从循环中的文件中添加并删除字节
我是一名安全研究人员,想知道如何从文件中删除添加的字节。下面的此功能每4个字节添加一个字节。但是我想知道如何也可以删除这些字节。需要一个可以按添加的顺序删除这些字节的函数。
特拉维斯
int AddByte(BYTE* bIn, BYTE* bOut, DWORD dwSize, int inc_every)
{
int increased = 0;
for (int i = 0; i < dwSize; i++)
{
*(bOut + increased) = *(bIn + i);
increased++;
if (i % inc_every == 0)
increased += 1;
}
return increased;
}
I'm a security researcher and am wondering how I could remove the added bytes from a file. This function below adds a byte every 4 bytes. But I'd like to know how I could remove those bytes as well. Need a function that will remove these bytes in the order they were added.
Travis
int AddByte(BYTE* bIn, BYTE* bOut, DWORD dwSize, int inc_every)
{
int increased = 0;
for (int i = 0; i < dwSize; i++)
{
*(bOut + increased) = *(bIn + i);
increased++;
if (i % inc_every == 0)
increased += 1;
}
return increased;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
addByte()
后应用此功能将回馈原始字符串。您的原始功能的偏移为1(它将跳过第二个字节),因此此功能包含相同的偏移Applying this function after
AddByte()
would give back the original string. Your original function has an offset of 1 (it will skip the second byte), so this function includes the same offset