Thread: Running Exe's
View Single Post
Old 08-15-2006, 10:02 PM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
What do you mean ?? something like this:
Code:
#include <stdio.h>
#define SIZE 16

int main(int argc, char* argv[])
{
  FILE *fp;
  char buff[SIZE];
  int i, n;
  if(argc != 2)
    {
      printf("Usage: %s <filename>\n", argv[0]);
      return -1;
    }
  if(!(fp=fopen(argv[1], "rb")))
    {
      printf("Error opening file: %s\n", argv[1]);
      return -1;
    }
  while(n=fread(buff, 1, SIZE, fp))
    {
      for(i=0; i<n; ++i)
	printf("%X ", buff[i]);
      for(i=0; i<n; ++i)
	printf("%c", buff[i]);
      printf("\n");
    } 
  fclose(fp);
  return 0;
}
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote