Meta tags:
Headings (most frequently used words):
the, 2024, does, it, video, but, problem, how, functions, fix, july, 2017, dispatch, game, hacking, memory, we, callback, unregistration, from, work, joshua, tree, 21, november, has, this, already, been, fixed, let, make, generic, tool, intercepting, affinity, logical, processor, info, run, now, bink, research, 09, october, 06, 05, june, 04, 20, february, threads, are, hard, concurrency, synchronization, tasking, adaptive, tuning, omg, bugs, looking, forward, links, about, me, blog, archive, part, deux, fixing, corruption, bug, in, python, overlapped, reproducing, corrupt, can, basic, hygiene, within, don, hold, locks, strong, guarantees, resolute, timers, which, patch, yes, set, timer, resolution, so, where, do, go, here,
Text of the page (most frequently used words):
the (687), that (241), and (230), this (149), was (95), but (92), for (89), with (71), can (70), game (63), have (61), #thread (57), #function (57), are (47), from (47), our (47), you (46), what (44), threads (43), which (41), not (39), would (39), system (38), callback (38), will (37), windows (36), out (35), other (34), all (32), one (31), just (31), like (31), when (30), called (30), cpus (29), some (29), only (29), any (28), since (28), things (27), time (27), also (27), process (27), more (26), into (26), has (26), these (25), now (25), they (25), see (25), how (25), unity (25), used (24), work (24), cpu (24), doing (24), python (24), lock (23), were (23), run (23), set (23), value (23), functions (23), then (23), event (23), different (22), could (22), problem (22), need (22), data (21), want (21), share (20), because (20), code (20), call (20), calling (20), bytes (20), than (19), number (19), let (19), about (18), does (18), memory (18), timer (18), resolution (18), first (18), may (17), programming (17), bit (17), running (17), priority (17), where (17), had (17), same (17), while (17), take (16), using (16), there (16), calls (16), fix (16), here (15), ps4 (15), use (15), task (15), back (15), subscription (15), overlapped (15), games (14), make (14), most (14), after (14), version (14), before (14), something (14), processors (14), within (14), dispatch (13), loop (13), even (13), still (13), crash (13), very (13), instead (13), much (13), get (13), done (13), don (13), list (13), next (13), turns (13), edx (13), unfortunately (13), bink (13), dll (13), been (12), started (12), looking (12), waiting (12), well (12), second (12), going (12), means (12), pretty (12), trying (12), being (12), tool (12), wait (12), lot (12), line (12), another (12), many (11), two (11), information (11), might (11), few (11), really (11), however (11), issues (11), start (11), through (11), simple (11), probably (11), way (11), check (11), video (11), unsubscribe (11), too (11), affinity (11), hacking (10), issue (10), threading (10), new (10), multiple (10), try (10), operation (10), least (10), allow (10), above (10), find (10), multi (10), didn (10), them (10), main (10), each (10), every (10), machine (10), doesn (10), tell (10), playing (10), typically (10), register (10), working (9), omniverse (9), planetside (9), joshua (9), writing (9), post (9), frame (9), sure (9), based (9), libdispatch (9), case (9), corruption (9), happen (9), originally (9), software (9), everything (9), api (9), actually (9), program (9), seconds (9), vector (9), complicated (9), stack (9), getsysteminfo (9), rogue (9), performance (8), current (8), good (8), flag (8), structure (8), read (8), tasks (8), etc (8), over (8), must (8), say (8), thing (8), clock (8), previous (8), cores (8), people (8), request (8), happens (8), uses (8), july (7), november (7), february (7), did (7), daybreak (7), kriegshauser (7), comments (7), year (7), 000 (7), half (7), cause (7), scheduler (7), generally (7), look (7), single (7), threaded (7), found (7), better (7), though (7), looks (7), safe (7), specific (7), problems (7), down (7), write (7), without (7), enough (7), error (7), cannot (7), values (7), application (7), requests (7), should (7), unlock (7), change (7), gives (7), else (7), quite (7), superluminal (7), ubisoft (7), stall (7), interesting (7), instruction (7), framebuffers (7), june (6), part (6), labels (6), pinterest (6), facebook (6), blogthis (6), email (6), posted (6), note (6), always (6), future (6), changes (6), xdispatch (6), put (6), long (6), point (6), figure (6), right (6), several (6), quickly (6), happening (6), makes (6), having (6), those (6), hard (6), synchronization (6), mutex (6), often (6), access (6), requires (6), processor (6), hardware (6), able (6), until (6), isn (6), once (6), milliseconds (6), step (6), return (6), finish (6), strong (6), callbacks (6), asyncio (6), fortunately (6), ida (6), executable (6), bits (6), screen (6), framebuffer (6), hook (6), october (5), 2024 (5), older (5), ago (5), ways (5), titles (5), made (5), itself (5), eventually (5), less (5), operations (5), old (5), lower (5), higher (5), operating (5), systems (5), prevent (5), never (5), got (5), launch (5), reading (5), exist (5), sometimes (5), looked (5), launched (5), happened (5), immediately (5), port (5), fast (5), team (5), given (5), similar (5), support (5), reason (5), available (5), nearly (5), difficult (5), full (5), logical (5), load (5), file (5), computer (5), shared (5), example (5), days (5), create (5), its (5), affect (5), variable (5), logging (5), faster (5), applications (5), app (5), fact (5), king (5), kill (5), passed (5), already (5), minimum (5), guarantee (5), yet (5), unregistration (5), unregister (5), locks (5), _overlapped (5), object (5), initial (5), stop (5), control (5), 86036 (5), divide (5), lie (5), dwnumberofprocessors (5), extended (5), black (5), width (5), march (4), april (4), august (4), january (4), nvidia (4), everquest (4), subscribe (4), little (4), library (4), implementation (4), gave (4), whole (4), completely (4), longer (4), making (4), basically (4), atomic (4), end (4), state (4), sort (4), give (4), solution (4), involved (4), live (4), later (4), handle (4), bugs (4), bug (4), tools (4), converting (4), nothing (4), link (4), written (4), playstation (4), slower (4), machines (4), dedicated (4), around (4), linux (4), both (4), works (4), easy (4), deeper (4), generic (4), concept (4), instance (4), early (4), testing (4), effect (4), 625 (4), per (4), seems (4), easier (4), sets (4), tries (4), appear (4), thought (4), course (4), basic (4), notifying (4), currently (4), during (4), otherwise (4), std (4), identifier (4), question (4), apparent (4), ever (4), again (4), occurs (4), changing (4), module (4), place (4), needs (4), their (4), years (4), added (4), test (4), completion (4), maybe (4), cancelioex (4), message (4), wasn (4), crashes (4), assassin (4), creed (4), critical (4), move (4), byte (4), mov (4), xor (4), ycrcb (4), newer (4), type (4), cache (4), engines (4), september (3), 2017 (3), blog (3), stuff (3), complete (3), previously (3), online (3), linked (3), hence (3), talk (3), rates (3), among (3), internal (3), keep (3), between (3), your (3), forward (3), reports (3), players (3), advantage (3), rather (3), locking (3), loops (3), fails (3), default (3), sleep (3), cases (3), noticed (3), finally (3), animation (3), getting (3), freed (3), finished (3), bad (3), timers (3), reddit (3), decided (3), mac (3), gcd (3), kernel (3), scheduling (3), setting (3), ps2 (3), queue (3), non (3), side (3), effects (3), developed (3), name (3), separate (3), helps (3), amount (3), sense (3), break (3), files (3), garbage (3), modify (3), section (3), hand (3), runs (3), especially (3), simultaneously (3), user (3), play (3), concurrency (3), copy (3), power (3), low (3), mask (3), possibility (3), article (3), patch (3), results (3), said (3), tells (3), minute (3), computers (3), sec (3), millisecond (3), goes (3), fine (3), know (3), requested (3), expect (3), display (3), periodically (3), handling (3), hygiene (3), notification (3), destroy (3), acquire (3), entry (3), null (3), remove (3), unregistered (3), add (3), free (3), structures (3), far (3), holding (3), objects (3), events (3), therefore (3), hold (3), behavior (3), receive (3), getqueuedcompletionstatus (3), ran (3), ended (3), cancel (3), tried (3), group (3), deallocation (3), attempt (3), hang (3), ideal (3), alternative (3), won (3), none (3), emulated (3), pop (3), traces (3), plugin (3), fixed (3), green (3), patched (3), theory (3), cdq (3), original (3), modulus (3), eax (3), takes (3), easily (3), pointer (3), r11d (3), clear (3), acc (3), exe (3), getnativesysteminfo (3), exactly (3), source (3), amd (3), released (3), fully (3), created (3), aspect (3), ratio (3), planes (3), decoder (3), binkregisterframebuffers (3), pitch (3), buffers (3), rgb (3), shader (3), represent (3), hooking (3), microsoft (3), loaded (3), tree (3), relationship (3), intercept (3), intercepted (3), numa (3), inject (3), detours (3), launches (3), connect (3), december (2), 2007 (2), 2009 (2), 2014 (2), deux (2), mine (2), employer (2), necessarily (2), view (2), profile (2), engineer (2), h1z1 (2), past (2), github (2), posts (2), home (2), planetside2 (2), kotk (2), references (2), went (2), caused (2), increase (2), across (2), knowledge (2), moving (2), projects (2), began (2), hangs (2), update (2), additional (2), whereas (2), dead (2), form (2), weren (2), conditions (2), preempted (2), changed (2), resolve (2), order (2), seen (2), statistical (2), programmers (2), evil (2), existed (2), namely (2), exists (2), technical (2), bsd (2), build (2), efficient (2), wrote (2), outside (2), became (2), porting (2), profiling (2), showing (2), largely (2), experience (2), approach (2), facets (2), challenging (2), tuning (2), discovered (2), core (2), ability (2), nor (2), intensive (2), project (2), existing (2), job (2), involve (2), breaking (2), entity (2), primary (2), needed (2), throw (2), theoretically (2), maximum (2), hint (2), increments (2), considered (2), resource (2), graphics (2), synchronized (2), fairly (2), synchronize (2), times (2), topic (2), creating (2), loading (2), server (2), sleeping (2), becomes (2), practical (2), class (2), generation (2), consoles (2), xbox (2), three (2), console (2), come (2), seem (2), processes (2), wouldn (2), somewhat (2), larger (2), environment (2), false (2), author (2), following (2), best (2), hit (2), download (2), including (2), imagine (2), glance (2), says (2), elapsed (2), nature (2), checking (2), obviously (2), against (2), priorities (2), multimedia (2), timebeginperiod (2), heart (2), likely (2), starts (2), programs (2), behind (2), sorts (2), lucas (2), hale (2), settimerresolution (2), commented (2), thinking (2), selected (2), digging (2), yes (2), technology (2), libraries (2), comes (2), dispatching (2), complexity (2), help (2), condition (2), notified (2), notify (2), subsequent (2), entries (2), anything (2), caller (2), fixing (2), real (2), world (2), unloads (2), subscribed (2), actual (2), subscriptions (2), resume (2), unlocked (2), stored (2), unlocking (2), iterators (2), respectively (2), pointers (2), tracking (2), why (2), situation (2), useful (2), designing (2), subscribers (2), recommendation (2), ask (2), asynchronous (2), gets (2), forth (2), simply (2), corner (2), ports (2), official (2), meant (2), possible (2), luck (2), cleaned (2), completed (2), automatically (2), iteration (2), bingo (2), complex (2), together (2), cancelled (2), getoverlappedresult (2), returns (2), sees (2), report (2), attempts (2), managed (2), effectively (2), run_forever (2), manage (2), away (2), constantly (2), debugging (2), clue (2), stopping (2), starting (2), graphical (2), differently (2), debug (2), moved (2), output (2), background (2), someone (2), top (2), anyone (2), crashing (2), tip (2), log (2), seeing (2), reference (2), allocating (2), took (2), franchise (2), red (2), language (2), preemption (2), worker (2), screenshot (2), further (2), uploaded (2), mods (2), fired (2), along (2), stalls (2), locations (2), instructions (2), quotient (2), remainder (2), significant (2), signed (2), location (2), getlogicalprocessorinformation (2), perfect (2), push (2), assembling (2), cross (2), hex (2), editor (2), idea (2), present (2), places (2), quick (2), analysis (2), modern (2), 280 (2), super (2), high (2), tracing (2), fire (2), day (2), alright (2), shows (2), threadripper (2), manager (2), great (2), own (2), freeze (2), correct (2), centered (2), wide (2), templar (2), address (2), last (2), decodes (2), buffer (2), dark (2), gray (2), remember (2), 1999 (2), color (2), space (2), allocated (2), zeroed (2), returned (2), binkopen (2), historically (2), skip (2), off (2), binkdoframe (2), dump (2), names (2), assembly (2), directly (2), filter (2), debugger (2), hack (2), promising (2), binkcopytobuffer (2), videos (2), stretched (2), epic (2), designed (2), monitor (2), query (2), host (2), sized (2), essentially (2), unlikely (2), include (2), hyperthreads (2), groups (2), setdll (2), injection (2), steam (2), multiplayer (2), listing (2), alter (2), anvilnext (2), awesome, inc, theme, powered, blogger, 2008, 2010, 2011, 2012, 2013, 2015, archive, legal, postings, alone, reviewed, approved, express, views, principal, development, sony, entertainment, san, diego, page, ultima, clone, wars, adventures, links, atom, authors, dated, content, relevant, behest, figured, recent, cropped, runaway, mostly, unnoticed, reduced, platforms, ramp, finding, eke, increasing, sharing, teams, efforts, types, parity, blinker, recently, hearing, ups, coincided, sdk, 500, logic, reserve, ramped, retooled, determined, lockup, unexpected, reasons, experiencing, progress, degenerate, design, internals, mutexes, met, retry, updated, runnable, indeed, fifo, round, robin, applying, progressive, algorithm, extreme, slight, momentary, dip, rate, starvation, inversion, compare, exchange, standing, internally, becoming, shudder, horror, terrible, locate, performing, reused, converted, assuming, spawned, sheds, insight, identified, killed, visible, assumptions, shockingly, shouldn, functional, song, mid, director, average, technologies, adapting, solid, framework, front, controlling, busy, iterations, deal, settled, guidelines, standard, queues, calculation, decompression, limit, facet, pole, continue, throughout, net, viable, taking, aspects, processing, physics, rendering, impossible, identify, omg, sub, requirement, points, attack, tune, adapt, concurrently, ideally, carry, adaptive, openmp, intel, building, blocks, apple, marketed, execution, levels, scheduled, powerful, fell, love, offer, iphone, bust, grand, central, fill, backlog, 100, khaaaaaaaannn, units, collect, animate, tasking, usually, 2000, surprise, incrementing, protect, primitive, spin, intrinsic, dvd, drives, counter, productively, stomp, problematic, interacts, 1000, yep, related, big, huge, gargantuan, wherein, lies, words, creates, talking, streaming, asset, updating, particle, grew, differs, quotes, yore, limited, uncommon, switching, house, thermostat, focus, shifted, speed, aka, ghz, 360, four, today, eight, olden, affecting, parent, variables, communicate, via, ipc, forking, availability, favoring, increasingly, numbers, woody, shares, expression, occurring, frequency, reach, positives, observer, reproduce, determinism, repercussions, considerations, compiler, optimization, subtly, reads, writes, challenge, boils, practices, encounter, weekend, tweetstorm, regarding, claiming, accuracy, responsiveness, removed, site, md5, recommend, third, party, mileage, vary, incorrect, 32k, size, shape, authored, glanced, mere, ensure, range, 015, 000000001, specify, boom, unnecessary, startup, stays, evaluate, upcoming, hotfix, straight, undocumented, mode, ntsettimerresolution, ntquerytimerresolution, technically, faint, wax, programmatically, documented, reported, scenes, browsers, tabs, open, streamer, recording, timegetdevcaps, edit, below, assumption, invalid, appears, client, 1ms, 5ms, latter, devs, lives, shut, citizen, behaviors, micro, stutters, miss, hits, landed, supposed, continually, believe, confirmation, bias, positive, gameplay, citizens, ending, reasonable, plausible, phone, forget, nanosecond, 4b3bccdb3bcbd48162aa77270d910276, apparently, valid, mirror, majesty, resolute, nuance, recursion, understand, unsubscribing, contains, besides, destroyed, pièce, résistance, reallocated, grown, iterate, index, skipping, append, astute, observant, amongst, notice, coming, forever, amend, asterisk, ordering, stands, violating, dependent, race, inside, hardest, solve, correctly, scenario, noted, proceeds, unload, executing, unloading, destructed, deleted, accessed, guarantees, walk, stateful, acquired, resize, reallocate, invalidates, position, walking, solutions, indexes, leaving, array, mark, empty, spaces, akin, middle, adding, acquiring, removing, evident, maintain, dangerous, execute, arbitrary, complication, recursive, contributing, cycles, deadlocks, arguably, troublesome, action, effort, singular, conditionally, ignore, meantime, consider, particular, wants, registration, shot, defer, examine, terms, context, imaginary, follows, principles, avoid, asks, experienced, complications, career, modular, distilled, rules, care, anymore, containing, uninitiated, pass, services, tenet, pushing, bonus, creator, positively, merged, oldest, supported, security, fixes, proactoreventloop, guido, van, rossum, unit, bunch, frustratingly, touchy, dusted, large, desire, recommendations, outsiders, elegant, worked, goal, cleanup, canceling, depends, labyrinthine, ecosystem, ism, myriad, stuck, diagnosis, properly, true, meaning, cancellation, hasn, error_not_found, succeeded, fail, error_io_pending, reproducible, understanding, filed, occur, leak, deallocate, anyways, lead, deallocated, socketpair, danger, arises, unregisters, destroying, turn, invokes, cleaning, _self_reading_future, acts, bridge, corrupt, pings, dummy, purpose, send, wakeup, signal, idiom, permanently, couldn, sample, produce, minutes, chance, print, call_soon_threadsafe, eternity, hands, finishes, dispatches, embedded, tick, implemented, proactor, reduce, knew, reproducing, network, input, continuing, fps, feel, sluggish, messy, synchronicity, interleaving, overlap, parallelization, synchronously, easiest, months, continued, irritated, trace, everyone, busier, bothered, crack, annoying, track, generated, who, rare, percolated, helpful, myself, sarcastically, indication, runtimeerror, 0xxxxxxxxxxxxxxxxx, pending, experts, spear, upgrade, random, trigger, pathology, curiously, occurred, deep, seemingly, innocuous, collector, releasing, handles, embeds, assigned, triage, scripting, upgraded, shortly, thereafter, occasional, crop, etw, anticipation, due, pushed, enjoyed, additionally, connection, bottom, left, sections, spends, decent, synchronizing, activity, graph, scroll, aha, chart, blue, visual, important, blocked, highlighted, ready, 747, 081, microseconds, readying, indicates, renamed, impressed, understands, members, haven, downloads, guess, enjoying, nexus, purrs, charm, accurate, established, earlier, rbx, idiv, convert, doubleword, quadword, result, chosen, magic, achieve, tricks, thus, divides, contain, integer, woods, doozy, ruins, smart, xxxxxx, confirm, string, safely, wrinkle, dubbed, methods, getprocessortopology, bring, total, nop, reset, popping, trick, r11b, getmemoryandcpuinfo, apply, trusty, vscode, search, preceding, lowest, exclusive, produced, immediate, representing, obvious, assembler, various, coded, rsp, 68h, systeminfo, getsysteminfo2, disassemble, disassembly, imports, liberty, renaming, cursory, freeware, compute, max, determine, common, runtime, implementations, cryptographically, fewer, causing, allowed, correspond, normal, captured, utilizing, capture, bruce, dawson, uiforetw, waking, stops, unknown, chooses, watching, recovers, head, favorite, profilers, seriously, hampered, contention, tons, searching, unique, 128, ram, wondered, perhaps, optimized, such, borrows, five, audio, freezes, nigh, unplayable, kenway, fleet, shadows, kinda, hey, nexusmods, voila, scaled, subtract, offset, plane, separately, smaller, tricky, aligned, speaking, calculate, tackle, centering, addresses, advances, represents, image, encoding, inefficient, pixel, computes, remain, zero, ends, 008700, greenish, hue, allocate, height, scaling, powers, extra, decoding, 1920, 1080, shaders, stretching, culprit, gpu, guy, ironic, pipeline, learn, undoubtedly, retaining, decompress, stream, soon, displaying, confusing, symbols, clues, except, unhandled, exception, sleeps, infinitely, virtualprotect, dirty, attach, anti, measures, reverse, snag, sound, binkcopytobufferrect, binkbufferopen, binkbuffersetresolution, binkbuffersetscale, sounding, tiny, accessing, tests, dumpbin, exports, guaranteed, logo, research, remained, consistent, integrate, integrated, 2006, familiar, popular, encoder, player, package, owned, rechristened, rad, tied, motion, cutscenes, double, almost, brain, watch, samsung, odyssey, beautifully, figures, ultrawide, evidenced, allows, specifying, drastically, chopped, queried, rebuild, filtered, builder, presented, highly, cached, queries, chops, saves, wrangle, optionally, layers, caching, mention, relationships, allowing, querying, returning, info, schedule, setthreadidealprocessor, emulating, mentioned, arguments, passing, happily, reporting, detects, debuggers, terminates, news, engine, debugview, utility, outputdebugstring, frustrated, dlls, catch, fiddled, filters, ships, complain, modifications, eureka, sounds, either, prevention, checks, modified, refused, loads, method, purchased, exits, cloud, sync, pan, interestingly, injected, withdll, hackers, messing, lengths, protections, element, curb, cheating, whenever, detourtransactioncommit, installdetours, compile, override, responses, wiki, instrumenting, intercepting, bigger, small, draw, gone, smp, preparing, servers, 256, unheard, evolved, conceivable, assume, pointed, iceberg, enter, amazing, legitimate, plan, facts, sucky, disable, bios, definitely, reboot, workaround, desktop, ostensibly, describes, 5975w, although, generations, apart,
Text of the page (random words):
buffer line offset we have to do this for each plane separately because the cr and cb planes are smaller than the y a planes the tricky thing here though is that bink requires the framebuffer address to be 16 byte aligned otherwise a hang occurs in the decoder speaking from experience voila not so wide now mr templar source is here uploaded to nexusmods and now back to playing the game posted by joshua kriegshauser at 5 35 pm 0 comments email this blogthis share to x share to facebook share to pinterest labels game programming games hacking programming 09 october 2024 game hacking i ve been playing through the assassin s creed franchise in anticipation of shadows due out later this year or well now pushed to early next year i really enjoyed assassin s creed iv black flag but ran into an issue that some other people had too kenway s fleet wouldn t load fortunately someone created a patch that fixed it and additionally made initial connection to ubisoft much faster fast forward a bit and i m playing assassin s creed rogue which is a great game in its own right but borrows a lot from black flag however i started running into an issue five or more second stalls where the game would just freeze audio would keep playing and then resume as if nothing happened i could go a minute or so without these freezes but sometimes it would be only a second or two after the previous freeze it was nigh unplayable searching around other people didn t seem to report the same problems that i did but my pc is pretty unique it s an amd threadripper with 64 logical cores and 128 gb of ram that s a lot of hardware for a game released 10 years ago looking in task manager i see that the game has about 280 threads that s a lot i wondered if the game is creating a number of worker threads per logical cpu but perhaps isn t optimized for such a high number of cpus designing software that runs well fully using 4 cpus is a lot different than software that fully uses 64 cpus alright so my working theory the game has a contention problem that shows up with tons of threads how to test that theory i fire up one of my favorite profilers superluminal unfortunately my ability to seriously debug performance issues is going to be hampered by the fact that i don t have any debugging information or source code for the game in question but superluminal can tell me what the os is doing and what requests the game is making of the os so i fire up superluminal and tell it to start watching acc exe the ac rogue executable sure enough within a few seconds i get a 5 second stall after it recovers i head back to superluminal to stop the tracing and start looking at it the stall is clear as day and i have selected it here from this it s pretty apparent that the main thread is running hard during the stall and from the function list in the bottom left corner i see it s trying to lock and unlock critical sections which are windows mutex like objects note that before and after the stall the main thread spends a decent amount of time synchronizing the red part of the red green cpu activity graph let s scroll through the other threads and see if we see anything else interesting aha thread 86036 has a cpu chart that is all blue this is superluminal s visual language for preemption that is the thread was running but the windows scheduler decided that running something else was more important also interesting to note that the other worker threads above are completely blocked on synchronization they re just waiting during this stall looking through some of the other threads there s not really much that is interesting a few threads are sleeping and waking up periodically but the main thread is running hard this thread 86036 is preempted and pretty much everything else stops while this is happening it s possible that windows for some unknown reason chooses to stop running this thread 86036 and instead runs the main thread superluminal gets information about every process running on the system at that time and the only thing using any cpu is acc exe the game we re profiling for additional information i also captured system state using event tracing for windows by utilizing the uiforetw tool by bruce dawson looking at the capture i was able to find a different stall in the same thread check out the highlighted line the thread was ready to run for 4 747 081 6 microseconds 4 7 seconds before it ran and the readying thread of 1 indicates that it was in fact preemption not immediately apparent from the screenshot but from further digging through the ui is that both the main thread and thread 86036 have the same ideal cpu 0 and priority 15 unfortunately it s still not super apparent exactly what is causing this a possibility is affinity which cpus a thread is allowed to run on but it s not clear how to check this most threads have 0 as their ideal cpu so i m not sure that this value is actually used by windows 11 but the priority values are interesting most of the threads in the process have priority values of 13 and 15 which would correspond to a high priority class and normal and time critical priorities respectively if both the main thread and thread 86036 share a time critical priority they could affect each other running but my initial thought was that 280 threads is a lot especially if it s running some or all of them as time critical priority let s see if we can get the game to create fewer threads unfortunately this is easier said than done most compute intensive programs trying to max out a machine like games will typically create at least one thread per cpu so maybe we can lie to the game about how many cpus there are there are actually several api calls that it could be making to determine this but the most common one would be getsysteminfo side note modern c runtime implementations use getnativesysteminfo but this function does not appear to be used by acc exe fortunately the game executable doesn t appear to be cryptographically signed so we should be able to patch it the next step is to disassemble the game so that we can find the places where it might be trying to find out the number of cpus for this i used ida freeware while the disassembly is quick the analysis happens in the background and takes a little while once analysis was done i looked at the imports and found the getsysteminfo function there were several cross references to places that were calling it i took the liberty of renaming the functions based on a cursory glance of what they were doing let s take a look at the second entry the one that i renamed to getsysteminfo2 i was really impressed with ida here it understands windows api structures and was able to figure out how members of the structures were being used note that dwnumberofprocessors is read into the edx register here and stored in various locations instead of reading the value from the structure i want to lie to the game i want it to see a hard coded value of 8 cpus so now i need to change the bytes 8b 54 24 50 which is the machine code for mov edx rsp 68h systeminfo dwnumberofprocessors to something else something that just gives me the value of 8 in edx unfortunately the free version of ida doesn t do assembling so i can t write new code here and expect ida to build me a new executable instead we re going to do it the hard way i need to figure out how to get the value of 8 into edx but in 4 bytes or less since ida won t help me out here i ll use an online assembler to try some things and then a hex editor to change the actual bytes well let s try the obvious instruction mov edx 8 unfortunately this results in 5 bytes ba 08 00 00 00 which is difficult to stuff into 4 bytes what s interesting is that the full immediate 32 bit value representing 8 is present in the machine code which makes some sense since we re writing to a 32 bit register this gave me an idea what is the machine code to move 8 into the lowest byte of edx the dl register turns out this is only 2 bytes b2 08 the problem is that the other 24 bits of our edx register are garbage maybe we can clear the register with an xor exclusive or instruction if you xor a register against itself the value is always 0 let s try that xor edx edx this produced machine code 31 d2 perfect so we have our solution then i ll just use my trusty hex editor plugin for vscode to search for the preceding bytes and write over the old bytes we just need to apply this to each location in our cross reference list above working through the list we run into a problem with the function that i ve called getmemoryandcpuinfo the dwnumberofprocessors value is written to a different register r11d this is an extended register for 64 bit processors and needs 5 machine code bits to read the value into it unfortunately our trick isn t working here assembling xor r11d r11d mov r11b 8 takes 6 bytes let s try a different approach push and pop the value which uses the stack we really don t want to make any stack changes as moving the stack pointer will cause issues with all of the following instructions that read write from the stack but if we immediately reset the stack pointer by popping the value it should be fine so let s try that perfect the push pop is only 4 instruction bytes so we had to add a nop or no operation instruction only one byte to bring us up to our total of 5 our next wrinkle happens in the function that i ve dubbed getprocessortopology while this function is also calling getsysteminfo and using dwnumberofprocessors easily patched by our previous methods it s also doing something further it s checking to see if windows is new enough to have a function getlogicalprocessorinformation and calling it if it does we don t really want the game to call this function since it ruins our lie about the number of processors fortunately this function is smart enough to handle the situation where that function doesn t exist so to prevent it from calling this function we ll just change the name to all x s it will attempt to find a function called xxxxxx which obviously doesn t exist ida can also confirm for us that this is the only location where that string is used so we can safely change the name unfortunately we re not out of the woods yet there is one more function and it s a doozy this function is doing a signed integer divide by the number of processors none of our tricks thus far will work for this let s take a deeper look at what this instruction is doing it takes a 64 bit value with the most significant 32 bits in edx and the least significant 32 bits in eax and divides by a 32 bit value in this case our dwnumberofprocessors eax will receive the quotient and edx will contain the remainder it does this in only 4 bytes however it doesn t appear to be using the quotient at all just the remainder so this is actually doing a modulus by the number of processors so what we need to do is actually a modulus by our lie of 8 processors can we do it in 4 bytes well we have a few things going for us the original function does a cdq convert doubleword to quadword instruction to set up for the divide it also needs eax and edx for the divide but only edx with the result and since we ve chosen a magic power of two value of 8 we can achieve a modulus by doing an and operation with 8 1 or 7 within reason we can also move some instructions around as long as the side effects are the same all we really need to do is this which is only 5 bytes and we ve already established that we don t need the cdq instruction since that was part of the divide so cdq idiv gives us 5 bytes all we need to do is move the mov r8 rbx one byte earlier then we have the 5 bytes that we need together that s all the locations calling getsysteminfo patched up the question is does it run i fired up the game and it purrs along like a charm no more stalls seems like the theory of my computer having too many cpus for an older game trying to take advantage of them was accurate i ve uploaded the patched executable to nexus mods but as of this writing there haven t been any downloads i guess not many people are trying to play a 10 year old game with 64 cpus at least i m enjoying it again posted by joshua kriegshauser at 7 07 pm 2 comments email this blogthis share to x share to facebook share to pinterest labels computer problems etw game programming games hacking performance superluminal 06 july 2024 fixing a memory corruption bug in python for omniverse we use python for scripting about a year and a half ago we upgraded from python 3 7 to python 3 10 shortly thereafter we started seeing occasional memory corruption issues crop up but it took a while to actually link the cause to python a lot of the crashes that we were seeing involved very deep and complex python stack traces in seemingly innocuous things the garbage collector releasing a reference sometimes allocating new memory within python since my team in the omniverse group handles the plugin system we manage the plugin that embeds python into omniverse which means i was assigned all of these crashes for triage we do have some internal python experts and my team wasn t the tip of the spear on the 3 7 3 10 upgrade though we were involved the nature of memory corruption means that crashes can happen in very random ways since any call to acquire or free memory which happens a lot may trigger a crash so we had 20 different stack traces that were considered to be part of the same memory corruption pathology curiously this was only happening on windows and another clue was that quite often we would see an error in the log sometimes well before the crash occurred runtimeerror _overlapped overlapped object at 0xxxxxxxxxxxxxxxxx still has pending operation at deallocation the process may crash helpful i thought to myself sarcastically well the process was in fact crashing so this may be an indication as to what happening however this crash was fairly low priority it wasn t happening often per se but it was annoying i made a task to track all of the different automatically generated crash stack traces and periodically tried to find someone who could look into it since it was windows only and rare it never percolated up to the top of anyone s priority queue months passed and i continued to be irritated when another new stack trace would pop up everyone including me was busier with higher priority tasks since no one else could be bothered to fix it i eventually decided to take a crack at it overlapped i o typically when you re writing a program and you want to do a network request or reading a file or any other sort of input output the easiest thing to do is to stop everything and wait because you need the results before continuing but in the world of 60 fps stopping and waiting for even a few milliseconds can feel sluggish we instead want to do things a synchronously have them happen in a background process and the program can do other things while waiting one way of doing this is through parallelization that is using a s...
|