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

Heap Corruption Detected #536

Open
LoseYouNow opened this issue Jan 1, 2025 · 6 comments
Open

Heap Corruption Detected #536

LoseYouNow opened this issue Jan 1, 2025 · 6 comments

Comments

@LoseYouNow
Copy link

image
how can i fix this problem

@AlbertShown
Copy link
Contributor

Does Launcher.exe use webui?
What backend-language are you using?
What is the code you are using?

@LoseYouNow
Copy link
Author

LoseYouNow commented Jan 3, 2025

Does use webui? What backend-language are you using? What is the code you are using?Launcher.exe
1.yes,i am using webui
2.vs 2022/c++
3.image this is my code that i am using

@LoseYouNow
Copy link
Author

Does use webui? What backend-language are you using? What is the code you are using?Launcher.exe

If I add the code '<script src=\“webui.js\”></script> ' to the HTML code, the program reports error

@LoseYouNow
Copy link
Author

LoseYouNow commented Jan 3, 2025

here is the information
`[User] webui_new_window()
[User] webui_get_new_window_id()
[Core] WebUI v2.5.0-beta.3 (Microsoft Windows, MSVC, Static, Non-Encrypted)
[Core] _webui_init()
[Core] _webui_get_current_path()
[Core] _webui_malloc([260])
[Core] _webui_ptr_add(0x000001C9A9A5BA00)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A5BA00) -> Pointer #0 saved (260 + 1 bytes)
[Core] _webui_malloc([260])
[Core] _webui_ptr_add(0x000001C9A9A64240)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A64240) -> Pointer #1 saved (260 + 1 bytes)
[User] webui_new_window_id([1])
[Core] _webui_malloc([8472])
[Core] _webui_ptr_add(0x000001C9A9A7CA00)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A7CA00) -> Pointer #2 saved (8472 + 1 bytes)
[Core] _webui_malloc([260])
[Core] _webui_ptr_add(0x000001C9A9A5F290)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A5F290) -> Pointer #3 saved (260 + 1 bytes)
[Core] _webui_malloc([260])
[Core] _webui_ptr_add(0x000001C9A9A63A80)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A63A80) -> Pointer #4 saved (260 + 1 bytes)
[User] webui_bind([1])
[Core] _webui_get_cb_index([1])
[Core] _webui_get_cb_index() -> Element: [webui_core_api]
[Core] _webui_get_cb_index() -> Not found
[Core] _webui_malloc([18])
[Core] _webui_ptr_add(0x000001C9A9A6AF20)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A6AF20) -> Pointer #5 saved (18 + 1 bytes)
[User] webui_bind() -> Save bind at 0
[Core] _webui_send_all()
[User] webui_new_window_id() -> New window #1 @ 0x000001C9A9A7CA00
[User] webui_show([1])
[Core] _webui_show([1])
[Core] _webui_malloc([68])
[Core] _webui_ptr_add(0x000001C9A9A61920)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A61920) -> Pointer #6 saved (68 + 1 bytes)
[Core] _webui_is_valid_url([<s...])
[Core] _webui_show() -> Embedded HTML:

    • -[HTML]- - - - - - - - - -
<script src="webui.js"></script> Hello World from C++! - - - - - - - - - - - - - - - - [Core] _webui_show_window(HTML, [1]) [Core] _webui_get_free_port() [Core] _webui_port_is_used([23445]) [Core] _webui_socket_test_listen_win32([23445]) [Core] _webui_malloc([32]) [Core] _webui_ptr_add(0x000001C9A9A673F0) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A673F0) -> Pointer #7 saved (32 + 1 bytes) [Core] _webui_malloc([22]) [Core] _webui_ptr_add(0x000001C9A9A67450) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A67450) -> Pointer #8 saved (22 + 1 bytes) [Core] _webui_wv_show([http://localhost:23445]) [Core] _webui_malloc([46]) [Core] _webui_ptr_add(0x000001C9A9A6FF30) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A6FF30) -> Pointer #9 saved (46 + 1 bytes) [Core] _webui_malloc([112]) [Core] _webui_ptr_add(0x000001C9A9A5FED0) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A5FED0) -> Pointer #10 saved (112 + 1 bytes) [Core] _webui_timer_start() [Core] [Thread .] _webui_webview_thread() [Core] _webui_wv_free() [Core] _webui_free_mem(0x0000000000000000) [Core] _webui_free_mem(0x0000000000000000) [Core] _webui_free_mem(0x0000000000000000) [Core] _webui_free_mem(0x0000000000000000) [Core] _webui_free_mem(0x0000000000000000) [Core] _webui_free_mem(0x0000000000000000) [Core] _webui_free_mem(0x000001C9A9A6FF30) [Core] _webui_free_mem(0x000001C9A9A6FF30) -> Pointer #9 freed (46 + 1 bytes) [Core] _webui_free_mem(0x000001C9A9A5FED0) [Core] _webui_free_mem(0x000001C9A9A5FED0) -> Pointer #10 freed (112 + 1 bytes) [Core] _webui_wv_show() -> Return [0] [Core] _webui_show_window() -> WebView Not Found [Core] _webui_browser_start([http://localhost:23445], [1]) [Core] _webui_find_the_best_browser() [Core] _webui_is_process_running([chrome.exe]) [Core] _webui_is_process_running([msedge.exe]) [Core] _webui_browser_exist([4]) [Core] _webui_get_windows_reg_value([Software\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe]) [Core] _webui_file_exist([C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe]) [Core] _webui_file_exist() -> Parsed to [C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe] [Core] _webui_malloc([122]) [Core] _webui_ptr_add(0x000001C9A9A5FED0) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A5FED0) -> Pointer #9 saved (122 + 1 bytes) [Core] _webui_free_mem(0x000001C9A9A5FED0) [Core] _webui_free_mem(0x000001C9A9A5FED0) -> Pointer #9 freed (122 + 1 bytes) [Core] _webui_browser_start_edge([http://localhost:23445]) [Core] _webui_browser_exist([4]) [Core] _webui_browser_create_new_profile(4) [Core] _webui_malloc([260]) [Core] _webui_ptr_add(0x000001C9A9A5AC60) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A5AC60) -> Pointer #9 saved (260 + 1 bytes) [Core] _webui_malloc([260]) [Core] _webui_ptr_add(0x000001C9A9A5A880) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A5A880) -> Pointer #10 saved (260 + 1 bytes) [Core] _webui_browser_create_new_profile(4) -> Generating WebUI profile [Core] _webui_get_temp_path() [Core] _webui_get_browser_args([4]) [Core] _webui_run_browser() [Core] _webui_cmd_async() [Core] _webui_cmd_async() -> Running [cmd /c "START "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --user-data-dir="C:\Users\.WebUI\WebUIEdgeProfile" --no-first-run --safe-mode --disable-extensions --disable-background-mode --disable-plugins --disable-plugins-discovery --disable-translate --disable-features=Translate --bwsi --disable-sync --disable-sync-preferences --disable-component-update --allow-insecure-localhost --auto-accept-camera-and-microphone-capture --no-proxy-server --app=http://localhost:23445" > nul 2>&1] [Core] _webui_system_win32() [Core] _webui_malloc([1022]) [Core] _webui_ptr_add(0x000001C9A9A7FDC0) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A7FDC0) -> Pointer #11 saved (1022 + 1 bytes) [Core] _webui_free_mem(0x000001C9A9A7FDC0) [Core] _webui_free_mem(0x000001C9A9A7FDC0) -> Pointer #11 freed (1022 + 1 bytes) [Core] _webui_show_window() -> App-mode browser succeeded [Core] _webui_free_mem(0x000001C9A9A67450) [Core] _webui_free_mem(0x000001C9A9A67450) -> Pointer #8 freed (22 + 1 bytes) [Core] _webui_show_window() -> Waiting for window connection & token validation [Core] _webui_timer_start() [Core] _webui_server_thread() [Core] _webui_server_thread([1]) -> URL: [http://localhost:23445] [Core] _webui_malloc([64]) [Core] _webui_ptr_add(0x000001C9A9A5ADB0) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9A5ADB0) -> Pointer #8 saved (64 + 1 bytes) [Core] _webui_server_thread([1]) -> Listening Success [Core] _webui_server_thread([1]) -> HTTP/WS Port: 127.0.0.1:23445 [Core] _webui_server_thread([1]) -> Root path: . [Core] _webui_server_thread([1]) -> Timeout is 15 seconds [Core] _webui_server_thread([1]) -> Waiting for connection [Core] _webui_timer_start() [Core] _webui_http_handler() [Core] _webui_http_handler() -> GET [/] [Core] _webui_get_cookies() [Core] _webui_http_handler() -> Client cookies [1_HeugOvVLKUWREmrE6YFCt7QjGurh16L] [Core] _webui_client_cookies_get_id() [Core] _webui_http_handler() -> Client ID not found [Core] _webui_http_handler() -> Embedded Index HTML ---[ HTML (68 bytes)]-------------- <script src="webui.js"></script> Hello World from C++! ------------------------------------ [Core] _webui_http_send([1]) [Core] _webui_http_send_header([1]) [Core] _webui_http_send_header() -> mime_type: [text/html] [Core] _webui_http_send_header() -> body_len: [68] [Core] _webui_http_send_header() -> cache: [0] [Core] _webui_get_cookies() [Core] _webui_client_cookies_get_id() [Core] _webui_generate_cookies() [Core] _webui_client_cookies_save() [Core] _webui_malloc([33]) [Core] _webui_ptr_add(0x000001C9A9AB84C0) [Core] _webui_ptr_exist() [Core] _webui_ptr_add(0x000001C9A9AB84C0) -> Pointer #11 saved (33 + 1 bytes) [Core] _webui_http_send() -> New auth cookies [1_KhxjRyYONXZUHpuH91IFwaTmJxuk49O] ---[ HTTP Header ]----------------- HTTP/1.1 200 OK Set-Cookie: webui_auth=1_KhxjRyYONXZUHpuH91IFwaTmJxuk49O; Path=/; HttpOnly; SameSite=Strict Access-Control-Allow-Origin: * Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0 Content-Type: text/html Content-Length: 68 Connection: close

[Core] _webui_http_handler() -> HTTP Status Code: 200
[Core] _webui_http_handler()
[Core] _webui_http_handler() -> GET [/webui.js]
[Core] _webui_get_cookies()
[Core] _webui_http_handler() -> Client cookies [1_KhxjRyYONXZUHpuH91IFwaTmJxuk49O]
[Core] _webui_client_cookies_get_id()
[Core] _webui_http_handler() -> Client ID found [0]
[Core] _webui_http_handler() -> WebUI-Bridge
[Core] _webui_generate_js_bridge()
[Core] _webui_malloc([15611])
[Core] _webui_ptr_add(0x000001C9A9AB86A0)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9AB86A0) -> Pointer #12 saved (15611 + 1 bytes)
[Core] _webui_http_send([1])
[Core] _webui_http_send_header([1])
[Core] _webui_http_send_header() -> mime_type: [application/javascript]
[Core] _webui_http_send_header() -> body_len: [15515]
[Core] _webui_http_send_header() -> cache: [0]
[Core] _webui_get_cookies()
[Core] _webui_client_cookies_get_id()
---[ HTTP Header ]-----------------
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0
Content-Type: application/javascript
Content-Length: 15515
Connection: close


[Core] _webui_free_mem(0x000001C9A9AB86A0)
[Core] _webui_free_mem(0x000001C9A9AB86A0) -> Pointer #12 freed (15611 + 1 bytes)
[Core] _webui_http_handler() -> HTTP Status Code: 200
[Core] _webui_http_handler()
[Core] _webui_http_handler() -> GET [/favicon.ico]
[Core] _webui_get_cookies()
[Core] _webui_http_handler() -> Client cookies [1_KhxjRyYONXZUHpuH91IFwaTmJxuk49O]
[Core] _webui_client_cookies_get_id()
[Core] _webui_http_handler() -> Client ID found [0]
[Core] _webui_file_exist_mg()
[Core] _webui_malloc([12])
[Core] _webui_ptr_add(0x000001C9A9A6A4D0)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A6A4D0) -> Pointer #12 saved (12 + 1 bytes)
[Core] _webui_malloc([13])
[Core] _webui_ptr_add(0x000001C9A9A6A6B0)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A6A6B0) -> Pointer #13 saved (13 + 1 bytes)
[Core] _webui_file_exist([.\favicon.ico])
[Core] _webui_file_exist() -> Parsed to [.\favicon.ico]
[Core] _webui_malloc([28])
[Core] _webui_ptr_add(0x000001C9A9AB7C20)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9AB7C20) -> Pointer #14 saved (28 + 1 bytes)
[Core] _webui_free_mem(0x000001C9A9AB7C20)
[Core] _webui_free_mem(0x000001C9A9AB7C20) -> Pointer #14 freed (28 + 1 bytes)
[Core] _webui_free_mem(0x000001C9A9A6A4D0)
[Core] _webui_free_mem(0x000001C9A9A6A4D0) -> Pointer #12 freed (12 + 1 bytes)
[Core] _webui_free_mem(0x000001C9A9A6A6B0)
[Core] _webui_free_mem(0x000001C9A9A6A6B0) -> Pointer #13 freed (13 + 1 bytes)
[Core] _webui_http_handler() -> HTTP Status Code: 302
[Core] _webui_ws_connect_handler()
[Core] _webui_get_cookies()
[Core] _webui_ws_connect_handler() -> Client cookies [1_KhxjRyYONXZUHpuH91IFwaTmJxuk49O]
[Core] _webui_client_cookies_get_id()
[Core] _webui_ws_connect_handler() -> Client ID found [0]
[Core] _webui_ws_connect_handler() -> Connection authentication OK
[Core] _webui_ws_ready_handler()
[Core] _webui_receive([1], [2], [0])
[Core] _webui_connection_save([1])
[Core] _webui_connection_save() -> Registering client #0
[Core] _webui_receive(0) -> Connection #0 registered
[Core] _webui_malloc([56])
[Core] _webui_ptr_add(0x000001C9A9AB86A0)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9AB86A0) -> Pointer #12 saved (56 + 1 bytes)
[Core] [Thread .] _webui_ws_process_thread()
[Core] _webui_ws_process(1)
[Core] _webui_ws_process(1) -> Start
[Core] _webui_ws_process(1) -> WEBUI_WS_OPEN
[Core] _webui_ws_process(1) -> Finished.
[Core] _webui_free_mem(0x0000000000000000)
[Core] _webui_free_mem(0x000001C9A9AB86A0)
[Core] _webui_free_mem(0x000001C9A9AB86A0) -> Pointer #12 freed (56 + 1 bytes)
[Core] _webui_ws_data_handler()
[Core] _webui_receive([1], [1], [9])
[Core] _webui_connection_get_id([1], [000001C9A9A8E298])
[Core] _webui_malloc([9])
[Core] _webui_ptr_add(0x000001C9A9A6A7A0)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9A6A7A0) -> Pointer #12 saved (9 + 1 bytes)
[Core] _webui_malloc([56])
[Core] _webui_ptr_add(0x000001C9A9AB86A0)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9AB86A0) -> Pointer #13 saved (56 + 1 bytes)
[Core] _webui_ws_data_handler() -> Finished
[Core] [Thread .] _webui_ws_process_thread()
[Core] _webui_ws_process(2)
[Core] _webui_ws_process(2) -> Start
[Core] _webui_get_token()
[Core] _webui_get_token() -> 0x67A0FD0C
[Core] _webui_get_id()
[Core] _webui_get_id() -> 0x0000
[Core] _webui_ws_process(2) -> Data received
[Core] _webui_ws_process(2) -> Packet Size : 9 bytes
[Core] _webui_ws_process(2) -> Packet Header : [ 0xDD 0x0C 0xFD 0xA0 0x67 0x00 0x00 0xF5 ]
[Core] _webui_ws_process(2) -> Packet Token: 0x67A0FD0C (1738603788)
[Core] _webui_ws_process(2) -> Packet ID: 0x0000 (0)
[Core] _webui_ws_process(2) -> Packet Data: []
[Core] _webui_ws_process(2) -> WEBUI_CMD_CHECK_TK
[Core] _webui_connection_get_id([1], [000001C9A9A8E298])
[Core] _webui_ws_process(2) -> Token accepted. Sending bind list
[Core] _webui_malloc([20])
[Core] _webui_ptr_add(0x000001C9A9AB7F20)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9AB7F20) -> Pointer #14 saved (20 + 1 bytes)
[Core] _webui_send_client()
[Core] _webui_connection_get_id([1], [000001C9A9A8E298])
[Core] _webui_send_client() -> Connection ID = 0
[Core] _webui_send_client() -> Packet ID = 0x0000
[Core] _webui_send_client() -> Packet CMD = 0xf5
[Core] _webui_send_client() -> Packet Data = 20 bytes
[Core] _webui_malloc([29])
[Core] _webui_ptr_add(0x000001C9A9AB7CE0)
[Core] _webui_ptr_exist()
[Core] _webui_ptr_add(0x000001C9A9AB7CE0) -> Pointer #15 saved (29 + 1 bytes)
[Core] _webui_send_client_ws()
[Core] _webui_send_client_ws() -> Client #0
[Core] _webui_send_client_ws() -> Packet size: 29 bytes
[Core] _webui_send_client_ws() -> Packet hex : [ 0xDD 0xFF 0xFF 0xFF 0xFF 0x00 0x00 0xF5 0x01 0x5F 0x5F 0x77 0x65 0x62 0x75 0x69 0x5F 0x63 0x6F 0x72 0x65 0x5F 0x61 0x70 0x69 0x5F 0x5F 0x2C 0x00 ]
[Core] _webui_send_client_ws() -> 29 bytes sent.
[Core] _webui_free_mem(0x000001C9A9AB7CE0)
[Core] _webui_free_mem(0x000001C9A9AB7CE0) -> Pointer #15 freed (29 + 1 bytes)
[Core] _webui_free_mem(0x000001C9A9AB7F20)
[Core] _webui_free_mem(0x000001C9A9AB7F20) -> Pointer #14 freed (20 + 1 bytes)`

@AlbertShown
Copy link
Contributor

AlbertShown commented Jan 3, 2025

I just test it, it's working fine for me.

[Core]          _webui_free_mem(0x000002D791A67130)
[Core]          _webui_free_mem(0x000002D791A67130) -> Pointer #15 freed (29 + 1 bytes)
[Core]          _webui_free_mem(0x000002D791AB5540)
[Core]          _webui_free_mem(0x000002D791AB5540) -> Pointer #12 freed (20 + 1 bytes)
[Core]          _webui_ws_process(2) -> Finished.

I guess you are doing something with includes, or how you compile project.

Make sure the static library and your project are compiled with the same compiler version.

The webui.js is a virtual file inside webui library, you don't need to generate it or to do anything with it, just add <script src=\“webui.js\”></script> to your HTML.

@AlbertShown
Copy link
Contributor

Try this:

#include "webui.hpp"
#include ... // Your project includes here

int main() {
	webui::window my_window;
	my_window.show_browser("<html><head><script src=\"webui.js\"></script></head> TEST </html>", Edge); // Or Chrome, Firefox...
	webui::wait();
	return 0;
}

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

2 participants