Install dependencies:
sudo apt install clang build-essential git
Install the UASM assembler from source:
git clone -b v2.50 https://github.com/Terraspace/UASM
pushd UASM
make -f Makefile_Linux CC=clang
sudo cp ./GccUnixR/uasm /usr/local/bin
popd
sudo mv UASM /usr/local/src/
Install the LLVM lld
linker from the repository (Ubuntu 18):
sudo apt install lld
Running against PE32 and PE32+ is slightly different:
For 32-bit PE32:
ddisasm ex.exe -F -j1 --generate-import-libs --asm out.asm
uasm -coff out.asm
lld-link-6.0 out.o /machine:x86 /subsystem:console /entry:_EntryPoint
For 64-bit PE32+:
ddisasm ex.exe -F -j1 --generate-import-libs --asm out.asm
uasm -win64 out.asm
lld-link-6.0 out.o /machine:x64 /subsystem:console /entry:__EntryPoint