Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 21 May 2013 21:46:17 +0200
From: Dániel Bali <>
Subject: Re: AMD GCN ISA development


2013/5/21 Solar Designer <>
> Why don't we use a hack, at least initially: simply generate a large
> enough (inner) ELF for a dummy kernel, and be replacing its contents?
> Since our actual code size will need to be smaller in all cases, we'll
> simply pad it with zeroes or whatever.  Would this work?

This was a great idea, thanks!

I created a long kernel (turns out it's optimized pretty well, so I had to
generate random OpenCL code that uses the input so it won't be predictable
and it won't be optimized out). The GCN part ended up 2184 bytes long, but
this is something we can change.

Then I pasted the original binary to the place of the newly generated one
and put NOPs at the end. It now works just the way the original binary
worked but we can add/change arbitrary code as long as its under 2184 bytes
long. Here is the new binary:

The inner elf starts at 0x18301. Inside the inner elf the GCN code section
starts at 0x4d36. (So globally it starts at 0x1d037)

I will now try to figure out realhet's code. I might need to refresh my
Pascal skills a bit.


Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.