Open-source(?) assembly hacks by Noxid

Apr 21, 2012 at 8:23 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
I'm never probably going to use these again so I figured like
why let these things go to waste

Much of this stuff is from days of yore and I don't even know what it overrides / does / conflicts with. I figure if you're smart enough to decipher this garbage you're smart enough to use it. I don't plan to offer any support on these hacks, and some of them may not even be finished. The only one I won't give away is the 2x hack, for obvious reasons, and those I made for other people who may still be around. With that said, here you go!


HackInstaller hacks
Earlier hacks made for use with carrotlord's hack installer, these are poorly documented and poorly made. Buyer beware.

HackInstaller

Contents:
AnimatedTiles - This hack may or may not make tiles animated. The new layout will match what's shown in CE_TILES.png included, with right-side having three frame animiations.
BasicMouseHack - mouse controls to prove I can
EQJ and VAC - I have no idea what this does
HpBarHack - The hack that I posted in HP Bars for every entity thread
Org2xCompatible - I believe this hack is a compatibility hack for executables with the 2x resolution hack that want to take advantage of the OrgmakerV2 drums hack
ORGKutsu Manual Version - I believe this is the original release of the Orgmaker V2 drum hack
TIMG hack - This is the hack I posted before that allows you to show an image over the screen. Maybe handy for cutscenes. Also may be outdated.
TitleScreenHack - I dunno. Maybe it's my three-save title screen.
TSCHack - The original version of the <VAR hack. I believe this has been superceded by TSC+
WAV Org hack - I think this is my working implementation of the OrgV2 drum hack.


Doukutsu Assembler hacks
Hacks made since the introduction of the Doukutsu Assembler. I try to be self-documenting, but I'm not the best commenter because I assume too much prior knowledge. They're probably easier hacks to use and maintain, but there are still most likely overlap and incompatibilities.
assembler V0.4
assembler V1.31
Contents:
TSC Modifications: lots of stuff, from the improved parser to the <VAR hack to the CIN input line hack. Good stuff.
Shotgun: from my island contest mod
HolyWaterWeapon: I can't remember if this was finished or not, but I don't think it ever saw the light of day.
DeathCannon - As-of-yet unseen enemy in KSS.
Assault Mech - The walking chicken robot in KSS. Kind of buggy.
WatS Pest - Something for dragonboots, I don't think it does much.
WATS Pest NPC - ??
Turret NPC - A little turret kind of based on the ones in Iji, but these are lamer because they don't retract or anything.
Trolly - The little wheely thing in KSS that you stand on to drive. Or maybe this is the one from Island that goes too fast and crashes. I forget.
SuperCrit - Boss battle from the storeroom in KSS. A hyped-up critter.
SinCos - just what it says on the tin. I forget how to use it.
NPC039 - Runs its event when the player's health drops below a certain threshold dictated by its flag ID
NewDrumLoader - I assume an integral part of the OrgV2 hack.
MapSys - Something to allow better display of the map system on 2x hacked mods. However, you could rework it to make the map show other things if you wanted.
Lift - The improved "elevator" lifts in KSS. I think they work pretty good.
ExplodingBarrels - boom
defines - Pretty much necessary to compile any of these with the assembler.

e: It's come to my attention that these might not work with the latest version of the assembler. When in doubt, they were made in V0.4 so that's what's most likely to process them properly.


Other:
Lowell's TSC Physics hack: change the physics with a TSC command. And some other stuff. It comes with documentation of sorts.
https://dl.dropboxusercontent.com/u/42853625/Permanent/Lowell_TSCPhysics.zip


My only request is that if you use these, either in whole or in part, that you give me some credit in your mod. Because like, I worked hard on these eh? And I'm probably going to be able to tell if you just take them and then I'll get mad at you and nobody wants that.
 
Last edited:
Aug 6, 2012 at 1:35 PM
scrungy
Bobomb says: "I need a hug!"
Join Date: Oct 7, 2011
Location: PrtWeed
Posts: 777
Age: 24
Thanks for these hacks, Nox.
 
Jan 19, 2013 at 4:44 AM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Nov 14, 2012
Location:
Posts: 167
where do I put the title screen thing?
 
Jan 19, 2013 at 5:33 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
If you have to ask, you probably shouldn't be using these.
 
Jan 23, 2013 at 6:41 AM
Veteran Member
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Aug 21, 2012
Location: At a computer
Posts: 332
Can i have permission to use the NPC039 hack?
Second, i got the assembler set up, i opened my doukutsu.exe, and selected direct assemble with NPC039.txt as a test, and it say's it can't recognize offset "npc039". What offset do i change it to to get it to work?
 
Jan 23, 2013 at 6:44 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
I'm no expert but you probably want to use the offset, not the name of the hack

Offset = 0x??????, $0??????, or 00??????
 
