@hyperdbg

@hyperdbg / Public archive of HyperDbg Telegram messages.

  • 2025

    • May 2025 (97)
    • Apr 2025 (303)
    • Mar 2025 (443)
    • Feb 2025 (220)
    • Jan 2025 (167)
  • 2024

    • Dec 2024 (72)
    • Nov 2024 (235)
    • Oct 2024 (83)
    • Sep 2024 (263)
    • Aug 2024 (332)
    • Jul 2024 (403)
    • Jun 2024 (570)
    • May 2024 (245)
    • Apr 2024 (156)
    • Mar 2024 (90)
    • Feb 2024 (134)
    • Jan 2024 (309)
  • 2023

    • Dec 2023 (62)
    • Nov 2023 (326)
    • Oct 2023 (76)
    • Sep 2023 (315)
    • Aug 2023 (757)
    • Jul 2023 (2215)
    • Jun 2023 (778)
    • May 2023 (300)
    • Apr 2023 (1)
    • Feb 2023 (5)
    • Jan 2023 (1)
  • 2022

    • Nov 2022 (1)
    • Oct 2022 (2)
    • Sep 2022 (1)
    • Aug 2022 (1)
    • Jul 2022 (39)
    • Jun 2022 (23)
    • May 2022 (256)
  • 2021

    • Dec 2021 (1)
    • Oct 2021 (82)
    • Jun 2021 (1)
    • Feb 2021 (1)
    • Jan 2021 (2)
  • 2020

    • Dec 2020 (1)
    • Nov 2020 (2)
