17 lines
No EOL
351 B
C
17 lines
No EOL
351 B
C
#include <stdio.h>
|
|
|
|
int save_img(char *out_path, __uint32_t *target_code){
|
|
// Count instructions
|
|
unsigned int count = 0;
|
|
while(target_code[count]!=0)
|
|
{
|
|
count++;
|
|
}
|
|
|
|
FILE *out_file = fopen(out_path, "wb");
|
|
if(out_file == NULL) return -1;
|
|
|
|
fwrite(target_code, sizeof(__uint32_t), count, out_file);
|
|
return 0;
|
|
|
|
} |