Last active
September 27, 2015 16:12
-
-
Save juntalis/cdc4bb86836ddc19bcbb to your computer and use it in GitHub Desktop.
Not-quite-compatible implementation of NASM's __utf16__ keyword for YASM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BITS 32 | |
| %macro __utf16__ 1 | |
| %assign idx 1 | |
| %xdefine wstring | |
| %xdefine cstring %1 | |
| %strlen cstrlen cstring | |
| %rep cstrlen | |
| %substr cchar cstring idx | |
| %if idx = 1 | |
| %xdefine wstring cchar, 0x0 | |
| %elif idx = cstrlen | |
| %xdefine wstring wstring cchar, 0x0 | |
| %else | |
| %xdefine wstring wstring cchar, 0x0, | |
| %endif | |
| %assign idx idx+1 | |
| %endrep | |
| db wstring | |
| %endmacro | |
| %define u(S) __utf16__ S | |
| main: | |
| pushf | |
| pusha | |
| xor eax, eax | |
| add eax, wsDllPath - $ | |
| ret | |
| wsDllPath: | |
| u('injected_dll') | |
| dw 0x0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment