These are chat archives for ProtoDef-io/node-protodef

10th
Apr 2017
Hans Elias J.
@hansihe
Apr 10 2017 08:02
what was it you wanted help with?
mhsjlw
@mhsjlw
Apr 10 2017 10:28
fixing statements that don't return
I just added an else that returns nil
I couldn't think of another way
Hans Elias J.
@hansihe
Apr 10 2017 10:35
you could do ||, but I think an else is the best way
mhsjlw
@mhsjlw
Apr 10 2017 11:08
a few things I want to get done this week @hansihe are a somewhat working raknet implementation that is good enough to handle mcpe clients and handle hot code reloading
as well as port voxel world generator to work with mcpe chunk format
then write a world native extension that can use the voxel generator
then I have 4 full days to work on the MCPE server because it's a holiday
mhsjlw
@mhsjlw
Apr 10 2017 11:21
and wait
@hansihe technically don't I have an advantage over the Minecraft PC server
it's udp, so I could in theory make a fully hot upgradable server
and just hold the raknet state of each player
if the acceptor crashes I'm in hot water
but the client I can just trash if it crashes
but hotcode reload I can maintain the socket and the packet sequence state
mhsjlw
@mhsjlw
Apr 10 2017 11:30
I'll work on that once I make everything work
Hans Elias J.
@hansihe
Apr 10 2017 11:59
Whether or not the protocol is UDP has nothing to do with whether or not you can make your app hot-code-upgradable
You could do that with tcp or whatever you want no problem at all
mhsjlw
@mhsjlw
Apr 10 2017 12:30
oh nice
actually that makes sense
upgrade clients then the acceptor
because my final goal is a mini game server
Lua scripting with no downtime and distribution
not worried about deployment right now though
but I'm kind of excited for when I get there
I'm not sure how I'm going to tackle scripting
but I'm thinking a backend would be interesting like protodef and vim
write your scripts in whatever language you want
not worried about that yet though
also I'm thinking the game itself will be implemented in Lua
so you can customize the server itself all in Lua
like the minetest engine
those are my aspirations
mhsjlw
@mhsjlw
Apr 10 2017 12:37
I'm not using Elixir scripts
because someone will File.rm("*")
Hans Elias J.
@hansihe
Apr 10 2017 12:46
so you are running untrusted code?
why?
sorry, I just don't understand what you are aiming for here
embedding a lua engine into erlang is going to create a whole heap of problems for you regardless
the execution model of erlang and of lua are inherently not very compatible
mhsjlw
@mhsjlw
Apr 10 2017 16:05
no
I'm saying plugins could have file.rm
it won't be untrusted but I don't want a plugin to run as root and nuke the system
what do you suggest?
Hans Elias J.
@hansihe
Apr 10 2017 16:13
don't run the server process as root
if you want to limit the damage things like plugins can do, you can run the server under a restricted user
mhsjlw
@mhsjlw
Apr 10 2017 16:15
no, I mean plugin wise
Hans Elias J.
@hansihe
Apr 10 2017 16:17
i might have misunderstood, elaborate
mhsjlw
@mhsjlw
Apr 10 2017 16:22
I want people to use the software, so it needs customizability
ex. Plugins
how would I write a plugin system
so I can start designing an internal API that could eventually support plugins
there are Lua implementations in pure erlang
really good ones too
@hansihe I'm asking what I could do, should I use Lua or elixir script
I'm thinking Lua because people already know it
Hans Elias J.
@hansihe
Apr 10 2017 16:27
right, that's what I was talking about as well
you said the reason you were gonna use Lua was because you wanted to avoid something like File.rm from being used, I think isolating the server at a process level is a better solution to that concern
using Lua for this has quite a few problems that are mostly impossible to get rid of. The main thing here is that you pretty much throw the entire Erlang process model out the window by using it
that problem exists whether or not you use a c or Erlang implementation of Lua
Hans Elias J.
@hansihe
Apr 10 2017 16:34
what Erlang Lua implementations are you talking about btw? I know about luerl, but as far as I know it doesn't support all language features properly
implementing a powerful game server plugin system in Elixir hadn't really been done before last I checked
so you're on new ground here mostly
you would have to experienment and see what works
Hans Elias J.
@hansihe
Apr 10 2017 16:42
I had some ideas where you could insert hook points, and have plugins be able to hook into them at compile time
that would be better than what java does, since you would be pretty much zero cost at runtime
*bukkit does in java
also, I have an ECS I was working on in elixir for McEx
which is fairly extensible and I think it is fairly powerful
but it's not really finished
don't try to use that directly though, it is not finished enough for that
you might be able to take some ideas though
Robin Lambertz
@roblabla
Apr 10 2017 17:05
So, my view with protodef is that as a library, it should mostly be about deserialization, serialization
I totally agree with that
but as a format, it should strive to be a complete documentation of the protocol.
Hence why it should know what transport is underneath it (in the canonical impl)
mhsjlw
@mhsjlw
Apr 10 2017 19:15
@hansihe so, compile Lua scripts into chunks then hook stuff at compile time
that seems problematic
ruins the 0 downtime
Hans Elias J.
@hansihe
Apr 10 2017 19:15
no
not lua
mhsjlw
@mhsjlw
Apr 10 2017 19:15
I'd like that to affect plugins as well maybe ?
what do you mean then
Hans Elias J.
@hansihe
Apr 10 2017 19:15
elixir code
mhsjlw
@mhsjlw
Apr 10 2017 19:15
oh
so you're saying dont use Lua
Hans Elias J.
@hansihe
Apr 10 2017 19:16
yes
doing so doesn't make much sense to me
mhsjlw
@mhsjlw
Apr 10 2017 19:16
because it doesn't support all language features ?
Hans Elias J.
@hansihe
Apr 10 2017 19:16
it creates more problems and complexity than it solves
mhsjlw
@mhsjlw
Apr 10 2017 19:17
the major complexity I want to avoid is making people learn elixir
because no one wants to learn pattern matching and otp to make a mini game
Hans Elias J.
@hansihe
Apr 10 2017 19:17
that complexity will be way less than what you will have to invent to make a powerful lua api
the main problem is state
mhsjlw
@mhsjlw
Apr 10 2017 19:17
my api would just be ripoff cuberite
what exactly ?
Hans Elias J.
@hansihe
Apr 10 2017 19:18
no, that would absolutely not work in an efficient way
mhsjlw
@mhsjlw
Apr 10 2017 19:18
just having state moved by Lua
Hans Elias J.
@hansihe
Apr 10 2017 19:18
the lua execution model assumes that global state is possible
mhsjlw
@mhsjlw
Apr 10 2017 19:18
like modifying process state in Lua
shit ...
Hans Elias J.
@hansihe
Apr 10 2017 19:18
doing that introduces a major major impedance mismatch
if you want me to go on and explain exactly what I mean, I can do so. I think you might have seen the problem?
mhsjlw
@mhsjlw
Apr 10 2017 19:20
I think I get it
the solution isn't obvious to me
I'm trying to think of a way around elixir but I can't see one
well actually I see one
the Java-erlang interface library
Hans Elias J.
@hansihe
Apr 10 2017 19:21
but that wouldn't solve anything though
you get the exact same problems
if you implement your server using the otp model it would be very hard/inefficient to make an api that hides that model
mhsjlw
@mhsjlw
Apr 10 2017 19:22
genserver + call Lua functions
that's hooking
Robin Lambertz
@roblabla
Apr 10 2017 19:22
why would you want to hide that model ?
and what's the problem with lua ?
mhsjlw
@mhsjlw
Apr 10 2017 19:22
because I want people to use this
read above
Robin Lambertz
@roblabla
Apr 10 2017 19:22
You can use lua without global state
Hans Elias J.
@hansihe
Apr 10 2017 19:22
you can
but how useful would it be?
Robin Lambertz
@roblabla
Apr 10 2017 19:23
It would, if you have a way to pass the state around without it being global :P
Hans Elias J.
@hansihe
Apr 10 2017 19:23
when making a minigame you would presumably want the ability to keep state
Robin Lambertz
@roblabla
Apr 10 2017 19:23
but I do agree it's overcomplicating things
mhsjlw
@mhsjlw
Apr 10 2017 19:24
so what about tying that state to the process
Hans Elias J.
@hansihe
Apr 10 2017 19:24
that would require you to have a mechanism for getting the state to every hook point
Robin Lambertz
@roblabla
Apr 10 2017 19:24
Actually
Hans Elias J.
@hansihe
Apr 10 2017 19:24
also
Robin Lambertz
@roblabla
Apr 10 2017 19:24
You could even get away with global state
if you tie the whole lua VM state to the hook
:D
Hans Elias J.
@hansihe
Apr 10 2017 19:24
have you used erlang?
Robin Lambertz
@roblabla
Apr 10 2017 19:25
Not used, but I read a fair bit about it
Hans Elias J.
@hansihe
Apr 10 2017 19:25
right
the way you would structure a server would be with a lot of concurrent processes
Robin Lambertz
@roblabla
Apr 10 2017 19:25
Isn't the lua VM state serializable ?
Hans Elias J.
@hansihe
Apr 10 2017 19:25
processes are shared nothing, communicates only by message passing
there is nowhere central to actually store the VM state
i mean, you could have a process dedicated to the VM, but then all processes would message that process at every hook point
it would be very very inefficient and would probably become a bottleneck very quickly
what do you mean by serializable?
if you are willing to go down to native code, you could store the VM state globally
but unless there is a Lua VM which supports true multithreading, you would still have schedulers waiting on the VM lock
Robin Lambertz
@roblabla
Apr 10 2017 19:29
meh. I can think up a few solutions but they all sound hacky.
Hans Elias J.
@hansihe
Apr 10 2017 19:30
share them if you want
Robin Lambertz
@roblabla
Apr 10 2017 19:30
lua is thread-safe kinda sorta iirc
Hans Elias J.
@hansihe
Apr 10 2017 19:30
right, but it still blocks
you can't run two threads of code concurrently?
correct me if i'm wrong
it does support coroutines, but that's not true concurrency
it's possible it seems
but complicated
Hans Elias J.
@hansihe
Apr 10 2017 19:34
that just locks the whole lua state with a mutex
it makes it thread safe, sure
but it's not threading
when you have 8 threads running erlang schedulers, you could potentially have 7 of them blocking at the same time
that's worst case, but I can see it happening as you would probably want to have hook-points at fairly busy parts of the game logic
Robin Lambertz
@roblabla
Apr 10 2017 19:37
probs. Anyway, I still think it's a better idea to have the API written in whatever language you're using :P
Makes it easier to make full use of the native language's expressive power.
Hans Elias J.
@hansihe
Apr 10 2017 19:37
yeah. if it was a language with the same paradigm, it would probably be fairly easy to wrap the api to something like lua
Robin Lambertz
@roblabla
Apr 10 2017 19:38
Is there actually any other language with the same paradigm as erlang ?
Hans Elias J.
@hansihe
Apr 10 2017 19:38
erlang is so different in how it handles state, it would be a lot more difficult
Robin Lambertz
@roblabla
Apr 10 2017 19:38
(Elixir doesn't count :P)
Hans Elias J.
@hansihe
Apr 10 2017 19:38
well, I count elixir and erlang as the same "language" :)
the main thing erlang has that nothing else I know of has is true preemptive scheduling combined with the shared-nothing concurrency model
mhsjlw
@mhsjlw
Apr 10 2017 20:24
urg
so there is no way to effectively implement a plugin system that is powerful enough to build a mini game ?
what if I just callback everything when it gets completed
like if I send a message , then the packet gets queued
then I send a receipt
or if I change the nickname of a player
it just does a quick change of state in the genserver
I guess I'm not getting it
Robin Lambertz
@roblabla
Apr 10 2017 20:28
TBH the idea seems flawed from the start. What if someone wants to connect to a psql database from their plugin ?
Can you even do that in a non-blocking way in lua ? And such that it plays nice with elixir/erlang VM ?
Hans Elias J.
@hansihe
Apr 10 2017 20:32
the point is that you have a very very nice way of doing concurrency in erlang, using processes
trying to pretend to consumers of the plugin api that it's all a single thread, single process doesn't seem like a good idea
there is definitely a way to implement a powerful plugin system, the compile-time hook thing I mentioned earlier would be very powerful
that's what I was planning to implement in McEx, but I sorta stopped working on it
mhsjlw
@mhsjlw
Apr 10 2017 20:40
@roblabla c extension ? lol
nope
@hansihe yeah, I'll try to stop fighting this
I just lost half my user base
2/2=1
Hans Elias J.
@hansihe
Apr 10 2017 20:42
go rewrite time
mhsjlw
@mhsjlw
Apr 10 2017 20:43
no
please no go
Hans Elias J.
@hansihe
Apr 10 2017 20:43
lol
mhsjlw
@mhsjlw
Apr 10 2017 20:45
I can't stand it
the message sending is weird
and just the concurrency seems fucked up
and the syntax creeps me out
Robin Lambertz
@roblabla
Apr 10 2017 20:46
I like go
for the most part
I just wish it had pattern matching :P
mhsjlw
@mhsjlw
Apr 10 2017 20:48
then people say they use it for fast compiling
and im just like why
I get when you're Google
but web dev
seems stupid
why not use Phoenix
it's better than 30 different web libs
Robin Lambertz
@roblabla
Apr 10 2017 20:48
phoenix ?
And sometimes you do need something that goes fast. I wish gitlab was written in go for instance >_>'
Gogs puts gitlab to shame so bad it hurts
both in terms of code quality and speed.
Hans Elias J.
@hansihe
Apr 10 2017 20:50
lol no generics
Robin Lambertz
@roblabla
Apr 10 2017 20:50
Who needs generics when you can hardcode special-cases in the compiler ?
_>'
(totally not talking about go maps here)
Hans Elias J.
@hansihe
Apr 10 2017 20:50
who needs generics when you have interface {}
aka void* with some glitter on it
Robin Lambertz
@roblabla
Apr 10 2017 20:51
exactly !
We worked without generics in C
and it was perfect !
/s
Hans Elias J.
@hansihe
Apr 10 2017 20:56
let me introduce you to my favorite shitty subreddit
mhsjlw
@mhsjlw
Apr 10 2017 20:57
i get it
this is funny
best comment
572 (16%) generics
what would improve go the most
wtf lmao
@roblabla it's like ruby on rails
but not shitty
made by the guy who made elixir and another guy
jose valim and chris hadwick
hadwick ?
no
hmm
Hans Elias J.
@hansihe
Apr 10 2017 20:59
yeah, that same guy posts rust stuff on every post on the subreddit
mhsjlw
@mhsjlw
Apr 10 2017 20:59
chris mccord
@hansihe bot ?
Hans Elias J.
@hansihe
Apr 10 2017 21:00
no, he does variations
mhsjlw
@mhsjlw
Apr 10 2017 21:00
lol
Hans Elias J.
@hansihe
Apr 10 2017 21:00
I have a very simple solution - switch to Rust. rustc statically guarantees that your code is beautiful and efficient. Once you've switched, no one in your team will be able to commit shitcode to the project. It simply won't compile. In addition to that, Rust also has zero-cost abstractions, move semantics, guaranteed memory safety, threads without data
races, trait-based generics, pattern matching, type inference, minimal runtime, and efficient C bindings.
nogenerics.info
mhsjlw
@mhsjlw
Apr 10 2017 21:01
hmm
lolool
redirects to go
too good
i cant believe i haven't gotten in on this meme earlier
Robin Lambertz
@roblabla
Apr 10 2017 21:04
So I'm at a point in some project where I'm currently reverse engineering my phone's camera driver (and contemplating a potential rewrite). Should I give up while I'm still sane ? XD
Hans Elias J.
@hansihe
Apr 10 2017 21:04
that subreddit is full of real shitty humor, but for some reason I find most of it hilarious. I think it might be because it's uncannily close to the truth sometimes
you should do it
Robin Lambertz
@roblabla
Apr 10 2017 21:04
(Some backstory : I'm trying to mount a FUSE FS on the folder in android that stores pictures, and as it turns out, that's like, impossible)
(I think the android camera driver is responsible, crazy as it seems)
(I'm not sure though)
Hans Elias J.
@hansihe
Apr 10 2017 21:05
that seems strange
Robin Lambertz
@roblabla
Apr 10 2017 21:05
I mean, I straced the camera app, and it doesn't even open the picture file it creates
Hans Elias J.
@hansihe
Apr 10 2017 21:06
I can't imagine the camera driver is responsible for actually writing the image to storage?
Robin Lambertz
@roblabla
Apr 10 2017 21:06
Instead, it seems to talk to another userland process that handles talking to the camera
@hansihe want to get the best part ? Let me tell you the best part
Hans Elias J.
@hansihe
Apr 10 2017 21:07
Yeah, it probably talks to some camera system service through binder?
Robin Lambertz
@roblabla
Apr 10 2017 21:07
It writes the pictures on the SD card, in the camera folder, completely bypassing my FUSE mountpoint
Hans Elias J.
@hansihe
Apr 10 2017 21:07
hahaha
Robin Lambertz
@roblabla
Apr 10 2017 21:07
like, yeah.
Having done some linux kernel dev recently, I happen to know that userland process can (and probably are) isolated in such a way that you can provide different views of the mountpoints to each.
But it's still weird because I can't find the damn open call to the file in the camera folder...
So yeah, fun times ahead of me
If only the whole damned stack was open source, I could verify this shit >_>'
Want to see what overengineering looks like ?
Hans Elias J.
@hansihe
Apr 10 2017 21:11
yeah, I know very well how android usually does stuff. fun.
Hans Elias J.
@hansihe
Apr 10 2017 21:24
sorry if that last sentence sounded smug or something, that's not how it was meant
i understand your struggle is what I meant to say
Robin Lambertz
@roblabla
Apr 10 2017 21:25
It didn't :P
Hans Elias J.
@hansihe
Apr 10 2017 21:26
ok, good :) english is hard
Robin Lambertz
@roblabla
Apr 10 2017 21:26
It is haha
mhsjlw
@mhsjlw
Apr 10 2017 22:59
i think I'm the only native English speaker out of you, roblabla and rom
and even im not good at it
but i think french is crazy
and ive got an exam for it soon as well
this'll be fun
Robin Lambertz
@roblabla
Apr 10 2017 23:08
Well, I'm not a native english speaker, but I did live in the US/UK for 8 years
sooo, I'm half-decent :P
French is pretty crazy
But there's crazier
my sis is learning chinese.
I'm like... :mindblown:
mhsjlw
@mhsjlw
Apr 10 2017 23:12
@roblabla remember when i posted that digitalocean link
and asked if you could access it ?
those fuckers deleted the production database
im not sure how you do that
Robin Lambertz
@roblabla
Apr 10 2017 23:17
Gitlab did the same not too long ago
It happens
mhsjlw
@mhsjlw
Apr 10 2017 23:18
hmm
i've never really run software in production so i have no idea
can't that be easily avoided by using puppet or chef
just write deploy scripts , don't do things yourself
Robin Lambertz
@roblabla
Apr 10 2017 23:19
The root cause of this incident was a engineer-driven configuration error. A process performing automated testing was misconfigured using production credentials. As such, we will be drastically reducing access to the primary system for certain actions to ensure this does not happen again.
it was automated
(this is from their postmortem)
The problem is, it was misconfigured.
This kind of stuff happens all the time. You're tired and restless, you fatfinger a parameter and boom, everything blows up
This is how AWS recently broke the whole internet not too long ago with S3 coming down
mhsjlw
@mhsjlw
Apr 10 2017 23:21
hmm
someone needs to fix that
Robin Lambertz
@roblabla
Apr 10 2017 23:21
They took down a bunch of S3 servers for routine maintenance, fatfingered the number of servers to take down, and suddenly no more s3 us-east-1 region
mhsjlw
@mhsjlw
Apr 10 2017 23:21
btw lua has a GIL
Robin Lambertz
@roblabla
Apr 10 2017 23:21
Lua has no built-in GIL.
mhsjlw
@mhsjlw
Apr 10 2017 23:22

