#development
1 messages · Page 133 of 1
and this will likely error, so make sure to remove it
you're already inside Game
and inside buttons
well that class is just for toss
i'll create diff classes for diff steps in game
The classic StackOverflowException
nononono, make different functions if u must
(Or whatever it’s called in node)
but not different classes
wouldn't that make it complex
classes can have as many functions as u want
Usually classes have more than one method
u can yeah
what u guys prefer
the code inside them will not be ran until you call the method
one class diff methods or diff class
One class different methods
btw guys
More than one class is starting to defeat the purpose of using classes in this situation
a class should be a representation of an entity
like, you have a game, so it's an entity
and do i make seperate files for methods
can i separate my functions from my class but still run it on it
the game can have many stages, but it's still the same game
hmm
you can, just import as always
wym
You can pass an instance of your class to a method and modify your object that way
can i use import export system here too?
But that starts to defeat the purpose of OOP classes
I need more context here
it's best to have a cluttered file than a cluttered project
Some files will be large if your class is large and has a lot of functionality
??
It should only be responsible for one “thing” usually, that’s one of the pillars of OOP
https://github.com/battleless/kick-api/blob/main/client.js
here, you see the functions like getCategories? can i put it into a different file
put them where they belong
if they're methods for your game, put in your game
hm?
Why would you? They’re 3 lines
yeah i know I'm just giving an example
if they were long
if the book belongs to Game, put in game
You cannot separate class definitions to multiple files
like this
wtf
You can extend a class, but that’s different
and this is not the full file
That’s just how it is
bro i dont have supervision
It’s not a bad thing either, you just have to get used to it
but I couldn't put that code outside of that file even if I wanted to
because they're meaningless outside of it
what is it?
and will only be used on that specific file
my card game
every method is an action, which gets called based on user input
so it's naturally long
ok so
create diff files for diff methods by exporting and importing class
and then create a file for full game run all methods
The logic for card games is pretty complex sometimes
or create a big file having all methods and call it there only
now i ee why rummy companies ads so much
yeah, a card game
kekw
that code doesn't include the renderer
?
renderer is somewhat smaller
dem
There is a main class somewhere within minecraft though, every program needs an entry point
again, if those methods belong to that class, put in that class
notch boi
It still has a main class internally somewhere
but u just said dont make more than class
if not necessary, yes
if those methods only have a meaning for that game, you can just put inside game class
The JVM needs a method signature of public static void main(String[]) somewhere in the bytecode
i am asking all that in one file???
or sperate
yes it is
Which means there is a class of some sort within MC that has that signature
yes
Just wait until you see his Helper.java file
mess but fine,thanks for explaning so well
Good night cya
have a good day sir
🧌
music starts
lmao that's long dead
players use commands to manipulate the board during their turn
whats the short form of spanish
like place a card, equip, use a spell, etc
like two characters
oh yeah thx
for reference, there's a list for that
ISO 639 is a standardized nomenclature used to classify languages. Each language is assigned a two-letter (639-1) and three-letter (639-2 and 639-3) lowercase abbreviation, amended in later versions of the nomenclature.
This table lists all of:
ISO 639-1: two-letter codes, one per language for ISO 639 macrolanguageAnd some of:
ISO 639-2/T: thr...
so i have tried almost all file extensions that might support transparency but nothing has been successful
for animation?
the closest i got was with gif which guess what had no transparency
yes i am using canvas
i tried apng webp
the image has to be set the first then over it a transparent animation
i don't care about the extention
nope
the final can be any extension as long as it has transparency
the user will get it via telegram where they can download it
it's a watermark bot
didn't find any package
yes
sorry english broki
the only one i found supported browser only
apng-js
or smthn
oh shit
there's also https://github.com/photopea/UPNG.js
are these not npm's
idk, I'm showing the first results I got from google
worth to search on npm to see if any pops
do you think it's possible to get it to work with canvas
you'll be editing the frames individually
so i guess that's alot of processing power
use canvas for making the frames and then pack it up with upng
well, you can't edit an animation without separating the frames
even if there was a lib that "did" that, it'd internally separate the frames
alright
so basically i will need to seperate all the frames of a apng
the elephant one has like 20 or 30
separate, add overlay, put somewhere for later use
oh so i can cache ittt
after u finish all frames, pack it up
since i will be using the same one
yep
would a json work

