flat assembler
Message board for the users of flat assembler.
Index
> Windows > UuidCreate in rpcrt4.dll wrapping executable |
Author |
|
Trojany 04 Jun 2010, 02:01
Just a little uuid-creator, if someone needs...
- no include files - error checking If you for any reason can't download the attached source file: Code: format PE section '.text' executable push _Uuid call [UuidCreate] cmp eax, 0 jne _End push _StringUuid push _Uuid call [UuidToString] cmp eax, 0 jne _End push -11 call [GetStdHandle] cmp eax, -1 je _End mov [_OutHandle], eax _Loop: push 0 push _BytesWritten push [_BytesToWrite] push [_StringUuid] push [_OutHandle] call [WriteFile] sub eax, 2 cmp eax, -2 je _End mov eax, [_BytesWritten] add [_StringUuid], eax sub [_BytesToWrite], eax jnz _Loop mov eax, 0 _End: ret section 'data' readable writable _Uuid dd 0, 0, 0, 0 _StringUuid dd 0 _OutHandle dd 0 _BytesWritten dd 0 _BytesToWrite dd 36 section '.idata' import readable dd rva lkernel32, 0, 0, rva nkernel32, rva akernel32 dd rva lrpcrt4, 0, 0, rva nrpcrt4, rva arpcrt4 dd 0, 0, 0, 0, 0 lkernel32: dd rva nGetStdHandle dd rva nWriteFile dd 0 nkernel32 db 'kernel32.dll', 0 akernel32: GetStdHandle dd rva nGetStdHandle WriteFile dd rva nWriteFile dd 0 nGetStdHandle db 0, 0, 'GetStdHandle', 0 nWriteFile db 0, 0, 'WriteFile', 0 lrpcrt4: dd rva nUuidCreate dd rva nUuidToString dd 0 nrpcrt4 db 'rpcrt4.dll', 0 arpcrt4: UuidCreate dd rva nUuidCreate UuidToString dd rva nUuidToString dd 0 nUuidCreate db 0, 0, 'UuidCreate', 0 nUuidToString db 0, 0, 'UuidToStringA', 0 FASM.EXE UuidCreate.asm UuidCreate.exe UuidCreate.exe will give you a unique string if successful, or an %errorlevel% if not.
|
|||||||||||
04 Jun 2010, 02:01 |
|
coconut 21 Jul 2010, 18:50
Please make example of using UUIDCreateSequential
|
|||
21 Jul 2010, 18:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.