News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

uasm ubuntu focal repo package highly wip experiment

Started by KradMoonRa, October 11, 2020, 09:36:38 AM

Previous topic - Next topic

KradMoonRa

I got some time to spend building uasm 2.50 and repackaging for ubuntu packages installs.

This build it install in /usr/bin and has macrolib in separate include files that's going to install in /usr/include/uasm

if your using the HLL

Add to your uasm comandline
-I /usr/include/uasm
Or add to path
sudo export PATH="$PATH:/usr/include/uasm"

Add to you code
include macrolib.inc

The new code it's not documented yet, but it will be in future.

What you will need to install in ubuntu focal:

add sign key
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xc3aa60f8ba7f9354

Create the file sudo nano /etc/apt/sources.list.d/navegos-uasm-2.50-focal.list with the following content:

# Navegos UASM 2.50 repository
#
deb [arch=amd64] https://navegos.github.io/UASM/ubuntu/focal/2.50/ focal main
deb-src [arch=amd64] https://navegos.github.io/UASM/ubuntu/focal/2.50/ focal main


Update ubuntu
sudo apt update && apt dist-upgrade -y

Install uasm
sudo apt install uasm
The uasmlib

mabdelouahab

#1
Installed well on kali linux  :thumbsup:

But the new version does not accept PROTO, and generates the first error

     Error A2169: General Failure
malloc proto :dword

p0  proto  fastcall :qword ; OK
p1 proto  c :qword         ; OK
p2 proto  stdcall :qword   ; OK
p  proto                  ; OK
p4 proto   :qword         ; ---->  Error A2169: General Failure
p3 proto  systemv :qword   ; ----> Error A2169: General Failure

It was not in the previous version

LiaoMi


KradMoonRa

Hi mabdelouahab,

The implementation for the news added conventions regcall and syscall for linux kernel in 64bits, got the code for conventions uninitialized till the 1º proc comes in 1º place before proto, bad bug here.
So I redone all the changes for if table for conventions initialization, and now it's necessary to exclusively call in the command-line the convention and convention initializer, output format and memory model.

One simple example:
testlinux.7z

UASM command-line:

./uasm testlinux.asm -c -Cp -archSSE -mf -elf64 -zf4 -W3 -Gy

-c         = Assemble without linking (always set)
-Cp      = Set OPTION CASEMAP none
-archSSE = Set OPTION ARCH (always set)(unnecessary)
-mf       = Set memory model flat
-elf64   = Elf64 Output Format
-W3     = Warning Level
-zf4      = convention initializer 64 bits SystemV style
-Gy       = Calling Convention SystemV

I will repack as soon as I have time.

Hi LiaoMi,  :thumbsup:

Quote from: mabdelouahab on October 12, 2020, 05:42:35 AM
Installed well on kali linux  :thumbsup:

But the new version does not accept PROTO, and generates the first error

     Error A2169: General Failure
malloc proto :dword

p0  proto  fastcall :qword ; OK
p1 proto  c :qword         ; OK
p2 proto  stdcall :qword   ; OK
p  proto                  ; OK
p4 proto   :qword         ; ---->  Error A2169: General Failure
p3 proto  systemv :qword   ; ----> Error A2169: General Failure

It was not in the previous version
The uasmlib

mabdelouahab

.....Building......
UASM v2.50, Oct 25 2020, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

./build.sh: line 15:  3942 Segmentation fault     ./uasm -c -Cp -archSSE -mf -elf64 -zf4 -W3 -Gy $SrcAsm.asm

.....Building......
UASM v2.50, Oct 10 2020, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

Warning A4109: Invalid command-line option: -zf4
testlinux.asm(7) : Error A2210: Syntax error: sysv64:7
testlinux.asm(19) : Error A2169: General Failure


Whitout sysv64:7;  uasm -elf64 testlinux.asm
.....Building......
UASM v2.47, Nov 17 2018, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

testlinux.asm: 38 lines, 3 passes, 2098 ms, 0 warnings, 0 errors  :thumbsup:

KradMoonRa

Yea, ./build.sh: line 15:  3942 Segmentation fault     ./uasm -c -Cp -archSSE -mf -elf64 -zf4 -W3 -Gy $SrcAsm.asm
This one if add *.asm files after command it cleans the pointer's (resetting everything to null), and seg's fault hitting the proto for uses off null-pointers.
Still figuring why this behavior.


Quote from: mabdelouahab on October 26, 2020, 06:02:52 PM
.....Building......
UASM v2.50, Oct 25 2020, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

./build.sh: line 15:  3942 Segmentation fault     ./uasm -c -Cp -archSSE -mf -elf64 -zf4 -W3 -Gy $SrcAsm.asm

.....Building......
UASM v2.50, Oct 10 2020, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

Warning A4109: Invalid command-line option: -zf4
testlinux.asm(7) : Error A2210: Syntax error: sysv64:7
testlinux.asm(19) : Error A2169: General Failure


Whitout sysv64:7;  uasm -elf64 testlinux.asm
.....Building......
UASM v2.47, Nov 17 2018, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

testlinux.asm: 38 lines, 3 passes, 2098 ms, 0 warnings, 0 errors  :thumbsup:

The uasmlib

mabdelouahab

./uasm testlinux.asm -c -Cp -archSSE -mf -elf64 -zf4 -W3 -Gy
Quote.....Building......
UASM v2.50, Oct 25 2020, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

testlinux.asm: 38 lines, 2 passes, 5270 ms, 0 warnings, 0 errors
55 items in symbol table, expected 55
max items in a line=2, lines with 0/1/<=5/<=10 items=7955/53/1/0,
2173 items in resw table, max items/line=6 [0=619 1=672 398 155 44 8 4 0]
invokation CATSTR=0 SUBSTR=0 SIZESTR=0 INSTR=0 EQU(text)=0
lines read(files)/processed in pass one: 38 / 38
invokations: PreprocessLine=381/365/354, Tokenize=391/0
memory used: 5120 kB
.....linking________
testlinux.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status

KradMoonRa

After this weeks still can't find a fix for proto in linux, without break windows also.
From my test's declaring the new call's in proto with no proc /or proto before proc end, the uasm crash's with unknow params or symbol.
Added new option to not create stack frame for stackbase:rbp in linux only.
Example anexed.
The uasmlib