Search found 40 matches

by xakep
Wed Aug 28, 2019 6:20 pm
Forum: Assembly and C Programming in PureBasic
Topic: AES-Example(64Bit) for AES supported CPUs
Replies: 3
Views: 11661

Re: AES-Example(64Bit) for AES supported CPUs

Great work!

Maybe you also have an x86 version?
by xakep
Wed Aug 15, 2018 3:51 pm
Forum: Tricks 'n' Tips
Topic: [PureBasic] Base91 encode/decode
Replies: 4
Views: 2344

Re: [PureBasic] Base91 encode/decode

Decoding of big files is pretty fast, but encoding is very slow, not sure how to make it more fast.
The main issue is that you are combining strings.
When encoding, you should allocate a buffer, fill that and return it instead of combining strings with + .
If that's not enough, using asm will make ...
by xakep
Wed Aug 15, 2018 12:42 pm
Forum: Tricks 'n' Tips
Topic: [PureBasic] Base91 encode/decode
Replies: 4
Views: 2344

[PureBasic] Base91 encode/decode

"basE91 is an advanced method for encoding binary data as ASCII characters.
It is similar to UUencode or base64, but is more efficient.
The overhead produced by basE91 depends on the input data.
It amounts at most to 23% (versus 33% for base64) and can range down to 14% , which typically occurs on ...
by xakep
Wed Apr 11, 2018 8:40 pm
Forum: Tricks 'n' Tips
Topic: SSL\TLS Client\Server lib based on Cryptlib Encryption Toolk
Replies: 21
Views: 17950

Re: SSL\TLS Client\Server lib based on Cryptlib Encryption T

@blueb You should use latest cryptlib available: https://www.cs.auckland.ac.nz/~pgut001/cryptlib/
There works fine on win 7 + PB 5.62 x86

@cas Yep, but GetFunction() won't work if you load the library via LoadLibrary( or any other way except of PB's OpenLibrary)
by xakep
Mon Apr 09, 2018 9:22 pm
Forum: Tricks 'n' Tips
Topic: SSL\TLS Client\Server lib based on Cryptlib Encryption Toolk
Replies: 21
Views: 17950

Re: SSL\TLS Client\Server lib based on Cryptlib Encryption T

Seems interesting, I will see if I can get this to work with HTTP GET and POST, thanks!

Like this:

EnableExplicit
#SSL_RESPONSE_TIMEOUT = 5000 ; m/s

#CRYPT_OK = 0
#CRYPT_SESSION_SSL = 03 ; /* SSL/TLS */
#CRYPT_SESSION_SSL_SERVER = 04 ; /* SSL/TLS SERVER */
#CRYPT_UNUSED = -101 ; /* A magic ...
by xakep
Mon Mar 26, 2018 11:52 pm
Forum: Coding Questions
Topic: Reflective DLL injection?
Replies: 4
Views: 1627

Re: Reflective DLL injection?

@CELTIC88
Thanks, that works.

But this version of reflective dll injection allready map dll, fix relocs + fix imports, so the manual find of kernel-base + getprocaddress + user32.dll, etc. is not needed anymore.
Will modify your code and post it there )
by xakep
Mon Mar 26, 2018 11:01 pm
Forum: Coding Questions
Topic: Reflective DLL injection?
Replies: 4
Views: 1627

Re: Reflective DLL injection?

DllMain <> AttachProcess

This reflective dll injection require Main() code to be executed before AttachProcess/AttachThread.
by xakep
Mon Mar 26, 2018 9:27 pm
Forum: Coding Questions
Topic: Reflective DLL injection?
Replies: 4
Views: 1627

Reflective DLL injection?

I converted this the reflective dll injection code from c++ to pb.
Now the problem is how to convert this code:


#include <iostream>
#include <Windows.h>

BOOL APIENTRY MyMain(LPVOID lpParameter) {
DWORD dwImageBase = reinterpret_cast<DWORD>(lpParameter);

WCHAR szOutput[MAX_PATH];
wsprintf ...
by xakep
Wed Mar 21, 2018 11:16 pm
Forum: Tricks 'n' Tips
Topic: MemDll - Load DLL from memory
Replies: 30
Views: 19107

Re: MemDll - Load DLL from memory

Can someone please reupload it?
Maybe to mega.co.nz
by xakep
Fri Jan 26, 2018 6:27 pm
Forum: Coding Questions
Topic: Multiple threads sleep for x seconds ?
Replies: 5
Views: 1831

Re: Multiple threads sleep for x seconds ?

@nco2k Great. Thanks alot )
by xakep
Thu Jan 25, 2018 8:03 pm
Forum: Coding Questions
Topic: Multiple threads sleep for x seconds ?
Replies: 5
Views: 1831

Re: Multiple threads sleep for x seconds ?

@nco2k
Yeap, seems like that works too:

EnableExplicit

Procedure Thread1()
Sleep_(2000)

Debug "Task each 2 seconds"

Thread1()
EndProcedure

Procedure Thread2()
Sleep_(6000)

Debug "Task each 6 seconds"

Thread2()
EndProcedure

Procedure Main()
Define hEvent.l

Dim Threads.l(1 ...
by xakep
Thu Jan 25, 2018 6:48 pm
Forum: Coding Questions
Topic: Multiple threads sleep for x seconds ?
Replies: 5
Views: 1831

Multiple threads sleep for x seconds ?

For example I want to have two threads, one that calls an procedure at each 2 seconds and another one that calls an procedure at each 6 seconds.
This code need to run forever, untill the program is closed.

What i got for now:
EnableExplicit

Procedure Thread1()
Define hEvent.l

hEvent ...
by xakep
Fri Sep 22, 2017 3:40 pm
Forum: Coding Questions
Topic: "Native" random/rand
Replies: 1
Views: 1146

"Native" random/rand

Based on this article: http://www.dreamincode.net/forums/topic/24225-random-number-generation-102/

Partially Converted:

EnableExplicit

ImportC ""
time(*tloc = #Null)
EndImport

Global iSeed.l

Procedure.l nextNumber()
Define iOutput.l, iTemp.l, i.i, Time.SYSTEMTIME

iSeed = time()

While i ...
by xakep
Sat Jul 15, 2017 8:40 pm
Forum: Coding Questions
Topic: [Solved] Redirect IO of process to socket
Replies: 3
Views: 2810

Re: Redirect IO of process to socket

@CELTIC88 Thanks for your time and help.

There is "my" final code:


EnableExplicit

;WS2_32.dll
Global Ws2_32_DLL.l
Global inet_addr.l
Global WSAStartup.l
Global WSAConnect.l
Global WSASocket.l
Global htons.l
Global WSAGetLastError.l

Prototype W_inet_addr(*IP)
Prototype W_WSAStartup ...
by xakep
Thu Jul 13, 2017 10:02 am
Forum: Coding Questions
Topic: [Solved] Redirect IO of process to socket
Replies: 3
Views: 2810

Re: Redirect IO of process to socket

Seems like no one want to help me with this (