GithubHelp home page GithubHelp logo

uasm-sdk's Introduction

UASM-SDK

UASM SDK is a collection of include files, libraries and binary tools required for working with the UASM assembler, for x86 or x64 coding. It includes v2.46 of UASM. You may need to update UASM and other files from time to time.

UASM-SDK Setup

  • Download the latest release. The latest release can be found via the releases section of this Github repository as Source code (zip)

  • Extract the contents, and rename any folders required so that it matches the following folder structure:

    \UASM\bin
    \UASM\include
    \UASM\lib
    \UASM\lib\x64
    

    If you are using the RadASM IDE, you may wish to also download: UASM-with-RadASM

Includes & Libraries

Note: The includes and libraries provided here as part of the SDK may be outdated or some files may not work. To ensure you have the best and most recent versions, I recommend using the libraries from the Windows SDKs.

Includes for both x86 and x64 can be obtained from using the WinInc package.

Libraries for x64 can be obtained via (assuming default installed locations):

  • Installed Windows SDK: \Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64
  • Installed Windows Kit: \Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64
  • PellesC - \PellesC\Lib\Win64

These x64 libraries should be copied to the UASM\lib\x64 folder.

Additional Resources

uasm-sdk's People

Contributors

mrfearless avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

uasm-sdk's Issues

error: unresolved external symbol; some libraries may be wrong?

Hello @mrfearless , how'r you doin'?

I have setup RadASM with UASM. I had issues if i use libraries in this repo.

Platform:
OS : Windows 10 x64
IDE : RasASM v2.2.2.3

Assembler : UASM v2.55
Assembler PATH : C:\UASM
Library Path : C:\UASM\Lib\x64

Sample MessageBox Code
I have created a new project under RadASM UASM64 -> WIN64 -> Without template and pasted the code

;--- Win64 "hello world" GUI application.
;--- assemble: 

    option casemap:none

    includelib kernel32.lib
    includelib user32.lib

externdef MessageBoxA : near
externdef ExitProcess : near

    .data

text    db 'Hello world!', 0
caption db 'Hello x86-64', 0

    .code

OPTION PROC:NONE
main proc
    sub rsp, 28h        ; space for 4 arguments + 16byte aligned stack
    xor r9d, r9d        ; 4. argument: r9d = uType = 0
    lea r8, [caption]   ; 3. argument: r8  = caption
    lea rdx, [text]     ; 2. argument: edx = window text
    xor rcx, rcx        ; 1. argument: rcx = hWnd = NULL
    call MessageBoxA
    xor ecx, ecx        ; ecx = exit code
    call ExitProcess
main endp

    end

RADASM OUTPUT
Then I hit the build button

\UASM\Bin\UASM64.exe /c -win64 -Zp8 /win64 /D_WIN64 /Cp /nologo /W2 /I"\UASM\Include" "GUI-MessageBox.asm"
GUI-MessageBox.Asm: 36 lines, 2 passes, 1 ms, 0 warnings, 0 errors
\UASM\Bin\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /MACHINE:X64 /LIBPATH:"\UASM\Lib\x64" /OUT:"GUI-MessageBox.exe" "GUI-MessageBox.obj" "GUI-MessageBox.res"
Microsoft (R) Incremental Linker Version 12.00.31101.0
Copyright (C) Microsoft Corporation.  All rights reserved.

\UASM\Lib\x64\kernel32.lib : warning LNK4003: invalid library format; library ignored
\UASM\Lib\x64\user32.lib : warning LNK4003: invalid library format; library ignored
GUI-MessageBox.obj : error LNK2019: unresolved external symbol MessageBoxA referenced in function main
GUI-MessageBox.obj : error LNK2019: unresolved external symbol ExitProcess referenced in function main
LINK : error LNK2001: unresolved external symbol WinMainCRTStartup
GUI-MessageBox.exe : fatal error LNK1120: 3 unresolved externals

Make error(s) occured.
Total compile time 187 ms

So I changed the library path to one of my windows sdk's and build again(i also added /ENTRY:main)

\UASM\Bin\UASM64.exe /c -win64 -Zp8 /win64 /D_WIN64 /Cp /nologo /W2 /I"\UASM\include" "GUI-MessageBox.asm"
GUI-MessageBox.Asm: 36 lines, 2 passes, 1 ms, 0 warnings, 0 errors
\UASM\Bin\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /MACHINE:X64 /ENTRY:main /LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64" /OUT:"GUI-MessageBox.exe" "GUI-MessageBox.obj" "GUI-MessageBox.res"
Microsoft (R) Incremental Linker Version 12.00.31101.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Make finished.
Total compile time 187 ms

So what is the problem.
I have checked several lib files in this repo -like kernel32 and user32- and they are slightly problematic. For example we can open a lib file with 7zip. Because they are a kind of archive files. you cannot open kernel32.lib and user32.lib in your this repo. But also there are some libraries are working like msvcrt.lib

We can also use detect-it-easy for cheking! If we open a normal working library with die, we get this output:

Binary
Archive: Coff library[AMD64]

But if it is a problematic library, die says:

Binary

Finally -maybe temporary- workaround is using library files under windows sdk!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.