@@ -56,16 +56,16 @@ void mono_doorstop_bootstrap(void *mono_domain) {
5656 free (norm_assembly_dir );
5757
5858 LOG ("Opening assembly: %s" , config .target_assembly );
59- void * file = fopen (config .target_assembly , "r" );
59+ void * file = fopen_custom (config .target_assembly , TSTR ( "r" ) );
6060 if (!file ) {
6161 log_err ("Failed to open assembly: %s" , config .target_assembly );
6262 return ;
6363 }
6464
6565 size_t size = get_file_size (file );
6666 void * data = malloc (size );
67- fread (data , size , 1 , file );
68- fclose (file );
67+ fread_custom (data , size , 1 , file );
68+ fclose_custom (file );
6969
7070 LOG ("Opened Assembly DLL (%d bytes); opening its main image" , size );
7171
@@ -83,7 +83,7 @@ void mono_doorstop_bootstrap(void *mono_domain) {
8383 LOG ("Image opened; loading included assembly" );
8484
8585 s = MONO_IMAGE_OK ;
86- void * assembly = mono .assembly_load_from_full (image , dll_path , & s , FALSE);
86+ mono .assembly_load_from_full (image , dll_path , & s , FALSE);
8787 free (dll_path );
8888 if (s != MONO_IMAGE_OK ) {
8989 log_err ("Failed to load assembly: %s. Got result: %d" ,
@@ -262,7 +262,6 @@ void il2cpp_doorstop_bootstrap() {
262262 char * app_path_n = narrow (app_path );
263263
264264 char_t * target_dir = get_folder_name (config .target_assembly );
265- char * target_dir_n = narrow (target_dir );
266265 char_t * target_name = get_file_name (config .target_assembly , FALSE);
267266 char * target_name_n = narrow (target_name );
268267
@@ -338,7 +337,7 @@ void hook_mono_jit_parse_options(int argc, char **argv) {
338337
339338 const char_t * mono_debug_address = config .mono_debug_address ;
340339 if (!mono_debug_address ) {
341- mono_debug_address = "127.0.0.1:10000" ;
340+ mono_debug_address = TSTR ( "127.0.0.1:10000" ) ;
342341 }
343342 size_t debug_args_len =
344343 STR_LEN (MONO_DEBUG_ARG_START ) + strlen (mono_debug_address );
@@ -398,11 +397,11 @@ void *hook_mono_image_open_from_data_with_name(void *data,
398397 strcat (new_full_path , name_file );
399398
400399 if (file_exists (new_full_path )) {
401- void * file = fopen (new_full_path , "r" );
400+ void * file = fopen_custom (new_full_path , TSTR ( "r" ) );
402401 size_t size = get_file_size (file );
403402 void * buf = malloc (size );
404- fread (buf , 1 , size , file );
405- fclose (file );
403+ fread_custom (buf , 1 , size , file );
404+ fclose_custom (file );
406405 result = mono .image_open_from_data_with_name (buf , size , need_copy ,
407406 status , refonly , name );
408407 if (need_copy )
0 commit comments