Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TLINK 32bit record encountered HELP

1,981 views
Skip to first unread message

jpon...@srs.loral.com

unread,
Aug 8, 1995, 3:00:00 AM8/8/95
to

Hi All,

I'm getting the following error when I try to build an asm file using
Borland c++ 4.5...

Linker Fatal: 32-bit record encountered in module ...

Any help or suggestions I could'nt find the error in the BCC manuals.
TIA
Joe
jpon...@srs.loral.com

gcli...@ulkyvx.louisville.edu

unread,
Aug 8, 1995, 3:00:00 AM8/8/95
to
In article <4085ad$c...@wdl1.wdl.loral.com>, jpon...@srs.loral.com writes:
>
> Hi All,
>
> I'm getting the following error when I try to build an asm file using
> Borland c++ 4.5...
>
You have probably put your .386 before the .MODEL statement... that or
you have explicitly used the keyword USE32 on some of your segments. Either
of these will cause the assembler to generate 32-bit code. The linker
won't link 32 bit code without the /3 switch. However, I take it you
didn't mean to generate 32 bit code so what you want to do is put the
.MODEL statement before your .386. If you do mean to use 32 bit code
use the /3 switch on the linker and it won't gargle at you.

David

Sebastian Schoenberg

unread,
Aug 9, 1995, 3:00:00 AM8/9/95
to

You have to set the /3 option of TLink.

Sebastian

Robert R. Collins

unread,
Aug 9, 1995, 3:00:00 AM8/9/95
to
In article <4085ad$c...@wdl1.wdl.loral.com>, jpon...@srs.loral.com says...

>
>
>Hi All,
>
>I'm getting the following error when I try to build an asm file using
>Borland c++ 4.5...
>
> Linker Fatal: 32-bit record encountered in module ...
>

As already mentioned, you are probably inadvertantly setting up a USE32
segment. Most linkers won't allow you to mix USE32 and USE16 segments
together, if they have the same name. To get around this, I wrote a
utility, which you can download at the following URL:

http://www.metronet.com/~rcollins/dloads/cvtubit.zip

--
Over 5000 people a day visit my web pages:
http://www.metronet.com/~rcollins
---------------------------------------------------------------------------
Robert R. Collins mailto:rcol...@ti.com 214.997.3923(w) 214.491.7718(h)


hanr...@genrad.co.uk

unread,
Aug 11, 1995, 3:00:00 AM8/11/95
to

Have you tried using TLINK32? I believe it comes with BC++ (at least its on
my hard disk in \bc4\bin). With version 4.02 of BC++, I get the following
version number: TLINK -> 6.10 and TLINK32 -> 1.02.


Regards,
Tony Hanratty

samark...@nospicedham.gmail.com

unread,
Nov 26, 2014, 3:23:19 AM11/26/14
to
Hi All,

i get the same error (fatal: fatal 32-bit record encountered in module)

how can i modify the code from .486 to x86??


The Code :

callW macro x
extrn x:PROC
call x
endm

.486
.model flat

.data

Samar khudruj

unread,
Nov 26, 2014, 3:23:42 AM11/26/14
to
Hello Guys

i get a warning:: reserved word used as symbol :END

And the full code as follows:

;----------------------------------------------------------------
; BMP2enhancedLSB v0.1
; Freeware, Open Source, GPL, Copyleft, whatever you want.
;----------------------------------------------------------------
;
; Steganography visual attack by enhancing the LSBs.
;
; This program asks you to choose a 24-bits uncompressed
; BMP file.

; Assemble it with:
; TASM32 /ml /m3 /z /t BMP2enhancedLSB
; TLINK32 -Tpe -aa BMP2enhancedLSB,,,import32
; Rebuild with LordPE (by yoda) to shrink it to the maximum.

callW macro x
extrn x:PROC
call x
endm

.386
.model flat


.data

;----------------- structures --------------------

openfilename_struct:
lStructSize dd openfilename_struct_size
hwndOwner dd 0
hInstance dd 0
lpstrFilter dd offset filter
lpstrCustomFilter dd 0
nMaxCustFilter dd 0
nFilterIndex dd 0
lpstrFile dd offset namebuffer
nMaxFile dd 255
lpstrFileTitle dd 0
nMaxFileTitle dd 32
lpstrInitialDir dd 0
lpstrTitle dd 0
Flags dd 1000h+4h+200000h
nFileOffset dw 0
nFileExtension dw 0
lpstrDefExt dd 0
lCustData dd 0
lpfnHook dd 0
lpTemplateName dd 0
openfilename_struct_size equ $-offset openfilename_struct

;------------- file/memory stuff --------------------

