转载exe文件是成功的,但是获取不到函数地址//Crackme0x03.exe
#include <stdio.h>
#include <windows.h>_declspec(dllexport) int Demo()
{
#define PASSWORD_SIZE 100
#define PASSWORD "myGOODpassword\n" int count=0;
char buff[PASSWORD_SIZE]=""; for(;;)
{
printf("Enter password:");
fgets(&buff[0],PASSWORD_SIZE-1,stdin); if(strcmp(&buff[0],PASSWORD))
printf("Wrong password\n");
else
break; if(++count>2) return -1;
}
printf("password ok\n");
return 1;
}void main()
{
HINSTANCE hmod;
int(*zzz)(); hmod=LoadLibrary("Crackme0x03.exe");
if(hmod)
{
zzz=(int(*)())GetProcAddress(hmod,"fnDemo");
if(zzz)
zzz();
}
}
#include <stdio.h>
#include <windows.h>_declspec(dllexport) int Demo()
{
#define PASSWORD_SIZE 100
#define PASSWORD "myGOODpassword\n" int count=0;
char buff[PASSWORD_SIZE]=""; for(;;)
{
printf("Enter password:");
fgets(&buff[0],PASSWORD_SIZE-1,stdin); if(strcmp(&buff[0],PASSWORD))
printf("Wrong password\n");
else
break; if(++count>2) return -1;
}
printf("password ok\n");
return 1;
}void main()
{
HINSTANCE hmod;
int(*zzz)(); hmod=LoadLibrary("Crackme0x03.exe");
if(hmod)
{
zzz=(int(*)())GetProcAddress(hmod,"fnDemo");
if(zzz)
zzz();
}
}
解决方案 »
- 如何在控制台程序中使用CCriticalSection类?
- 编写一个程序,能够阻止其他用户非法“拷贝”,“删除”,“新建”,“阅读”文件或目录。对以上4个操作,操作之前必需输入密码才能进行。
- 定时发送消息问题
- 基于对话框的画图程序在处理大图片时遇到问题!!!
- 关于写一个启动界面遇到的问题
- 紧急求答(在线等待)
- VC工具使用问题 Resource View -〉Resource Includes... Compile-time directives使用来干嘛的?
- 关于接口地址的问题
- 如何将自己写的软件连接到别人的上
- 用VC开发数据库客户端,怎样做出像C++ Builder中数据库的那种表的显示方式?
- 多文档问题
- 怎么样关闭http连接
然后GetProcAddress获得函数地址,直接给函数指针
但是改正之后,仍然获取不了Demo函数的地址阿!typedef int (WINAPI *MYFUNC)();
MYFUNC zzz;
我定义了Demo指针之后
zzz=(MYFUNC)GetProcAddress(hmod,"Demo");
HMODULE hModule,
LPCWSTR lpProcName
);
用autoblue(小城)说的的方法看看....
文件内容如下:
LIBRARY 你的dll文件名
EXPORTS
Demo @1
但是改正之后,仍然获取不了Demo函数的地址阿!typedef int (WINAPI *MYFUNC)();
MYFUNC zzz;
我定义了Demo指针之后
zzz=(MYFUNC)GetProcAddress(hmod,"Demo");你的Crackme0x03.exe有和你定义的指针相应的函数吗?