Skip to content

Instantly share code, notes, and snippets.

@misodengaku
Last active August 29, 2015 14:01
Show Gist options
  • Save misodengaku/bb933051e0fbe59653f5 to your computer and use it in GitHub Desktop.
Save misodengaku/bb933051e0fbe59653f5 to your computer and use it in GitHub Desktop.
every_ip_address.txt generator
#include <stdio.h>
void main()
{
FILE *fp;
int a, b, c, d;
printf("start\n");
fp = fopen("ip.txt", "wb");
for (a = 0; a < 256; a++){
for (b = 0; b < 256; b++){
for (c = 0; c < 256; c++){
for (d = 0; d < 256; d++){
fprintf(fp, "%d.%d.%d.%d", a, b, c, d);
fputc(0x0a, fp); // LF
}
}
}
printf("A: %d\n", a); // 進捗
}
fclose(fp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment