镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

c++ emulation issue with std::cout << "Hello World!\n"; #377

Closed

Description

@decustom

I get an error while emulating following MSVC++ code on Linux: std::cout << d << " Hello World!\n";
However, if I change to use printf("%d Hello World!\n", d); it is able to emulate!

[+] Initiate stack address at 0x7ffffffde000
[+] Loading rootfs/x8664_windows/bin/ConsoleApplication12.exe to 0x140000000
[+] PE entry point at 0x140001524
[+] TEB addr is 0x6030
[+] PEB addr is 0x60b8
[+] Loading rootfs/x8664_windows/Windows/System32/ntdll.dll to 0x7ffff0000000
[+] Done with loading rootfs/x8664_windows/Windows/System32/ntdll.dll
[+] Loading rootfs/x8664_windows/Windows/System32/msvcp140.dll to 0x7ffff01f4000
[+] Done with loading rootfs/x8664_windows/Windows/System32/msvcp140.dll
[+] Loading rootfs/x8664_windows/Windows/System32/vcruntime140_1.dll to 0x7ffff0285000
[+] Done with loading rootfs/x8664_windows/Windows/System32/vcruntime140_1.dll
[+] Loading rootfs/x8664_windows/Windows/System32/vcruntime140.dll to 0x7ffff0291000
[+] Done with loading rootfs/x8664_windows/Windows/System32/vcruntime140.dll
[+] Loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-runtime-l1-1-0.dll to 0x7ffff02aa000
[+] Done with loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-runtime-l1-1-0.dll
[+] Loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-math-l1-1-0.dll to 0x7ffff02ae000
[+] Done with loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-math-l1-1-0.dll
[+] Loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-stdio-l1-1-0.dll to 0x7ffff02b3000
[+] Done with loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-stdio-l1-1-0.dll
[+] Loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-locale-l1-1-0.dll to 0x7ffff02b7000
[+] Done with loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-locale-l1-1-0.dll
[+] Loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-heap-l1-1-0.dll to 0x7ffff02ba000
[+] Done with loading rootfs/x8664_windows/Windows/System32/api-ms-win-crt-heap-l1-1-0.dll
[+] Loading rootfs/x8664_windows/Windows/System32/kernel32.dll to 0x7ffff02bd000
[+] Done with loading rootfs/x8664_windows/Windows/System32/kernel32.dll
GetSystemTimeAsFileTime(lpSystemTimeAsFileTime = 0x80000001cfe0)
GetCurrentThreadId() = 0x0
GetCurrentProcessId() = 0x7cc
QueryPerformanceCounter(lpPerformanceCount = 0x80000001cfe8) = 0x0
_initterm_e(pfbegin = 0x140002228, pfend = 0x140002240) = 0x0
_initterm(pfbegin = 0x140002210, pfend = 0x140002220)
_get_initial_narrow_environment() = 0x0
__p___argv() = 0x50009fcd8
__p___argc() = 0x50009fd20
[!] ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z is not implemented
[!] Emulation Error

Activity

  1. xwings commented on Jul 14, 2020

    @xwings
    Member

    Need to debug more too see the actual issue.

    Well, Windows always a myth and windows + MSVC. i guess we are lost.

  2. xwings commented on Jan 27, 2021

    @xwings
    Member

    update issue #333 , we should support C++

  3. learn-more commented on Feb 9, 2021

    @learn-more
    Contributor

    This is going to be a huge set of functions to support.
    BTW this specific function translates to:
    public: class std::basic_ostream<char,struct std::char_traits<char> > & __ptr64 __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(__int64) __ptr64

  4. xwings commented on Oct 6, 2022

    @xwings
    Member

    Close for now.

    We updated the codebase for Qiling and Unicorn since this issue being posted.

    Feel free to try the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions