Back to legacygamers.net
WARPGATE

Hangul

CHangulComposer, CHangulContext, CHangulWordBreaker, CIMEManager, CTrie/CFst, SCSK

Functions 52Code 9 KBAddresses 0x00AC3D90 to 0x0108F680Group Systems
52 functions
AddressSizeNameDescription
0x00AC3D90128CTrie__destroyDestroys a CTrie structure. Frees compiled data at offset 4 (1 byte), recursively destroys child/sibling subtrees from root, frees root node (0xC bytes), then frees the 300-byte trie object itself.
0x00AC3E30110CTrie__clearClears a CTrie in place without freeing the outer object. Frees compiled data and recursively destroys all nodes in the tree.
0x00AC3EB0260CTrie__insertInserts a string (param_2, length param_3) into a trie. Creates root node on first insert. Traverses existing nodes matching characters, creating new 0xC-byte nodes as needed (byte 0=char, byte 1=terminal flag, offset 4=sibling, offset 8=child). Returns 1 if new word, 0 if duplicate.
0x00AC3FC035CTrie__get_unique_prefix_lengthGets unique prefix length in the trie. Traverses child chain (offset 8) counting nodes that have no siblings (offset 4 == 0). Returns count of unique prefix characters.
0x00AC3FF049CTrie__destroy_subtreeRecursively destroys a trie subtree. Post-order traversal: destroys child (offset 8), then sibling (offset 4), then frees this 0xC-byte node.
0x00AC403028CTrie__count_sibling_chainCounts the number of nodes in a sibling chain (linked via offset 4). Simple traversal counter.
0x00AC40502187CHangulWordBreaker__segment_textKorean word breaker. Segments input text (param_2, length param_3) into word break positions stored in param_4 (max param_5 breaks). Initializes dictionary/FST on first call, then processes each byte using character class tables, FST dictionary lookups, and hangul_should_break_word rules. param_6 flags control break behavior. Returns number of segments.
0x00AC48E0307CFst__match_stringMatches a string against a compiled finite state transducer (FST). Traverses the packed state table following transitions for each input byte. Handles compressed state encoding with branch/terminal flags. Returns longest match length (or 1000 for empty input). Used for Korean word segmentation.
0x00AC4A40261CHangulDictionary__initInitializes the Hangul dictionary. Destroys existing trie if present, allocates new 300-byte CRsmFileData, loads dictionary from ftwrk.lex file via FUN_00ac4fa0. Copies 0x400 bytes of default table from DAT_013486a8.
0x00AC4B5019CHangulDictionary__copy_default_tableCopies 0x180 bytes (96 dwords) of default Hangul character classification table from DAT_01348528 into the destination buffer.
0x00AC4B70137CFst__compile_sibling_chainCompiles a trie sibling chain into FST byte array at param_1's compiled buffer (offset 0x10). Writes character bytes and terminal flags. Recursively compiles child subtrees via CFst__compile_trie_node.
0x00AC4C2051CTrie__compile_to_fstCompiles a trie into an FST (finite state transducer) byte array. Allocates buffer (node_count * 10), then calls CFst__compile_trie_node to build the packed state table. Stores compiled size at offset 3.
0x00AC4C60188CFst__lookup_wordLooks up a null-terminated string in the compiled FST. Traverses packed state transitions matching each byte. Returns 1 if found (terminal state reached), 0 otherwise. Uses 22-bit addresses for state pointers.
0x00AC4D40331CFst__compile_trie_nodeCompiles a trie node and its children into FST packed byte format. Writes 3-byte state pointers for siblings, then character sequences for chains without branches. Handles terminal flags and recursive compilation. Core of the trie-to-FST compilation.
0x00AC4FA0447CHangulDictionary__load_from_fileLoads Hangul dictionary from a .lex file. Opens via CFileStream, reads 0x118-byte header, validates word/node counts, allocates and reads FST data. Sets loaded flag at offset 0x128. Cleans up on failure.
0x00AC5160176CHangulDictionary__save_to_fileSaves Hangul dictionary to a file. Populates header fields from runtime data. Opens file with fopen("wb"), writes 0x118-byte header then FST data. Returns 1 on success, 0 on failure.
0x00AFAF00231SCSK__init_keyboard_securityInitializes SCSK keyboard security. Loads SCSKAppLink.dll, gets proc addresses for LoadSCSK, StartSCSK, StopSCSK, GetRealAscii. Calls LoadSCSK to initialize. Sets global DAT_016d5768 on success. Only runs when param_2==0xF and not already initialized.
0x00AFAFF0131SCSK__stop_keyboard_securityStops SCSK keyboard security by calling StopSCSK function pointer. Only runs when initialized (magic 0xF) and currently active. Outputs debug string on success/failure.
0x00AFB08054SCSK__get_real_asciiGets real ASCII keycode from SCSK keyboard security module. Only works when magic is 0xF, module is loaded, and input key is '*' (0x2A, the masked character). Calls GetRealAscii function pointer to decrypt the real key.
0x00AFB0C0225SCSK__load_libraryLoads SCSK keyboard security library. Same as SCSK__init_keyboard_security but returns 1/0 success/failure and doesn't set the global pointer. Loads SCSKAppLink.dll, resolves LoadSCSK/StartSCSK/StopSCSK/GetRealAscii.
0x00AFB1B0100SCSK__start_keyboard_securityStarts SCSK keyboard security. Calls StartSCSK(param_2) function pointer when module is loaded but not yet started. Outputs debug string on success/failure. Returns handle on success, 0 on failure.
0x00AFB22082SCSK__stop_and_reportStops SCSK keyboard security and reports status. Calls StopSCSK function when module is active. Returns handle on success, 0 on failure. Outputs debug strings.
0x00AFB2A0135IME_helper_cleanupCleans up IME helper (IMESCHLP.dll). Loads the library, calls QueryIMEHelper with command 0x9000F004, then calls the returned function, gets module handle, and frees the library.
0x00AFB410446IME_helper_init_and_loginInitializes and logs in to IME helper (IMESCHLP.dll). Loads the library, calls QueryIMEHelper for login (0x9000F002), then authenticates (0x9000F001). On failure, shows warning dialog. On specific error (-0x7FFF1FFF), shows dialog box and calls IME_helper_show_window. Version string: '5.01.2600.1832'.
0x00AFB5D060IME_helper_show_windowShows the IME helper window. Loads IMESCHLP.dll, calls QueryIMEHelper with command 0x9000F003, then calls the returned function with the main window handle.
0x00AFB610111IME_helper_error_callbackIME helper error callback. Maps error codes (0x8000E001-0x8000E006) to string resource IDs (0x416-0x41A) and shows a dialog box. Then shows IME helper window and triggers game quit via CGameMode__on_quit.
0x00AFB74030CIMEManager__ctorConstructor for CIMEManager. Stores HWND handle, zeroes internal state fields: context pointer, composition state, and character buffer.
0x00AFB79022CIMEManager__get_candidate_listGets the IME candidate list. Returns result from internal function if context (offset 4) exists, otherwise returns 0.
0x00AFB7B072CIMEManager__send_ime_charSends an IME character to the window. Uses WM_USER+0x64 (0x464) message. If currently composing (offset 0x11), sends reset first. Sends char as WPARAM, updates stored character at offset 0x10.
0x00AFB80072CIMEManager__send_ime_char_00afb800Duplicate of CIMEManager__send_ime_char. Sends IME character via message 0x464, resets composition state first if active.
0x00AFB85030CIMEManager__destroy_contextDestroys the IME context. Calls cleanup function then frees the 0x34-byte context structure at offset 4.
0x00AFB870241CIMEManager__process_ime_keyProcesses an IME key event. Calls internal composition handler, then based on result code (0x3E9=compose, 0x3EA=commit, 0x3EB=direct), sends appropriate messages via SendMessageA(0x464). Manages composition state and character buffer.
0x00AFB970163CIMEManager__init_and_composeInitializes IME and processes composition. Stores HWND, allocates 0x34-byte context if mode is 0x66 (Korean), initializes context, then calls composition handler. Returns composition result or 0 if no context.
0x00AFBA2073CIMEManager__handle_char_inputHandles character input through IME manager. If context (offset 0xC) exists, tries composition first. If composition fails, falls through to direct send via SendMessageA(0x464). Returns 1 if composed, 0 for direct send.
0x00AFBA7036CIMEManager__send_raw_charSends a raw character directly to the window via SendMessageA with message 0x464. Updates the stored last character at offset 0x10. No IME processing.
0x00AFBAA038CIMEManager__on_key_downHandles key down events for IME. Tracks VK_CONTROL (0x11) and VK_MENU/ALT (0x12) modifier key state at offsets 0x14 and 0x18.
0x00AFBAD057CIMEManager__on_key_upHandles key up events for IME. When both Ctrl+Alt are released simultaneously, toggles IME mode (offset 0xC). Clears modifier tracking for VK_CONTROL (0x11) and VK_MENU (0x12).
0x00AFBB2027CHangulComposer__ctorConstructor for CHangulComposer (2-set Hangul input). Sets vtable, initializes last consonant to 0x7F, resets composition indices to -1.
0x00AFBB40308CHangulComposer__compose_charHangul character composition engine. Handles Korean jamo (consonant/vowel) input, composing syllables from individual keystrokes. Manages consonant/vowel state machine with rules for double consonants, vowel combinations (w+e, w+y etc.), and syllable completion. Returns syllable index or 1000 for reset, -1 for rejection.
0x00AFBC8084CHangulComposer__validate_continuationValidates whether a character can continue the current Hangul composition. Returns 0 if invalid (triggers reset via vtable call), 1 if valid. Checks against vowel table (DAT_0134C42C) and specific consonant rules.
0x00AFBD0048CHangulContext__initInitializes a Hangul input context structure (0x34 bytes). Zeroes all composition state, input buffer, and syllable tracking. Sets initial state to 0x3E9 (ready for input).
0x00AFBD3018CHangulContext__set_modeSets the Hangul input mode at offset 0x2C if different from current value.
0x00AFBD50200CHangulContext__set_input_methodSets the Hangul input method (0=3-set, 1=2-set). Frees existing composer if present, creates new 0x10-byte composer object. Method 0 creates CHangulComposer3Set, method 1 creates CHangulComposer (2-set). Returns true if composer created.
0x00AFBE2023CHangulContext__free_composerFrees the Hangul composer object (0x10 bytes) if allocated. Always returns 1.
0x00AFBE40359CHangulContext__process_keyProcesses a key through the Hangul composition engine. Manages three states: 0x3E9 (initial), 0x3EA (awaiting vowel after initial consonant), 0x3EB (composing syllable). Maps input chars to jamo indices, handles vowel selection (A/E/I/O/U/Y/D), manages syllable buffer with rollover at 10 entries. Returns state code.
0x00AFC010180CHangulContext__create_composerCreates a Hangul composer object based on input method type. Frees existing composer, then creates CHangulComposer3Set (type 0) or CHangulComposer (type 1, 2-set). Returns true if creation succeeded.
0x00AFC0D0194CHangulContext__check_and_composeChecks if a character can be composed in the current Hangul context. In state 0x3EB (composing), validates via composer. Resets state if validation fails. For vowel chars (A/E/I/O/U/Y/D), transitions to state 0x3EA (awaiting composition). Returns 1 if composed, 0 if not.
0x00AFC1A071CHangulContext__resetResets the Hangul input context. Optionally calls composer's reset method (vtable offset 8). Clears all composition state, buffers, and sets state back to 0x3E9 (ready).
0x00AFC1F027CHangulComposer3Set__ctorConstructor for CHangulComposer3Set (3-set/Sebulshik input). Sets vtable to 0x0115A850, initializes last char to 0x7F, resets indices to -1.
0x00AFC21064CHangulComposer3Set__compose_char3-set Hangul composition engine. Maps digit keys 1-9 to jamo components. Handles double consonants (key 6 after vowel), vowel combinations (key 7 after O/U), complex finals (key 8 after A). Key 9+D produces special syllable 0x49. Returns syllable index, 1000 for reset, -1 for rejection.
0x00AFC38032CHangulComposer3Set__validate_continuationValidates continuation for 3-set Hangul input. Returns 1 if the character is a digit 1-9 (valid jamo key), 0 otherwise (triggers composer reset).
0x0108F68010thunk_to_CTrie__destroyThunk that calls CTrie__destroy to destroy a global trie structure.