PDA

View Full Version : Update from August 11



Petr Schreiber
12-08-2008, 09:47
Hi Charles,

update from Monday looks very good from the feature list, thanks.
Any demos ;) ?


Petr

Charles Pegge
12-08-2008, 12:42
The only additional instructions are: / and /+

They are used to align tables or set them to specific locations in the binary code string


Simple examples:

jmp long ok
o2 /0c
.ok
ret

produces:

0000: e9 07 00 00 00
0002: 00 00 00 00 00 00 00
000C: c3

jmp long ok
o2 /+4
.ok
ret

produces

0000: e9 03 00 00 00
0005: 00 00 00
0008: c3


you can see how this is applied in the import section of an EXE.
There is some fiddly pointering going on here, but the tables can be kept aligned to the correct boundaries.

ga produces the 4 byte offset for a specified label. (start of code string=0)



; IMPORT DIRECTORY ENTRY RECORD
; -----------------------------

/+1000
.imports

ga name_list ; 00001C00 dw RVA Function Name List 0000C040
hl00000000 ; 00001C04 dw Useless 1 00000000
hl00000000 ; 00001C08 dw Useless 2 00000000
ga module_name ; 00001C0C dw RVA Module Name 0000C244
ga proc_address_list ; 00001C10 dw RVA Function Address List 0000C0A8

; Function List (declare_order and name)
; ---------------------------------------
; 00001CB0 0000C0A0 0001 FreeLibrary
; 00001CBC 0000C0A4 0002 GetProcAddress
; 00001CC0 0000C0A8 0003 LoadLibraryA


/+4
.proc_address_list

ga FreeLibrary
ga GetProcAddress
ga LoadLibraryA

/+4
.module_name `KERNEL32.DLL` 00 00


/+4
.name_list

/+4 .FreeLibrary hw0001 `FreeLibrary` 00 00
/+4 .GetProcAddress hw0002 `GetProcAddress` 00 00
/+4 .LoadLibraryA hw0003 `LoadLibraryA` 00 00

kryton9
12-08-2008, 21:33
My studies in Assembly are going slow, but I keep plugging away. With all the capabilities Charles is providing it is incentive to keep studying. I Can see now that once it is learned you can do anything, since Charles is developing the compiler and already his module can be used to create your own language in a way. And all of this can be done via thinbasic and the modules, it is incredible!

But being the moth drawn to light of higher level languages I wander off of assembly in search of the light to often!

Charles Pegge
15-08-2008, 00:26
Hi Kent,
I hope we will be able to build higher levels with the h2o project soon. I am trying to crack the hardest nuts first - hence working on Hash tables, operator precedence, PE formats etc. :)

kryton9
15-08-2008, 04:53
Sounds good Charles, thanks for all the effort!