<travisg>
nice. any in particular you found to be lovely?
srjek has joined #osdev
dbana has joined #osdev
dbana has quit [Client Quit]
billc has joined #osdev
dutch has quit [Quit: WeeChat 3.2]
dutch has joined #osdev
zaquest has quit [Remote host closed the connection]
smeso has quit [Quit: smeso]
zaquest has joined #osdev
jbg has quit [Ping timeout: 240 seconds]
jbg has joined #osdev
smeso has joined #osdev
jbg has quit [Ping timeout: 250 seconds]
jbg has joined #osdev
srjek has quit [Ping timeout: 240 seconds]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
flx-- has joined #osdev
flx-- is now known as flx
flx- has quit [Ping timeout: 240 seconds]
sts-q has quit [Ping timeout: 252 seconds]
sts-q has joined #osdev
nyah has quit [Ping timeout: 240 seconds]
h4zel has joined #osdev
mahmutov has joined #osdev
Shikadi has quit [Ping timeout: 250 seconds]
edr has quit [Ping timeout: 248 seconds]
fedorafan_altern has joined #osdev
edr has joined #osdev
nur has quit [Quit: Leaving]
ZombieChicken has joined #osdev
fedorafan_altern has quit [Quit: Textual IRC Client: www.textualapp.com]
ZombieChicken has quit [Quit: WeeChat 3.2]
GeDaMo has joined #osdev
k0valski has quit [Quit: Ping timeout (120 seconds)]
h4zel has quit [Ping timeout: 240 seconds]
<klange>
Thinking... instead of writing another paint app, I should do a vector illustrator... really push my little path rasterizer to the limit.
mctpyt has joined #osdev
<zid>
You should draw ayame
wgrant has quit [Ping timeout: 240 seconds]
Belxjander has joined #osdev
immibis has quit [Ping timeout: 252 seconds]
tacco has joined #osdev
wgrant has joined #osdev
tacco has quit []
mahmutov has quit [Ping timeout: 248 seconds]
wgrant has quit [Ping timeout: 252 seconds]
k0valski has joined #osdev
mahmutov has joined #osdev
regreg has joined #osdev
wgrant has joined #osdev
regreg has quit [Read error: Connection reset by peer]
fwg has quit [Ping timeout: 250 seconds]
regreg has joined #osdev
fwg has joined #osdev
regreg has quit [Read error: Connection reset by peer]
regreg has joined #osdev
nur has joined #osdev
wgrant has quit [Ping timeout: 250 seconds]
regreg has quit [Read error: Connection reset by peer]
mctpyt has quit [Ping timeout: 250 seconds]
gateway2000 has quit [Read error: Connection reset by peer]
gateway2000 has joined #osdev
<klange>
I _thought_ my UI was feeling a bit sluggish lately... turns out I accidentally removed a line that was supposed to be resetting clip regions, so it was flushing the entire screen on every update
<zid>
not bad
<zid>
I just wrote a program to parse the imports in PE and now I hate myself
<zid>
PE is dum and I hate it
<clever>
zid: i once saw somebody translate a windows kernel module into a linux elf dynamic library
<clever>
so they could debug it under plain gdb
<zid>
There's no program headers so it's all loaded so everything is done in virtual address space
<clever>
at least its not a .com file :P
<zid>
.com would have been preferable
<zid>
I'm planning some stupid heinous exe shenanigans
wgrant has joined #osdev
<zid>
I have a .dll that I inject into an .exe to povide rawinput, launcher's suck because it's hard to debug, can't do it after it already starts running because it's too late
<zid>
so I just hex edited the entry point of the .exe to be LoadLibrary("hook.dll"); jmp _start
<klange>
Today I added back in an old feature that was preloading fonts into shared memory blobs, which plays doubly duty of providing some level of theme control and making text rendering faster than the typical alternative of jumping around and using file i/o operations.
<zid>
But that provides no feedback for the dll not being found, or version control etc, and there's no real space to put it into the original .exe
<zid>
so I was going to re-pack them both into a new exe, by combining their import tables and .text/.data sections
<clever>
zid: :D
<zid>
The fact it's all done in virtual address space means that's a super annoying job though, because the import table is in memory, and BETWEEN .text and .data, so I can't grow it
<klange>
Something relevant to your PE woes, I also added some getopting to my readelf, which was previously doing a solid job of emulating the output of binutils' `readelf -a`
<zid>
so the stupid hack is to dump both, put the SUPER IMPORT TABLE *after* everything, then steal the relocations and reapply them to the original import tables
<zid>
cus you know, PE is dumb
<clever>
ive done injecting a dll and patching the relocation tables once before
<zid>
patching would be easy, I need to grow it :/
<clever>
LD_PRELOAD makes things far far simpler on linux
<zid>
I instead need to dump, combine, patch
<clever>
i was patching the table at runtime...
<zid>
Yea that's trivial
<zid>
the rdata entries are at fixed offsets it's literally *((u32 *)rdata_for_func) = new_func;
<zid>
It's a ghetto got/plt basically
<clever>
once you remap that page r/w
<zid>
My dll already does patching and has helpers for all that
<zid>
It has a PATCH ENGINE where it takes an array of patches with hint tags like "we're patching a call"
<zid>
and does the jmp size + 4 + relative offset calc for you
<zid>
patch a 4 byte call at 40d2b2 to call input_init instead, put 5 nops at d3c8 etc
<clever>
ah, thats way more powerful
<zid>
but the dll itself obviously needs WriteProcessMemory etc relocated for it, and game.exe doesn't need it, and the IAT is 'full', hence the issue
<zid>
if you try to pack the exe with the dll, either you're manually doing all your relocations for the exe or the dll, as the loader can only do one 'half', or you're doing my insane shit
<clever>
isnt there a way to do CreateProcess and hang immediately? for debugger usage?
<zid>
where you make a fake 'combined' IAT, then write it back out
<zid>
Yes, that's a loader
<zid>
and loaders suck
<clever>
and then you can patch the target to inject the dll, without needing a bigger import table
<clever>
ahh
fwg has quit [Quit: .oO( zzZzZzz ...]
<clever>
what if you just make .text bigger
<zid>
that will move .data
<clever>
can you add a whole new section?
<zid>
I can, on the end, which si the plan
<zid>
.text.dll .rdata.dll and .data.dll go on the end or whatever
<clever>
what if you just add a .text.loader
<zid>
and rdata.dll actually imports everything game.exe would have wnated
<clever>
then patch _start to jump to that, LoadLibrary with error checking, then jump back
<zid>
and then copies the first half of itself to the original .rdata
<clever>
so LoadLibrary still does all of the work
<zid>
who's doing the imports for the exe then
<zid>
my loader will need diff imports, so we've got the exact same issue
<zid>
There is a way to do it like that, where you just add a .loader and it does GetProcAdress for anything it needs to call
billc has quit [Quit: Leaving]
freakazoid333 has quit [Ping timeout: 250 seconds]