taskmanager icon indicating copy to clipboard operation
taskmanager copied to clipboard

Cannot get to run.

Open MichaelKoopa opened this issue 3 years ago • 36 comments

I got it to build cmd_i5pkbBCNCk but whenever I run it, the window that is supposed to spawn inside of taskmanager never spawns all I get is the injector window and after pressing any key nothing happens. image I first thought it was my windows version as my main install is 19042 but running it in a vm on 19041 it still does not run. I have not tried it on 18363 but seeing as it doesnt work on 19041 I don't think it's the windows version breaking it. If you need any more info let me know.

MichaelKoopa avatar Mar 18 '21 13:03 MichaelKoopa

try placing the injector and the dll in your root folder(C:\) as i can see yo mama has spaces.

turtiustrek avatar Mar 18 '21 14:03 turtiustrek

It still does not spawn the window inside of taskmanager. Also here is winver just to make sure I'm not wasting time. image

MichaelKoopa avatar Mar 18 '21 14:03 MichaelKoopa

ah, thanks for that. just noticed the 19041.264. This version is not supported but the console should still spawn.. This is worth taking a look into. These are the supported versions:

10.0.19041.844 10.0.19041.746 10.0.18362.1316 Also, if you can then please attach your compiled dll's (sounds strange but this is the only i can confirm this)

turtiustrek avatar Mar 18 '21 14:03 turtiustrek

Injector.exe [please compile the source instead] dllmain.dll [please compile the source instead] also how would I find those specific versions?

MichaelKoopa avatar Mar 18 '21 14:03 MichaelKoopa

I tried your DLL and can confirm, the console does not spawn even though the final binary is 64-bit. strange. if you don't mind trying out random binaries on the internet, here is the freshly compiled binary

[please compile the source instead]

For reference this the g++ version I am using

g++ --version
g++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

turtiustrek avatar Mar 18 '21 14:03 turtiustrek

The verison of g++ is the exact verison that I am using. image The newly compiled version you attached did not spawn a window in task manager although I still have not gotten the exact version of windows that is supported. Edit: I moved it to the root (because of the space) and that did not help.

MichaelKoopa avatar Mar 18 '21 14:03 MichaelKoopa

The newly compiled version you attached did not spawn a window in task manager although I still have not gotten the exact version of windows that is supported.

Yes, but even if the version is wrong, the console should still spawn regardless of the version and complain about it in the console. I'm currently on image Task manager version: image

also how would I find those specific versions?

I'm not sure if Microsoft allows downloading specific versions of windows.

turtiustrek avatar Mar 18 '21 15:03 turtiustrek

This is my task manager version: image

MichaelKoopa avatar Mar 18 '21 15:03 MichaelKoopa

The only thing i can say is use an external injector like https://processhacker.sourceforge.io (run as admin) and try it from there. if the console spawns then it should complain about the version and that can be addressed later. a

turtiustrek avatar Mar 18 '21 15:03 turtiustrek

Okay doing it with process hacker does not work, I also tried using extreme injector and that does not work either. HZLQIP8xIc

relized the frames folder was missing fixed that

MichaelKoopa avatar Mar 18 '21 16:03 MichaelKoopa

try injecting it into Notepad.exe and see if it even spawns a console. Console spawning is not task manager dependent. That's all i got honestly, i'm not sure why the console is not even spawning.

turtiustrek avatar Mar 18 '21 16:03 turtiustrek

Injecting into notepad also does not work.

MichaelKoopa avatar Mar 19 '21 12:03 MichaelKoopa

I have the same issue on image using pre-compiled injector and library (I can't setup mingw cuz i'm stupid)

trigger337 avatar Mar 19 '21 18:03 trigger337

Hmm, seems like multiple versions of windows 10 are having this issue (could be because mingw-64 is not placing the functions in the right section for these versions or LoadLibrary with mingw is messed up ). Either way i have no idea about this problem but ill look into with these versions.

turtiustrek avatar Mar 20 '21 20:03 turtiustrek

Snipaste_2021-03-28_18-44-36 same issue on my system

lybchikfreed avatar Mar 28 '21 15:03 lybchikfreed

That's not 19041 but 19042. this does not support 19042

turtiustrek avatar Mar 28 '21 16:03 turtiustrek

Could you provide how you find the function: UpdateData, GetBlockWidth, IsServer, GetBlockColors, SetBlockData, SetRefreshRate

On my side, the program cannot found: UpdateData, GetBlockWidth

So people can find pattern for functions in case of windows/taskmgr version compatibility

image

Update

Just use decompiler and Taskmgr.pdb you'll got result like this, hopefully it's works image

ii64 avatar Mar 31 '21 05:03 ii64

Could you provide how you find the function:

Absolutely!

To make comparison easier, you can use this tool to download different task manager versions and compare them with the entries in pattern.hpp file. The contents in the pattern.hpp file contains the first 40 bytes of the routine. Luckily since the PDB is available, you can look up the functions in IDA (from the comments of LookupPatternTable struct). Then simply copy over the first forty bytes of the function. You can simply append the new set of stubs in without worrying about the adjusting the size of the table and make sure to provide the version string.