Jan 23, 2013 at 6:47 AM
Veteran Member
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Aug 21, 2012
Location: At a computer
Posts: 332
MagicDoors said:
I'm no expert but you probably want to use the offset, not the name of the hack

Offset = 0x??????, $0??????, or 00??????
I know, but it said in the npc039.txt file that came in the zip "offset npc039"
 
Jan 23, 2013 at 7:08 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
-looking at .txt-

I'm fairly certain you're not supposed to copypaste that code. You actually have to plug the values in.

E: and by fairly certain I mean you MUST plug the values in
 
Oct 7, 2013 at 2:10 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
uhhhhhhhh it should be in defines.txt ... which you replace the existing defines.txt or whatever with

Code:
CPU Disasm
Address   Hex dump          Command                                  Comments
0048BF00      55            push ebp
0048BF01      89E5          mov ebp,esp
0048BF03      83EC 04       sub esp,4
0048BF06      8B45 08       mov eax,[ebp+8]
0048BF09      2B45 10       sub eax,[ebp+10]
0048BF0C      0FAFC0        imul eax,eax
0048BF0F      8B55 0C       mov edx,[ebp+0C]
0048BF12      2B55 14       sub edx,[ebp+14]
0048BF15      0FAFD2        imul edx,edx
0048BF18      01D0          add eax,edx
0048BF1A      8945 FC       mov [ebp-4],eax
0048BF1D      8D45 FC       lea eax,[ebp-4]
0048BF20      DB00          fild dword ptr [eax]
0048BF22      D9FA          fsqrt
0048BF24      DB18          fistp dword ptr [eax]
0048BF26      8B00          mov eax,[eax]
0048BF28      89EC          mov esp,ebp
0048BF2A      5D            pop ebp
0048BF2B      C3            retn

55 89 E5 83 EC 04 8B 45 08 2B 45 10 0F AF C0 8B
55 0C 2B 55 14 0F AF D2 01 D0 89 45 FC 8D 45 FC
DB 00 D9 FA DB 18 8B 00 89 EC 5D C3
freebie function, computes the distance between two points
PUSH P2Y
PUSH P2X
PUSH P1Y
PUSH P1X
CALL <function>
ADD ESP, 10
length rounded to the nearest integer returned in eax
 
Mar 26, 2014 at 1:06 AM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 26
Last edited:
Mar 26, 2014 at 1:11 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
huh, imagine that.
Well, glad you managed to pull it out of the aether.
 
Jan 17, 2015 at 3:11 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
If anybody is interested in the physics I had at the end of the decembuary mod contest, here's the ASM I wrote for it

Code:
offset 416470

#define
xpos=[ebp-4]
ypos=[ebp-8]
xvel=[ebp-0C]
yvel=[ebp-10]
kh=[ebp-14]
accel=28
drag=12
focusX=49E65C
focusY=49E660
speedcap=7ff
minBounceSpeed=50
#enddefine

push ebp
mov ebp, esp
sub esp, 14
cmp [ebp+4], 0
je :RETURN
mov xpos, 49E654
mov ypos, 49E658
mov xvel, 49E66C
mov yvel, 49E670
mov eax, KeyHeld
mov kh, eax

;handles x-vel shit
mov edx, xvel
test kh, 3
jz :noKeyLR
test kh, 1
jz :noKeyLeft
sub [edx], accel
mov DirectionFaced, 0
:noKeyLeft
test kh, 2
jz :noKeyRight
add [edx], accel
mov DirectionFaced, 1
:noKeyRight
jmp :checkUD
:noKeyLR
mov eax, [edx]
cdq
mov ecx, drag
idiv ecx
mov edx, xvel
sub [edx], eax


:checkUD
mov edx, yvel
test kh, C
jz :noKeyUD
test kh, 4
jz :noKeyUp
sub [edx], accel
mov IsFacingUp, 1
:noKeyUp
test kh, 8
jz :noKeyDown
add [edx], accel
mov IsFacingDown, 1
:noKeyDown
jmp :checkBounce
:noKeyUD
mov eax, [edx]
cdq
mov ecx, drag
idiv ecx
mov edx, yvel
sub [edx], eax

:checkBounce
mov eax, PlayerTile
mov edx, xvel
mov ecx, [edx]
neg ecx
shl ecx, 1
test eax, 1
jz :noBounceL
cmp [edx], -minBounceSpeed
jg :noBounceL
mov [edx], ecx
push 1
push 3
call PlaySound
add esp, 8
mov eax, PlayerTile
mov edx, xvel
mov ecx, [edx]
neg ecx
shl ecx, 1
:noBounceL
test eax, 4
jz :noBounceR
cmp [edx], minBounceSpeed
jl :noBounceR
mov [edx], ecx
push 1
push 3
call PlaySound
add esp, 8
:noBounceR
mov edx, yvel
mov ecx, [edx]
neg ecx
sar ecx, 1
test eax, 2
jz :noBounceU
cmp [edx], -minBounceSpeed
jg :noBounceU
mov [edx], ecx
:noBounceU
test eax, 8
jz :noBounceD
cmp [edx], minBounceSpeed
jz :noBounceD
mov [edx], ecx
:noBounceD

