flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
CandyMan 30 Oct 2014, 17:55
How to create "Hello World" PE64 from scratch compressible by UPX?
_________________ smaller is better |
|||
![]() |
|
bitRAKE 31 Oct 2014, 02:58
I used MSDELTA, should be on all Win64 machines. I have PE64 with decompression under 256 bytes - haven't seen smaller.
Code: ; MS Delta Unpacker by bitRAKE ; ; Much Thanks... ; Franck Charlet (hitchhikr), 1kPack - the initial inspiration. ; Ange Albertini (corkami), PE101 docs and samples. ; ; Goals: ; - functional on all 64-bit versions of windows ; (MSDELTA.DLL is distributed with Vista+. Yet, availble in SDK.) ; ; 2013.05.14-04:48 : Initial release to testers ; ; TODO: ; NOTE: Addresses default to RVA, must add IMAGEBASE to get memory address. format binary as 'exe' IMAGEBASE equ $10000 STAGE1 equ $20002 ; fixed use64 ; registers: EntryPoint: ; must be $100 * N ;+ <-= required/fixed db 'MZ' ; pop r10 ;+4D 5A This is required and fixes the stack alignment win-win! jmp @F ; EB 2C db 'PE',0,0 ;+signature These are kind of static and required dw $8664 ;+machine If we can't find another use for them dw $0000 ;+sections they are just wasted bytes @@: push SOURCE.. ; 6A 76 uSize, length of buffer [0,127] jmp @F ; EB 20 sz.kernel32.dll db 'KERNEL32' ; ######## 8 bytes dw $0000 ;+size of optional header (null) More required bytes(+) dw $0002 ;+characteristics, not $2000 (DLL) Can't really get loaded without these dw $020B ;+PE32+ (hint) Re-purpose as much as possible sz.GetProcAddress db 'GetProcAddress' ; ############## 14 bytes dd EntryPoint ;+AddressOfEntryPoint (null) Tools are questioning if this is a valid PE |
|||
![]() |
|
CandyMan 31 Oct 2014, 15:01
Thanks!
_________________ smaller is better |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.