Back home
中文
H7 / SECURITY RESEARCH NOTES

Writing a dll Using a def File

On this page1 sections
  • Two files: one c file and one .def file
  • The contents of main.c are as follows:
#include <windows.h>
#include <stdio.h>

int sub(int a, int b) {
	return a - b;
}

int add(int a, int b) {
	return a + b;
}
  • The contents of main.def are as follows:
LIBRARY dll_with_def
EXPORTS
	add @1
	sub @2
1.https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-def-files?view=msvc-170