just put it in a const and do your stuff
after u finish it'll be cleared automatically as u left the scope
the thing is i don't wanna fetch the frames all the time when a user inserts a new image
anyway that's for later i will try to get it working first
Talking about that since telegram api's has a close timeout
then yeah, you can store it for later usage
use a self-expiring map to store the image bytes (buffer)
alrightys
it should 👀
Its a seperate event
😔 I just wrote so much code and I dont like it 
Just going to delete it and restart. Wasted 6 hours today ^-^
Thanks
If there was a job to waste time I would be the best at it.
Especially if it was to look like I'm doing something useful
regarding the apng project i kind of got it to work but all the frames it encodes seem very transparent
aka there is nothing on them
💀
the data looks fine
if it is the libs issue
i am gonna go fucking crazy
before the decoding
after
wdym?
also, windows doesn't assign a default app for apng
that's why it shows the default thumbnail
it's just lua that's weird
Yeah when u open it its literally transparent
weird, try seeing if u didn't miss anything
also, to test it try dragging to the browser
but Roblox uses it
using something doesnt means it's good
also there are quite a few languages that work well as embedded languages and don't give too much access to the scripter
which is likely why they chose lua
well
Roblox has millions of concurrent players
so if Lua can do allat I think it’s good
it has millions of conc players, but lua's not running millions of times
you forget the each lua script is ran in its own context
the game is not made in lua, only the scripts
The largest discord bot uses Python, doesn’t mean it’s good
in the same way that my bot is in java, but my cards are executed in groovy
doesn't mean I made my bot in groovy
So are you saying Python and Lua are both bad languages?
they're good for their own niches
lua is good if you need an embedded lang an restrict access to the scripter
because you can setup your own sandbox and choose what the scripter can use
ok
guys
how do I make an npm package
transparent aka white in the browser cuz that's how it shows it's transparent. I am very confused if the fault is the encoding or the canvas. Here is the code btw
what did this output?
lua users realising their language is rarely used as the main language of a project but rather an addition to it
I mean, it wasn't created to be a main language anyway
yes it is hard to make one
the issue with obfuscators is that simply renaming identifiers and removing every space and newline isn't enough
because reverting it will be really easy
a proper obfuscator will break functions in half, transform strings into codepoints, do shmucks with formulas and code flow, etc
setup your package.json, make your main file export something, publish to npm, done
in a way that it barely resembles the original code even if reverted
wym setup your package.json
it is
ok
give it a name, a description, and all the basic stuff
what do you need an obfuscator for?
making your own obfuscator is almost as hard as making your own compiler
wdym exploiters?
ik what roblox is
but wdym exploiters? like, can they even read the scripts?
replicated?
if running foreign scripts is your concern then obfuscators will do nothing
that sounds like a roblox flaw tbh
but well, so what would obfuscators help in this case?
Roblox has the world’s shittiest anticheat
If a 12 year old can make a script to cheat in a game, then the anticheat is either nonexistent or completely useless
so when does a replication happen?
can my bot require people to have a discord role before being able to reveal spoiler text?
Nope
dang
You could theoretically do a message with components with the Text "unspoiler" and depending on the role, respond with a ephemeral message
unspoiler lmao
thats kinda cool actually
thanks for the inspiration
Could probably check if the message || contains spoilers like these || and have emojis replace these according to their length
Pressing that unspoiler button then does that
logs all the frames
Width : 720 Height: 692 and the length 34
Which seem fine
see if anyone in google faced that issue before
i feel big header text on discord is so cursed
they need to keep the old way which is lower text with ability to make text bold or wiggly
were not making a html blog here
wait, is this not the blogging server?
https://github.com/photopea/UPNG.js/issues/64 reading this, it seems like it's an issue with the lib it self
not sure, but from what I understood ur trying to run a client script on the server
it seems solved by the end of the issue
yes i see the encoding type
just use a token
^
no u dont
ah, ic
hm, u have no data about the sender?
see if u can get machine info through lua
like MAC address
or some other physical info that's not hardcoded
if all fails, create a site that returns your own IP
then make your script send a request to that site and hash the ip
then check (in your server) if the sender hash is in the expected list
i wonder if its possible to read the TPM on windows like the actual keys on it
no real reason just would be nice to know
even if someone reads your code, they wont know ur ip
so they cant fake it
to be extra safe, use ipv6 instead of ipv4
since it's physically impossible to bruteforce it
i think i found the issue
have you tried RWE?
so i saved all the canvas,
const out = fs.createWriteStream(`canvas${i}.png`);
const stream = canvas.createPNGStream();
stream.pipe(out);
out.on('finish', () => console.log(`Saved canvas ${i}.png`));
why isn't the elephant pink? and where are the wings? i'm so confused
all the images are the same loaded from canvas and it seems like all the frames from the apng are in one
not sure which function is causing this
to stressed to think about that
i can fix it later

