News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

a error

Started by lw, February 04, 2007, 12:23:47 PM

Previous topic - Next topic

lw

....
invoke [_ap_rputs@8], "dddd", [esp + ep.r]
mov eax, -1
ret

mod_tut1_register_hooks:
invoke [_ap_hook_handler@20], addr mod_tut1_method_handler, 0, 0, 20
ret
.....

output:

GoAsm.Exe Version 0.56 beta - Copyright Jeremy Gordon 2001/7 - JG@JGnet.co.uk
Output file: test.obj
GoLink.Exe Version 0.26.7 - Copyright Jeremy Gordon 2002/6-JG@JGnet.co.uk

Error!
The following symbols were not defined in the object file or files:-
_ap_rputs
_ap_hook_handler
Output file not made

jorgon

This doesn't happen for me.
Could you post more of your source?
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

lw

D:\tool>type test.asm
#DYNAMICLINKFILE d:\tool\libhttpd.dll
.code
   invoke [_ap_walk_config@12], 1, 1, 1
   invoke [_ap_xml_parse_input@8], 1, 1
   invoke [ap_allow_methods]
   invoke [ap_allow_standard_methods], 1, 1
   invoke [_ap_vrprintf@12], 1, 1, 1
D:\tool>d:\tool\goasm test.asm

GoAsm.Exe Version 0.56 beta - Copyright Jeremy Gordon 2001/7 - JG@JGnet.co.uk
Output file: test.obj

D:\tool>d:\tool\golink test.obj

GoLink.Exe Version 0.26.7 - Copyright Jeremy Gordon 2002/6-JG@JGnet.co.uk

Error!
The following symbols were not defined in the object file or files:-
ap_walk_config
ap_xml_parse_input
ap_vrprintf
Output file not made

lw

Sorry for my poor english,  a problem:   "_" and  "@"  ?

dumppe libhttpd.dll

....
00014C20  16C   426 _ap_update_vhost_from_headers@4
00014FC0  16D   427 _ap_update_vhost_given_ip@4
00014F40  16E   428 _ap_vhost_iterate_given_conn@12
00011640  16F   429 _ap_vrprintf@12
00002E90  170   430 _ap_walk_config@12
0001B1D0  171   431 _ap_xml_parse_input@8
0000E970  172    13 ap_allow_methods
0000E9B0  173    16 ap_allow_standard_methods
0002AEE0  174    25 ap_bucket_type_eoc
0002AF00  175    26 ap_bucket_type_error
....

1rDirEctoALgran0

At assembly time try "goasm -MS test.asm"
So goasm leaves the decorations "_" and "@" unchanged and GoLink can retrive the original MicroSoft fashion names.
I have not tested it, but it is a possible answer.

Best regards.

Patrick

Vortex

1rDirEctoALgran0,

Go Tools can handle decorated names without any problem.

1rDirEctoALgran0

Forget what I said.
I think that the file "libhttpd.dll" has two dependency files : LIBAPR.DLL and LIBAPRUTIL.DLL.
Have you such files ?
Declare them with #DYNAMICLINKFILE or at link time.

Patrick

lw

#DYNAMICLINKFILE "d:\tool\libhttpd.dll" "d:\tool\libapr-1.dll" "d:\tool\libaprutil-1.dll"
.code
   invoke [_ap_walk_config@12], 1, 1, 1
   invoke [_ap_xml_parse_input@8], 1, 1
   invoke [ap_allow_methods]
   invoke [ap_allow_standard_methods], 1, 1
   invoke [_ap_vrprintf@12], 1, 1, 1

GoAsm.Exe Version 0.55.14e - Copyright Jeremy Gordon 2001/6 - JG@JGnet.co.uk
Output file: test.obj


GoLink.Exe Version 0.26.7 - Copyright Jeremy Gordon 2002/6-JG@JGnet.co.uk

Error!
The following symbols were not defined in the object file or files:-
ap_walk_config
ap_xml_parse_input
ap_vrprintf
Output file not made

lw

#DYNAMICLINKFILE "d:\tool\libhttpd.dll" "d:\tool\libapr-1.dll" "d:\tool\libaprutil-1.dll"
.code
   invoke [_ap_walk_config@12], 1, 1, 1
   invoke [_ap_xml_parse_input@8], 1, 1
   invoke [ap_allow_methods]
   invoke [ap_allow_standard_methods], 1, 1
   invoke [_ap_vrprintf@12], 1, 1, 1

d:\tool\goasm /ms test.asm

GoAsm.Exe Version 0.55.14e - Copyright Jeremy Gordon 2001/6 - JG@JGnet.co.uk
Output file: test.obj

d:\tool\goasm test.obj
GoLink.Exe Version 0.26.7 - Copyright Jeremy Gordon 2002/6-JG@JGnet.co.uk

Error!
The following symbols were not defined in the object file or files:-
_ap_walk_config
_ap_xml_parse_input
_ap_vrprintf
Output file not made

jorgon

lw

Could you just confirm to me whether or not libhttpd.dll is a Win32 executable in PE format (which is what GoAsm works with)?

I downloaded it with a view to looking at the actual names of the APIs using Wayne Radburn's PEView, and found that it appears to be a 16-bit DOS DLL.
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

lw

D:\PROGRA~1\APACHE~1\Apache2.2\bin>dumppe libhttpd.dll 1>1.txt

libhttpd.dll                       (hex)           (dec)

