Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
9abd5530
Commit
9abd5530
authored
23 years ago
by
Andreas Mohr
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make snoop code take ordinal base into account.
parent
9650c2ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/snoop.h
+1
-1
1 addition, 1 deletion
include/snoop.h
loader/elf.c
+1
-1
1 addition, 1 deletion
loader/elf.c
loader/pe_image.c
+5
-5
5 additions, 5 deletions
loader/pe_image.c
relay32/snoop.c
+6
-4
6 additions, 4 deletions
relay32/snoop.c
with
13 additions
and
11 deletions
include/snoop.h
+
1
−
1
View file @
9abd5530
...
...
@@ -6,7 +6,7 @@
#include
"module.h"
extern
void
SNOOP_RegisterDLL
(
HMODULE
,
LPCSTR
,
DWORD
);
extern
void
SNOOP_RegisterDLL
(
HMODULE
,
LPCSTR
,
DWORD
,
DWORD
);
extern
FARPROC
SNOOP_GetProcAddress
(
HMODULE
,
LPCSTR
,
DWORD
,
FARPROC
);
extern
void
SNOOP16_RegisterDLL
(
NE_MODULE
*
,
LPCSTR
);
extern
FARPROC16
SNOOP16_GetProcAddress16
(
HMODULE16
,
DWORD
,
FARPROC16
);
...
...
This diff is collapsed.
Click to expand it.
loader/elf.c
+
1
−
1
View file @
9abd5530
...
...
@@ -162,7 +162,7 @@ WINE_MODREF *ELF_LoadLibraryExA( LPCSTR libname, DWORD flags)
hmod
=
ELF_CreateDummyModule
(
t
,
modname
);
SNOOP_RegisterDLL
(
hmod
,
libname
,
STUBSIZE
/
sizeof
(
ELF_STDCALL_STUB
));
SNOOP_RegisterDLL
(
hmod
,
libname
,
0
,
STUBSIZE
/
sizeof
(
ELF_STDCALL_STUB
));
wm
=
PE_CreateModule
(
hmod
,
libname
,
0
,
0
,
FALSE
);
wm
->
find_export
=
ELF_FindExportedFunction
;
...
...
This diff is collapsed.
Click to expand it.
loader/pe_image.c
+
5
−
5
View file @
9abd5530
...
...
@@ -115,13 +115,13 @@ void dump_exports( HMODULE hModule )
}
}
/* Look up the specified function or ordinal in the exportlist:
/* Look up the specified function or ordinal in the export
list:
* If it is a string:
* - look up the name in the
N
ame list.
* - look up the name in the
n
ame list.
* - look up the ordinal with that index.
* - use the ordinal as offset into the functionlist
* If it is a ordinal:
* - use ordinal-pe_export->Base as offset into the functionlist
* If it is a
n
ordinal:
* - use ordinal-pe_export->Base as offset into the function
list
*/
static
FARPROC
PE_FindExportedFunction
(
WINE_MODREF
*
wm
,
/* [in] WINE modreference */
...
...
@@ -656,7 +656,7 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, LPCSTR filename, DWORD flags,
}
if
(
pe_export
)
SNOOP_RegisterDLL
(
hModule
,
wm
->
modname
,
pe_export
->
NumberOfFunctions
);
SNOOP_RegisterDLL
(
hModule
,
wm
->
modname
,
pe_export
->
Base
,
pe_export
->
NumberOfFunctions
);
/* Send DLL load event */
/* we don't need to send a dll event for the main exe */
...
...
This diff is collapsed.
Click to expand it.
relay32/snoop.c
+
6
−
4
View file @
9abd5530
...
...
@@ -59,6 +59,7 @@ typedef struct tagSNOOP_DLL {
HMODULE
hmod
;
SNOOP_FUN
*
funs
;
LPCSTR
name
;
DWORD
ordbase
;
DWORD
nrofordinals
;
struct
tagSNOOP_DLL
*
next
;
}
SNOOP_DLL
;
...
...
@@ -126,7 +127,7 @@ int SNOOP_ShowDebugmsgSnoop(const char *dll, int ord, const char *fname) {
}
void
SNOOP_RegisterDLL
(
HMODULE
hmod
,
LPCSTR
name
,
DWORD
nrofordinals
)
{
SNOOP_RegisterDLL
(
HMODULE
hmod
,
LPCSTR
name
,
DWORD
ordbase
,
DWORD
nrofordinals
)
{
SNOOP_DLL
**
dll
=
&
(
firstdll
);
char
*
s
;
...
...
@@ -139,6 +140,7 @@ SNOOP_RegisterDLL(HMODULE hmod,LPCSTR name,DWORD nrofordinals) {
*
dll
=
(
SNOOP_DLL
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
SNOOP_DLL
));
(
*
dll
)
->
next
=
NULL
;
(
*
dll
)
->
hmod
=
hmod
;
(
*
dll
)
->
ordbase
=
ordbase
;
(
*
dll
)
->
nrofordinals
=
nrofordinals
;
(
*
dll
)
->
name
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
name
);
if
((
s
=
strrchr
((
*
dll
)
->
name
,
'.'
)))
...
...
@@ -322,7 +324,7 @@ void WINAPI SNOOP_DoEntry( CONTEXT86 *context )
context
->
Eip
=
(
DWORD
)
fun
->
origfun
;
DPRINTF
(
"%08lx:CALL %s.%ld: %s("
,
GetCurrentThreadId
(),
dll
->
name
,
ordinal
,
fun
->
name
);
DPRINTF
(
"%08lx:CALL %s.%ld: %s("
,
GetCurrentThreadId
(),
dll
->
name
,
dll
->
ordbase
+
ordinal
,
fun
->
name
);
if
(
fun
->
nrofargs
>
0
)
{
max
=
fun
->
nrofargs
;
if
(
max
>
16
)
max
=
16
;
for
(
i
=
0
;
i
<
max
;
i
++
)
...
...
@@ -355,7 +357,7 @@ void WINAPI SNOOP_DoReturn( CONTEXT86 *context )
DPRINTF
(
"%08lx:RET %s.%ld: %s("
,
GetCurrentThreadId
(),
ret
->
dll
->
name
,
ret
->
ordinal
,
ret
->
dll
->
funs
[
ret
->
ordinal
].
name
);
ret
->
dll
->
name
,
ret
->
dll
->
ordbase
+
ret
->
ordinal
,
ret
->
dll
->
funs
[
ret
->
ordinal
].
name
);
max
=
ret
->
dll
->
funs
[
ret
->
ordinal
].
nrofargs
;
if
(
max
>
16
)
max
=
16
;
...
...
@@ -368,7 +370,7 @@ void WINAPI SNOOP_DoReturn( CONTEXT86 *context )
}
else
DPRINTF
(
"%08lx:RET %s.%ld: %s() retval = %08lx ret=%08lx tid=%08lx
\n
"
,
GetCurrentThreadId
(),
ret
->
dll
->
name
,
ret
->
ordinal
,
ret
->
dll
->
funs
[
ret
->
ordinal
].
name
,
ret
->
dll
->
name
,
ret
->
dll
->
ordbase
+
ret
->
ordinal
,
ret
->
dll
->
funs
[
ret
->
ordinal
].
name
,
context
->
Eax
,
(
DWORD
)
ret
->
origreturn
,
GetCurrentThreadId
());
ret
->
origreturn
=
NULL
;
/* mark as empty */
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment