SRL Archive - S.M.A.R.T.

SRL Reflection


Cheddy

2013-10-31 09:39:23

Having issues porting the old api as there is no function currently for "SmartGetFieldString", please help :D

tls

2013-10-31 12:51:13

If you look through the old code, you can find that we used a include-side function to get strings, because String is an object and needs to be converted. First rule of porting, understand the code completely before trying to reproduce it.
function: https://github.com/tlsdude/SRL-Reflection-2/blob/master/lib/core/core.simba#L76
use: https://github.com/tlsdude/SRL-Reflection-2/blob/master/lib/core/interfaces.simba#L362

Hoodz

2013-10-31 15:46:57

From: tls
If you look through the old code, you can find that we used a include-side function to get strings, because String is an object and needs to be converted. First rule of porting, understand the code completely before trying to reproduce it.
function: https://github.com/tlsdude/SRL-Reflection-2/blob/master/lib/core/core.simba#L76
use: https://github.com/tlsdude/SRL-Reflection-2/blob/master/lib/core/interfaces.simba#L362

cant you help us to revive the old reflection include?

Flight

2013-10-31 22:53:37

Borrowing the methods from Reflection 2 I whipped this up as an example of getting a simple string. You'll need to provide the most recent hooks as well as my custom SRL-OSR with the correct SMART-handling.


Function R_getPlayerName: String;
var
Me,NameBytes: Integer;
begin
Me := OS_SMART.getFieldObject(0, HOOK_LOCAL_PLAYER);
NameBytes := OS_SMART.getFieldObject(Me, HOOK_PLAYER_NAME);
SetLength(Result, 512);
SetLength(Result, OS_SMART.StringFromString(NameBytes, Result));
Result := Replace(Result, 'Â', '', [rfReplaceAll]);
Result := Replace(Result, #160, #32, [rfReplaceAll]);
OS_SMART.freeObject(NameBytes); // Need to be freed?
end;

Untested but I don't see any problems with that.

tls

2013-11-01 13:48:12

From: Flight
Borrowing the methods from Reflection 2 I whipped this up as an example of getting a simple string. You'll need to provide the most recent hooks as well as my custom SRL-OSR with the correct SMART-handling.


Function R_getPlayerName: String;
var
Me,NameBytes: Integer;
begin
Me := OS_SMART.getFieldObject(0, HOOK_LOCAL_PLAYER);
NameBytes := OS_SMART.getFieldObject(Me, HOOK_PLAYER_NAME);
SetLength(Result, 512);
SetLength(Result, OS_SMART.StringFromString(NameBytes, Result));
Result := Replace(Result, 'Â', '', [rfReplaceAll]);
Result := Replace(Result, #160, #32, [rfReplaceAll]);
OS_SMART.freeObject(NameBytes); // Need to be freed?
end;

Untested but I don't see any problems with that.


You need to free Me aswell. Anytime an object is loaded it needs to be freed.

Flight

2013-11-01 19:44:37

From: tls
You need to free Me aswell. Anytime an object is loaded it needs to be freed.


Ah right, my mistake.

Cheddy

2014-03-09 17:57:28

Ok, I may return to the simba community now that I have made my own reflection/injection bot and give you guys a hand with the reflection if you want? You got an hook updater (ASM/BCEL) yet?

Sk1nyNerd

2014-03-09 18:06:35

From: fish1328
Ok, I may return to the simba community now that I have made my own reflection/injection bot and give you guys a hand with the reflection if you want? You got an hook updater (ASM/BCEL) yet?


talk to @Frement @elfyyy or @Krazy_Meerkat

Kyle

2014-03-09 18:07:29

From: fish1328
Ok, I may return to the simba community now that I have made my own reflection/injection bot and give you guys a hand with the reflection if you want? You got an hook updater (ASM/BCEL) yet?


Watch the grave digging man. You can check out the link in my sig for our current include and if you have any questions you can pm me or talk to me on skype.

EDIT:Damn…. Ninja'd… :'(

roelthekille

2014-03-23 18:18:42

[ATTACH=CONFIG]23119[/ATTACH][ATTACH=CONFIG]23119[/ATTACH]
i get this error

Cheddy

2014-04-28 14:20:05

From: elfyyy
Watch the grave digging man. You can check out the link in my sig for our current include and if you have any questions you can pm me or talk to me on skype.

EDIT:Damn…. Ninja'd… :'(


Haha what do you mean watch the grave digging? :D
My updater currently has 100 hooks which are stable on every old school revision yet. Admittedly not as good as some of the ones out there (I think Static's is nearing 400 hooks) but it gets the vital hooks for a bot