結果
| 問題 |
No.8012 Catch C code
|
| ユーザー |
|
| 提出日時 | 2015-12-03 16:18:04 |
| 言語 | Text (cat 8.3) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 922 bytes |
| コンパイル時間 | 146 ms |
| コンパイル使用メモリ | 5,120 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-09-14 08:27:36 |
| 合計ジャッジ時間 | 594 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
ソースコード
//-Wl,--export-dynamic
#include <stdio.h> //NULL
/// dlfcn.h ///
#ifdef __cplusplus
extern "C"{
#endif
#if defined(WIN32) || (!defined(__GNUC__) && !defined(__clang__))
void* LoadLibraryA(const char *x);
void* GetProcAddress(void *x,const char *y);
int FreeLibrary(void *x);
#elif defined(__APPLE__)
void* dlopen(const char *x,int y);
void* dlsym(void *x,const char *y);
int dlclose(void *x);
#define LoadLibraryA(s) dlopen(s,2)
#define GetProcAddress dlsym
#define FreeLibrary dlclose
#else
void* __libc_dlopen_mode(const char *x,int y);
void* __libc_dlsym(void *x,const char *y);
int __libc_dlclose(void *x);
#define LoadLibraryA(s) __libc_dlopen_mode(s,2)
#define GetProcAddress __libc_dlsym
#define FreeLibrary __libc_dlclose
#endif
#ifdef __cplusplus
}
#endif
typedef void (*Tvoid)();
Tvoid pcatch;
int main(){
void *h=LoadLibraryA(NULL);
pcatch=(Tvoid)GetProcAddress(h,"catch");
pcatch();
}