turtiustrek avatar Mar 31 '21 09:03 turtiustrek

Absolutely!

Thanks, i am using original taskmgr it's running but nothing happend image

ii64 avatar Mar 31 '21 10:03 ii64

It seems like the handler returned from UpdateDataHook did not populate. Did you switch over to the performance tab before the DLL was loaded? if so then try again and let the DLL show the 'Waiting for handler to populate' message and then switch over to the performance tab.

turtiustrek avatar Mar 31 '21 10:03 turtiustrek

Alright after i continue debugging, I got that UpdateDataHook is not even got called. (i tried wait for handler to populate, same result)

Find pattern for UpdateData got 0x7ff631e48d64 And offset function 0xA8164 So this looks correct right? 0x7ff631da0000 + 0xA8164 = 0x7ff631e48164 (hooked)

Base address 0x7ff631da0000
DLL address 0x656016c3
Process Version: 10.0.17763.1697
Table task manager version:10.0.17763.1697
Finding UpdateData function... 0x7ff631e48d64 Done
Finding GetBlockWidth function... 0x7ff631e48448 Done
Finding IsServer function... 0x7ff631dd2c30 Done
Finding GetBlockColors function... 0x7ff631e482e8 Done
Finding SetBlockData function... 0x7ff631e48c40 Done
Finding SetRefreshRate function... 0x7ff631dd4e7c Done

Anyway, if GlobalSettings already retrieved from IsServer function, and *cpu_count already changed to fake one Shouldn't it updated? image

ii64 avatar Mar 31 '21 13:03 ii64

So this looks correct right?

Yes that looks correct.

Anyway, if GlobalSettings already retrieved from IsServer function, and *cpu_count already changed to fake one Shouldn't it updated?

On some versions this does not update since there is another struct which for the viewable placeholders(10.0.19041.746). A better way to check the hooks would be trigger the SetRefreshRate function. to do that head to the Performance tab and set the update speed to High by navigating to View>Update speed in task manager.

turtiustrek avatar Mar 31 '21 14:03 turtiustrek

Okay, View>Update speed triggers SetRefreshRate, unfortunately CPU count still the same, i noticed the update become faster (because SetRefreshRate)

ii64 avatar Mar 31 '21 14:03 ii64

i feared this would happen. GLOBAL_SETTINGS_CPU_OFFSET may in fact be incorrect or this version does not properly show the change. The callee of the function UpdateData references this GLOBAL_SETTINGS_CPU_OFFSET. Also it'll help if you can kindly share the stubs you found(pattern.hpp attached or something).

turtiustrek avatar Mar 31 '21 14:03 turtiustrek

I attached dll source code, and Taskmgr executable binary + IDA db 10.0.17763.1697.zip

ii64 avatar Mar 31 '21 14:03 ii64

Awesome thanks, will check that out soon.

turtiustrek avatar Apr 01 '21 10:04 turtiustrek

@ii64 can you try this gist? https://gist.github.com/turtiustrek/e737a9b4155004f9a1c4187bfc25725f Only the GLOBAL_SETTINGS_CPU_OFFSET has been changed iirc

turtiustrek avatar Apr 01 '21 16:04 turtiustrek

Hi, just tested the gist code, it doesn't change anything except the *cpu_core value is 0 (the original GLOBAL_SETTINGS_CPU_OFFSET 0x944 giving the same amout) UpdateDataHook still not even got called, is this the root cause why it still waiting handler to populate?

update

image

ii64 avatar Apr 13 '21 06:04 ii64

UpdateDataHook still not even got called, is this the root cause why it still waiting handler to populate?

bummer, UpdateDataHook should only get called when the fake_cores count is greater then 64. This is then called when switching into the performance tab so the 'handler' should populate when this occurs. so if you follow the init of the heatmap(AtmCpuView::LoadLogicalCpuChart), you'll see that a call is made to TmGlobalSettings::GetProcessorDetailsLogicalCount which checks the processor count. if its > 0x40 only then the heatmap init is called and the heatmap is used.

If you follow TmGlobalSettings::GetProcessorDetailsLogicalCount, it returns the value which is referenced by GLOBAL_SETTINGS_CPU_OFFSET + GlobalSettings. So perhaps try hooking TmGlobalSettings::GetProcessorDetailsLogicalCount so that it always returns the fake_cores (no clue if it will work though).

turtiustrek avatar Apr 13 '21 10:04 turtiustrek

Okay i did implemented the TmGlobalSettings::GetProcessorDetailsLogicalCount hook, it is called when i switch to Performace tab, it is got called, but immediately crash the TaskManager, i think there's race between this function, and *cpu_count = fakeCores, like it's accessed before the dll change it to fakeCores

ii64 avatar Apr 15 '21 11:04 ii64