RSS feed.    Made with tg-archive
  • 1
  • 2
  • 3
  • 4
  • 5
  • 10 July 2023 (225 messages)
  • @ricnar #2589 03:58 PM, 10 Jul 2023

    photo_2023-07-10_15-58-37.jpg
  • @HughEverett ↶ Reply to #2588 #2590 03:59 PM, 10 Jul 2023
    💪
  • @ricnar #2591 04:02 PM, 10 Jul 2023
    The only thing I need to try is what happens if we write to the buffer after putting the monitor command
  • @ricnar #2592 04:02 PM, 10 Jul 2023
    moving the memcpy after the pause
  • @ricnar #2593 04:03 PM, 10 Jul 2023

    photo_2023-07-10_16-03-30.jpg
  • @ricnar #2594 04:03 PM, 10 Jul 2023
    to look if it stops when write
  • @ricnar #2595 04:04 PM, 10 Jul 2023

    photo_2023-07-10_16-04-30.jpg
  • @HughEverett ↶ Reply to #2594 #2596 04:20 PM, 10 Jul 2023
    You have to specify both 'x' and 'w' for this purpose.
  • @HughEverett #2597 04:21 PM, 10 Jul 2023
    !monitor xw AddrFrom AddrTo script { ... }
  • @ricnar #2598 04:41 PM, 10 Jul 2023
    nop
  • @ricnar #2599 04:42 PM, 10 Jul 2023
    i want to test if putting only x skip when writing
  • @ricnar #2600 05:19 PM, 10 Jul 2023
    why this happen
  • @ricnar #2601 05:19 PM, 10 Jul 2023

    photo_2023-07-10_17-19-17.jpg
  • @ricnar #2602 05:19 PM, 10 Jul 2023
    the address is allocated
  • @ricnar #2603 05:19 PM, 10 Jul 2023

    photo_2023-07-10_17-19-47.jpg
  • @ricnar #2604 05:19 PM, 10 Jul 2023
    is no paged?
  • @ricnar #2605 05:19 PM, 10 Jul 2023
    not paged
  • @ricnar #2606 05:20 PM, 10 Jul 2023
    but was allocated two lines after
  • @ricnar #2607 05:27 PM, 10 Jul 2023
    seems to be not paged
  • @ricnar #2608 05:27 PM, 10 Jul 2023
    when you resolve the page in problem i will continue
  • @ricnar #2609 05:27 PM, 10 Jul 2023
    ping me when you finish to test
  • @ricnar #2610 05:36 PM, 10 Jul 2023
    it bypass all the w writes and it stops only by execution
  • @ricnar #2611 05:36 PM, 10 Jul 2023

    photo_2023-07-10_17-36-08.jpg
  • @ricnar #2612 05:36 PM, 10 Jul 2023
    perfect
  • @ricnar #2613 05:36 PM, 10 Jul 2023
    its ok
  • @HughEverett ↶ Reply to #2607 #2614 05:48 PM, 10 Jul 2023
    You can check whether it's paged or not by using '!pte' or '!va2pa' command.
  • @HughEverett ↶ Reply to #2609 #2615 05:48 PM, 10 Jul 2023
    Sure.
  • @ricnar #2616 05:48 PM, 10 Jul 2023
    Yes but I put two memcpys
  • @HughEverett ↶ Reply to #2613 #2617 05:48 PM, 10 Jul 2023
    👍
  • @ricnar #2618 05:48 PM, 10 Jul 2023
    One after the break and another before
  • @ricnar #2619 05:49 PM, 10 Jul 2023
    And the memory is paged when the first write happen
  • @ricnar #2620 05:49 PM, 10 Jul 2023
    And skips the second write and stops only by execution
  • @ricnar #2621 05:49 PM, 10 Jul 2023
    It's ok
  • @HughEverett #2622 05:50 PM, 10 Jul 2023
    So, the 'db' is still problematic?
  • @ricnar #2623 05:50 PM, 10 Jul 2023
    It works as expected
  • @ricnar #2624 05:50 PM, 10 Jul 2023
    Nop
  • @HughEverett #2625 05:50 PM, 10 Jul 2023
    👍
  • @ricnar #2626 05:51 PM, 10 Jul 2023
    I bypass the page in problem repeating the memcpys
  • @ricnar #2627 05:51 PM, 10 Jul 2023
    But when the page in is finished will be awesome
  • @HughEverett ↶ Reply to #2627 #2628 05:52 PM, 10 Jul 2023
    Even when I add the '.pagein' command, we still need another command to spin (halt) the target process.
  • @HughEverett ↶ Reply to #2628 #2629 05:52 PM, 10 Jul 2023
    I have some ideas for this as well.
  • @ricnar #2630 05:53 PM, 10 Jul 2023
    Yes but I change the program code to circumvent this
  • @ricnar #2631 05:53 PM, 10 Jul 2023
    This is a nasty trick
  • @HughEverett #2632 05:53 PM, 10 Jul 2023
    And this command is needed because of the fundamental design issue of not applying events immediately.
  • @HughEverett ↶ Reply to #2631 #2633 05:53 PM, 10 Jul 2023
    😅
  • @ricnar #2634 05:54 PM, 10 Jul 2023
    Ping me to test when finish
  • @ricnar #2635 05:54 PM, 10 Jul 2023
    Thanks for your hard work
  • @HughEverett ↶ Reply to #2635 #2637 05:55 PM, 10 Jul 2023
    Thanks for putting time testing it. 🙏
  • @prekvapko #2638 10:28 PM, 10 Jul 2023
    @HughEverett Hey, could I sponsor you a motherboard with a COM port? :D
  • @prekvapko #2639 10:29 PM, 10 Jul 2023
    I'm still completely lost on this issue
  • @prekvapko #2640 10:29 PM, 10 Jul 2023
    Issue is somewhere in ReadIrpBasedBuffer, that's the furthest I can get by checking the debugee process
  • @prekvapko #2641 10:29 PM, 10 Jul 2023
    since I can't attach a debugger to it
  • @prekvapko #2642 10:30 PM, 10 Jul 2023
    or whole system freezes
  • @prekvapko #2643 10:46 PM, 10 Jul 2023
    also confirmed not working on last dev branch commit
  • 11 July 2023 (164 messages)
  • @prekvapko #2645 12:56 AM, 11 Jul 2023
    Regarding COM port issue:

    - Fails at first packet:
    Checksum mismatch

    0x84 SENT FROM DEBUGEE
    0x54 CALCULATED ON DEBUGGER
  • @a_nevv #2646 02:36 AM, 11 Jul 2023
    Joined.
  • @HughEverett ↶ Reply to #2645 #2647 04:36 AM, 11 Jul 2023
    Aha, okay. That should be the problem. I'm not that much familiar with serial programming, but do we need to implement a handshaking mechanism for the packets? I mean is it common these days that some packets fail to be received due to the physical problems?
  • @HughEverett #2648 04:36 AM, 11 Jul 2023
    I have to order a PCIe serial card to test it.
  • @ricnar #2649 10:30 AM, 11 Jul 2023
    helllo
  • @ricnar #2650 10:31 AM, 11 Jul 2023
    i tried with
  • @ricnar #2651 10:31 AM, 11 Jul 2023

    photo_2023-07-11_10-31-13.jpg
  • @ricnar #2652 10:32 AM, 11 Jul 2023
    and it works too, there is not difference between the option the other end is an application or the other end is a VM
  • @ricnar #2653 10:32 AM, 11 Jul 2023
    it works
  • @HughEverett ↶ Reply to #2652 #2654 10:35 AM, 11 Jul 2023
    Also, I worked on the '.pagein' today. But, I think I have to read Intel manual (SDM) to figure out some of the Error Codes that are valid for #PFs. So, I need more time to finish the '.pagein' command as it's a little bit tricky.
  • @ricnar #2655 10:40 AM, 11 Jul 2023
    another thing
  • @ricnar #2656 10:40 AM, 11 Jul 2023
    the x option in monitor
  • @ricnar #2657 10:40 AM, 11 Jul 2023
    works too without the script
  • @ricnar #2658 10:41 AM, 11 Jul 2023

    photo_2023-07-11_10-41-01.jpg
  • @ricnar #2659 10:41 AM, 11 Jul 2023
    and stops in the first line executed
  • @ricnar #2660 10:42 AM, 11 Jul 2023
    after it stops I disable the event
  • @ricnar #2661 10:42 AM, 11 Jul 2023

    photo_2023-07-11_10-42-09.jpg
  • @ricnar #2662 10:42 AM, 11 Jul 2023
    press G and it continues
  • @ricnar #2663 10:42 AM, 11 Jul 2023

    photo_2023-07-11_10-42-36.jpg
  • @ricnar #2664 10:44 AM, 11 Jul 2023
    another thing i detect
  • @ricnar #2665 10:45 AM, 11 Jul 2023
    One thing that I realized is that if the target is waiting for a console entry in the same CMD of the hyperdbg, if you do ctrl -C and you want to change the context it doesn't work, you do .process pid xxx and G and it doesn't return because the CMD remains waiting for the entry of a key of that program
  • @ricnar #2666 10:47 AM, 11 Jul 2023
    pressing a key in CMD it returns the control to hyperdbg and it switchs the context
  • @ricnar #2667 10:48 AM, 11 Jul 2023
    but wait for a program target console input to complete the switch is not cool
  • @ricnar #2668 10:48 AM, 11 Jul 2023
    maybe hyperdbg can force a new cmd not execute inside the same cmd
  • @HughEverett #2669 10:49 AM, 11 Jul 2023
    This is a really hard to fix issue. Because, how we can detect it's execution? Windows just won't context switch to the process that is waiting.
  • @HughEverett ↶ Reply to #2668 #2670 10:49 AM, 11 Jul 2023
    Can explain it more?
  • @ricnar #2671 10:49 AM, 11 Jul 2023
    if the target is in a different cmd than hyperdbg is the same?
  • @ricnar #2672 10:50 AM, 11 Jul 2023
    if the target process runs in a new CMD outside the hyperdbg CMD
  • @HughEverett #2673 10:50 AM, 11 Jul 2023
    oh, yes, I got what you mean.
  • @HughEverett #2674 10:50 AM, 11 Jul 2023
    You mean HyperDbg just creates the process inside HyperDbg-cli.exe
  • @ricnar #2675 10:51 AM, 11 Jul 2023
    is the execution in the same CMD affecting or will be the same
  • @HughEverett #2676 10:51 AM, 11 Jul 2023
    Yes, I noticed it too.
  • @HughEverett #2677 10:51 AM, 11 Jul 2023
    No, the execution is different.
  • @HughEverett #2678 10:52 AM, 11 Jul 2023
    Let me see, if I can fix it right now.
  • @ricnar #2679 10:52 AM, 11 Jul 2023
    maybe i can try executing with start path "cmd /c path"
  • @HughEverett ↶ Reply to #2679 #2680 10:52 AM, 11 Jul 2023
    No, need that. Wait a minute, I'll fix it now.
  • @ricnar #2681 10:53 AM, 11 Jul 2023
    i'm annoying
  • @HughEverett ↶ Reply to #2681 #2682 10:54 AM, 11 Jul 2023
    No, of course not.
  • @HughEverett #2683 10:54 AM, 11 Jul 2023
    These things are easily solvable as all of them are Windows APIs
  • @HughEverett #2684 10:54 AM, 11 Jul 2023
    I have to figure out the flag that needs to be passed to the CreateProcess()
  • @ricnar #2685 10:54 AM, 11 Jul 2023
    the thing is if will be different we'll see
  • @ricnar #2686 10:56 AM, 11 Jul 2023
    but i think will be better in other new process outside hyperdbg cmd
  • @HughEverett ↶ Reply to #2686 #2687 11:02 AM, 11 Jul 2023
    Fixed! Please 'pull' the last commit from the 'dev' branch.
  • @ricnar #2688 11:06 AM, 11 Jul 2023
    the fix is in the driver or in the rest of the files?
  • @ricnar #2689 11:06 AM, 11 Jul 2023
    change the other files is easier
  • @ricnar #2690 11:06 AM, 11 Jul 2023
    the driver is running
  • @HughEverett ↶ Reply to #2688 #2691 11:06 AM, 11 Jul 2023
    No, it's a Win API fix. I just added CREATE_NEW_CONSOLE to the CreateProcessW's dwCreationFlags .
  • @ricnar #2692 11:07 AM, 11 Jul 2023
    in hyperdbg-cli.exe?
  • @HughEverett #2693 11:07 AM, 11 Jul 2023
    No, in hyperdbg/hprdbgctrl/code/debugger/user-level/ud.cpp
  • @HughEverett ↶ Reply to #2692 #2694 11:08 AM, 11 Jul 2023

    photo_2023-07-11_11-08-29.jpg
  • @ricnar #2695 11:10 AM, 11 Jul 2023
    i smash the existing folder with the new folder and the affected file will be replaced
  • @ricnar #2696 11:32 AM, 11 Jul 2023
    it's cleaner now
  • @ricnar #2697 11:32 AM, 11 Jul 2023

    photo_2023-07-11_11-32-51.jpg
  • @ricnar #2698 11:37 AM, 11 Jul 2023

    photo_2023-07-11_11-37-40.jpg
  • @ricnar #2699 11:37 AM, 11 Jul 2023
    it works thanks
  • @ricnar #2700 11:43 AM, 11 Jul 2023
    another thing
  • @ricnar #2701 11:43 AM, 11 Jul 2023

    photo_2023-07-11_11-43-37.jpg
  • @ricnar #2702 11:43 AM, 11 Jul 2023
    the * does not work in the name of the module
  • @ricnar #2703 11:43 AM, 11 Jul 2023
    hehehe
  • @ricnar #2704 11:44 AM, 11 Jul 2023
    if the module has a long name
  • @ricnar #2705 11:44 AM, 11 Jul 2023
    sometimes is confortable to use * in the name too
  • @ricnar #2706 11:44 AM, 11 Jul 2023
    mark-beaks-yeah.mp4
  • @HughEverett ↶ Reply to #2702 #2707 11:45 AM, 11 Jul 2023
    yes, it's not supported yet 🫣
  • @ricnar #2708 11:46 AM, 11 Jul 2023

    photo_2023-07-11_11-46-17.jpg
  • @ricnar #2709 11:46 AM, 11 Jul 2023
    this is very strange
  • @HughEverett ↶ Reply to #2706 #2710 11:46 AM, 11 Jul 2023
    No, of course not. Keep sending me feedbacks. 😎😎😎
  • @ricnar #2711 11:46 AM, 11 Jul 2023
    how the symbol can be found and i cannot put a bp in it
  • @ricnar #2712 11:47 AM, 11 Jul 2023
    this does not happen in windbg never happen to me
  • @HughEverett #2713 11:47 AM, 11 Jul 2023
    What is the address?
  • @HughEverett #2714 11:47 AM, 11 Jul 2023
    u user32!MessageBoxA
  • @HughEverett #2715 11:47 AM, 11 Jul 2023
    isn't it available?
  • @HughEverett #2716 11:48 AM, 11 Jul 2023
    or

    print user32!MessageBoxA
  • @ricnar #2717 11:48 AM, 11 Jul 2023

    photo_2023-07-11_11-48-11.jpg
  • @ricnar #2718 11:48 AM, 11 Jul 2023

    photo_2023-07-11_11-48-30.jpg
  • @HughEverett #2719 11:49 AM, 11 Jul 2023
    Is it paged out?
  • @ricnar #2720 11:49 AM, 11 Jul 2023

    photo_2023-07-11_11-49-06.jpg
  • @ricnar #2721 11:49 AM, 11 Jul 2023
    a api used by any process paged out?
  • @HughEverett #2722 11:49 AM, 11 Jul 2023
    no, that shouldn't happen.
  • @HughEverett #2723 11:50 AM, 11 Jul 2023
    Okay, maybe HyperDbg is loading the wrong base address?
  • @HughEverett ↶ Reply to #2720 #2724 11:51 AM, 11 Jul 2023
    can you verify whether the current process contains the user32 module? and get its address using 'lm um pid 1234'
  • @ricnar #2725 11:52 AM, 11 Jul 2023
    its a bug
  • @ricnar #2726 11:52 AM, 11 Jul 2023

    photo_2023-07-11_11-52-03.jpg
  • @HughEverett #2727 11:52 AM, 11 Jul 2023
    Maybe reloading symbols? .sym reload?
  • @ricnar #2728 11:52 AM, 11 Jul 2023
    a messagebox is displaying at this moment
  • @ricnar #2729 11:52 AM, 11 Jul 2023

    photo_2023-07-11_11-52-38.jpg
  • @ricnar #2730 11:52 AM, 11 Jul 2023
    cannot be paged out
  • @ricnar #2731 11:53 AM, 11 Jul 2023
    .sym download
  • @HughEverett ↶ Reply to #2731 #2732 11:53 AM, 11 Jul 2023
    .sym reload
  • @ricnar #2733 11:54 AM, 11 Jul 2023

    photo_2023-07-11_11-54-15.jpg
  • @HughEverett ↶ Reply to #2726 #2734 11:54 AM, 11 Jul 2023
    When did you use this command? Immediately after running it?
  • @HughEverett ↶ Reply to #2733 #2735 11:54 AM, 11 Jul 2023
    Oops, something went wrong. Crashed. You need to restart that.
  • @ricnar #2736 11:54 AM, 11 Jul 2023
    its blocked now
  • @ricnar #2737 11:55 AM, 11 Jul 2023
    no probelm i have the snapshot of the host and target previous to connect all configured
  • @HughEverett #2738 11:57 AM, 11 Jul 2023
    Please make sure that once you access the 'user32!MessageBoxA', the address is loaded in the target module. Because I suspect (maybe) Windows didn't load that DLL into the process if you immediately access it.
  • @HughEverett #2739 11:57 AM, 11 Jul 2023
    But, if you run it and it showed 'Hello World!' then after that, it should be present.
  • @ricnar #2740 11:58 AM, 11 Jul 2023

    photo_2023-07-11_11-58-17.jpg
  • @ricnar #2741 12:00 PM, 11 Jul 2023
    in the entry point
  • @ricnar #2742 12:00 PM, 11 Jul 2023

    photo_2023-07-11_12-00-31.jpg
  • @ricnar #2743 12:00 PM, 11 Jul 2023
    i can redownload the symbols
  • @ricnar #2744 12:00 PM, 11 Jul 2023
    and reload again
  • @ricnar #2745 12:01 PM, 11 Jul 2023
    for avoid changes when switching
  • @HughEverett #2746 12:01 PM, 11 Jul 2023
    Let me check it with x64dbg.
  • @HughEverett #2747 12:02 PM, 11 Jul 2023
    Are you trying to access the user32!MessageBoxA at the entrypoint?
  • @ricnar #2748 12:02 PM, 11 Jul 2023

    photo_2023-07-11_12-02-41.jpg
  • @ricnar #2749 12:02 PM, 11 Jul 2023
    yes but now i will run till messagebox appears
  • @ricnar #2750 12:03 PM, 11 Jul 2023

    photo_2023-07-11_12-03-09.jpg
  • @ricnar #2751 12:03 PM, 11 Jul 2023
    i break
  • @ricnar #2752 12:03 PM, 11 Jul 2023
    switch context
  • @ricnar #2753 12:03 PM, 11 Jul 2023

    photo_2023-07-11_12-03-49.jpg
  • @ricnar #2754 12:03 PM, 11 Jul 2023
    the messagebox is displaying now
  • @ricnar #2755 12:05 PM, 11 Jul 2023

    photo_2023-07-11_12-05-20.jpg
  • @ricnar #2756 12:05 PM, 11 Jul 2023
    i'm in the context of the process and messagebox are displaying now
  • @HughEverett #2757 12:05 PM, 11 Jul 2023
    So, is it still incorrect?
  • @ricnar #2758 12:05 PM, 11 Jul 2023

    photo_2023-07-11_12-05-59.jpg
  • @ricnar #2759 12:06 PM, 11 Jul 2023
    yes
  • @ricnar #2760 12:06 PM, 11 Jul 2023
    albeit messagebox is displaying
  • @ricnar #2761 12:06 PM, 11 Jul 2023
    cannot be put a bp in mesagebox
  • @ricnar #2762 12:06 PM, 11 Jul 2023
    i'm in the context
  • @HughEverett #2763 12:06 PM, 11 Jul 2023
    Can you read the modules list?
  • @HughEverett #2764 12:06 PM, 11 Jul 2023
    lm um pid 1234
  • @ricnar #2765 12:07 PM, 11 Jul 2023

    photo_2023-07-11_12-07-01.jpg
  • @HughEverett #2766 12:07 PM, 11 Jul 2023

    photo_2023-07-11_12-07-21.jpg
  • @HughEverett #2767 12:07 PM, 11 Jul 2023
    I check the x64dbg and it seems Windows didn't change this yet. All process's user32 are mapped in the same address.
  • @ricnar #2768 12:08 PM, 11 Jul 2023

    photo_2023-07-11_12-08-00.jpg
  • @HughEverett #2769 12:08 PM, 11 Jul 2023
    Ops, did you get it?
  • @ricnar #2770 12:08 PM, 11 Jul 2023

    photo_2023-07-11_12-08-31.jpg
  • @HughEverett #2771 12:08 PM, 11 Jul 2023
    It interprets it as x64 bit.
  • @HughEverett #2772 12:08 PM, 11 Jul 2023
    While it's 32 bit.
  • @ricnar #2773 12:08 PM, 11 Jul 2023
    yes but i think bp is taking the 64 bits module
  • @ricnar #2774 12:08 PM, 11 Jul 2023
    yes
  • @HughEverett #2775 12:09 PM, 11 Jul 2023
    Nice catch, thanks a lot for finding it.
  • @HughEverett #2776 12:09 PM, 11 Jul 2023
    This is a really hidden error, I've never think of it.
  • @HughEverett #2777 12:09 PM, 11 Jul 2023
    And it should be fixed immediately.
  • @ricnar #2778 12:10 PM, 11 Jul 2023
    sometimes is useful to be annoying hehehe
  • @HughEverett #2779 12:10 PM, 11 Jul 2023
    You're always helpful.
  • @HughEverett #2780 12:10 PM, 11 Jul 2023
    So, we can conclude that HyperDbg interprets user32 as a x64-bit module in a 32-bit module.
  • @ricnar #2781 12:10 PM, 11 Jul 2023
    yes
  • @HughEverett #2782 12:11 PM, 11 Jul 2023
    Let me create an issue for it in the GitHub.
  • @ricnar #2783 12:11 PM, 11 Jul 2023
    in a wow64 process it needs take the symbols different
  • @ricnar #2784 12:12 PM, 11 Jul 2023
    but redownloading the symbols does not fix it
  • @HughEverett ↶ Reply to #2784 #2785 12:12 PM, 11 Jul 2023
    Yes, that needs a fix from the code.
  • @HughEverett #2786 12:12 PM, 11 Jul 2023
    As I never reached to this error.
  • @HughEverett #2787 12:13 PM, 11 Jul 2023
    This was buried deep in the codes of HyperDbg,
  • @ricnar #2788 12:14 PM, 11 Jul 2023
    maybe an x32 alternative to x
  • @ricnar #2789 12:14 PM, 11 Jul 2023
    to catch the symbols in wow64 mode
  • @HughEverett ↶ Reply to #2788 #2790 12:14 PM, 11 Jul 2023
    no, we could easily manage that with the same x command.
  • @HughEverett #2791 12:14 PM, 11 Jul 2023
    The should not be a hard to solve problem.
  • @ricnar #2792 12:15 PM, 11 Jul 2023
    it can be detected if a process is a wow64 make this
  • @HughEverett ↶ Reply to #2792 #2793 12:15 PM, 11 Jul 2023
    yes
  • @ricnar #2794 12:15 PM, 11 Jul 2023
    for x and bp
  • @ricnar #2795 12:15 PM, 11 Jul 2023
    and some other commands
  • @HughEverett #2796 12:15 PM, 11 Jul 2023
    exactly
  • @ricnar #2797 12:15 PM, 11 Jul 2023
    some flag
  • @HughEverett ↶ Reply to #2795 #2798 12:17 PM, 11 Jul 2023
    https://github.com/HyperDbg/HyperDbg/issues/243
    Problem with interpreting 32-bit modules in x64 processes · Issue #243 · HyperDbg/HyperDbg

    HyperDbg treats 32-bit modules in the same way as 64-bit modules, meaning that symbols pertaining to 32-bit modules must be loaded independently.

  • @ricnar #2799 12:22 PM, 11 Jul 2023
    👍
  • @ricnar #2800 12:38 PM, 11 Jul 2023
    path is system32
  • @ricnar #2801 12:38 PM, 11 Jul 2023

    photo_2023-07-11_12-38-22.jpg
  • @ricnar #2802 12:38 PM, 11 Jul 2023
    this path only have 64 bits modules
  • @HughEverett ↶ Reply to #2801 #2803 12:38 PM, 11 Jul 2023
    it should be wow64. I'll add that to the issue too.
  • @ricnar #2804 12:39 PM, 11 Jul 2023
    the imagebase and final address are correct
  • @prekvapko ↶ Reply to #2647 #2805 02:02 PM, 11 Jul 2023
    TypeOfThePacket DEBUGGER_REMOTE_PACKET_TYPE_DEBUGGEE_TO_DEBUGGER
    RequestedActionOfThepacket DEBUGGER_REMOTE_PACKET_REQUESTED_ACTION_ON_USER_MODE_PAUSE
  • @prekvapko #2806 02:02 PM, 11 Jul 2023
    also, you need a motherboard with a com serial port
  • @prekvapko #2807 02:03 PM, 11 Jul 2023
    a virtual (pcie) serial port will not work
  • @prekvapko ↶ Reply to #2805 #2808 02:03 PM, 11 Jul 2023
    ^ this is the first packet that debugger receives
  • 12 July 2023 (48 messages)
  • @HughEverett ↶ Reply to #2806 #2809 04:57 AM, 12 Jul 2023
    No, why motherboard? Once I buy a PCI-e serial card, it should be fine.
  • @prekvapko #2810 04:59 AM, 12 Jul 2023
    that requires so much more work though
  • @prekvapko #2811 05:00 AM, 12 Jul 2023
    since you can't natively send to i/o ports
  • @prekvapko #2812 05:00 AM, 12 Jul 2023
    i asked about this already once
  • @HughEverett ↶ Reply to #2811 #2813 05:00 AM, 12 Jul 2023
    🤨🤨🤨
  • @prekvapko #2814 05:00 AM, 12 Jul 2023
    you'd need to write a efi dxe driver, replace/install acpi dbg and dbg2 tables, etc
  • @prekvapko #2815 05:00 AM, 12 Jul 2023
    to even somewhat make this work
  • @prekvapko #2816 05:00 AM, 12 Jul 2023
    and this hasn't been done publicly before
  • @HughEverett ↶ Reply to #2814 #2817 05:02 AM, 12 Jul 2023
    You mean, something like this, isn't enough?
    https://www.aliexpress.com/item/1005005154188493.html
  • @prekvapko #2818 05:03 AM, 12 Jul 2023
    not for debugging purposes
  • @HughEverett #2819 05:03 AM, 12 Jul 2023
    I thought that I can use this PCIe device to connect it to PCI and then use the same HyperDbg functionalities to send data out.
  • @HughEverett ↶ Reply to #2818 #2820 05:03 AM, 12 Jul 2023
    why? 🤔
  • @prekvapko #2821 05:03 AM, 12 Jul 2023
    welp, theoretically you can until there's a bp :)
  • @HughEverett ↶ Reply to #2821 #2822 05:04 AM, 12 Jul 2023
    I can use the kdnet windbg to handle breakpoints in HyperDbg.
  • @HughEverett #2823 05:05 AM, 12 Jul 2023
    In HyperDbg we pass the breakpoint to the same HOST_IDT of the Windows for the debugging of it.
  • @HughEverett #2824 05:06 AM, 12 Jul 2023
    That's why it's possible to intercept breakpoints in VMX-root mode using WinDbg. But, intercepting breakpoints in VMX non-root mode, needs additional considerations in HyperDbg. (e.g., avoid intercepting #BPs in exception bitmap VMCS)
  • @prekvapko #2825 05:08 AM, 12 Jul 2023
    the point, if i understood it correctly, is that with a pcie device you won't be able to send i/o to the guest during a system bp
  • @HughEverett ↶ Reply to #2825 #2826 05:10 AM, 12 Jul 2023
    Why? you mean that IN/OUT instructions on COM ports won't lead to sending/receiving data?

    photo_2023-07-12_05-10-27.jpg
  • @HughEverett #2827 05:10 AM, 12 Jul 2023
    Is it handled through Memory Mapped I/O (MMIO)?
  • @prekvapko #2828 05:19 AM, 12 Jul 2023
    I don't know, that's what I've been told by people who tried/looked into it.
  • @prekvapko #2829 05:19 AM, 12 Jul 2023
    I'll gladly sponsor you a motherboard though
  • @HughEverett ↶ Reply to #2829 #2830 05:20 AM, 12 Jul 2023
    No need. I try to buy one.
  • @HughEverett #2831 05:20 AM, 12 Jul 2023
    But let's ask people to make sure what happens to the serial card.
  • @HughEverett #2832 05:21 AM, 12 Jul 2023
    We could support PCIe serial cards too.
  • @HughEverett #2833 05:21 AM, 12 Jul 2023
    If these cards are supporting only MMIO (not PMIO).
  • @HughEverett #2834 05:22 AM, 12 Jul 2023
    I think going through the PCIe internals would be fun.
  • @ahsatan_99 #2835 09:11 AM, 12 Jul 2023
    Joined.
  • @ricnar #2836 06:17 PM, 12 Jul 2023
    hello
  • @ricnar #2837 06:19 PM, 12 Jul 2023
    Is the bug fix and the page in feature progressing?
  • @HughEverett ↶ Reply to #2837 #2838 08:18 PM, 12 Jul 2023
    Hi, yes, it's almsot done. I will finish it tomorrow. Here's the help of this command:
  • @HughEverett #2839 08:18 PM, 12 Jul 2023

    photo_2023-07-12_20-18-21.jpg
  • @HughEverett #2840 08:18 PM, 12 Jul 2023

    photo_2023-07-12_20-18-21.jpg
  • @HughEverett ↶ Reply to #2837 #2841 08:22 PM, 12 Jul 2023
    I intercepted all the page-fault exceptions on the system to find the valid error codes (page-fault code.). I believe the default behavior of this command (without parameter) should be injecting with the 'p' or present bit set, which indicates that some instructions try to read the target address and user can also change this behavior to 'w' (write) or 'f' (fetch) or 'u' (user access) or a combination of these page-fault codes.
  • @HughEverett #2842 08:26 PM, 12 Jul 2023
    However, one thing that is interesting for me and still unsolved is why sometimes the error code for the page-fault is zero? I couldn't find the reason what happens that lead to a page-fault with error code equal to zero. 🤔
  • @ricnar #2843 08:34 PM, 12 Jul 2023
    The page in command is for the complete section of the address?
  • @ricnar #2844 08:34 PM, 12 Jul 2023
    Or can be greater than 0x1000
  • @HughEverett ↶ Reply to #2843 #2845 08:35 PM, 12 Jul 2023
    Do you mean that we should add a range for it?
  • @ricnar #2846 08:35 PM, 12 Jul 2023
    By example pagen 401000 408000
  • @ricnar #2847 08:35 PM, 12 Jul 2023
    Maybe if a range can be added
  • @ricnar #2848 08:36 PM, 12 Jul 2023
    Will be awesome for unpacking
  • @ricnar #2849 08:36 PM, 12 Jul 2023
    If a complete section is not paged
  • @ricnar #2850 08:36 PM, 12 Jul 2023
    And you need use the monitor command in the same range
  • @ricnar #2851 08:37 PM, 12 Jul 2023
    First you can page in a range and next monitor the same range
  • @HughEverett #2852 08:38 PM, 12 Jul 2023
    So, I'll add a 'size' argument to this command.
  • @HughEverett #2853 08:40 PM, 12 Jul 2023
    But, we have to make sure that a range of memory will need several page-faults to be delivered.
  • @ricnar #2854 08:44 PM, 12 Jul 2023
    And the bug of the 32 bits symbols?
  • @HughEverett ↶ Reply to #2854 #2855 08:46 PM, 12 Jul 2023
    No, I still didn't work on that. Once the page-fault injection command is finished, I will get to that.
  • @ricnar #2856 08:47 PM, 12 Jul 2023
    document_2023-07-12_20-47-37.mp4
  • 13 July 2023 (114 messages)
  • @prekvapko #2857 06:02 AM, 13 Jul 2023
    @HughEverett For the time-based attack evasion, do you also account for instructions that might be between the rdtsc & cpuid instructions?
  • @HughEverett ↶ Reply to #2857 #2858 06:05 AM, 13 Jul 2023
    any special instruction? or regular instructions?
  • @prekvapko #2859 06:05 AM, 13 Jul 2023
    both
  • @prekvapko #2860 06:05 AM, 13 Jul 2023
    entering fpu, avx/sse context switches..
  • @prekvapko #2861 06:05 AM, 13 Jul 2023
    or just regular instructions
  • @HughEverett #2862 06:05 AM, 13 Jul 2023
    I don't remember it, let me see.
  • @HughEverett ↶ Reply to #2861 #2863 06:08 AM, 13 Jul 2023
    as long as I see it in the source code, I think it can also bypass regular instructions but not sure about fpu, avx/sse instructions. 🤔
  • @prekvapko #2864 06:08 AM, 13 Jul 2023
    I'll give it a quick check
  • @HughEverett ↶ Reply to #2864 #2865 06:09 AM, 13 Jul 2023
    I didn't test this mechanism for years. It might cause instabilities on your system.
  • @HughEverett #2866 06:10 AM, 13 Jul 2023
    But, feel free to add new features and possible new detections to the transparent-mode. It's still one of the places in HyperDbg that needs lots of contributions.
  • @prekvapko #2867 06:30 AM, 13 Jul 2023

    photo_2023-07-13_06-30-10.jpg
  • @prekvapko #2868 06:30 AM, 13 Jul 2023
    looks good, but cpuid in between catches it
  • @prekvapko #2869 06:31 AM, 13 Jul 2023
    left is without hide right is with
  • @prekvapko #2870 06:35 AM, 13 Jul 2023
    long long a = __rdtsc();
    _mm_lfence();
    for (size_t i = 0; i != 64; i++)
    {
    __asm
    {
    addps xmm1, xmm0
    addps xmm2, xmm1
    addps xmm3, xmm2
    addps xmm0, xmm3
    cpuid
    addps xmm1, xmm0
    addps xmm2, xmm1
    addps xmm3, xmm2
    addps xmm0, xmm3
    }
    }
    long long b = __rdtsc();
    _mm_lfence();
  • @prekvapko #2871 06:36 AM, 13 Jul 2023
    ran 1024 times, b - a stored
  • @HughEverett ↶ Reply to #2867 #2872 06:38 AM, 13 Jul 2023
    Is it working now?
  • @HughEverett #2873 06:38 AM, 13 Jul 2023
    The overall logic behind it is very simple. It can be manipulated here:
    https://github.com/HyperDbg/HyperDbg/blob/a571781e8651998b982a9f53edf8f3d3501a6b2e/hyperdbg/hprdbghv/code/transparency/Transparency.c
    HyperDbg/hyperdbg/hprdbghv/code/transparency/Transparency.c at a571781e8651998b982a9f53edf8f3d3501a6b2e · HyperDbg/HyperDbg

    State-of-the-art native debugging tool. Contribute to HyperDbg/HyperDbg development by creating an account on GitHub.

  • @HughEverett #2874 10:42 AM, 13 Jul 2023
    @ricnar Do you have any idea how we can implement this '.pagein' command for the VMI mode?
  • @HughEverett #2875 10:44 AM, 13 Jul 2023
    The problem here is, we never context switched to a new process in the VMI Mode. I'm sure we have to manage it with something like APC but, I'm not sure if that's a good idea. Because APCs are in APC_LEVEL IRQL which might cause problem for delivering the page-faults. 🤔
  • @ricnar #2876 11:00 AM, 13 Jul 2023
    my ideas are dirty jeje reading or writing to the address but storing the orginal content to restore
  • @ricnar #2877 11:01 AM, 13 Jul 2023
    reading is easier storing the original value of the register where the value is readed
  • @ricnar #2878 11:01 AM, 13 Jul 2023
    this will trigger the exception
  • @ricnar #2879 11:02 AM, 13 Jul 2023
    and i think will be paged
  • @ricnar #2880 11:02 AM, 13 Jul 2023
    is a little hack
  • @ricnar #2881 11:02 AM, 13 Jul 2023
    dirty
  • @HughEverett #2882 11:05 AM, 13 Jul 2023
    Probably, we need to be in the context of the target process. Because otherwise, we might break the operating system semantics. Writing on the other process means that we forced the cr3 to change to the target process and meanwhile, injecting #PF is wrong. Because, once the OS wants to handle the page-fault, it realizes that the current process details don't match with cr3 and probably lead to a BSOD.
  • @ricnar #2883 11:09 AM, 13 Jul 2023
    i didnt't try the user mode mode but in normal user mode debuggers non paged does not happen
  • @ricnar #2884 11:09 AM, 13 Jul 2023
    i think hyperdbg is different than a normal user mode debugger
  • @HughEverett ↶ Reply to #2884 #2885 11:37 AM, 13 Jul 2023
    Yes, in user-mode debugger it's handled transparently by the operating system. But as we're in halt the operating system in the hypervisor-level, we have to consider paging.
  • @ricnar #2886 11:42 AM, 13 Jul 2023
    I see
  • @ricnar #2887 11:43 AM, 13 Jul 2023
    I don't know how to do
  • @HughEverett #2888 11:43 AM, 13 Jul 2023
    I'm gonna test attaching to the target process stack.
  • @HughEverett #2889 11:43 AM, 13 Jul 2023
    To see what happens.
  • @ricnar #2890 11:44 AM, 13 Jul 2023
    When I use your start command in kernel debugging when I reach the entry point are in the same context
  • @HughEverett ↶ Reply to #2890 #2891 11:44 AM, 13 Jul 2023
    yes.
  • @ricnar #2892 11:44 AM, 13 Jul 2023
    In this moment read or write is possibly
  • @HughEverett #2893 11:44 AM, 13 Jul 2023
    That's why !pte or !va2pa won't support the 'pid' argument.
  • @ricnar #2894 11:45 AM, 13 Jul 2023
    Context is necessary
  • @ricnar #2895 11:45 AM, 13 Jul 2023
    And telling the user is necessary switch context first?
  • @ricnar #2896 11:45 AM, 13 Jul 2023
    And the command only can be used in the same context?
  • @HughEverett #2897 11:46 AM, 13 Jul 2023
    I'm thinking about intercepting the clock-interrupt in the target process, and once we're in the context of target process, we could inject it.
  • @HughEverett ↶ Reply to #2897 #2898 11:49 AM, 13 Jul 2023
    But, the thing about this method is, we're not sure whether the context of the process once we intercept it, is in the kernel-mode or the user-mode. So, it's like the user tries to inject a page-fault from the kernel-mode but the context of the process is in the user-mode. Thus, Windows interprets it as an attempt to read a kernel address from a user-mode process and delivers an exception to the SEH handler of the process which might lead to crashing the target process.
  • @ricnar #2899 11:50 AM, 13 Jul 2023
    Ah
  • @ricnar #2900 11:51 AM, 13 Jul 2023
    Very difficult
  • @nut_gonna_update_lol #2901 12:27 PM, 13 Jul 2023
    Joined.
  • @HughEverett #2902 01:21 PM, 13 Jul 2023
    @ricnar would you please send your packed file again?
  • @HughEverett #2903 01:22 PM, 13 Jul 2023
    I'm gonna test the .pagein now.
  • @HughEverett #2904 01:22 PM, 13 Jul 2023
    And also, send the expected address to bring it in.
  • @ricnar #2906 01:23 PM, 13 Jul 2023
    i don't remember if is this
  • @ricnar #2907 01:23 PM, 13 Jul 2023
    i have a lot
  • @HughEverett ↶ Reply to #2907 #2908 01:24 PM, 13 Jul 2023
    💪💪👌
  • @HughEverett ↶ Reply to #2905 #2909 01:27 PM, 13 Jul 2023
    Do you have any idea about the expected address? I remember you told me you knew the section address which was an static address. 🧐
  • @ricnar #2910 01:29 PM, 13 Jul 2023
    the second line from the entry point
  • @ricnar #2911 01:30 PM, 13 Jul 2023

    photo_2023-07-13_13-30-02.jpg
  • @ricnar #2912 01:30 PM, 13 Jul 2023
    has the finalization of the cod esection
  • @ricnar #2913 01:30 PM, 13 Jul 2023
    code setion
  • @ricnar #2914 01:30 PM, 13 Jul 2023
    it will change by aslr but you can grab from this line
  • @HughEverett #2915 01:30 PM, 13 Jul 2023
    So, you mean the address that is expected to be paged-in is 408000?
  • @HughEverett #2916 01:30 PM, 13 Jul 2023
    Oh, yes
  • @ricnar #2917 01:30 PM, 13 Jul 2023
    no
  • @HughEverett #2918 01:31 PM, 13 Jul 2023
    I'll do that now.
  • @ricnar #2919 01:31 PM, 13 Jul 2023
    this is the end of the section
  • @ricnar #2920 01:31 PM, 13 Jul 2023
    it start 0x7000 before
  • @ricnar #2921 01:31 PM, 13 Jul 2023
    the address will be the grabbed from this line -0x7000
  • @ricnar #2922 01:31 PM, 13 Jul 2023
    minus 0x7000
  • @HughEverett #2923 01:31 PM, 13 Jul 2023
    -0x7000 from entrypoint?
  • @ricnar #2924 01:32 PM, 13 Jul 2023
    without randomization is 0x401000 till 0x408000
  • @ricnar #2925 01:32 PM, 13 Jul 2023
    this will be the code section without aslr
  • @HughEverett #2926 01:32 PM, 13 Jul 2023
    Okay, so I can run it until the entrypoint.
  • @HughEverett #2927 01:32 PM, 13 Jul 2023
    And fine the .text address with ASLR
  • @ricnar #2928 01:32 PM, 13 Jul 2023
    you can grab the end from the second line
  • @ricnar #2929 01:32 PM, 13 Jul 2023
    substract 0x7000
  • @ricnar #2930 01:33 PM, 13 Jul 2023
    and you will have the start and end of the section
  • @HughEverett ↶ Reply to #2929 #2931 01:33 PM, 13 Jul 2023
    Subtract 0x7000 from what?
  • @ricnar #2932 01:33 PM, 13 Jul 2023

    photo_2023-07-13_13-33-32.jpg
  • @ricnar #2933 01:33 PM, 13 Jul 2023
    this is the second line with aslr when running
  • @ricnar #2934 01:33 PM, 13 Jul 2023
    A28000 is the end of the code section
  • @ricnar #2935 01:34 PM, 13 Jul 2023
    the start will be A28000-0x7000
  • @HughEverett #2936 01:34 PM, 13 Jul 2023
    So, HyperDbg is supposed to make A28000-0x7000 available?
  • @ricnar #2937 01:34 PM, 13 Jul 2023

    photo_2023-07-13_13-34-43.jpg
  • @ricnar #2938 01:34 PM, 13 Jul 2023
    yes
  • @ricnar #2939 01:34 PM, 13 Jul 2023
    is the code section
  • @HughEverett #2940 01:35 PM, 13 Jul 2023
    Okay, let me test it now.
  • @ricnar #2941 01:35 PM, 13 Jul 2023
    is not paged but is part of the sections of the excutable
  • @ricnar #2942 01:35 PM, 13 Jul 2023
    the packer will write the unpacked code in this section
  • @ricnar #2943 01:36 PM, 13 Jul 2023
    and jump to the OEP the real entry point of unpacked in this section
  • @ricnar #2944 01:37 PM, 13 Jul 2023

    photo_2023-07-13_13-37-45.jpg
  • @ricnar #2945 01:38 PM, 13 Jul 2023
    is monitor whit x option is enabled in this section, it should stop here
  • @ricnar #2946 01:38 PM, 13 Jul 2023
    the first line executed
  • @HughEverett #2947 01:42 PM, 13 Jul 2023

    photo_2023-07-13_13-42-52.jpg
  • @HughEverett ↶ Reply to #2944 #2948 01:44 PM, 13 Jul 2023

    photo_2023-07-13_13-44-18.jpg
  • @HughEverett ↶ Reply to #2948 #2949 01:46 PM, 13 Jul 2023
    okay, it seems that it works in this case. Am I do it right @ricnar ?
  • @ricnar #2950 01:47 PM, 13 Jul 2023
    yes
  • @ricnar #2951 01:47 PM, 13 Jul 2023
    you can test if you can page in all the rangle
  • @ricnar #2952 01:47 PM, 13 Jul 2023
    range
  • @ricnar #2953 01:47 PM, 13 Jul 2023
    228000-7000 till 228000
  • @ricnar #2954 01:48 PM, 13 Jul 2023
    page in all this range
  • @ricnar #2955 01:48 PM, 13 Jul 2023
    and put a monitor command x
  • @ricnar #2956 01:48 PM, 13 Jul 2023
    in all this range to look if stops in the same line i show you the real OEP
  • @HughEverett #2957 01:49 PM, 13 Jul 2023
    okay, it's a really good test-case. I didn't implement the range page-in yet.
  • @ricnar #2958 01:49 PM, 13 Jul 2023
    perfect
  • @HughEverett #2959 01:49 PM, 13 Jul 2023
    but, just for one page, it works now.
  • @ricnar #2960 01:49 PM, 13 Jul 2023
    yes
  • @ricnar #2961 01:49 PM, 13 Jul 2023
    but you can appreciate here the value of the pagein in a range
  • @ricnar #2962 01:50 PM, 13 Jul 2023
    the importance
  • @HughEverett #2963 01:50 PM, 13 Jul 2023
    The only thing that remain unsolved is :
    1. Finding a way to run this command in VMI Mode
    2. Implement the range page-in
  • @ricnar #2964 01:50 PM, 13 Jul 2023
    perfect
  • @HughEverett ↶ Reply to #2961 #2965 01:53 PM, 13 Jul 2023
    Yes, I'll do that. But it needs some extra considerations. Like, some pages are allocated with 3-level of paging (big page) with 2 MB granularity. I have to make sure whether the target range is within a 4 KB page or a 2 MB page to avoid injecting page-faults to a single page multiple times. Which will cause a crash in the target process if we didn't truly respect the page granularity as one single page might receive page-faults multiple times.
  • @HughEverett #2966 01:54 PM, 13 Jul 2023
    I'll push the current version to the github and will continue working on it tomorrow.
  • @ricnar #2967 01:54 PM, 13 Jul 2023
    i think jumping 0x1000 bytes ahead in a cycle and repeting the pagein can work
  • @HughEverett ↶ Reply to #2967 #2968 01:56 PM, 13 Jul 2023
    yes, but having a range is a better way of handling it 😌
  • @ricnar #2969 01:57 PM, 13 Jul 2023
    yes ciclying inside the range adding 0x1000 to the original address if is located inside the range pagein and repeat if not exit and so on
  • @HughEverett ↶ Reply to #2969 #2970 01:57 PM, 13 Jul 2023
    exactly
  • @arch_msi #2971 05:48 PM, 13 Jul 2023
    Joined.
  • 14 July 2023 (14 messages)
  • @HughEverett ↶ Reply to #2969 #2972 07:30 AM, 14 Jul 2023
    @ricnar There is a technical difficulty here in supporting a range in the '.pagein' command that my previous assumption might not work for that. Generally, what we do now, is injecting a #PF in the target guest and set a trap flag in the target process. Then, we ask the user, to press the 'g' which will continue the debugger and once the target debgee continues, the page-fault is delivered to the process and Windows page-fault handler will manage it. Now, how we can halt the debuggee in the target process again? The answer is as we set the RFLAG's TRAP FLAG, the same process (and same thread) will throw a debug break (#DB) and we intercept the target thread again while one instruction is executed there. This approach is totally fine and works perfectly.

    But the problem is once, we want to specify a range, we have to either start submitting our requests in a loop and each time run one instruction (because of the trap flag), and bring one page in. This is completely possible, but it's an ugly way of handling issues. Because, once the debuggee is halted again, the target program might be executed several instructions (as the result of the trap flag) and I think it's considered a weird behavior in a debugger.

    Previously, my assumption was utilizing the interrupt window exiting in the VMCS, injecting several page faults all at once, and each of them is delivered to the debuggee once the interrupt window is open. This way, we could inject all of the page faults while only one instruction will be executed in the target. But, unfortunately, based on my current tests this approach is proved to be problematic in some cases.

    For example, we might inject a #pf once the interrupt window is open but it's not guaranteed that the operating system won't context switch while it's handling an interrupt. So, once the #PF is handled in the OS, the interrupt window is open and we might land on a different process as the OS has already context-switched to another process.

    Someone might think that is why we have to use trap flags. Because what other things to use? If for example, we use a breakpoint (0xcc) on the current instruction to avoid running a single instruction, then it's still not a good idea. Why? Because the user might (and will) inject a page-fault while it's operating at a shared Windows library. For instance, assume if the user is in the 'kernel32.dll' and wants to inject a page-fault. If we set a 0xcc on the current instruction of the thread. Other threads from other processes might trigger the breakpoint as the libraries are using the same physical address.

    Thus, I believe it's better not to support the range for the '.pagein' command for now because this way the user understands that by injecting one page-fault, one instruction will be executed in the target debuggee. If you guys have any other ideas, please let me know so we can investigate the possible solutions.
  • @ricnar #2973 07:53 AM, 14 Jul 2023
    I see
  • @HughEverett ↶ Reply to #2973 #2974 10:47 AM, 14 Jul 2023
    I'm done with testing it. The '.pagein' command is now ready to be used.

    photo_2023-07-14_10-47-17.jpg
  • @HughEverett ↶ Reply to #2974 #2975 10:48 AM, 14 Jul 2023
    Btw, make sure to use the 'u2' command, instead of the 'u' because it's 32-bit target.
  • @ricnar #2977 11:08 AM, 14 Jul 2023
    The 32 bits problem is solved?
  • @HughEverett ↶ Reply to #2977 #2978 11:08 AM, 14 Jul 2023
    not yet. I'm working on that right now.
  • @ricnar #2979 11:09 AM, 14 Jul 2023
    I will try thanks
  • @ricnar #2980 11:32 AM, 14 Jul 2023
    today i'm busy at work, tomorrow i will try
  • @HughEverett #2981 01:14 PM, 14 Jul 2023
    Here's the documentation page for the '.pagein' command:
    https://docs.hyperdbg.org/commands/meta-commands/.pagein
    .pagein (bring the page into the RAM)

    Description of the '.pagein' command in HyperDbg.

  • @ricnar #2982 01:18 PM, 14 Jul 2023
    👍
  • @ricnar #2983 07:28 PM, 14 Jul 2023
    I have an idea
  • @ricnar #2984 07:31 PM, 14 Jul 2023
    What would happen if, for example, you have to make a pagein of 5000 bytes and you make an allocation of that same size and then a reps movs to read the area to be paged and copy it there
  • @ricnar #2985 07:31 PM, 14 Jul 2023
    Copying all the block in one only instruction
  • @ricnar #2986 07:32 PM, 14 Jul 2023
    How the system resolves this case?
  • 15 July 2023 (31 messages)
  • @HughEverett ↶ Reply to #2984 #2988 08:22 AM, 15 Jul 2023
    I didn't get the idea but generally there is no way to allocate memory while HyperDbg is operating at the VMX root-mode. Because, the API functions that we need to call have to be HIGH_IRQL compatible, which none of the memory functions of Windows are designed for this purpose.
  • @HughEverett #2989 08:23 AM, 15 Jul 2023
    That's why HyperDbg uses it's own pool manager for VMX root-mode.
    https://github.com/HyperDbg/HyperDbg/blob/master/hyperdbg/hprdbghv/code/memory/PoolManager.c
    HyperDbg/hyperdbg/hprdbghv/code/memory/PoolManager.c at master · HyperDbg/HyperDbg

    State-of-the-art native debugging tool. Contribute to HyperDbg/HyperDbg development by creating an account on GitHub.

  • @HughEverett ↶ Reply to #2988 #2990 08:24 AM, 15 Jul 2023
    But, it would be best if you can clarify it a little bit. 🤔
  • @ricnar #2991 09:25 AM, 15 Jul 2023
    Using in a reps movs instruction with the non paged region as source and any temporal buffer as destination
  • @ricnar #2992 09:26 AM, 15 Jul 2023
    Using all the region to be paged in one instruction
  • @ricnar #2993 10:30 AM, 15 Jul 2023
    is only a non important idea
  • @ricnar #2994 12:09 PM, 15 Jul 2023
    something extrange happen with the monitor command
  • @ricnar #2996 12:10 PM, 15 Jul 2023
    this version of the packed program has the ASLR disabled to explain better
  • @ricnar #2997 12:13 PM, 15 Jul 2023
    using IDA and putting a breakpoint on execution from 401000 to 408000 it stops in the OEP here
  • @ricnar #2998 12:13 PM, 15 Jul 2023

    photo_2023-07-15_12-13-08.jpg
  • @ricnar #2999 12:13 PM, 15 Jul 2023
    the first line executed in this section
  • @ricnar #3000 12:13 PM, 15 Jul 2023
    but using hyperdbg
  • @ricnar #3001 12:14 PM, 15 Jul 2023
    using page in in the block 0x401000 to 0x401fff
  • @ricnar #3002 12:14 PM, 15 Jul 2023

    photo_2023-07-15_12-14-50.jpg
  • @ricnar #3003 12:15 PM, 15 Jul 2023
    and using a monitor command in this range
  • @ricnar #3004 12:15 PM, 15 Jul 2023

    photo_2023-07-15_12-15-24.jpg
  • @ricnar #3005 12:16 PM, 15 Jul 2023
    it skips the ope in 40146e and stops later
  • @ricnar #3006 12:16 PM, 15 Jul 2023

    photo_2023-07-15_12-16-52.jpg
  • @ricnar #3007 12:17 PM, 15 Jul 2023
    in another function
  • @ricnar #3008 12:17 PM, 15 Jul 2023

    photo_2023-07-15_12-17-31.jpg
  • @ricnar #3009 12:31 PM, 15 Jul 2023
    can the page in command in the same block affect the monitor command?
  • @HughEverett ↶ Reply to #2992 #3010 03:24 PM, 15 Jul 2023
    Yes, I also thought about this, but the thing is which region? We have to allocate something in the target process. Am I right? So, it's not a good idea for the transparency. If the memory is allocated in the kernel. Still, we cannot move the context from user-mode to kernel-mode. We could forcibly do it but, this way, we'll break the OS semantic as a thread is supposed to spin user-mode while it's currently in kernel-mode. Which doesn't make sense.
  • @HughEverett ↶ Reply to #3009 #3011 03:28 PM, 15 Jul 2023
    no, of course not. you mean it passed the entrypoint but HyperDbg didn't notice it?
  • @HughEverett #3012 03:30 PM, 15 Jul 2023
    The !monitor command will continue the guest for some time. How did you prevent it from running? is there any other threads in the process?
  • @ricnar #3013 03:48 PM, 15 Jul 2023
    But the oep instruction is in the Main thread and is the first instruction of the original executed
  • @HughEverett ↶ Reply to #3013 #3015 03:53 PM, 15 Jul 2023
    yes, but how did you run the !monitor command? I mean setting the !monitor itself runs the debuggee for some time. At this time, the thread will get a chance to be executed (and possibly run the OEP). Previously, I mentioned, even when I make the '.pagein' command, we still need another command to spin the current thread so, we can set the !monitor. But, I remember, you told me you used a dirty trick to halt the current thread. I am right? or is it the lack of the spinning command is problematic right now?
  • @ricnar #3016 03:54 PM, 15 Jul 2023
    I will try
  • @HughEverett ↶ Reply to #3016 #3017 03:55 PM, 15 Jul 2023
    yes, no worries about these problems. whatever happens, I'm here to solve it. 👍
  • @my_telegra #3018 04:54 PM, 15 Jul 2023
    Joined.
  • @5978511860 ↶ Reply to #3017 #3019 11:01 PM, 15 Jul 2023
    hi i have Q
  • @5978511860 #3020 11:02 PM, 15 Jul 2023
    What is this group and how can I benefit from what you are talking about
  • 16 July 2023 (34 messages)
  • @apkunpacker ↶ Reply to #3020 #3021 03:29 AM, 16 Jul 2023
    1. If you don't know what this group for , why you are here ? Just random joining from other groups?
    2. HyperDbg is an open-source, user-mode, and kernel-mode debugger that relies on hardware features to debug the Windows Kernel and Applications.
  • @5781093824 #3022 11:20 AM, 16 Jul 2023
    Joined.
  • @ricnar #3023 12:01 PM, 16 Jul 2023
    did you know this debugger checking test
  • @ricnar #3024 12:01 PM, 16 Jul 2023
    https://github.com/hfiref0x/WubbabooMark
    GitHub - hfiref0x/WubbabooMark: Debugger Anti-Detection Benchmark

    Debugger Anti-Detection Benchmark. Contribute to hfiref0x/WubbabooMark development by creating an account on GitHub.

  • @ricnar #3025 12:01 PM, 16 Jul 2023

    photo_2023-07-16_12-01-57.jpg
  • @ricnar #3026 12:02 PM, 16 Jul 2023

    photo_2023-07-16_12-02-12.jpg
  • @ricnar #3027 12:02 PM, 16 Jul 2023
    hyperdbg remains tracing
  • @ricnar #3028 12:02 PM, 16 Jul 2023
    and did not finish the test
  • @ricnar #3029 12:04 PM, 16 Jul 2023

    photo_2023-07-16_12-04-11.jpg
  • @HughEverett ↶ Reply to #3029 #3030 12:14 PM, 16 Jul 2023
    Hi,
    Yes, I saw it yesterday. For now, it seems that they only check for the object device name of HyperDbg, which can be easily bypassed by using a different name in the source code. However, for the test, it's just a matter of injecting or not injecting #DBs into the guest. Once, I have free time, I'll check that to see how we can bypass its mitigations.

    photo_2023-07-16_12-14-46.jpg
  • @HughEverett ↶ Reply to #3023 #3031 12:17 PM, 16 Jul 2023
    Also, @ricnar FYI, I changed the behavior of symbol search, and now the module search is case-insensitive and I almost fixed the issue regarding the loading of SysWow64 modules. I'll let you know once it's finished (probably tonight).
  • @ricnar #3032 12:17 PM, 16 Jul 2023
    great
  • @HughEverett ↶ Reply to #3032 #3033 04:17 PM, 16 Jul 2023
    The issue is now fixed. But, I have to test it with several other conditions (hopefully tomorrow) to make sure it works as expected.
    https://github.com/HyperDbg/HyperDbg/issues/243
    https://github.com/HyperDbg/HyperDbg/commit/249320d8c94086a840b7397d2227effb637ba535
    Problem with interpreting 32-bit modules in x64 processes · Issue #243 · HyperDbg/HyperDbg

    HyperDbg treats 32-bit modules in the same way as 64-bit modules, meaning that symbols pertaining to 32-bit modules must be loaded independently.

  • @ricnar #3034 04:21 PM, 16 Jul 2023
    document_2023-07-16_16-21-22.mp4
  • @HughEverett ↶ Reply to #3034 #3035 04:21 PM, 16 Jul 2023
    One interesting thing that I didn't know was that symbols (PDB files) for Wow64 DLLs start with a 'w' prefix. For example, 'wntdll.pdb', 'wkernelbase.pdb', 'wuser32.pdb', etc.
  • @ricnar ↶ Reply to #3035 #3036 04:24 PM, 16 Jul 2023
    I didn't know either
  • @prekvapko ↶ Reply to #3038 #3039 06:03 PM, 16 Jul 2023
    https://rayanfam.com/topics/hypervisor-from-scratch-part-1/
    Hypervisor From Scratch - Part 1: Basic Concepts & Configure Testing Environment

    We write about Windows Internals, Hypervisors, Linux, and Networks.

  • @mehrdadblue11 #3040 07:54 PM, 16 Jul 2023
    Joined.
  • @mehrdadblue11 #3041 07:56 PM, 16 Jul 2023
    How does hyperdbg work to read MSRs ? does it connect to cpu directly?and use cpu instructions to bypass OS ?
    is there any debugger to work like that? if no why dont they make like hyperdbg to debugg in user and kernel mode.
  • @HughEverett ↶ Reply to #3041 #3042 07:58 PM, 16 Jul 2023
    HyperDbg uses regular WRMSR and RDMSR instructions to read/write on MSR registers.
    Please check:

    https://docs.hyperdbg.org/commands/debugging-commands/rdmsr
    https://docs.hyperdbg.org/commands/debugging-commands/wrmsr
    rdmsr (read model-specific register)

    Description of the 'rdmsr' command in HyperDbg.

  • @mehrdadblue11 #3043 08:00 PM, 16 Jul 2023
    Ollydbg and IDA are not like hyperdbg.
    e.x.
    I use rdmsr and wrmsr in Ollydbg but it does not work.it comment " privilaged command" . surely,Olly cant go beyond.
  • @mehrdadblue11 ↶ Reply to #3042 #3044 08:01 PM, 16 Jul 2023
    I check it bro👍.

    IDA mmm no. I think cant work like hyperdbg,can it?!
  • @HughEverett #3045 08:01 PM, 16 Jul 2023
    But if you mean, how HyperDbg intercepts reads/writes to MSR registers, there is something called 'MSR Bitmap' in VMCS of Intel processor. Once you set one bit on this bitmap (memory), each of the read or write access to the corresponding MSR will cause a VM-exit, in which we form it as MSR events.

    Please check:
    https://docs.hyperdbg.org/commands/extension-commands/msrread
    https://docs.hyperdbg.org/commands/extension-commands/msrwrite
    !msrread (hook RDMSR instruction execution)

    Description of the '!msrread' command in HyperDbg.

  • @ricnar ↶ Reply to #3044 #3046 08:02 PM, 16 Jul 2023
    IDA can use windbg plugin to debug kernel
  • @mehrdadblue11 ↶ Reply to #3045 #3047 08:04 PM, 16 Jul 2023
    wooowww 👍.so This is why hyperdbg catch very low events.I mean it works out of regular ring0,3 . below zero.right?
  • @HughEverett ↶ Reply to #3043 #3048 08:04 PM, 16 Jul 2023
    Reading and writing to MSRs needs kernel mode privilege.
  • @HughEverett ↶ Reply to #3046 #3049 08:04 PM, 16 Jul 2023
    Exactly
  • @mehrdadblue11 ↶ Reply to #3046 #3050 08:04 PM, 16 Jul 2023
    ye ye that is a plugin.this is not in its core of the app.
  • @HughEverett ↶ Reply to #3047 #3051 08:05 PM, 16 Jul 2023
    Yes, it works on ring -1. Lower than the operating system.
  • @mehrdadblue11 ↶ Reply to #3051 #3052 08:08 PM, 16 Jul 2023
    oo man.that is amazing. hyperdbg is better than othe debuggers by far. I am so womder how you though to make such a practical debugger which can catch high level viruses.
    thnk bro👍☕
  • @mehrdadblue11 ↶ Reply to #3048 #3053 08:09 PM, 16 Jul 2023
    ye which Olly and IDA can not go beyond.not witough plugin.
  • @HughEverett ↶ Reply to #3052 #3054 08:13 PM, 16 Jul 2023
    Thanks. Personally, I don't think that HyperDbg is better than other debuggers, it's just with different capabilities and designed for different purposes. For example, for driver development, of course, WinDbg is better. Or if you want to debug a user-mode application, of course, the best option is x64dbg.

    But, sometimes, you need extra information or you need hardware capabilities to assist you in your debugging journey. That's when you can use HyperDbg to ease your analysis or reverse engineering.
  • @mehrdadblue11 ↶ Reply to #3054 #3055 08:17 PM, 16 Jul 2023
    Ye ye I mean hyperdbg capabilities are more practical.You can not catch high level viruses with Olly or IDA(whiich iiss reaallly good)you know that the viruses are on devicedriver layer. is it possoble yo catch boot rootkits or I dont know DKOM attacks with other debuggers?!. in these situations, we need a debugger that works on rings below zero just like hyperdbg not x64dbg.
    for normal works normal cracking ye olly , ida , x64 are enough. i know Ida is really good but ....
  • @mehrdadblue11 ↶ Reply to #3054 #3056 08:17 PM, 16 Jul 2023
    part two : ye ye I agree. I need a lot to know about hardware to do so well.
  • 17 July 2023 (6 messages)
  • @1638783893 #3057 08:52 PM, 17 Jul 2023
    Joined.
  • @5978511860 ↶ Reply to #3021 #3058 08:53 PM, 17 Jul 2023
    I haven't spoken to you. I'm talking to the owner
  • @HughEverett #3059 09:18 PM, 17 Jul 2023
    Guys, just take a deep breath and chill out.
  • @HughEverett #3060 09:18 PM, 17 Jul 2023
    Don't take anything seriously.
  • @HughEverett ↶ Reply to #3020 #3061 09:22 PM, 17 Jul 2023
    We're here to talk about HyperDbg debugger and have discussions of how we can make it a more suitable tool for our reverse engineering experiences.
  • @5539033269 #3062 09:31 PM, 17 Jul 2023
    Pls ask meaningfully questions, and no fights pls
  • 18 July 2023 (17 messages)
  • @HughEverett #3063 11:42 AM, 18 Jul 2023
    @ricnar The problem with loading 32-bit modules is now completely solved and ready to test.
  • @HughEverett #3064 11:43 AM, 18 Jul 2023

    photo_2023-07-18_11-43-05.jpg
  • @HughEverett ↶ Reply to #3064 #3065 11:44 AM, 18 Jul 2023
    I test it with your example, "user32!messageboxa". Please note that, based on your previous feedback, it's no longer case-sensitive. 🙃
  • @HughEverett #3066 11:45 AM, 18 Jul 2023
    Just one more thing, based on my tests, once you start a process (run it by using the '.start' command), the user32 and probably other modules are not loaded into the memory.
  • @HughEverett #3067 11:46 AM, 18 Jul 2023
    So, in order to bring them into the memory, the '.pagein' command needs to be used.
  • @HughEverett #3068 11:46 AM, 18 Jul 2023
    I test it with this program.

    photo_2023-07-18_11-46-42.jpg
  • @HughEverett #3069 11:46 AM, 18 Jul 2023
    ConsoleApplication1.cpp
  • @ricnar #3070 11:48 AM, 18 Jul 2023
    Thanks I will test it
  • @HughEverett ↶ Reply to #3070 #3071 11:49 AM, 18 Jul 2023
    I try to release v0.4 now.
  • @ricnar #3072 11:52 AM, 18 Jul 2023
    Perfect
  • @ricnar #3073 11:52 AM, 18 Jul 2023
    I will try in the weekend
  • @Manolo_AF #3074 12:12 PM, 18 Jul 2023
    Joined.
  • @HughEverett #3075 12:50 PM, 18 Jul 2023
    HyperDbg v0.4 is released.

    https://github.com/HyperDbg/HyperDbg/releases/tag/v0.4.0
    Release v0.4.0 · HyperDbg/HyperDbg

    HyperDbg v0.4 is released! If you’re enjoying HyperDbg, don’t forget to give a star 🌟 on GitHub! Please visit Build & Install to configure the environment for running HyperDbg. Check out the Qu...

  • @ricnar #3076 12:50 PM, 18 Jul 2023
    document_2023-07-18_12-50-48.mp4
  • @Bym24v #3077 01:55 PM, 18 Jul 2023
    Joined.
  • @unittype #3078 07:17 PM, 18 Jul 2023
    Joined.
  • @skranyasi #3079 11:21 PM, 18 Jul 2023
    Joined.
  • 19 July 2023 (22 messages)
  • @killaragorn #3080 03:12 AM, 19 Jul 2023
    Can HyperDbg debug Windows PatchGuard?
  • @HughEverett ↶ Reply to #3080 #3081 04:42 AM, 19 Jul 2023
    Yes. You have plenty of options to monitor PatchGuard.
  • @HughEverett #3082 04:43 AM, 19 Jul 2023
    https://github.com/tandasat/GuardMon/tree/master

    Satoshi Tanda creates a hypervisor years ago to monitor PatchGuard. All of the capabilities that he used in his project are also available in HyperDbg.
    GitHub - tandasat/GuardMon: Hypervisor based tool for monitoring system register accesses.

    Hypervisor based tool for monitoring system register accesses. - GitHub - tandasat/GuardMon: Hypervisor based tool for monitoring system register accesses.

  • @HughEverett #3083 04:46 AM, 19 Jul 2023
    For example,

    for monitoring debug registers:
    https://docs.hyperdbg.org/commands/extension-commands/dr

    for monitoring memory:
    https://docs.hyperdbg.org/commands/extension-commands/monitor
    !dr (hook access to debug registers)

    Description of the '!dr' command in HyperDbg.

  • @prekvapko #3084 06:38 PM, 19 Jul 2023
    Hey, is memory introspection available in v0.4?
  • @HughEverett ↶ Reply to #3084 #3085 06:46 PM, 19 Jul 2023
    The project that I previously talked about it as memory introspection is not yet available. But, what else do you want better than '!monitor'?

    Starting from version 0.4 it's able to intercept Read/Write/Execute from any address range both in the user-mode and the kernel-mode.
  • @prekvapko #3086 06:47 PM, 19 Jul 2023
    Does this allow me to monitor reads coming from a driver to unknown memory locations?
  • @prekvapko #3087 06:47 PM, 19 Jul 2023
    problem is- i'm dealing with a target with virtualized code, so it's much harder to determine from which routines these reads would be coming from
  • @HughEverett ↶ Reply to #3086 #3088 06:50 PM, 19 Jul 2023
    It's possible to implement such a scenario using !monitor but it's so tricky. Because you might end up blocking the CPU's memory manager from modifying the memory and setting page-table bits. You still need to wait for that memory introspection project.
  • @HughEverett ↶ Reply to #3086 #3089 06:52 PM, 19 Jul 2023
    But, you have some options here. You can block your target driver from executing in the target machine. Using '! monitor's short-circuiting event.
  • @HughEverett #3090 06:52 PM, 19 Jul 2023
    And after you can log from the instructions or step through the instructions.
  • @HughEverett #3091 06:53 PM, 19 Jul 2023
    And, you know, the memory introspection project wouldn't be that much better than this approach.
  • @HughEverett #3092 06:54 PM, 19 Jul 2023
    Please take a look at:
    https://docs.hyperdbg.org/commands/extension-commands/monitor#short-circuiting

    @prekvapko
    !monitor (monitor read/write/execute to a range of memory)

    Description of the '!monitor' command in HyperDbg.

  • @prekvapko #3093 06:54 PM, 19 Jul 2023
    thanks ❤️
  • @HughEverett ↶ Reply to #3093 #3094 06:55 PM, 19 Jul 2023
    Did you get the idea?
  • @prekvapko #3095 06:55 PM, 19 Jul 2023
    I'll read through it.
  • @HughEverett #3096 06:55 PM, 19 Jul 2023
    Just block the execution of your driver and step through its instructions.
  • @prekvapko #3097 06:56 PM, 19 Jul 2023
    will be fun on a 14mb sample :D
  • 1
  • 2
  • 3
  • 4
  • 5
  • 01 Jul 2023 (23)
  • 02 Jul 2023 (9)
  • 03 Jul 2023 (238)
  • 04 Jul 2023 (6)
  • 05 Jul 2023 (110)
  • 06 Jul 2023 (295)
  • 07 Jul 2023 (141)
  • 08 Jul 2023 (6)
  • 09 Jul 2023 (1)
  • 10 Jul 2023 (225)
  • 11 Jul 2023 (164)
  • 12 Jul 2023 (48)
  • 13 Jul 2023 (114)
  • 14 Jul 2023 (14)
  • 15 Jul 2023 (31)
  • 16 Jul 2023 (34)
  • 17 Jul 2023 (6)
  • 18 Jul 2023 (17)
  • 19 Jul 2023 (22)
  • 20 Jul 2023 (10)
  • 21 Jul 2023 (2)
  • 22 Jul 2023 (14)
  • 23 Jul 2023 (121)
  • 24 Jul 2023 (43)
  • 25 Jul 2023 (5)
  • 26 Jul 2023 (29)
  • 27 Jul 2023 (19)
  • 28 Jul 2023 (1)
  • 29 Jul 2023 (7)
  • 30 Jul 2023 (396)
  • 31 Jul 2023 (64)