flat assembler
Message board for the users of flat assembler.

Index > Windows > MS COFF linking fails when rb / db dup (?) is used

Author
Thread Post new topic Reply to topic
x250



Joined: 22 Apr 2019
Posts: 2
x250 22 Apr 2019, 01:29
Hi, guys,
I have come across an issue, and, frankly, run out of ideas how to solve it.
I have a main program and a static library. The main program is an MS COFF fasm file, the library is written in Pelles C.
Now, I'm trying to link the two files. In the fasm code I create a section where I specify the following line:
Code:
section '.extra' data readable writeable
 _infile        db 1001 dup (?)    


Or in lieu of the db keyword I can use rb 1001.
I can create the .obj file out of the fasm code ok. But when I try to link it with the .lib file I get an error:
Code:
MSCOFF.OBJ : fatal error LNK1107: invalid or corrupt file: cannot read at 0x3E9    


Interestingly, 0x3E9 is 1001.

If I delete the " _infile db 1001 dup (?)" line, I get the final .exe file.

Here is the fasm code of the main program:
Code:
include 'fasm/Include/Win32a.inc'

format MS COFF

extrn _ComputeFileHash@12:DWORD

section '.text' code readable executable

 public _main

 _main:
        push _hash
        push 12
        push _message
        call _ComputeFileHash@12
        ret

section '.data' data readable writeable

 _hash dd 0,0,0,0
 _message db 'Coffee time!',0

section '.extra' data readable writeable
 _infile        db 1001 dup (?)    


Here is how I try to link the 2 files:
Code:
c:\Users\user\source\repos\Project\Project>fasm\FASM.EXE MSCOFF.ASM
flat assembler  version 1.73.10  (1048576 kilobytes memory)
3 passes, 331 bytes.

c:\Users\user\source\repos\Project\Project>"c:\Program Files\PellesC\bin\polink.exe" /LIBPATH:"C:\Program Files\PellesC\Lib" /LIBPATH:"C:\Program Files\PellesC\Lib\Win" /VERBOSE /SUBSYSTEM:WINDOWS /ENTRY:"mainCRTStartup" /MACHINE:X86 MSCOFF.OBJ accounting.lib
Loading MSCOFF.OBJ
POLINK: fatal error: Invalid or corrupt object 'MSCOFF.OBJ'.    


Or with the MS linker:

Code:
c:\Users\user\source\repos\Project\Project>"c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe" /LIBPATH:"C:\Program Files\PellesC\Lib" /LIBPATH:"C:\Program Files\PellesC\Lib\Win" /VERBOSE /SUBSYSTEM:WINDOWS /ENTRY:"mainCRTStartup" MSCOFF.OBJ accounting.lib
Microsoft (R) Incremental Linker Version 14.00.24245.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Starting pass 1
module 'MSCOFF.OBJ' unsafe for SAFESEH image.

Searching libraries
    Searching accounting.lib:
      Found _ComputeFileHash@12
        Referenced in MSCOFF.OBJ
        Loaded accounting.lib(accounting.obj)