:spikes
mov eax, PlayerTile
and eax, 400
je :nospike
movzx eax, byte InvincTimer
cmp eax, 0
jnz :nospike
push 01
call 419910
add esp, 4
mov eax, xvel
mov ecx, [eax]
neg ecx
sar ecx, 1
mov [eax], ecx
mov eax, yvel
mov ecx, [eax]
neg ecx
sar ecx, 1
mov [eax], ecx
:nospike


:capSpeed
mov ecx, speedcap
mov edx, xvel
cmp [edx], ecx
jle :checkSpeedLeft
mov [edx], ecx
:checkSpeedLeft
neg ecx
cmp [edx], ecx
jge :checkSpeedUp
mov [edx], ecx
:checkSpeedUp
mov edx, yvel
cmp [edx], ecx
jge :checkSpeedDown
mov [edx], ecx
:checkSpeedDown
neg ecx
cmp [edx], ecx
jle :END
mov [edx], ecx


:END
mov eax, xvel
mov eax, [eax]
mov edx, xpos
add [edx], eax
mov eax, [edx]
mov [FocusX], eax

mov eax, yvel
mov eax, [eax]
mov edx, ypos
add [edx], eax
mov eax, [edx]
mov [FocusY], eax


:RETURN
mov esp, ebp
pop ebp
retn

It replaces the "fish boss" physics you get with the <UNI0001 command
that's not actually all you need to do, there are like 5 spots where Pixel sets the y-velocity to 0 when you hit a roof. You can delete them cuz I moved them all into the "bump ur noggin and make sparks appear" function. Coincindentally, they're all after calls to it. I only have binary for the function itself though.
Code:
55 8B EC 83 EC 04 C7 45 FC 54 E6 49 00 8B 4D FC 0F B6 41 E4 83 E0 02 75 4A 6A 01 6A 03 E8 BE 94
00 00 83 C4 08 6A 00 6A 0D 8B 4D FC 8B 41 04 2B 41 2C 50 FF 31 E8 F6 3A FF FF 83 C4 10 6A 00 6A
0D 8B 4D FC 8B 41 04 2B 41 2C 50 FF 31 E8 DE 3A FF FF 83 C4 10 8B 4D FC 83 79 F8 00 75 05 33 C0
89 41 1C 8B E5 5D C3

A similar trick for hitting the ground would be useful so you're bouncy on all 4 sides but I wasn't motivated enough to fix that.
e: those hex bytes go @ 417160, but if I try to edit it in then all the formatting in the code blocks will shit itself
 
Feb 3, 2015 at 4:51 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
apparently I never posted the TSC physics modifying hack I made for Lowell, and since I doubt he's going to be around to complain I've updated the OP with that.
 
Jun 25, 2019 at 9:46 PM
War criminal
"Life begins and ends with Nu."
Join Date: Jun 27, 2013
Location: Phoenix
Posts: 2758
Age: 29
Mind the bump, this is just me being curious and looking into the HackInstaller folder, but I was trying out the <EQJ and the <VAC hacks, and the mod would crash when the hack would try to read address 0x475700. Was there a missing hex file for the hack in that address?
 
Jul 2, 2019 at 11:27 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
TscHack hex3_core_junk.txt has this snippet
Code:
475700

55 8B EC 83 EC 04 8B 45 08 0F B6 08 83 F9 56 74 37 83 E9 30 69 C9 E8 03 00 00 89 4D FC 0F B6 48
01 83 E9 30 6B C9 64 01 4D FC 0F B6 48 02 83 E9 30 6B C9 0A 01 4D FC 0F B6 48 03 83 E9 30 01 4D
FC 8B 45 FC 8B E5 5D C3 0F B6 48 01 83 E9 30 6B C9 64 89 4D FC 0F B6 48 02 83 E9 30 6B C9 0A 01
4D FC 0F B6 48 03 83 E9 30 01 4D FC 8B 45 FC D1 E0 05 90 E0 49 00 0F B7 00 8B E5 5D C3

No idea what it does but it's probably some function I forgot was used elsewhere
 
Apr 27, 2020 at 6:57 PM
Based Member
"Life begins and ends with Nu."
Join Date: Dec 31, 2011
Location: United States
Posts: 2307
Age: 27
After years of Noxid being so incredibly active here and always updating links from other users that went inactive, it's so weird to see him end up going inactive and his links going dead...

Anyway, thanks for updating these download links.
 
Top