.EXE size (bytes)                    490            1168
Minimum load size (bytes)            450            1104
Overlay number                         0               0
Initial CS:IP                  0000:0000
Initial SS:SP                  0000:00B8             184
Minimum allocation (para)              0               0
Maximum allocation (para)           FFFF           65535
Header size (para)                     4               4
Relocation table offset               40              64
Relocation entries                     0               0

Portable Executable starts at                 e8
Signature                               00004550 (PE)
Machine                                     014C (Intel 386)
Sections                                    0005
Time Date Stamp                         45A476E1 Wed Jan 10 13:17:21 2007
Symbol Table                            00000000
Number of Symbols                       00000000
Optional header size                        00E0
Characteristics                             210E
   Executable Image
   Line numbers stripped
   Local symbols stripped
   32 bit word machine
   DLL
Magic                                       010B
Linker Version                              6.00
Size of Code                            00029000
Size of Initialized Data                0001C000
Size of Uninitialized Data              00000000
Address of Entry Point                  00029ADB
Base of Code                            00001000
Base of Data                            0002A000
Image Base                              6FF00000
Section Alignment                       00001000
File Alignment                          00001000
Operating System Version                    4.00
Image Version                               0.00
Subsystem Version                           4.00
reserved                                00000000
Image Size                              00046000
Header Size                             00001000
Checksum                                00000000
Subsystem                                   0002 (Windows)
DLL Characteristics                         0000
Size Of Stack Reserve                   00100000
Size Of Stack Commit                    00001000
Size Of Heap Reserve                    00100000
Size Of Heap Commit                     00001000
Loader Flags                            00000000
Number of Directories                   00000010

Directory Name                          VirtAddr  VirtSize
--------------------------------------  --------  --------
Export                                  0002DAF0  00003870
Import                                  0002B418  000000B4
Resource                                00041000  000007C8
Exception                               00000000  00000000
Security                                00000000  00000000
Base Relocation                         00042000  00003104
Debug                                   0002A640  0000001C
Decription/Architecture                 00000000  00000000
Machine Value (MIPS GP)                 00000000  00000000
Thread Storage                          00000000  00000000
Load Configuration                      00000000  00000000
Bound Import                            00000000  00000000
Import Address Table                    0002A000  00000638
Delay Import                            00000000  00000000
COM Runtime Descriptor                  00000000  00000000
(reserved)                              00000000  00000000

Section Table
-------------
01  .text      Virtual Address         00001000
      Virtual Size            00028BB0
      Raw Data Offset         00001000
      Raw Data Size           00029000
      Relocation Offset       00000000
      Relocation Count        0000
      Line Number Offset      00000000
      Line Number Count       0000
      Characteristics         60000020
         Code
         Executable
         Readable

02  .rdata     Virtual Address         0002A000
      Virtual Size            00007360
      Raw Data Offset         0002A000
      Raw Data Size           00008000
      Relocation Offset       00000000
      Relocation Count        0000
      Line Number Offset      00000000
      Line Number Count       0000
      Characteristics         40000040
         Initialized Data
         Readable

03  .data      Virtual Address         00032000
      Virtual Size            0000EEA4
      Raw Data Offset         00032000
      Raw Data Size           0000A000
      Relocation Offset       00000000
      Relocation Count        0000
      Line Number Offset      00000000
      Line Number Count       0000
      Characteristics         C0000040
         Initialized Data
         Readable
         Writeable

04  .rsrc      Virtual Address         00041000
      Virtual Size            000007C8
      Raw Data Offset         0003C000
      Raw Data Size           00001000
      Relocation Offset       00000000
      Relocation Count        0000
      Line Number Offset      00000000
      Line Number Count       0000
      Characteristics         40000040
         Initialized Data
         Readable

05  .reloc     Virtual Address         00042000
      Virtual Size            000034DC
      Raw Data Offset         0003D000
      Raw Data Size           00004000
      Relocation Offset       00000000
      Relocation Count        0000
      Line Number Offset      00000000
      Line Number Count       0000
      Characteristics         42000040
         Initialized Data
         Discardable
         Readable


Exp Addr Hint   Ord Export Name by libhttpd.dll - Wed Jan 10 13:17:21 2007
-------- ---- ----- ---------------------------------------------------------
0001A250    0     1 _ap_add_cgi_vars@4
00019DA0    1     2 _ap_add_common_vars@4
000057C0    2     3 _ap_add_file_conf@8

jorgon

lw

It looks like I downloaded the wrong file.

The most likely cause of your problem is that the function you are trying to call is not in the DLLs which you are giving to GoLink.

To test this could you confirm that the functions appear on your PE dumps as exports from the DLL?  Or, if copyright allows maybe you could post the DLLs here, then I can test it myself.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

lw

this file:


[attachment deleted by admin]

jorgon

Thanks, there does seem to be a problem - I'll come back to you.
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

lw

thanks, i like GoAsm


seem to be other problem:
---------------------------------------------
#DYNAMICLINKFILE libapr-1.dll
.code
start:
ret

Error!
Line 1 of assembler source file (D:\tool\test.asm):-
Specify .dll/.ocx/.exe/.drv for dynamic linker file:-
#DYNAMICLINKFILE libapr-1.dll

OBJ file not made
----------------------------------------
but

#DYNAMICLINKFILE 'libapr-1.dll'
.code
start:
ret

output:

GoLink.Exe Version 0.26.7 - Copyright Jeremy Gordon 2002/6-JG@JGnet.co.uk
Output file: D:\tool\test.exe
Format: win32 size: 1,536 bytes