oh lol
did u remember to clear the canvas for each frame?
lmao
you'll want to watch this to learn more about cartoon elephants
https://www.youtube.com/watch?v=jcZUPDMXzJ8
Dumbo 70th Anniversary Edition is now available to own on Bluray!! The scene in Dumbo in which Dumbo and Timothy have dreams of Pink elephants from being drunk. Comment, rate, and subscribe!! I OWN NOTHING!
i have not
i tried getting chatgpt to tell me but it thought i was trying to hack someones private keys on their tpm so it didnt tell me
when i said it was my pc it gave me some powershell script which did not work
the aggressive looking chinese text is making me worry
lmao
so i just set a cleaner for the canvas just to find out the apng is static now
so it doesnt load any driver deemed as remotely dangerous
rip
its also not happy i have a custom CA installed
i swear all of this is designed for average computer users
i have windows pro ffs
ima pro
wait its not even using my fucking tpm
i think its because i have secure boot turned off
which renders the tpm useless because anyone can install custom os and read the tpm
xD
fuck
huh
i always install windows with secure boot disabled, otherwise i cant even boot into the installer
i think it means you have to install windows with secure boot otherwise you wont be able to enable it
and then turn it back on after installed
my bios wants me to mess with some "authorisation keys" or whatever
can load os on usb
linux too!
no
i get this error when i try to turn it on
aw
wtf is a platform key
I wanted to make a discord soap2day
and how do i enrol one
btw does anyone know a api to download movies
wym?
youre going away for a long time buddy
is that a prison room
it in fact is
Lmao an api to download movies
what why
That’s just piracy
no
lmao
i love this server bro
If you want to pirate something for watching it yourself that’s a slightly different conversation since it’s a legal grey area, but downloading movies for anything other than that is just straight up illegal
I just wanna download
For what purpose
uh
That’s what I thought
so I can see the movies length
I heard that with movies and games, you can keep a pirated copy for a few days on your hard drive
Ok so you don’t need to download an entire fucking movie to get the length of it
indian youtuber to the rescue
https://www.youtube.com/watch?v=KF2vdUnzLlg
You may see an error "System in Setup Mode, Secure Boot can be enabled when system in User mode. Repeat operation after enrolling Platform Key (PK)" while enabling the secure boot from UEFI BIOS. This happens when you change the boot mode from CSM to UEFI BIOS or the system already has some platform keys enrolled.
Step to fix System in setup mo...
That’s just a bullshit reason
yeah I do
it happened to me once it was not fun
how else will I know the length?
By using an API for movie info???
no
I need accurate info
from first talking scene to final talking scene
no credits n such
Plus if this was a supposed solution to your issue then you’re taking possibly the most incredibly inefficient route possible
fuck it ill try it anyways
So I don’t believe you
bruh
I know that you’re not the sharpest tool in the shed sometimes but this is still below you
Come on man
Yes
Extremely
That’ll get you a nice little visit from the FBI at some point
(Assuming you meant distributing)
ok
WERE IN ACTION
thank you indian man
I was never planning on doing that I just want the accurate length
xD
Yeah that’s the biggest lie I’ve heard from you ngl
No sane individual could think that is the proper solution for that
I gave up i am going to bed
Technically, the movie's true length includes credits
Even more for marvel movies
Turns out saving the frames by it self is just fine but when i use them in the canvas it uses the data from the first frame for the rest of them. Which ends up a static image
for my next project i am going to make a discord api wrapper like discord.js
There are hundreds already
You're very likely not using a clean frame for every frame
I am pretty sure i cleaned them
I deleted and redrawn in the loop
yeah but this is for practice
i think i am good enough to remake discord.js now
Ah
(wait until he founds out how dogshit the dapi is to work with)
that does deserve a super reaction
You underestimate thw sheer size of it
humbled 💀
Also, if u miscode something u can end up getting the infamous 1-day ban from cloudflare
Autocorrect got me
why ?
Spam
Ah
nah it’s just Client then .on then interaction
pretty easy
Bruh
Ratelimits
That’s literally not how it works 💀
wym
If u mistime the limits too many times in a short frame u get a cloudflare ban
class
Who do you think had to build that class from scratch? Discord.js did
class Client
Also happens if u get too many 4xx errors
I can handle them
Yeah well believe it or not just making a class and doing .on() isn’t a thing
I’m a professional with ratelimits
me if cloudflare bans me:
yeah it is
It’s literally not
Buddy u literally are the thing ratelimits were created for
You have to define the code that emits those events
client.on("interactionCreate", interaction => {
});
You also have to extend EventEmitter and know how that works
Dude this doesn’t just exist out of nowhere
yeah ik
It’s hilarious how blissfully unaware you are
I just have to make a function inside of the client class called on
It’s not too difficult
I don’t even think you’d figure out how to make the proper code to connect to gateway via websockets 💀
I can figure out the logicists
Nope. That’s wrong.
You'll need to create everything from scratch
You won't have Client or interaction
Or any objects or classes whatsoever
on is not a function that you are going to write in your class
That comes from EventEmitter
I can do that
Please do
Do it then
At the end of the day its battleless he can do anything
I’d love to see this crash and burn
It brings me joy to see overconfidence get shattered
when I’m done my skittles
Just remember, you only get a few shots at making your request bucket work
Once u hit the limit you can't continue for a day
I cban
The thing that kills "very good" drivers too
can
You can't
yea
Cloudflare will prevent u
dont listen to them be optimistic and try your best if you fail just try again and learn from the experience
ez
prove them wrong!
fr
they’re just haters
Sure, if u pay for the extra ips
(You don't know this guy very well do you)
She prolly does lol
(this is not true)
As much as I have coded in java I still take my hat off for MinnDev
Couldn't imagine myself making JDA
There's a reason we talk like this to him, he's been a dick on multiple occasions to so many trying to help him
Boy i have been working on my watermarkbot for days and i keep getting fucking stuck on stupid issues
@wheat mesa
@lyric mountain
can you make discordjs yourself?
No
Probably not
why not?
Cuz it requires a community to work on it
Both time and willpower
I think u guys can
Because it's a massive project and I have no need to make it
Or a small team
i could not be asked to remake d.js
cap
Plus I don't have a ton of experience with the dapi
A lib the size of djs would take a single dev AT LEAST a year
I've made code that connects to the gateway before, but even that was an absolute mess and hassle
bruh
And that's the "easy" part
Roblox
Roblox?
Go join a roblox community
I can’t remake roblox
Yes
You should make your own discord library, since you're so confident that you can make it
Please
Make a topdown space shooter
I will try that
Lol
no I’m not a game dev
idk anything about that
What's the difference
Make it with vanilla js if u skilled
did u guys forget I’m a beginner
Actually no libs at all
🤨
java my beloved
can I see
Dont u love such projects
Hi guys, how can i make my bot notice if someone has my bump system enabled so it would send the ad to the channel in every server that has it enabled
Then make a snake game
Easier than space shooter
https://github.com/Jwaffled/PlayBrew here's my engine (the actual game is in the test folder, but it's really buggy and shitty because we didn't have much time)
Can be done with bare array and recursion knowledge
Since you are mentioning bump then you are in the wrong server i guess but you are gonna have to use an API
Top.gg has no bumps right?
constantly says he knows everything
"guys im a beginner"
Check the website which has the "bumps" for your server they might have the api docs
Yes
You certainly do
Skill issue?
yea
It's for my own advertising system
Not the top.gg one
Oh so you are talking for your own feature
You are gonna need to setup a check for all the servers and take out the ones that don't have the bump system enabled
Afterwards make a interval to start sending the ad or whatever
Not sure
u r
Very
i still dont fully understand git
sometimes its just a black box
last time it for some reason decided to replace all my changes with an old commit on github that ive worked months on
i still don't use git for all my projects lol
i just edit locally then unlink <file> and nano <file>
for some bigger projects i use git
I don't see anything wrong here, elaborate further, maybe
cmon, that's a very basic project
and I don't mean anything fancy, just a text snake moving in the console eating text apples
and it’s always moving?
idk how to do that
but I don’t know where to start
this is beyond my skill leve
start by learning how to write stuff on the console
console.log 😐
now learn how to clear the console
tbh, I wouldnt be 100% certain how to do it either in console.
in react though no problem 👀
I could figure out either though
you just need to know how to write, clear and take input
clear on each frame, then "draw" the game as a grid of text
then just hook events on up, down, left an right key presses
or WASD whatsoever
Too complex
Did you do some kind of rebase? What commands did you run?
it's not, can be done in less than 50 lines
cap
write, clear and input are all one-liners
drawing a text grid is 5 lines (2 loops + write)
the remaining is for the snake logic
which level is higher
a-z
that doesnt help
That's the issue
it does
When the local repository is not synced up with upstream, it cannot cleanly push to it, so when merging changes it assumes the previous commits aren't pushed either and so that happens
Though this can easily be fixed with just a rebase
Looking at your GitHub you've done a few things which logically are harder than making a console version of snake
Use an interactive rebase with git rebase -i <commit hash>^ (replace <commit hash> with the commit SHA of the commit where that happened), change pick to edit on the commit where it happened, remove those changes, and keep your current changes and continue with the rebase, and finally do a force push
console is really easy to work with, but people fear it for some reason
If you fear the console find something you don't fear, website, discord, anything, console is the easiest of those but
You are A Dev From Any Library @earnest phoenix
Hm?
You are A Dev From Any Library @earnest phoenix
he is node.js
also read his about me 🧌
Comedy gold
Almost as if all of us told you that
true
but idk what else to make
it looked like a good thing to make
ok guys
how do i get out of a if statement
?
i'm asking for help here
if you don't wanna help don't help
🧌
not simple
i googled no good answers
Why would you get out of an if statement? In what world would that be necessary?
You’re essentially asking for goto-esque functionality
That’s a terrible thing to do
What
@hushed robin post the code you’re trying to create here
yeah give me a sec
i want those to exit my if to run code at bottom
Then just use blocks like a normal human instead of returning?
wym
if(thing) {
if(!somethingElse) {
// Code here
} else {
// Code here
}
}
No?
yah
No?
i will have to do that for every return
You’ll probably have to nest some if statements, sometimes that’s how it is
let me show u
Java is basically javascript but with less flexibility
Jesus Christ
yes
🤦♂️
That’s not what I was saying
Keep in mind you could also just put all of that logic in a function instead of writing it out if you wanted to do it that way
Even though that’s still not the right way
why…
Why would you intentionally increase the length of a function unnecessarily
I’m not gonna even try
ok
in my fetch
i want to see if it's in cache first
and if is return
thats point of this
but i also wanna add force paramter
so u can force it to fetch everytime
and no check cache
nvm i solved it myself like a smart person
C++ templates and concepts 🧌
c++ is easy because the std library got your back
Taken from cppreference.com: ```cpp
#include <string>
#include <cstddef>
#include <concepts>
// Declaration of the concept "Hashable", which is satisfied by any type 'T'
// such that for values 'a' of type 'T', the expression std::hash<T>{}(a)
// compiles and its result is convertible to std::size_t
template<typename T>
concept Hashable = requires(T a)
{
{ std::hash<T>{}(a) } -> std::convertible_tostd::size_t;
};
struct meow {};
// Constrained C++20 function template:
template<Hashable T>
void f(T) {}
//
// Alternative ways to apply the same constraint:
// template<typename T>
// requires Hashable<T>
// void f(T) {}
//
// template<typename T>
// void f(T) requires Hashable<T> {}
//
// void f(Hashable auto /parameterName/) {}
int main()
{
using std::operator""s;
f("abc"s); // OK, std::string satisfies Hashable
// f(meow{}); // Error: meow does not satisfy Hashable
}
I'd say this is confusing
Mirror of https://git.ffmpeg.org/ffmpeg.git. Contribute to FFmpeg/FFmpeg development by creating an account on GitHub.

honestly C goat language for working with low level data like raw bytes
main thing c/c++ needs is a centralized package manager
getting libs to work is such a hassle
I know but none of them are really "standardized" across ecosystems, cmake is probably the most universal build system
I want something like cargo but for C++, easy to use and isn't obscure
frfr
@wheat mesa why is ur username waffle.cs
not waffle.rs
u don't do C# afaik
speaking of which
damn counter strike players
do u play cs
nah
interactions always have the user property
dem
the submission requires a command, but my bot needs none?
what
Most bots operate on commands, either text or slash
mine works by the blood, sweat, tears and glue holding it together
sexy
ikr
i guess i just make one for /info
commands are so old fashion 😄
I see some bots able to link their website dashboard url as 'social' tab, tho i seem to only be able to link main social media urls. Is it something changed recently?

hi guys i am back to working with my watermark bot

nice
https://pastebin.com/raw/jze71H97
am i cleaning the canvas properly:
ctxCanvas.clearRect(0, 0, canvas.width, canvas.height);
ctxCanvas.drawImage(userImage, 0, 0);
ctxCanvas.drawImage(frameCanvas, watermarkX, watermarkY);
top gg requires, and overall is a good practice, for the bot to not require admin perms.
My bot needs to be able to create threads in any channel. Is there a perm beside admin that allows that?
const mainImageData = ctxCanvas.getImageData(0, 0, canvas.width, canvas.height);
console.log(mainImageData)
const mainRgbaFrame = new Uint8Array(mainImageData.data.buffer);
after logging the mainImageData it seems that the data for all the frames is the same
even tho when i individually saved the frames everything seemed to be fine
this is inside the loop function btw
that would be the CREATE_PUBLIC_THREADS permission (since it's not admin, you need to check whether your bot is permissible to do that)
where is Kuhaaku when i need him the most
ya but if it cannot see the channel, it cannot create a thread in it, even tho it has the perm to create threads
I guess you'll also have to check for view channel permission
there's not really any way around it other than admin so
that should do, according to the docs
hang on
kuhaaku is cool but so pessimistic LOL
he's playing in realistic difficulty
can't blame em
and often pessimistic views lowers your expectations and allows more dopamine if you get it through
im his optimistic doppelganger
what
<Canvas2DContext>.clearRect indeed does clear the canvas
alright so that's not the issue
but for some reasone ImageData contains the same data for all them frames
the one inside the loop
idk what i am doing wrong
have you mutated them before trying to access?
the raw code is blinding me eyes
Iv just submitted my bot but it sent be back to step 2 and i cant push 'next'.
Is there a way to check if it has been submitted?
top.gg said no
idk ask #support
said no to what?
to your bot?
where did u see that
idk just an assumption
just submitted 30 seconds ago
im not asking if it has been accepted, but it has been submitted correctly. Got no notification on that
@quartz kindle actually now that i enabled secure boot i just made it harder to enable your tpm mod or whatever it is
idk you ask #support for stuff like this
k thx
tpm essentially becomes a self destruct armed device when secure boot is on and tpm is initialised
any attempt to disable secure boot or read tpm without correct password or try to access it physically causes it to erase itself and/or lock itself
pretty cool how its engineered to resist tampering and unauthorised access
inspiring in fact
lmao
what does tpm even protect against? like in practice
so basically you have your drive decryption keys / passwords for whatever
problem becomes storing them without an unauthorised source accessing them
so you arm the tpm and enable secure boot so the computer can only run windows or whatever trusted thing you installed so only that code can access the tpm
its designed to protect again physical attacks like reading the chips pins and extracting the keys as well as a malicious party installing a custom os to read the tpm
its even emp shielded so you cant try to read the signals the tpm gives off or try to manipulate it with one
then its probably not used and erasing it isnt an issue
i dont think it stores your windows login creds or browser passwords because that would be annoying
but it might
such an over complicated feature that is completely useless for 99% of the users out there, wow
:^)
yeah really its more like a cool thing to have rather than an essential feature for secure computing
my company doesnt even use the TPM for our work laptops
we have to manually enter in a bitlocker unlock key
lmao
its safer anyways
as someone who worked with data recovery in the past, i absolutely hate drive encryption
plus actually using tpm is less secure because you can just let windows boot normally and automatically unlock itself and then read the contents of the RAM to determine the decryption key that way essentially bypassing the tpm
yeah but it helps with not having your data seen by the wrong people
that is if your decryption key is strong
tpm is a good source of random generated numbers tho
now that i think of it ive inspired myself to create a proof of concept
let a tpm protected and bitlocker encrypted drive unlock itself automatically then attach probes to ram to read the contents and extract the decryption key
the company lets you do projects like this and even funds them
what kind of data you even need to hide from the wrong people? and who are the wrong people lmao, most of the time its just "company secrets" which is nothing more than intellectual property thats not really worth anything in the hands of others
for my company its mostly intellectual property yeah but also some vulnerabilities and info that could be used by the wrong people
the amount of big companies you see making stupid and simple security mistakes is unbelievable in their code
no wonder they pay a fortune to security companies
regardless, the biggest attack vector by far is human error
which renders all of that crap useless once again :^)
whats your company btw? if i may ask
can tell in dms :o
sure
people working 
it's probably the way i am passing the frames in the canvas
want me to hire you again? i might have some stuff for you soon, when i get some cash
i don't wanna force you
just feel free to
i get fun from working with people
but i need to improve as well
:)
cursed js working with cursed css
if you are paranoid you can just create / destroy contexts
but that has memory cost
hhhhm
fr
are you struggling to get a job or just dont want to?
get me a nice job too
if i have a job now i would have a massive time crisis
my company kinda has that theyre extremely flexible
they dont care how many hours or days you work as long as you get the work done
since i get started late, i just sorta press myself to "get good faster"
going to office is also optional but i get distracted too easily so ill probably be going there often
task-based pay?
ooo
youre on a salary but theyre not really concerned in the hours you put in
but yeah i don't think i have any strong offers to companies atm
my skills are not good yet
any position for a nodejs guy?
xD
lmao
you kinda have to be a master in everything for cyber sec
nodejs would help but you would also need to basically be happy to learn anything
just like me fr
i like learning about new technologies and expanding my knowledge so i dont mind
i like learning too, just not react
or vue
or any frontend framework for that matter
i learned react
lmao
i do ui/ux and frontend programming
then jumped right into nextjs
true
except svelte, that the only one im interested in trying out
knowledge of front end would probably help but some of the work is not even related to code
knowledge of front end vulnerabilities would definitely help tho
yeah svelte looks interesting
havent used it much though
yes
i like how it compiles everything to a single javascript bundle instead of having a stupid framework powering everything behind the scenes
(react)
though react makes code a nightmare to reverse engineer
so like real dom manipulation
yeah
ah i see
i wish there are equivalent of framer-motion for other frameworks too
angular has its own animation library but it's a bit confusing to use
trying that rn fr fr
isnt canvas hardware accelerated?
idk is it
destroying context would prob destroy any benefit of hardware acceleration lol
point is having data already in the gpu memory ready to be used
maybe
dont know about 2d though
depends on browser ig
mine is apparently
chrome://gpu
probably not related though i mean in terms of performance
for (let i = 0; i < apng.frames.length; i++) {
// Get the RGBA pixel data for the current frame
const rgbaFrameData = UPNG.toRGBA8(apng)[i];
console.log(`Processed frame ${i + 1}/${apng.frames.length}`);
// console.log(`RGBA FRAME DATA:`, new Uint8Array(rgbaFrameData));
// Create a new canvas for the current frame
const frameCanvas = createCanvas(apng.width, apng.height);
console.log(frameCanvas);
const frameCtx = frameCanvas.getContext("2d");
// Put the RGBA pixel data onto the frame canvas
const imageData = frameCtx.createImageData(apng.width, apng.height);
imageData.data.set(new Uint8ClampedArray(rgbaFrameData));
frameCtx.putImageData(imageData, 0, 0);
const isSame = imageData.data.every(
(value, index) => value === imageData.data[index]
);
console.log(isSame);
// Clear the canvas
ctxCanvas.clearRect(0, 0, canvas.width, canvas.height);
// Redraw the user's image onto the canvas
ctxCanvas.drawImage(userImage, 0, 0);
// Draws the frame onto the main canvas
ctxCanvas.drawImage(frameCanvas, watermarkX, watermarkY);
// Save the canvas as an image
const out = fs.createWriteStream(`canvas${i}.png`);
const stream = canvas.createPNGStream();
stream.pipe(out);
out.on("finish", () => console.log(`Saved canvas ${i}.png`));
const mainImageData = ctxCanvas.getImageData(
0,
0,
canvas.width,
canvas.height
);
// console.log(mainImageData);
const mainRgbaFrame = new Uint8Array(mainImageData.data.buffer);
frames.push(mainRgbaFrame);
// Saving the current frame as a seperate png file
// const out = fs.createWriteStream(`frame${i}.png`);
// const stream = frameCanvas.createPNGStream();
// stream.pipe(out);
// out.on('finish', () => console.log(`Saved frame ${i}.png`));
console.log(`Processed frame ${i + 1}/${apng.frames.length}`);
}
me when canvas no work
i have been trying to debug everything about this.
if u see the the frame being saved as a png at the end that i have commented that worked just fine.
But when i save each canvas which is also up there and not commented. It logs me the same frame for all the frames
as u can see the frame is fine the canvas is not
i'll go crazy no cap
same for edge
where is ctxCanvas defned?
and canvas
// Creates a canvas with the same dimensions as the user's image
const canvas = createCanvas(userImage.width, userImage.height);
const ctxCanvas = canvas.getContext("2d");
// Draws the user's image onto the canvas
ctxCanvas.drawImage(userImage, 0, 0);
// Calculates the position at which to draw the watermark image
const watermarkX = (userImage.width - apng.width) / 2;
const watermarkY = (userImage.height - apng.height) / 2;
// Creates an array to hold the frames
const frames = [];
// Set the delay for each frame (in milliseconds)
const frameDelay = apng.frames[0].delay;
for (let i = 0; i < apng.frames.length; i++) {
so you're drawing each frame on the same canvas?
and you want to save each frame as an image?
the frame saving is fine, the canvas saving is the one that has the issue. I am saving them just to debug
the end result will be send to the user
what should the end result be?
the image of the user with the apng over it. sent as a .apng
aka an animated watermark
and how is the .apng built?
// Encode the APNG image
console.log(
"HELLOOO",
frames,
+" " + "WIDTH" + " " + canvas.width,
canvas.height,
apng.frames.length
);
const apngBuffer = UPNG.encode(
frames,
canvas.width,
canvas.height,
0,
new Array(apng.frames.length).fill(frameDelay)
);
console.log(`Encoded APNG image: ${apngBuffer.byteLength} bytes`);
try {
await ctx.replyWithDocument({
source: Buffer.from(apngBuffer),
filename: "watermarked.apng",
});
console.log("Sent APNG document");
//Saving it locally for testing purposes
// console.log("apngBuffer before:", apngBuffer);
fs.writeFileSync("watermarked.apng", Buffer.from(apngBuffer));
console.log("Saved watermarked.apng");
// console.log("apngBuffer after:", apngBuffer);
} catch (err) {
console.error(`Error sending APNG document: ${err.message}`);
}
});
this is after the loop function
don't mind my debuging
what type of object is mainImageData.data.buffer?
it's an arraybuffer
ArrayBuffer {
[Uint8Contents]: <22 26 25 ff 24 28 27 ff 27 2d 2d ff 23 2c 2b ff 1b 25 24 ff 17 26 21 ff 17 28 20 ff 11 25 19 ff 0c 23 13 ff 19 30 1c ff 1a 31 1d ff 18 30 1a ff 1a 2f 1e ff 21 36 25 ff 37 4b 3f ff 48 5d 4a ff 6a 7e 62 ff 73 8f 66 ff 67 8d 5a ff 53 7c 44 ff 4c 6a 34 ff 3e 54 26 ff 2f 35 19 ff 23 2a 1a ff 1f 2c 23 ff ... 1030524 more bytes>,
byteLength: 1030624
}
a typedArray initialized with an ArrayBuffer is not a copy, it shares the same buffer
and the thing is they all have the same data
const mainImageData = ctxCanvas.getImageData(
0,
0,
canvas.width,
canvas.height
);
// console.log(mainImageData);
const mainRgbaFrame = new Uint8Array(mainImageData.data.buffer);
frames.push(mainRgbaFrame);
``` this part here
im not sure what getImageData returns
but if it returns a reference to the canvas arraybuffer, then creating an Uint8array out of that will keep that reference
so the next time the canvas is updated, all bytes in those references will be affected
try this
new Uint8Array(mainImageData.data.buffer.slice())
that will force copy the arraybuffer
was just trying that lol
which got me:
Expected 1-2 arguments, but got 0.ts(2554)
lib.es5.d.ts(1683, 11): An argument for 'begin' was not provided.
(method) slice(begin: number, end?: number): ArrayBuffer
Returns a section of an ArrayBuffer.
so i got rid of the .buffer.
const mainRgbaFrame = new Uint8Array(mainImageData.data.slice())
still having the issues tho
what is the type of data?
mainImageData?
.data
is anyone having issues with the npm registry?
what kind of issues?
btw thats just ts being dumb, you can fix that by doing .slice(0)
can't capture it cuz it spams it lol but i guess an array:
5,8,60,180,255,8,60,180,255,8,60,180,255,8,60,180,255,7,59,179,255,7,59,179,255,7,59,179,255,8,60,180,255,8,60,180,255,8,60,180,255,7,59,179,255,7,59,179,255,8,60,180,255,8,60,182,255,8,60,182,255,8,60,182,255,7,59,181,255,6,58,180,255,6,58,180,255,7,58,183,255,7,58,183,255,6,57,182,255,6,57,182,255,7,59,181,255,7,59,181,255,7,59,181,255,7,59,181,255,6,58,180,255,6,58,180,255,6,58,18
it's a Uint8ClampedArray
logged it with console.log(mainImageData.data.constructor);
then new Uint8Array(mainImageData.data) should work
if you are testing based on the canvas frames that are saved by the pngstream then thats not accurate, because the streams are async
yes
the end result is fully transparent tho
if you wanna test the frames correctly, you need to use canvas.toBuffer
and save with fs.writeFile
doing that rn
also, i dont get this part
const imageData = frameCtx.createImageData(apng.width, apng.height);
imageData.data.set(
new Uint8ClampedArray(new Uint8Array(rgbaFrameData).slice().buffer)
);
frameCtx.putImageData(imageData, 0, 0);
createImageData, set the data on it, then write the data on it back onto itself?
unless that doesnt do what i think it does
yeah the frames are totally fine
but the apng still isnt?
try using canvas.toBuffer() for the apng frames, instead of getImageData