Processed /DEFAULTLIB:crt
Processed /DEFAULTLIB:kernel32
    Searching C:\Program Files\PellesC\Lib\crt.lib:
      Found _mainCRTStartup
        Loaded crt.lib(_crt0.obj)
      Found ___sin
        Referenced in accounting.lib(accounting.obj)
        Loaded crt.lib(_sin.obj)
      Found _pow
        Referenced in accounting.lib(accounting.obj)
        Loaded crt.lib(pow.obj)
      Found _floor
        Referenced in accounting.lib(accounting.obj)
        Loaded crt.lib(floor.obj)
      Found _fabs
        Referenced in accounting.lib(accounting.obj)
        Loaded crt.lib(fabs.obj)
      Found _malloc
        Referenced in accounting.lib(accounting.obj)
        Loaded crt.lib(malloc.obj)
      Found _free
        Referenced in accounting.lib(accounting.obj)
        Referenced in crt.lib(malloc.obj)
        Loaded crt.lib(free.obj)
      Found ___ftoll
        Referenced in accounting.lib(accounting.obj)
        Referenced in crt.lib(_sin.obj)
        Referenced in crt.lib(pow.obj)
        Loaded crt.lib(_ftoll.obj)
      Found __fltused
        Referenced in accounting.lib(accounting.obj)
        Loaded crt.lib(msfpjunk.obj)
      Found __except_handler3
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(seh2.obj)
      Found __except_list
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(seh1.obj)
      Found ___xt_z
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(_initex.obj)
      Found ___crtheapsize
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(_crt0dat.obj)
      Found ___setenvp
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(_setenvp.obj)
      Found ___setargv
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(_setargv.obj)
      Found ___clockinit
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(clock.obj)
      Found ___xcptfilter
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(_xcptfilter.obj)
      Found ___crt_abort
        Referenced in crt.lib(_crt0.obj)
        Referenced in crt.lib(_setenvp.obj)
        Referenced in crt.lib(_setargv.obj)
        Loaded crt.lib(_crtabort.obj)
      Found ___bheapinit
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(_bigheap.obj)
      Found ___features
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(features.obj)
      Found ___ioinit
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(_ioinit.obj)
      Found __set_crt_heap_size
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(_heapsz.obj)
      Found _exit
        Referenced in crt.lib(_crt0.obj)
        Loaded crt.lib(exit.obj)
      Found ___rteps
        Referenced in crt.lib(_sin.obj)
        Loaded crt.lib(_values.obj)
      Found ___fptest
        Referenced in crt.lib(_sin.obj)
        Referenced in crt.lib(fabs.obj)
        Loaded crt.lib(_fptest.obj)
      Found ___feraise
        Referenced in crt.lib(_sin.obj)
        Referenced in crt.lib(pow.obj)
        Loaded crt.lib(_feraise.obj)
      Found __matherr
        Referenced in crt.lib(_sin.obj)
        Referenced in crt.lib(pow.obj)
        Loaded crt.lib(_matherr.obj)
      Found _fmod
        Referenced in crt.lib(_sin.obj)
        Loaded crt.lib(fmod.obj)
      Found ___fpunscale
        Referenced in crt.lib(pow.obj)
        Referenced in crt.lib(fmod.obj)
        Loaded crt.lib(_fpunscale.obj)
      Found ___fpint
        Referenced in crt.lib(pow.obj)
        Referenced in crt.lib(floor.obj)
        Loaded crt.lib(_fpint.obj)
      Found ___exp
        Referenced in crt.lib(pow.obj)
        Loaded crt.lib(_exp.obj)
      Found ___log
        Referenced in crt.lib(pow.obj)
        Loaded crt.lib(_log.obj)
      Found ___getmem
        Referenced in crt.lib(malloc.obj)
        Loaded crt.lib(_getmem.obj)
      Found _errno
        Referenced in crt.lib(malloc.obj)
        Referenced in crt.lib(free.obj)
        Referenced in crt.lib(_feraise.obj)
        Loaded crt.lib(errno.obj)
      Found ___llmul
        Referenced in crt.lib(clock.obj)
        Loaded crt.lib(_llmul.obj)
      Found ___lldiv
        Referenced in crt.lib(clock.obj)
        Loaded crt.lib(_lldiv.obj)
      Found ___llmod
        Referenced in crt.lib(clock.obj)
        Loaded crt.lib(_llmod.obj)
      Found _signal
        Referenced in crt.lib(_xcptfilter.obj)
        Loaded crt.lib(signal.obj)
      Found ___stderr
        Referenced in crt.lib(_crtabort.obj)
        Loaded crt.lib(_files.obj)
      Found _fputs
        Referenced in crt.lib(_crtabort.obj)
        Loaded crt.lib(fputs.obj)
      Found __Exit
        Referenced in crt.lib(_crtabort.obj)
        Referenced in crt.lib(exit.obj)
        Loaded crt.lib(_exit.obj)
      Found _memcpy
        Referenced in crt.lib(_bigheap.obj)
        Loaded crt.lib(memcpy.obj)
      Found ___ioimport
        Referenced in crt.lib(_ioinit.obj)
        Loaded crt.lib(_ioxfer.obj)
      Found ___set_default_crt_heap_size
        Referenced in crt.lib(_heapsz.obj)
        Loaded crt.lib(_dflheap.obj)
      Found _feraiseexcept
        Referenced in crt.lib(_feraise.obj)
        Loaded crt.lib(feraiseexcept.obj)
      Found ___fpscale
        Referenced in crt.lib(fmod.obj)
        Referenced in crt.lib(_exp.obj)
        Loaded crt.lib(_fpscale.obj)
      Found ___fpnorm
        Referenced in crt.lib(_fpunscale.obj)
        Referenced in crt.lib(_fpscale.obj)
        Loaded crt.lib(_fpnorm.obj)
      Found ___unbuf_stream
        Referenced in crt.lib(fputs.obj)
        Loaded crt.lib(_stbuf.obj)
      Found _fputc
        Referenced in crt.lib(fputs.obj)
        Loaded crt.lib(fputc.obj)
      Found _calloc
        Referenced in crt.lib(_ioxfer.obj)
        Loaded crt.lib(calloc.obj)
      Found ___fflush
        Referenced in crt.lib(_stbuf.obj)
        Referenced in crt.lib(fputc.obj)
        Loaded crt.lib(_fflush.obj)
      Found __isatty
        Referenced in crt.lib(_stbuf.obj)
        Loaded crt.lib(isatty.obj)
      Found ___fwrite
        Referenced in crt.lib(fputc.obj)
        Loaded crt.lib(_fwrite.obj)
      Found _memset
        Referenced in crt.lib(calloc.obj)
        Loaded crt.lib(memset.obj)
      Found __write
        Referenced in crt.lib(_fflush.obj)
        Loaded crt.lib(write.obj)
      Found ___init_closeall
        Referenced in crt.lib(_fwrite.obj)
        Loaded crt.lib(fclose.obj)
      Found ___ansicp
        Referenced in crt.lib(write.obj)
        Loaded crt.lib(_state.obj)
      Found ___cp_to_cp
        Referenced in crt.lib(write.obj)
        Loaded crt.lib(_cp2cp.obj)
      Found ___maposerr
        Referenced in crt.lib(write.obj)
        Loaded crt.lib(_maperr.obj)
      Found ___is_console_osfhnd
        Referenced in crt.lib(write.obj)
        Loaded crt.lib(_osfinfo.obj)
      Found __lseek64
        Referenced in crt.lib(write.obj)
        Loaded crt.lib(lseek64.obj)
      Found __Atexit
        Referenced in crt.lib(fclose.obj)
        Loaded crt.lib(_atexit.obj)
      Found __close
        Referenced in crt.lib(fclose.obj)
        Loaded crt.lib(close.obj)
      Found _remove
        Referenced in crt.lib(fclose.obj)
        Loaded crt.lib(remove.obj)
      Found _abort
        Referenced in crt.lib(_atexit.obj)
        Loaded crt.lib(abort.obj)
      Found __unlink
        Referenced in crt.lib(remove.obj)
        Loaded crt.lib(unlink.obj)
      Found _raise
        Referenced in crt.lib(abort.obj)
        Loaded crt.lib(raise.obj)
    Searching C:\Program Files\PellesC\Lib\Win\kernel32.lib:
      Found _RtlUnwind@16
        Referenced in crt.lib(seh1.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__FreeEnvironmentStringsA@4
        Referenced in crt.lib(_setenvp.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetEnvironmentStrings@0
        Referenced in crt.lib(_setenvp.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetModuleFileNameA@12
        Referenced in crt.lib(_setargv.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetCommandLineA@0
        Referenced in crt.lib(_setargv.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__QueryPerformanceFrequency@4
        Referenced in crt.lib(clock.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__QueryPerformanceCounter@4
        Referenced in crt.lib(clock.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__UnhandledExceptionFilter@4
        Referenced in crt.lib(_xcptfilter.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__OutputDebugStringA@4
        Referenced in crt.lib(_crtabort.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__IsDebuggerPresent@0
        Referenced in crt.lib(_crtabort.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__HeapValidate@12
        Referenced in crt.lib(_bigheap.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__HeapSize@12
        Referenced in crt.lib(_bigheap.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__HeapFree@12
        Referenced in crt.lib(_bigheap.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__HeapReAlloc@16
        Referenced in crt.lib(_bigheap.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__HeapAlloc@12
        Referenced in crt.lib(_bigheap.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__HeapDestroy@4
        Referenced in crt.lib(_bigheap.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__HeapCreate@12
        Referenced in crt.lib(_bigheap.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetStartupInfoW@4
        Referenced in crt.lib(_ioinit.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetCurrentProcess@0
        Referenced in crt.lib(_ioinit.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__DuplicateHandle@28
        Referenced in crt.lib(_ioinit.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetFileType@4
        Referenced in crt.lib(_ioinit.obj)
        Referenced in crt.lib(_ioxfer.obj)
        Referenced in crt.lib(_osfinfo.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetStdHandle@4
        Referenced in crt.lib(_ioinit.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__VirtualQuery@12
        Referenced in crt.lib(_getmem.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__VirtualAlloc@16
        Referenced in crt.lib(_getmem.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__SetConsoleCtrlHandler@8
        Referenced in crt.lib(signal.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__ExitProcess@4
        Referenced in crt.lib(_exit.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__WriteConsoleW@20
        Referenced in crt.lib(write.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetConsoleOutputCP@0
        Referenced in crt.lib(write.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__WideCharToMultiByte@32
        Referenced in crt.lib(write.obj)
        Referenced in crt.lib(_cp2cp.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetLastError@0
        Referenced in crt.lib(unlink.obj)
        Referenced in crt.lib(write.obj)
        Referenced in crt.lib(_osfinfo.obj)
        Referenced in crt.lib(lseek64.obj)
        Referenced in crt.lib(close.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__WriteFile@20
        Referenced in crt.lib(write.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__MultiByteToWideChar@24
        Referenced in crt.lib(_cp2cp.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__GetConsoleMode@8
        Referenced in crt.lib(_osfinfo.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__SetStdHandle@8
        Referenced in crt.lib(_osfinfo.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__SetFilePointerEx@20
        Referenced in crt.lib(lseek64.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__CloseHandle@4
        Referenced in crt.lib(close.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __imp__DeleteFileA@4
        Referenced in crt.lib(unlink.obj)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __IMPORT_DESCRIPTOR_KERNEL32
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Referenced in kernel32.lib(KERNEL32.dll)
        Loaded kernel32.lib(KERNEL32.dll)
      Found __NULL_IMPORT_DESCRIPTOR
        Referenced in kernel32.lib(KERNEL32.dll)
        Loaded kernel32.lib(KERNEL32.dll)
      Found KERNEL32_NULL_THUNK_DATA
        Referenced in kernel32.lib(KERNEL32.dll)
        Loaded kernel32.lib(KERNEL32.dll)

Finished searching libraries

Finished pass 1

Generating non-SAFESEH image.
    Discarded ___lcid
    Discarded ___wenvp
    Discarded ___wargv
    Discarded __fltused
    Discarded _FreeEnvironmentStringsA@4 from kernel32.lib(KERNEL32.dll)
    Discarded _GetEnvironmentStrings@0 from kernel32.lib(KERNEL32.dll)
    Discarded _GetModuleFileNameA@12 from kernel32.lib(KERNEL32.dll)
    Discarded _GetCommandLineA@0 from kernel32.lib(KERNEL32.dll)
    Discarded _QueryPerformanceFrequency@4 from kernel32.lib(KERNEL32.dll)
    Discarded _QueryPerformanceCounter@4 from kernel32.lib(KERNEL32.dll)
    Discarded _UnhandledExceptionFilter@4 from kernel32.lib(KERNEL32.dll)
    Discarded _OutputDebugStringA@4 from kernel32.lib(KERNEL32.dll)
    Discarded _IsDebuggerPresent@0 from kernel32.lib(KERNEL32.dll)
    Discarded _HeapValidate@12 from kernel32.lib(KERNEL32.dll)
    Discarded _HeapSize@12 from kernel32.lib(KERNEL32.dll)
    Discarded _HeapFree@12 from kernel32.lib(KERNEL32.dll)
    Discarded _HeapReAlloc@16 from kernel32.lib(KERNEL32.dll)
    Discarded _HeapAlloc@12 from kernel32.lib(KERNEL32.dll)
    Discarded _HeapDestroy@4 from kernel32.lib(KERNEL32.dll)
    Discarded _HeapCreate@12 from kernel32.lib(KERNEL32.dll)
    Discarded _GetStartupInfoW@4 from kernel32.lib(KERNEL32.dll)
    Discarded _GetCurrentProcess@0 from kernel32.lib(KERNEL32.dll)
    Discarded _DuplicateHandle@28 from kernel32.lib(KERNEL32.dll)
    Discarded _GetFileType@4 from kernel32.lib(KERNEL32.dll)
    Discarded _GetStdHandle@4 from kernel32.lib(KERNEL32.dll)
    Discarded _VirtualQuery@12 from kernel32.lib(KERNEL32.dll)
    Discarded _VirtualAlloc@16 from kernel32.lib(KERNEL32.dll)
    Discarded _SetConsoleCtrlHandler@8 from kernel32.lib(KERNEL32.dll)
    Discarded _ExitProcess@4 from kernel32.lib(KERNEL32.dll)
    Discarded _WriteConsoleW@20 from kernel32.lib(KERNEL32.dll)
    Discarded _GetConsoleOutputCP@0 from kernel32.lib(KERNEL32.dll)
    Discarded _WideCharToMultiByte@32 from kernel32.lib(KERNEL32.dll)
    Discarded _GetLastError@0 from kernel32.lib(KERNEL32.dll)
    Discarded _WriteFile@20 from kernel32.lib(KERNEL32.dll)
    Discarded _MultiByteToWideChar@24 from kernel32.lib(KERNEL32.dll)
    Discarded _GetConsoleMode@8 from kernel32.lib(KERNEL32.dll)
    Discarded _SetStdHandle@8 from kernel32.lib(KERNEL32.dll)
    Discarded _SetFilePointerEx@20 from kernel32.lib(KERNEL32.dll)
    Discarded _CloseHandle@4 from kernel32.lib(KERNEL32.dll)
    Discarded _DeleteFileA@4 from kernel32.lib(KERNEL32.dll)
Starting pass 2
     MSCOFF.OBJ
MSCOFF.OBJ : fatal error LNK1107: invalid or corrupt file: cannot read at 0x3E9    


As soon as I delete that last line, linking succeeds:

Code:
c:\Users\user\source\repos\Project\Project>"c:\Program Files\PellesC\bin\polink.exe" /LIBPATH:"C:\Program Files\PellesC\Lib" /LIBPATH:"C:\Program Files\PellesC\Lib\Win" /VERBOSE /SUBSYSTEM:WINDOWS /ENTRY:"mainCRTStartup" /MACHINE:X86 MSCOFF.OBJ accounting.lib
Loading MSCOFF.OBJ
Searching .\accounting.lib
    Found _ComputeFileHash@12
        accounting.lib(accounting.obj)
Processed /Defaultlib:crt.lib
Processed /Defaultlib:kernel32.lib
Searching C:\Program Files\PellesC\Lib\crt.lib
    Found _pow
        crt.lib(pow.obj)
    Found ___sin
        crt.lib(_sin.obj)
    Found _fabs
        crt.lib(fabs.obj)
    Found _floor
        crt.lib(floor.obj)
    Found ___ftoll
        crt.lib(_ftoll.obj)
    Found _malloc
        crt.lib(malloc.obj)
    Found _free
        crt.lib(free.obj)
    Found __fltused
        crt.lib(msfpjunk.obj)
    Found ___fpunscale
        crt.lib(_fpunscale.obj)
    Found ___fpint
        crt.lib(_fpint.obj)
    Found ___inf
        crt.lib(_values.obj)
    Found __matherr
        crt.lib(_matherr.obj)
    Found ___feraise
        crt.lib(_feraise.obj)
    Found ___log
        crt.lib(_log.obj)
    Found ___exp
        crt.lib(_exp.obj)
    Found ___fptest
        crt.lib(_fptest.obj)
    Found _fmod
        crt.lib(fmod.obj)
    Found ___getmem
        crt.lib(_getmem.obj)
    Found ___bheap_threshold
        crt.lib(_crt0dat.obj)
    Found ___bheap_alloc
        crt.lib(_bigheap.obj)
    Found _errno
        crt.lib(errno.obj)
    Found ___fpnorm
        crt.lib(_fpnorm.obj)
    Found _feraiseexcept
        crt.lib(feraiseexcept.obj)
    Found ___fpscale
        crt.lib(_fpscale.obj)
    Found _memcpy
        crt.lib(memcpy.obj)
    Found ___feature_mask
        crt.lib(features.obj)
Searching C:\Program Files\PellesC\Lib\Win\kernel32.lib
    Found __imp__VirtualAlloc@16
        kernel32.lib(KERNEL32.dll)
    Found __imp__VirtualQuery@12
        kernel32.lib(KERNEL32.dll)
    Found __imp__HeapCreate@12
        kernel32.lib(KERNEL32.dll)
    Found __imp__HeapDestroy@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__HeapAlloc@12
        kernel32.lib(KERNEL32.dll)
    Found __imp__HeapReAlloc@16
        kernel32.lib(KERNEL32.dll)
    Found __imp__HeapFree@12
        kernel32.lib(KERNEL32.dll)
    Found __imp__HeapSize@12
        kernel32.lib(KERNEL32.dll)
    Found __imp__HeapValidate@12
        kernel32.lib(KERNEL32.dll)
    Found __IMPORT_DESCRIPTOR_KERNEL32
        kernel32.lib(KERNEL32.dll)
    Found __NULL_IMPORT_DESCRIPTOR
        kernel32.lib(KERNEL32.dll)
    Found KERNEL32_NULL_THUNK_DATA
        kernel32.lib(KERNEL32.dll)
Searching .\accounting.lib
Searching C:\Program Files\PellesC\Lib\crt.lib
Searching C:\Program Files\PellesC\Lib\Win\kernel32.lib
Searching .\accounting.lib
Searching C:\Program Files\PellesC\Lib\crt.lib
    Found _mainCRTStartup
        crt.lib(_crt0.obj)
    Found __except_handler3
        crt.lib(seh2.obj)
    Found __except_list
        crt.lib(seh1.obj)
    Found __set_crt_heap_size
        crt.lib(_heapsz.obj)
    Found ___clockinit
        crt.lib(clock.obj)
    Found ___ioinit
        crt.lib(_ioinit.obj)
    Found ___setargv
        crt.lib(_setargv.obj)
    Found ___setenvp
        crt.lib(_setenvp.obj)
    Found ___xi_a
        crt.lib(_initex.obj)
    Found ___crt_abort
        crt.lib(_crtabort.obj)
    Found _exit
        crt.lib(exit.obj)
    Found ___xcptfilter
        crt.lib(_xcptfilter.obj)
    Found ___set_default_crt_heap_size
        crt.lib(_dflheap.obj)
    Found ___lldiv
        crt.lib(_lldiv.obj)
    Found ___llmul
        crt.lib(_llmul.obj)
    Found ___llmod
        crt.lib(_llmod.obj)
    Found ___ioimport
        crt.lib(_ioxfer.obj)
    Found ___stderr
        crt.lib(_files.obj)
    Found _fputs
        crt.lib(fputs.obj)
    Found __Exit
        crt.lib(_exit.obj)
    Found _signal
        crt.lib(signal.obj)
    Found _calloc
        crt.lib(calloc.obj)
    Found _fputc
        crt.lib(fputc.obj)
    Found ___buf_stream
        crt.lib(_stbuf.obj)
    Found _memset
        crt.lib(memset.obj)
    Found ___fwrite
        crt.lib(_fwrite.obj)
    Found ___fflush
        crt.lib(_fflush.obj)
    Found __isatty
        crt.lib(isatty.obj)
    Found ___init_closeall
        crt.lib(fclose.obj)
    Found __write
        crt.lib(write.obj)
    Found __Atexit
        crt.lib(_atexit.obj)
    Found __close
        crt.lib(close.obj)
    Found _remove
        crt.lib(remove.obj)
    Found ___is_console_osfhnd
        crt.lib(_osfinfo.obj)
    Found ___ansicp
        crt.lib(_state.obj)
    Found ___cp_to_cp
        crt.lib(_cp2cp.obj)
    Found __lseek64
        crt.lib(lseek64.obj)
    Found ___maposerr
        crt.lib(_maperr.obj)
    Found _abort
        crt.lib(abort.obj)
    Found __unlink
        crt.lib(unlink.obj)
    Found _raise
        crt.lib(raise.obj)
Searching C:\Program Files\PellesC\Lib\Win\kernel32.lib
    Found _RtlUnwind@16
        kernel32.lib(KERNEL32.dll)
    Found __imp__QueryPerformanceFrequency@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__QueryPerformanceCounter@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetStartupInfoW@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetStdHandle@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetFileType@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetCurrentProcess@0
        kernel32.lib(KERNEL32.dll)
    Found __imp__DuplicateHandle@28
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetCommandLineA@0
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetModuleFileNameA@12
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetEnvironmentStrings@0
        kernel32.lib(KERNEL32.dll)
    Found __imp__FreeEnvironmentStringsA@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__IsDebuggerPresent@0
        kernel32.lib(KERNEL32.dll)
    Found __imp__OutputDebugStringA@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__UnhandledExceptionFilter@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__ExitProcess@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__SetConsoleCtrlHandler@8
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetConsoleOutputCP@0
        kernel32.lib(KERNEL32.dll)
    Found __imp__WriteFile@20
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetLastError@0
        kernel32.lib(KERNEL32.dll)
    Found __imp__WriteConsoleW@20
        kernel32.lib(KERNEL32.dll)
    Found __imp__WideCharToMultiByte@32
        kernel32.lib(KERNEL32.dll)
    Found __imp__CloseHandle@4
        kernel32.lib(KERNEL32.dll)
    Found __imp__SetStdHandle@8
        kernel32.lib(KERNEL32.dll)
    Found __imp__GetConsoleMode@8
        kernel32.lib(KERNEL32.dll)
    Found __imp__MultiByteToWideChar@24
        kernel32.lib(KERNEL32.dll)
    Found __imp__SetFilePointerEx@20
        kernel32.lib(KERNEL32.dll)
    Found __imp__DeleteFileA@4
        kernel32.lib(KERNEL32.dll)
Searching .\accounting.lib
Searching C:\Program Files\PellesC\Lib\crt.lib
Searching C:\Program Files\PellesC\Lib\Win\kernel32.lib
Discarded _VirtualAlloc@16 from kernel32.lib(KERNEL32.dll)
Discarded _VirtualQuery@12 from kernel32.lib(KERNEL32.dll)
Discarded _HeapCreate@12 from kernel32.lib(KERNEL32.dll)
Discarded _HeapDestroy@4 from kernel32.lib(KERNEL32.dll)
Discarded _HeapAlloc@12 from kernel32.lib(KERNEL32.dll)
Discarded _HeapReAlloc@16 from kernel32.lib(KERNEL32.dll)
Discarded _HeapFree@12 from kernel32.lib(KERNEL32.dll)
Discarded _HeapSize@12 from kernel32.lib(KERNEL32.dll)
Discarded _HeapValidate@12 from kernel32.lib(KERNEL32.dll)
Discarded _QueryPerformanceFrequency@4 from kernel32.lib(KERNEL32.dll)
Discarded _QueryPerformanceCounter@4 from kernel32.lib(KERNEL32.dll)
Discarded _GetStartupInfoW@4 from kernel32.lib(KERNEL32.dll)
Discarded _GetStdHandle@4 from kernel32.lib(KERNEL32.dll)
Discarded _GetFileType@4 from kernel32.lib(KERNEL32.dll)
Discarded _GetCurrentProcess@0 from kernel32.lib(KERNEL32.dll)
Discarded _DuplicateHandle@28 from kernel32.lib(KERNEL32.dll)
Discarded _GetCommandLineA@0 from kernel32.lib(KERNEL32.dll)
Discarded _GetModuleFileNameA@12 from kernel32.lib(KERNEL32.dll)
Discarded _GetEnvironmentStrings@0 from kernel32.lib(KERNEL32.dll)
Discarded _FreeEnvironmentStringsA@4 from kernel32.lib(KERNEL32.dll)
Discarded _IsDebuggerPresent@0 from kernel32.lib(KERNEL32.dll)
Discarded _OutputDebugStringA@4 from kernel32.lib(KERNEL32.dll)
Discarded _UnhandledExceptionFilter@4 from kernel32.lib(KERNEL32.dll)
Discarded _ExitProcess@4 from kernel32.lib(KERNEL32.dll)
Discarded _SetConsoleCtrlHandler@8 from kernel32.lib(KERNEL32.dll)
Discarded _GetConsoleOutputCP@0 from kernel32.lib(KERNEL32.dll)
Discarded _WriteFile@20 from kernel32.lib(KERNEL32.dll)
Discarded _GetLastError@0 from kernel32.lib(KERNEL32.dll)
Discarded _WriteConsoleW@20 from kernel32.lib(KERNEL32.dll)
Discarded _WideCharToMultiByte@32 from kernel32.lib(KERNEL32.dll)
Discarded _CloseHandle@4 from kernel32.lib(KERNEL32.dll)
Discarded _SetStdHandle@8 from kernel32.lib(KERNEL32.dll)
Discarded _GetConsoleMode@8 from kernel32.lib(KERNEL32.dll)
Discarded _MultiByteToWideChar@24 from kernel32.lib(KERNEL32.dll)
Discarded _SetFilePointerEx@20 from kernel32.lib(KERNEL32.dll)
Discarded _DeleteFileA@4 from kernel32.lib(KERNEL32.dll)
Discarded .data from crt.lib(memcpy.obj)
Discarded .data from crt.lib(memset.obj)
Discarded ___mbcurmax from crt.lib(_state.obj)
Discarded .extra from MSCOFF.OBJ
Discarded .bss from crt.lib(msfpjunk.obj)
Discarded .bss from crt.lib(_crt0dat.obj)
Discarded .bss from crt.lib(errno.obj)
Discarded .bss from crt.lib(_ioinit.obj)
Discarded .bss from crt.lib(exit.obj)
Discarded .bss from crt.lib(_state.obj)
Discarded ___wargv from <common>
Discarded ___wenvp from <common>
Discarded ___lcid from <common>
Discarded size: 488 bytes
Creating executable: MSCOFF.exe    


Any idea why it fails?

Edit by revolution: Added code tags
Post 22 Apr 2019, 01:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 22 Apr 2019, 02:11
Does it link if you change the line to this?
Code:
 _infile        db 1001 dup (0)    
Post 22 Apr 2019, 02:11
View user's profile Send private message Visit poster's website Reply with quote
x250



Joined: 22 Apr 2019
Posts: 2
x250 22 Apr 2019, 02:40
revolution wrote:
Does it link if you change the line to this?
Code:
 _infile        db 1001 dup (0)    

It does.
It would be a workaround but the size of the file will inflate in this case as the raw size of the section won't be 0 anymore.
Post 22 Apr 2019, 02:40
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 22 Apr 2019, 03:36
Some OSes get upset when the BSS section is missing. Perhaps adding an empty section at the end could help.
Code:
;dummy section for bss, see http://board.flatassembler.net/topic.php?t=3689
segment writeable    
Probably won't help, but something that is easy to try.
Post 22 Apr 2019, 03:36
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.