#include <Windows.h>
#include <stdio.h>
int count = 0;
FILE* pFile = 0;
long Size = 0;
void *memfrob(void * s, size_t n)
{
char *p = (char *) s;
while (n-- > 0)
*p++ ^= 42;
return s;
}
int main()
{
fopen_s(&pFile, "***", "r+");
fseek(pFile, 0, SEEK_END);
Size = ftell(pFile);
char *buffer = (char*)malloc(Size);
memset(buffer, 0, Size);
fread(buffer, Size, 1, pFile);
fclose(pFile);
memfrob(buffer, Size);
fopen_s(&pFile, "***", "w+");
fwrite(buffer, Size, 1, pFile);
fclose(pFile);
}
Run Code Online (Sandbox Code Playgroud)
嗨,fread没有读取从文件到缓冲区的任何内容,我无法弄清楚原因.有人能给我一个暗示或推动正确的方向吗?
我收到以下错误:
1>c:\documents and settings\krzys\desktop\desktop icons\ollydbg\plugins\odbgscript\OllyLangCommands.cpp(3602): error C2593: 'operator =' is ambiguous
1> c:\documents and settings\krzys\desktop\desktop icons\ollydbg\plugins\odbgscript\var.h(45): could be 'var &var::operator =(const long double &)'
1> c:\documents and settings\krzys\desktop\desktop icons\ollydbg\plugins\odbgscript\var.h(42): or 'var &var::operator =(const int &)'
1> c:\documents and settings\krzys\desktop\desktop icons\ollydbg\plugins\odbgscript\var.h(41): or 'var &var::operator =(const ulong &)'
1> while trying to match the argument list '(var, std::streamsize)'
Run Code Online (Sandbox Code Playgroud)
在这段代码:
map<string, var> variables;
streamsize sum = 0;
if (sum) {
variables["$RESULT"] = sum; // Error 1
return true;
}
Run Code Online (Sandbox Code Playgroud)
和
class var
{ …Run Code Online (Sandbox Code Playgroud)