2020-05-06 00:40:04 +02:00
|
|
|
// -------------------------------------------------------------
|
|
|
|
// KWINE is a fork of program PELoad written by 0CodErr
|
|
|
|
// author of fork - rgimad
|
|
|
|
//-------------------------------------------------------------
|
|
|
|
#include "stddef.h"
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include "msvcrt.dll.h"
|
|
|
|
|
2020-05-08 00:14:53 +02:00
|
|
|
#include "string.h"
|
|
|
|
#include "conio.h"
|
|
|
|
#include "stdio.h"
|
|
|
|
#include "stdlib.h"
|
|
|
|
#include "time.h"
|
|
|
|
|
2020-05-06 00:40:04 +02:00
|
|
|
#include "string.c"
|
|
|
|
#include "conio.c"
|
|
|
|
#include "stdio.c"
|
|
|
|
#include "stdlib.c"
|
2020-05-07 00:35:48 +02:00
|
|
|
#include "time.c"
|
|
|
|
|
2020-05-08 00:14:53 +02:00
|
|
|
// note: by default all function in c are cdecl :D
|
2020-05-06 00:40:04 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
void *f;
|
|
|
|
} export_t;
|
|
|
|
|
|
|
|
// conio
|
|
|
|
const char sz__getch[] = "_getch";
|
|
|
|
const char sz__kbhit[] = "_kbhit";
|
|
|
|
|
|
|
|
// stdio
|
|
|
|
const char sz_printf[] = "printf";
|
|
|
|
const char sz_puts[] = "puts";
|
|
|
|
const char sz_gets[] = "gets";
|
2020-05-08 00:14:53 +02:00
|
|
|
const char sz_putchar[] = "putchar";
|
2020-05-06 00:40:04 +02:00
|
|
|
|
|
|
|
//string
|
|
|
|
const char sz_strlen[] = "strlen";
|
|
|
|
const char sz_strcmp[] = "strcmp";
|
|
|
|
const char sz_strcat[] = "strcat";
|
2020-05-08 00:14:53 +02:00
|
|
|
const char sz_strchr[] = "strchr";
|
|
|
|
const char sz_strrchr[] = "strrchr";
|
|
|
|
const char sz_strcpy[] = "strcpy";
|
|
|
|
const char sz_strncpy[] = "strncpy";
|
|
|
|
const char sz_memset[] = "memset";
|
|
|
|
const char sz_memcpy[] = "memcpy";
|
|
|
|
const char sz_memcmp[] = "memcmp";
|
2020-05-06 00:40:04 +02:00
|
|
|
|
|
|
|
// stdlib
|
2020-05-08 00:14:53 +02:00
|
|
|
const char sz_srand[] = "srand";
|
|
|
|
const char sz_rand[] = "rand";
|
2020-05-06 00:40:04 +02:00
|
|
|
const char sz_malloc[] = "malloc";
|
|
|
|
const char sz_free[] = "free";
|
|
|
|
const char sz_realloc[] = "realloc";
|
|
|
|
//const char sz_[] = "";
|
|
|
|
|
2020-05-07 00:35:48 +02:00
|
|
|
// time
|
|
|
|
const char sz_time[] = "time";
|
2020-05-08 00:14:53 +02:00
|
|
|
const char sz_mktime[] = "mktime";
|
|
|
|
const char sz_localtime[] = "localtime";
|
|
|
|
const char sz_difftime[] = "difftime";
|
2020-05-07 00:35:48 +02:00
|
|
|
|
2020-05-06 00:40:04 +02:00
|
|
|
|
|
|
|
//uint32_t EXPORTS[] __asm__("EXPORTS") =
|
|
|
|
export_t EXPORTS[] =
|
|
|
|
{
|
|
|
|
{sz__getch, (void*)_getch},
|
|
|
|
{sz__kbhit, (void*)_kbhit},
|
|
|
|
|
|
|
|
{sz_printf, (void*)printf},
|
|
|
|
{sz_puts, (void*)puts},
|
|
|
|
{sz_gets, (void*)gets},
|
2020-05-08 00:14:53 +02:00
|
|
|
{sz_putchar, (void*)putchar},
|
2020-05-06 00:40:04 +02:00
|
|
|
|
|
|
|
{sz_strlen, (void*)strlen},
|
|
|
|
{sz_strcmp, (void*)strcmp},
|
|
|
|
{sz_strcat, (void*)strcat},
|
2020-05-08 00:14:53 +02:00
|
|
|
{sz_strchr, (void*)strchr},
|
|
|
|
{sz_strrchr, (void*)strrchr},
|
|
|
|
{sz_strcpy, (void*)strcpy},
|
|
|
|
{sz_strncpy, (void*)strncpy},
|
|
|
|
{sz_memset, (void*)memset},
|
|
|
|
{sz_memcpy, (void*)memcpy},
|
|
|
|
{sz_memcmp, (void*)memcmp},
|
|
|
|
|
|
|
|
{sz_srand, (void*)srand},
|
|
|
|
{sz_rand, (void*)rand},
|
2020-05-06 00:40:04 +02:00
|
|
|
{sz_malloc, (void*)malloc},
|
|
|
|
{sz_free, (void*)free},
|
|
|
|
{sz_realloc, (void*)realloc},
|
2020-05-07 00:35:48 +02:00
|
|
|
|
|
|
|
{sz_time, (void*)time},
|
2020-05-08 00:14:53 +02:00
|
|
|
{sz_mktime, (void*)mktime},
|
|
|
|
{sz_localtime, (void*)localtime},
|
|
|
|
{sz_difftime, (void*)difftime},
|
|
|
|
|
2020-05-07 00:35:48 +02:00
|
|
|
|
2020-05-06 00:40:04 +02:00
|
|
|
{NULL, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int lib_init()
|
|
|
|
{
|
|
|
|
con_init_console_dll();
|
|
|
|
}
|