Похожие чаты

Why after resezing the stack it doesnt work anymore? #include <cstdio> #pragma

comment(lib, "Ws2_32.lib")
#pragma warning(disable : 4996)

_declspec(noinline) int old_main() {
char name[32];
printf("Reading name from file...\n");
FILE* f = fopen("name.dat", "rb");
if (!f)
return -1;
fseek(f, 0L, SEEK_END);
long bytes = ftell(f);
fseek(f, 0L, SEEK_SET);
int pos = 0;
while (pos < bytes) {
int len = bytes - pos > 200 ? 200 : bytes - pos;
fread(name + pos, 1, len, f);
pos += len;
}
name[bytes] = '\0';
fclose(f);
printf("Hi, %s!\n", name);
return 0;
}

2 ответов

5 просмотров

where is the main?

for answering it you should see stack contents, I explained you how to do it with msvc..

Похожие вопросы

Обсуждают сегодня

Карта сайта