http://lua-users.org/wiki/ThreadsTutorial

Global mutex and multiprocessing
The method above for implementing threading in Lua using a global mutex is inefficient on multiprocessor systems. As one thread holds the global mutex, other threads are waiting for it. Thus only one Lua thread may be running at a time, regardless of the number of processors in the system.

Robin Lambertz
@roblabla
Apr 10 2017 23:22
gah can't find the article now xD
Hans Elias J.
@hansihe
Apr 10 2017 23:23
lua has no giil because lua doesn't work with threads
mhsjlw
@mhsjlw
Apr 10 2017 23:23
is that not GIL
Robin Lambertz
@roblabla
Apr 10 2017 23:23
yeah that
@mhsjlw basically, lua has no built-in GIL because it has no threading support
So you have to add the GIL yourself
I wonder however if it'd be possible to use lua in a thread-safe manner without a GIL.
mhsjlw
@mhsjlw
Apr 10 2017 23:24
kdgjklfjdslkfjasklf <- upset
in a perfect world, i'd have plugins with LuaJIT that could use LuaRocks
boy oh boy would i love to just be able to sit down , write a simple plugin with some lua rocks extensions for a quick mini game
Robin Lambertz
@roblabla
Apr 10 2017 23:25
I also wonder how https://github.com/torch/threads works xD
mhsjlw
@mhsjlw
Apr 10 2017 23:25
then just deploy across 3 servers with no downtime
but nope , gil , state , processes , concurrency ,threading , words, more words
lol
@roblabla looks like mutex
Hans Elias J.
@hansihe
Apr 10 2017 23:26
roblabla: that just makes a new lua vm it looks like
mhsjlw
@mhsjlw
Apr 10 2017 23:26
a lot of mutex
Robin Lambertz
@roblabla
Apr 10 2017 23:26
guessed so.
Hans Elias J.
@hansihe
Apr 10 2017 23:26
and copies the return values over when the thread joins back
mhsjlw
@mhsjlw
Apr 10 2017 23:26
is that a good idea ?
Hans Elias J.
@hansihe
Apr 10 2017 23:27
well, it seems to work
it would be a better idea to have threading support in the vm, but that's a tradeoff as well
you would have additional synchronization overhead, even when only using it from a single thread
Robin Lambertz
@roblabla
Apr 10 2017 23:29
Can I just rant about hwo terribly coded this library is ?
it #include's some .c
and puts code in some .h
like, wat ?
/rant
mhsjlw
@mhsjlw
Apr 10 2017 23:30
shoulda used rust
@hansihe say anything was possible , what would the solution to this be
(using lua effectively, with any api you want/could think of )
Robin Lambertz
@roblabla
Apr 10 2017 23:31
Make an API in elixir
teach people how to use elixir
:D
Hans Elias J.
@hansihe
Apr 10 2017 23:32
yes
mhsjlw
@mhsjlw
Apr 10 2017 23:32
ya ya ya
Hans Elias J.
@hansihe
Apr 10 2017 23:32
that is the only real solution
mhsjlw
@mhsjlw
Apr 10 2017 23:32
ok i'll worry about this later
i'll just get shit done
Hans Elias J.
@hansihe
Apr 10 2017 23:32
you should rewrite it in a language that has zero-cost abstractions, move semantics, guaranteed memory safety, threads without data races, trait-based generics, pattern matching, type inference, minimal runtime, and efficient C bindings
mhsjlw
@mhsjlw
Apr 10 2017 23:32
i'm using elixir for a reason
Robin Lambertz
@roblabla
Apr 10 2017 23:32
:+1:
mhsjlw
@mhsjlw
Apr 10 2017 23:33
rust can't be easily deployed across 10,000 servers with chef and massive distribution
actually i saw an actor library for rust
Hans Elias J.
@hansihe
Apr 10 2017 23:33
i was joking, but now this turned serious :)
erlang can't either
it's not a silver bullet
Robin Lambertz
@roblabla
Apr 10 2017 23:33
Meanwhile, some more stracing revealed an open("/dev/ashmem") in the camera app when taking a pic. Relevant docs : http://elinux.org/Android_Kernel_Features#ashmem
mhsjlw
@mhsjlw
Apr 10 2017 23:34
@hansihe it absolutely is , don't say it isn't /s
elixir has excellent generics
Robin Lambertz
@roblabla
Apr 10 2017 23:34
So, this is android basically duplicating a bunch of existing functionality in the kernel...
mhsjlw
@mhsjlw
Apr 10 2017 23:35
but does it have sql injections
Robin Lambertz
@roblabla
Apr 10 2017 23:35
No, but I wonder how many secbugs I'm going to find in the camera driver if I go further.
mhsjlw
@mhsjlw
Apr 10 2017 23:35
that was a joke , but ok
Robin Lambertz
@roblabla
Apr 10 2017 23:36
I also found some interesting sockets, /data/misc/camera/cam_socket1 and /data/misc/camera/cam_socket2. If I connect to them with socat, during camera driver init, I can mak the camera app crash.
(Probs because it fails to connect to the socket since I took its place mwahaha)
Aaaanyway. I'm going to sleep now. I have a feeling tomorrow will be an interesting day with this project...
I'm already hating android kernel so much,a nd I barely scratched the surface.
mhsjlw
@mhsjlw
Apr 10 2017 23:38
let me know when you find a root exploit in the media handing library
oh wait that already happened
Robin Lambertz
@roblabla
Apr 10 2017 23:39
I'll let you know when I find a new one :P
mhsjlw
@mhsjlw
Apr 10 2017 23:39
tfw keyboard kernel module has a buffer overflow
Hans Elias J.
@hansihe
Apr 10 2017 23:39
They should have written it in a language with zero-cost abstractions, move semantics, guaranteed memory safety, threads without data races, trait-based generics, pattern matching, type inference, minimal runtime, and efficient C bindings
Robin Lambertz
@roblabla
Apr 10 2017 23:40
Reversing an android is so much easier than reversing the switch btw. A lot of stuff is already documented, and like 70% of the code is open source.
The switch is kinda like "Don't take any preconceptions with you, they'll bite your ass"
mhsjlw
@mhsjlw
Apr 10 2017 23:41
@hansihe (Buffer overflow in net message)
if only it was written in a language with zero-cost ... ... ...
it's absolutely under used
i bet you have a keyboard macro for that
Robin Lambertz
@roblabla
Apr 10 2017 23:41
or just copy pasta
mhsjlw
@mhsjlw
Apr 10 2017 23:42
no
keyboard macro is more elite
Robin Lambertz
@roblabla
Apr 10 2017 23:42
1337
mhsjlw
@mhsjlw
Apr 10 2017 23:42
i have a bitwise operator question
is >> 3 not just multiply by 8
can i just multiply by 8 instead of that
<< 3
^^
Hans Elias J.
@hansihe
Apr 10 2017 23:43
<< 3 is, yeah
mhsjlw
@mhsjlw
Apr 10 2017 23:44
okay thanks
byte_size(options[:buffer]) <<< 3 :: size(16) -> trunc(byte_size(options[:buffer]) * 8) :: size(16)
sweet
mhsjlw
@mhsjlw
Apr 10 2017 23:50
i can't figure this out
and it's pissing me off
no match of right hand side value: <<9, 0, 5, 47, 132, 141, 188, 73, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0>>
i know what the problem is
<< buffer :: size(length), rest :: binary >> = rest
the length has to be wrong
but why
raknet says that's the length you read