Tag Archives: assembler

Enables or disables privileges with fasm.

Today I will show you how to enables or disables privileges with fasm.
The Windows 10 come with Authorization and this is the right granted an individual to use the system and the data stored on it.
This is based on the Windows Server and Windows operating systems that control access to resources.
The example is a shutdown application tool make with FASM version 1.71.61.
I used functions from MSDN like: GetCurrentProcess, OpenProcessToken, LookupPrivilegeValue, AdjustTokenPrivileges and CloseHandle.
This functions need to be fill with parameters.
For example the OpenProcessToken function need this parameters:

You can take a look at this function at MSDN website.
The base of assembly file come with include win32ax.inc file.
The ..\include\ let the fasm to get this file and use this functions.
The SE_PRIVILEGE_ENABLED set with 2 make the privilege enabled.
Also the TOKEN_ADJUST_PRIVILEGES is required to enable or disable the privileges in an access token.
This two is used to make the executable application.
Into .data area I put the data need by application – messages to show.
For example if I want to put a string into my application then I will use this:

The title_msg is used by application to take the string tool_shutdown_cmd and 0 is used to end the string into the application.
Also I need the SeShutdownPrivilege parameter required to shut down a local system..
The application will run into loop from .code to enable_privilege.
It start with .code start: show the window with message box make by MessageBox and ask us the option to shutdown or not.
IN this area will run some MSDN functions like: MessageBox, InitiateSystemShutdown and ExitProcess.
When the user will press the Yes button then the application will run the enable_privilege area.
The cmp, jne, jc and jmp is used to take decisions into application.
The invoke is used to invoke can be used to call the procedures through pointers defined in the import tables.
Example of this line:

is equivalent to:

The start: , exit: , fail: , enable_privilege: is used by fasm to know points of application.
The .end start is put to end the program of fasm language.
You have question about the fasm the take a look at fasm manual.

Posted in All, Assembler, Programming, Windows 10. Tagged with , , , , .

The SASM I.D.E. assembler for NASM, GAS, FASM and MASM.

The SimpleASM named SASM is a simple open source crossplatform IDE for NASM, MASM, GAS, FASM assembly languages and is working with Windows and Linux.
I tested the Windows version 3.8.0 with FASM x64 example and is working well.
Also I tested another FASM files from my projects area and also working great.
You need to add the FASM folder into SASM folder and this just to include all libraries of FASM.
You can use the help page by pressing the F1 key.
Also you need to check from Menu Page the Settings of your build project.
You can download it from here.
assembly

Posted in All, Assembler, Programming, Windows 10. Tagged with , , , , .

Assembly language x64: The System V ABI – part 001.

The System V Application Binary Interface named ABI defines a system interface for compiled application programs.
This System V Application Binary Interface is a set of specifications that detail calling conventions, object file formats, executable file formats, dynamic linking semantics, and much more.
The ABI defines a binary interface for application programs that are compiled for System V implementations on many different hardware architectures.
Also the System V ABI is a family of specifications composed of two basic parts:
– a generic part of the specification ( describes those parts of the interface that remain constant across all hardware implementations of System V;
– a processor-specific part ( the specification describes the parts of the specification that are specific to a particular processor architecture ).
Example:
Virtual addresses and file offsets for the 64-bit PowerPC processor family segments are congruent modulo 64
Kbytes (0x10000) or larger powers of 2. Although 4096 bytes is currently the 64-bit PowerPC page size, this
allows files to be suitable for paging even if implementations appear with larger page sizes. The value of the
p_align member of each program header in a shared object file must be 0x10000.
You need to put segments with different characteristics in separate 256 Mbyte portions of the address space, to give the operating system full paging flexibility in the 64-bit address space.
One example of an executable file (the program linked with a base address of 0x10000000):

The possible corresponding program header segments:

The memory image of virtual adress for the program above is shown here, assuming 4096 (0x1000) byte pages.

Documents about: System V ABI
TODO:Ensure whether these are the latest official links.

Posted in All, Assembler, Programming, Windows 10. Tagged with , , , .

New x64dbg debugger released.

Today, January 4, 2017 come with new released version of x64dbg debugger application.
This is a open-source x64/x32 debugger for windows and is under constant active development.
The x64dbg can debug both x64 and x32 applications and used Qt, TitanEngine, capstone, Yara, Scylla, Jansson, lz4, XEDParse, Keystone, asmjit and snowman.
Simple, powerful development this debugger come with many features.
You can download ths application from here.

Posted in All, Assembler, Windows 10. Tagged with , , , .

News: FASMW64 with more examples.

The FASM come with great examples. If you get a look on this topic, you will see the news about FASM.
The news are:
[FASMW64\FASMW32.EXE] – 32bit asm development
[FASMW64\FASMW64.EXE] – 64bit asm development
[FASMW64\DLL] – 32bit DLL’s required by most programs
[FASMW64\DLL64] – 64bit DLL’s requred by some programs
[FASMW64\fasmw16935] – Original FasmW package un-modified
[FASMW64\Resources] – audio/image/etc.. required by some programs
[FASMW64\SOURCE] – Changes to the source code made by me (currently only fasmw.asm)
[FASMW64\V7 Examples 32bit] – 32bit example code, includes: DX7, DX8, DX9, DX10, Windows (use FASMW32.EXE to compile)
[FASMW64\V7 Examples 64bit] – 64bit example code, includes: DX9, DX10, Windows (use FASMW64.EXE to comile)
[FASMW64\V7INCLUDE32 32bit] – Vista/Win7 include files and api’s
[FASMW64\V7SHELLS32 32bit] – Window Shells
[FASMW64\V7INCLUDE64 64bit] – Vista/Win7 include files and api’s
[FASMW64\V7SHELLS64 64bit] – Window Shells

The FASMW is a great way to learn and deal with assembly language.
The forum has many users to help you.
The goal to understand assembly language is to learn the basic and then to start to put questions.

Posted in news. Tagged with , , , .