Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FreemudWrapper
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李定达
FreemudWrapper
Commits
28827eb8
Commit
28827eb8
authored
Aug 14, 2017
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.支付宝支付界面调用dll
parent
1b2543ef
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
41 deletions
+55
-41
FreemudWrapper.cpp
+55
-36
FreemudWrapper.suo
+0
-0
freemudwrapper.def
+0
-5
No files found.
FreemudWrapper.cpp
View file @
28827eb8
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
EXTERN_C
IMAGE_DOS_HEADER
__ImageBase
;
EXTERN_C
IMAGE_DOS_HEADER
__ImageBase
;
#define SBKPAYDLL "sbkpay.dll"
#define FMPDLL "fmclient.dll"
#define FMPDLL "fmclient.dll"
//#define FMCRYPT "fmcrypt.dll"
//#define FMCRYPT "fmcrypt.dll"
#define LIBCURL "libcurl.dll"
#define LIBCURL "libcurl.dll"
...
@@ -28,6 +30,7 @@ EXTERN_C IMAGE_DOS_HEADER __ImageBase;
...
@@ -28,6 +30,7 @@ EXTERN_C IMAGE_DOS_HEADER __ImageBase;
void
DoCopyFile
(
const
char
*
dir
);
void
DoCopyFile
(
const
char
*
dir
);
EXTERN_C
typedef
void
(
_stdcall
*
PFN_START
)(
char
*
,
char
*
);
EXTERN_C
typedef
int
(
_stdcall
*
PFN_GETVALUE
)(
char
*
,
char
*
);
EXTERN_C
typedef
int
(
_stdcall
*
PFN_GETVALUE
)(
char
*
,
char
*
);
EXTERN_C
typedef
int
(
_stdcall
*
PFN_RESGETVALUE
)(
char
*
,
char
*
);
EXTERN_C
typedef
int
(
_stdcall
*
PFN_RESGETVALUE
)(
char
*
,
char
*
);
EXTERN_C
typedef
int
(
_stdcall
*
PFN_GETRSACRET
)(
int
,
const
char
*
,
const
char
*
);
EXTERN_C
typedef
int
(
_stdcall
*
PFN_GETRSACRET
)(
int
,
const
char
*
,
const
char
*
);
...
@@ -50,11 +53,12 @@ HMODULE GetInstance()
...
@@ -50,11 +53,12 @@ HMODULE GetInstance()
SetCurrentDirectory
(
mod
);
SetCurrentDirectory
(
mod
);
char
instance
[
MAX_PATH
]
=
{
0
};
char
instance
[
MAX_PATH
]
=
{
0
};
sprintf
(
instance
,
"%s%s"
,
mod
,
FMP
DLL
);
sprintf
(
instance
,
"%s%s"
,
mod
,
SBKPAY
DLL
);
if
(
init_sign
==
0
)
//
if(init_sign == 0)
DoCopyFile
(
mod
);
//
DoCopyFile(mod);
init_sign
=
1
;
//
init_sign = 1;
HMODULE
hMod
=
LoadLibraryA
(
instance
);
HMODULE
hMod
=
LoadLibraryA
(
instance
);
//HMODULE hModw = LoadLibraryW(L"C:\\Users\\dingda.li\\Desktop\\sbkpay\\sbkpay.dll");
printf
(
"Changing current to: %s
\n
"
,
current_dir
);
printf
(
"Changing current to: %s
\n
"
,
current_dir
);
SetCurrentDirectory
(
current_dir
);
SetCurrentDirectory
(
current_dir
);
...
@@ -112,46 +116,60 @@ void DoCopyFile(const char *dir)
...
@@ -112,46 +116,60 @@ void DoCopyFile(const char *dir)
extern
"C"
{
extern
"C"
{
__declspec
(
dllexport
)
int
_stdcall
GetValue
(
char
*
indata
,
char
*
outdata
)
__declspec
(
dllexport
)
void
_stdcall
FreemudPay
(
char
*
indata
,
char
*
outdata
)
{
{
HMODULE
hMod
=
GetInstance
();
HMODULE
hMod
=
GetInstance
();
if
(
hMod
)
{
if
(
hMod
)
{
PFN_
GETVALUE
pfn_GetValue
=
(
PFN_GETVALUE
)
GetProcAddress
(
hMod
,
"_GetValue@8
"
);
PFN_
START
pfn_GetValue
=
(
PFN_START
)
GetProcAddress
(
hMod
,
"Start
"
);
if
(
pfn_GetValue
)
{
if
(
pfn_GetValue
)
{
return
pfn_GetValue
(
indata
,
outdata
);
pfn_GetValue
(
indata
,
outdata
);
return
;
}
}
FreeLibrary
(
hMod
);
FreeLibrary
(
hMod
);
}
}
return
;
return
-
1
;
}
}
__declspec
(
dllexport
)
int
_stdcall
RESGetValue
(
char
*
indata
,
char
*
outdata
)
//__declspec(dllexport) int _stdcall GetValue(char *indata, char *outdata)
{
//{
HMODULE
hMod
=
GetInstance
();
// HMODULE hMod = GetInstance();
if
(
hMod
)
{
// if (hMod) {
PFN_RESGETVALUE
pfn_GetValue
=
(
PFN_RESGETVALUE
)
GetProcAddress
(
hMod
,
"RESGetValue"
);
// PFN_GETVALUE pfn_GetValue = (PFN_GETVALUE)GetProcAddress(hMod, "_GetValue@8");
if
(
pfn_GetValue
)
{
// if (pfn_GetValue) {
return
pfn_GetValue
(
indata
,
outdata
);
// return pfn_GetValue(indata, outdata);
}
// }
FreeLibrary
(
hMod
);
// FreeLibrary(hMod);
}
// }
return
-
1
;
// return -1;
}
//}
__declspec
(
dllexport
)
int
_stdcall
GetRSACret
(
int
partnerId
,
const
char
*
storeID
,
const
char
*
posNo
)
//__declspec(dllexport) int _stdcall RESGetValue(char *indata, char *outdata)
{
//{
HMODULE
hMod
=
GetInstance
();
// HMODULE hMod = GetInstance();
if
(
hMod
)
{
// if (hMod) {
PFN_GETRSACRET
pfn_GetValue
=
(
PFN_GETRSACRET
)
GetProcAddress
(
hMod
,
"_GetRSACret@12"
);
// PFN_RESGETVALUE pfn_GetValue = (PFN_RESGETVALUE)GetProcAddress(hMod, "RESGetValue");
if
(
pfn_GetValue
)
{
// if (pfn_GetValue) {
return
pfn_GetValue
(
partnerId
,
storeID
,
posNo
);
// return pfn_GetValue(indata, outdata);
}
// }
FreeLibrary
(
hMod
);
// FreeLibrary(hMod);
}
// }
return
-
1
;
// return -1;
}
//}
//__declspec(dllexport) int _stdcall GetRSACret(int partnerId,const char *storeID,const char *posNo)
//{
// HMODULE hMod = GetInstance();
// if (hMod) {
// PFN_GETRSACRET pfn_GetValue = (PFN_GETRSACRET)GetProcAddress(hMod, "_GetRSACret@12");
// if (pfn_GetValue) {
// return pfn_GetValue(partnerId, storeID, posNo);
// }
// FreeLibrary(hMod);
// }
// return -1;
//}
};
};
\ No newline at end of file
FreemudWrapper.suo
View file @
28827eb8
No preview for this file type
freemudwrapper.def
View file @
28827eb8
LIBRARY
EXPORTS
RESGetValue
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment