-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
48 lines (36 loc) · 1.21 KB
/
Copy pathmain.c
File metadata and controls
48 lines (36 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Main Entry-Point
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "hdd.h"
#include "util.h"
#include "hooks.h"
#include "dog.h"
// Entry Point.
void __attribute__((constructor)) initialize(void){
// Get root path of the ELF to find helper files.
get_root_path();
// Detect current game version to help with SCRIPT redirection.
detect_game_version();
printf("Game Version: %d Detected!\n",game_version);
// Resolve API hooks.
/*
* It's a good idea to do this first with the way things link, most
* functions, well, any that use a function we're hooking will crash
* if they run before this as I don't feel like checking if the
* function pointer is null and reloading before using it.
*/
resolve_hooks();
// Get config.cfg values - WARNING, this has to happen after resolving hooks!
init_config();
// Get HDD ATA Data information from HDD file.
// Note - This HAS to happen after resolving the hooks or shit breaks.
get_ata_data();
// Set up emulated dongle.
// TODO - Make Dongle Path Configurable
char dongle_path[4096] = {0x00};
sprintf(dongle_path,"%s/%s",root_path,dog_filename);
init_microdoge(dongle_path);
}