Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support wow64 traces? #13

Open
tostercx opened this issue Feb 21, 2022 · 0 comments
Open

Support wow64 traces? #13

tostercx opened this issue Feb 21, 2022 · 0 comments

Comments

@tostercx
Copy link

tostercx commented Feb 21, 2022

Hello, thanks for the awesome project!

I'm attempting to fuzz a wow64 application with wtf - my traces end up 64bit but tenet on ida with a 32bit binary is able to load only 32bit traces. It would be nice if tenet was able to load these as well.

I guess another option would be for wtf to support 32bit trace output? That would leave out some steps that happen in 64bit land tho.

I'm currently using a hacky script to convert the 64bit trace to 32. It simply drops anything 64bit related and converts r[xx] to e[xx]. Seems to somewhat work in most cases. Adding it below if anyone needs it.

<?php

$infile = $argv[1];
$out = [];

foreach (file($infile, 6) as $line)
{
    $items = [];
    foreach (explode(',', $line) as $item)
    {
        if (preg_match('#0x[\da-f]{9}#', $item)) // drop anything that looks 64bit
            continue;
        
        list($key, $value) = explode('=', $item);
        
        if (preg_match('#r\d+#', $key)) // drop r8-r15
            continue;
        
        if (preg_match('#r\w\w#', $key)) // rxx -> exx
            $item = 'e'.substr($key,1).'='.$value;
        
        $items[] = $item;
    }
    
    $out[] = implode(',', $items);
}

file_put_contents($infile.'.wow64', implode("\n", array_filter($out)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant