summaryrefslogtreecommitdiff
path: root/rbutil/chinachippatcher/chinachip.c
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/chinachippatcher/chinachip.c')
-rw-r--r--rbutil/chinachippatcher/chinachip.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/rbutil/chinachippatcher/chinachip.c b/rbutil/chinachippatcher/chinachip.c
index 7237572fac..dc1d2a40bb 100644
--- a/rbutil/chinachippatcher/chinachip.c
+++ b/rbutil/chinachippatcher/chinachip.c
@@ -260,54 +260,3 @@ err:
260 return -1; 260 return -1;
261} 261}
262 262
263
264#ifdef STANDALONE
265
266#define VERSION "0.1"
267#define PRINT(fmt, ...) fprintf(stderr, fmt"\n", ##__VA_ARGS__)
268
269static void info(void* userdata, char* fmt, ...)
270{
271 (void)userdata;
272 va_list args;
273 va_start(args, fmt);
274 vfprintf(stderr, fmt, args);
275 va_end(args);
276}
277
278static void err(void* userdata, char* fmt, ...)
279{
280 (void)userdata;
281 va_list args;
282 va_start(args, fmt);
283 vfprintf(stderr, fmt, args);
284 va_end(args);
285}
286
287void usage(char* name)
288{
289 PRINT("Usage:");
290 PRINT(" %s <firmware> <bootloader> <firmware_output> [backup]", name);
291 PRINT("\nExample:");
292 PRINT(" %s VX747.HXF bootloader.bin output.HXF ccpmp.bak", name);
293 PRINT(" This will copy ccpmp.bin in VX747.HXF as ccpmp.old and replace it"
294 " with bootloader.bin, the output will get written to output.HXF."
295 " The old ccpmp.bin will get written to ccpmp.bak.");
296}
297
298int main(int argc, char* argv[])
299{
300 PRINT("ChinaChipPatcher v" VERSION " - (C) Maurus Cuelenaere 2009");
301 PRINT("This is free software; see the source for copying conditions. There is NO");
302 PRINT("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
303
304 if(argc < 4)
305 {
306 usage(argv[0]);
307 return 1;
308 }
309
310 return chinachip_patch(argv[1], argv[2], argv[3], argc > 4 ? argv[4] : NULL,
311 &info, &err, NULL);
312}
313#endif