npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@autoit-gui-skeleton/ags-wrapper-binary-call

v1.0.3

Published

AGS package for the library BinaryCall created by Ward. Write subroutines in C, call in AutoIt.

Downloads

16

Readme

AGS-wrapper-binary-call

AutoIt Gui Skeleton package for wrapping the library BinaryCall created by Ward's. See this package on npmjs.com

How to install AGS-wrapper-binary-call ?

We assume that you have already install Node.js and Yarn, for example by taking a Chocolatey. AGS framework use it for manage dependencies.

To add this package into your AutoIt project, just type in the root folder of your AGS project where the package.json is stored. You can also modify the dependencies property of this json file and use the yarn install command. It is easier to use the add command :

λ  yarn add @autoit-gui-skeleton/ags-wrapper-binary-call --modules-folder vendor

The property dependencies of the package.json file is updated consequently, and all package dependencies, as well as daughter dependencies of parent dependencies, are installed in the ./vendor/@autoit-gui-skeleton/ directory.

Finally to use this library in your AutoIt program, you need to include this library in the main program. There is no need for additional configuration to use it.

#include './vendor/@autoit-gui-skeleton/ags-wrapper-binary-call/BinaryCall.au3'

What is AGS (AutoIt Gui Skeleton) ?

AutoIt Gui Skeleton give an environment for developers, that makes it easy to build AutoIt applications. To do this AGS proposes to use conventions and a standardized architecture in order to simplify the code organization, and thus its maintainability. It also gives tools to help developers in recurring tasks specific to software engineering.

More information about AGS framework

AGS provides a dependency manager for AutoIt library. It uses the Node.js ecosystem and its dependency manager npm and its evolution Yarn. All AGS packages are hosted in npmjs.org repository belong to the @autoit-gui-skeleton organization. And in AGS you can find two types of package :

  • An AGS-component is an AutoIt library, that you can easy use in your AutoIt project built with the AGS framework. It provides some features for application that can be implement without painless.
  • An AGS-wrapper is a simple wrapper for an another library created by another team/developer.

More information about dependency manager for AutoIt in AGS

BinaryCall : Write subroutines in C, call in AutoIt

According to the ward's documentation for BinaryCall, see https://www.autoitscript.com/forum/topic/162366-binarycall-udf-write-subroutines-in-c-call-in-autoit/

BinaryCall UDF - Write Subroutines In C, Call In AutoIt

I have wrote a lot of binary code library for AutoIt before. I also discover many ways to generate binary code for AutoIt in the past. However, all of them have limitation or need some extra effort.

Recently, I think I found the best and easiest way to generate the binary code. So I wrote this UDF, may be my last one about binary code.

The Features: * Both AutoIt x86 and x64 version are supported. * Windows API and static variables can be use (code relocation supported). * Decompression at run-time with smallest footprint LZMA decoder. * Allocated memory blocks are released automatically. * Most C source code works without modification. * Two step or one step script generation, very easy to use.

How It Works: 1. The C source code must be compiled by MinGW GCC with "-S -masm=intel" option. Output is GAS syntax assembly file.

2. BinaryCall Tool is able to convert the GAS syntax assembly file (*.s)
   to FASM syntax (*.asm). During the conversion, global symbols will be
   stored as "Symbol Jump Table" at the head of the file. The output file
   should be able to be assembled to binary file under command line by
   FASM.EXE. This syntax conversion is step 1.

3. The step 2 is to assemble the file. BinaryCall Tool will use the
   embedded FASM to assemble every file twice to generate the relocation
   table. "BinaryCall.inc" will be included automatically before
   assembling to detect the Windows API and generate the "API Jump table".
   All the results will be compressed and converted to AutoIt script output.

4. There are two major functions in the output script. _BinaryCall_Create()
   function allocates memorys, decompress the binary, relocates the address
   in memory, and fills the "API Jump Table".

5. _BinaryCall_SymbolList() converts the "Symbol Jump Table" to memory
   addresses, and then store them as pointers in a DllStruct variable.

6. Finally, we can use DllCallAddress() to call the memory address stored
   in the DllStruct.

Step by Step Tutorial:

1. Write C source code:

       #include <windows.h>
       void main()
       {
           MessageBox(0, "Hello", "Welcome Message", 1);
       }

2. Use GCC MinGW 32/64 to compile the source code:

       gcc -S -masm=intel32 -m32 MessageBox.c

3. Use BinaryCall Tool "GAS2AU3 Converter", select "MessageBox.s":

       If Not @AutoItX64 Then
           Local $Code = '...'
           Local $Reloc = '...'
           Local $Symbol[] = ["main"]

           Local $CodeBase = _BinaryCall_Create($Code, $Reloc)
           If @Error Then Exit

           Local $SymbolList = _BinaryCall_SymbolList($CodeBase, $Symbol)
           If @Error Then Exit
       EndIf

4. Paste the output script, call the main() in AutoIt:

       #Include "BinaryCall.au3"

       ; Paste output here

       DllCallAddress("none:cdecl", DllStructGetData($SymbolList, "main"))

5. Try to run it!

Change Log:

v1.0
    * Initial release.

v1.1
    * A lot of improvement for GAS2ASM converter and FASM header file.
    * Add many C Run-Time library as inline asm subroutines.
    * Add command-line to argc/argv parser for easy calling main() function.
    * Add ability to redirect stdio.

      More C source code can work without modification in this version.
      Following open source projects are tested.
      And Yes, they can run as binary code library in AutoIt now.

      SQLite 3.8.5
      TCC 0.9.26
      PuTTY beta 0.63

v1.2
    * Dynamic-link library (DLL) calling is supported now.
      If the C program requires a DLL file to run, just put it together
  with the source file. BinaryCall Tool will searches *.dll and exports
  all the symbols in these DLL files automatically. Of course, you need
  these DLL files when run the output script. However, it also works if
  you loaded them by last version of MemoryDll UDF.

    * To add more Windows API library easily by editing the ini file.
    * Better error handling and more error messages in output script.
    * Add zero padding to avoid short jumps that crash the relocation table.
    * BinaryCall Tool accepts drag and drop files now.
    * Some small bug fixed.

2015.1.21 Ward

About

Acknowledgments

Acknowledgments for Ward's work and its library BinaryCall.au3

Contributing

Comments, pull-request & stars are always welcome !

License

Copyright (c) 2018 by v20100v. Released under the MIT license.