filter db "Bmp files *.bmp",0,"*.bmp",0,0
namebuffer db 255 dup(0)
result_title db "BMP2LSB", 0
no_bmp db "This file does not have the 24-bits BMP signature",0

file_handle2 dd ?
file_size dd ?
file_handle dd ?
file_mem_buffer dd ?
file_nb_bytes_read dd ?
pixels_data_start dd ?

.code

programme:

;-------- choose a file -------------

push offset openfilename_struct
callW GetOpenFileNameA
test eax, eax
jz end

;-------- open it --------------

push 0
push 80h
push 3
push 0
push 0
push 80000000h+40000000h
push dword ptr [lpstrFile]
callW CreateFileA
inc eax
jz end
dec eax
mov file_handle, eax

;---------- get its size ---------

push 0
push dword ptr file_handle
callW GetFileSize
inc eax
jz close_file
dec eax
mov file_size, eax

;--------- alloc memory for file --------

mov eax, file_size
add eax, 1024
push eax
push 40h
callW LocalAlloc
test eax, eax
jz close_file
mov file_mem_buffer, eax

;------- read entire file ------------

push 0
push offset file_nb_bytes_read
push file_size
push file_mem_buffer
push file_handle
callW ReadFile
test eax, eax
jz free_memory
mov eax, file_nb_bytes_read
cmp eax, file_size
jnz free_memory

;-------- find BMP signature ---------

mov esi, file_mem_buffer
lodsw
cmp ax, "MB"
jne trouble

;------- find number of bits per pixel ------

add esi, 8
lodsd
add eax, file_mem_buffer
mov pixels_data_start, eax
add esi, 14
lodsw
cmp ax, 24
je this_looks_like_a_bmp

;-------- not 24-bits BMP -----------

trouble:
push 0
push offset result_title
push offset no_bmp
push 0
callW MessageBoxA
jmp free_memory

;------ Enhance LSBs -----------

this_looks_like_a_bmp:

mov eax, pixels_data_start
sub eax, file_mem_buffer
mov ecx, file_size
sub ecx, eax

mov esi, pixels_data_start
mov edi, esi

change_all:
lodsb ;get byte
and al, 1 ;eliminate everything except LSB
jz no_fill ;if 0, do nothing
mov al, 0ffh ;if 1, replace by 255
no_fill:
stosb ;put the byte back
loop change_all

;------- add _LSB to the name ----------------

mov esi, offset namebuffer
mov ecx, 255

find_extension:
mov al, [esi+ecx]
cmp al, "."
je modify_name
loop find_extension

modify_name:
mov eax, "BSL_"
mov [esi+ecx], eax
mov eax, "pmb."
mov [esi+ecx+4], eax

;------- open a new file on the disk ----------------

push 0
push 80h
push 2
push 0
push 0
push 40000000h
push offset namebuffer
call CreateFileA
mov file_handle2, eax

;------- write buffer in it ----------------

push 0
push offset file_nb_bytes_read
push file_size
push file_mem_buffer
push file_handle2
callW WriteFile

;------- close it ----------------

push file_handle2
callW CloseHandle
jmp free_memory

;------- close memory ----------------

free_memory:
push file_mem_buffer
callW LocalFree

;-------- close file ----------

close_file:
push dword ptr file_handle
callW CloseHandle

;----------- exit ----------

end:
push -1
callW ExitProcess

end programme

Steve

unread,
Nov 26, 2014, 8:39:41 AM11/26/14
to
Samar khudruj <samark...@nospicedham.gmail.com> writes:

>Hello Guys
>
>i get a warning:: reserved word used as symbol :END
>
>And the full code as follows:

Right. Do a search on "END". And you get the
following lines of code:

>test eax, eax
>jz end

"End" used as a symbol.

>inc eax
>jz end

"End" used as a symbol.

>;----------- exit ----------
>
>end:

"End" used as a symbol.

>end programme

"End" used as a directive, and as such, it is a
reserved word and cannot be used as a symbol.

Change the other "end"s to "end_of_program" (or
whatever) and your error will go away.

HTH,

Steve N.

Frank Kotler

unread,
Nov 26, 2014, 5:26:30 PM11/26/14
to
You don't really show enough code to be sure, but it looks like this is
intended to be 32-bit code - in which case you probably want to be using
TLINK32. If you want 16-bit code... I think ".model flat" indicates
32-bit code. Try maybe ".model small"? In addition, I think it matters
whether the ".486" directive comes before or after the ".model"
directive. Try it after. This isn't going to make code suitable for
32-bit suitable for 16-bit! This is a WAG - I'm old enough to remember
the Borland toolset, but I never used it much. Hasn't been updated this
millennium, you know. (but should still work)

Best,
Frank

0 new messages