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

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

Closed
decustom opened this issue Jul 14, 2020 · 4 comments
Closed

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

decustom opened this issue Jul 14, 2020 · 4 comments

Comments

@decustom
Copy link

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

@xwings
Copy link
Member

xwings commented Jul 14, 2020

Need to debug more too see the actual issue.

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

@xwings
Copy link
Member

xwings commented Jan 27, 2021

update issue #333 , we should support C++

@xwings xwings mentioned this issue Jan 27, 2021
@learn-more
Copy link
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

@xwings
Copy link
Member

xwings commented Oct 6, 2022

Close for now.

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

Feel free to try the latest version.

@xwings xwings closed this as completed Oct 6, 2022
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

3 participants