PDA

View Full Version : Simple Tools


liuyanghejerry
December 18th, 2009, 12:20 PM
-v-I'm learning C++,so I made a simple tool for enlarge ROM.
Ya,you can use XSE,but someone may doesn't know how to(there should be a little...).
This tool is too simple to use.
Just drag the rom on this Enlarge.exe,and after a short time of black,it done~
Have fun^^

Maybe there'll be more simple tools in here~

Tec thing:

#include <fstream>
int main(int argc, char* argv[]){
using namespace std;
FILE *fp;
if(fp=fopen(argv[1],"ab")){
int *a= new int[4194304];
fwrite(a,sizeof(a),4194304,fp);
fclose(fp);
delete a;

}

}

ZodiacDaGreat
December 19th, 2009, 10:59 PM
It's good to see C++ tools, uh You should try learning the Windows API coding to add a interface to your tools ^^ Good luck with C++

liuyanghejerry
December 20th, 2009, 05:19 AM
It's good to see C++ tools, uh You should try learning the Windows API coding to add a interface to your tools ^^ Good luck with C++
Thanks~XD
I can do that,with C++ builder 2009,but it always makes the tool so big.
While adding a interface,this tool will immediately enlarge to XXX KB...

Anyway,thanks for supporting~

ZodiacDaGreat
December 20th, 2009, 08:27 AM
Uh, well, that's like the problem with environment I suppose. You should code with resource files. It'll be smaller that way. Best of Luck

Juan
December 20th, 2009, 12:19 PM
Very Good.

I prefer to use the "ofstream/ifstream" class belonging to the library c++, but C's "FILE*" works very well for this. :D

I recommend using the code:blocs instead of the builder.
It is faster, and multiplatform.

Search for wxWidgets, you can make multiplatform visual tools using object orientation.

liuyanghejerry
December 20th, 2009, 02:32 PM
Uh, well, that's like the problem with environment I suppose. You should code with resource files. It'll be smaller that way. Best of Luck
XD I'll try and thank you,my friend~
Very Good.

I prefer to use the "ofstream/ifstream" class belonging to the library c++, but C's "FILE*" works very well for this. :D

I recommend using the code:blocs instead of the builder.
It is faster, and multiplatform.

Search for wxWidgets, you can make multiplatform visual tools using object orientation.
I used the FILE* just because it's the function upon the function about stream in the document that I download^ ^
I'll try the IDE now~
Thanks for supporting~

Haku.
December 20th, 2009, 07:16 PM
The tool is great, no complaints from me.
Try making more complicated tools like a free flag finder.
Would be useful for many people :P

Full Metal
December 20th, 2009, 10:22 PM
its nice to see i'm not the only one who likes c++
^_^ and for learning win32 development (adding a gui) google search
"forgers win32 tutorial" it's great ;)

score_under
December 21st, 2009, 12:07 AM
Try making more complicated tools like a free flag finder.
More complicated? That's verging on completely impossible! (For the same reason the Boomerang Decompiler project... doesn't :p )

liuyanghejerry
December 21st, 2009, 07:17 AM
The tool is great, no complaints from me.
Try making more complicated tools like a free flag finder.
Would be useful for many people :P

XD Thanks for supporting,but it seems much more difficult...

its nice to see i'm not the only one who likes c++
^_^ and for learning win32 development (adding a gui) google search
"forgers win32 tutorial" it's great ;)

I used to use C++ builder 2009.But from now,I'm going to start with resource code.
Thanks for supporting XD

Tropical Sunlight
December 28th, 2009, 03:22 PM
uh..guys,I have a qustion, where can I get a text editor for pokemon leafgreen that works? or , when I try a-text, it says"component comdlg.ocx or one of its dependencies not correctly regestered:a file is missing or invalid." please help me!
Maybe you should try downloading comdlg.ocx and put in in here (may vary from comp to comp but the basic is here): C:/WINDOWS/system32
Also, this is completely irrelevant to the thread.

May I suggest something like a... Like a... I have ran out of ideas :P xD

FinalZero
December 29th, 2009, 02:22 PM
It's good to see C++ tools,
Yes, it's a shame people insist on using the sham of a language that is VB.

While adding a interface,this tool will immediately enlarge to XXX KB...Only if you tell it to include the .dll files and stuff in the .exe.

Also, I echo Juan's comment of prefering to use ofstream and ifstream. And lastly, if using CBuilder's open dialog boxes, don't forget this useful piece of code:

if(!OpenDialog1 -> Execute()) {
return;
}More complicated? That's verging on completely impossible!It's not impossible, it'd just take a long time to run (ansd write) because the program would have to look through every piece of script and other stuff to see which flags are used.

Is it a library file... I downloaded It except my dad says its a virus.If you try to run a program that you know is safe and it says it's missing a file, then the file that's missing is safe too; It's not a virus. It's just like a .dll file that you need to run the program.

score_under
December 29th, 2009, 03:13 PM
It's not impossible, it'd just take a long time to run (ansd write) because the program would have to look through every piece of script and other stuff to see which flags are used.
Firstly, how would it find every script? How would it know if the script it found is valid or not? What about scripts called from ASM? What about flags modified from ASM?

FinalZero
December 30th, 2009, 03:05 PM
Firstly, how would it find every script? How would it know if the script it found is valid or not? What about scripts called from ASM? What about flags modified from ASM?
No idea for any of those questions. But the game does all those things, so a program could too. The game is just another program after all. I wasn't volunteering myself to do it. =p

onyx79
December 30th, 2009, 04:08 PM
wow man this is awesome,it's easy to use thanks a lot!

Juan
December 30th, 2009, 07:17 PM
No idea for any of those questions. But the game does all those things, so a program could too. The game is just another program after all. I wasn't volunteering myself to do it. =p

The flags are modified at run time.

The function to return the address of the flags is this:


ROM:0809D6EC
ROM:0809D6EC ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
ROM:0809D6EC
ROM:0809D6EC ; Parameters: r0 = flag
ROM:0809D6EC ; Return: r0 = address
ROM:0809D6EC
ROM:0809D6EC GetFlagAddress
ROM:0809D6EC
ROM:0809D6EC PUSH {LR}
ROM:0809D6EE LSL R1, R0, #0x10
ROM:0809D6F0 LSR R2, R1, #0x10
ROM:0809D6F2 ADD R3, R2, #0
ROM:0809D6F4 CMP R2, #0
ROM:0809D6F6 BNE loc_809D6FC
ROM:0809D6F8 MOV R0, #0
ROM:0809D6FA B loc_809D72E
ROM:0809D6FC ; ---------------------------------------------------------------------------
ROM:0809D6FC
ROM:0809D6FC loc_809D6FC ; CODE XREF: GetFlagAddress+Aj
ROM:0809D6FC LDR R0, =0x3FFF
ROM:0809D6FE CMP R2, R0
ROM:0809D700 BHI loc_809D71C
ROM:0809D702 LDR R0, =0x3005D8C
ROM:0809D704 LSR R1, R1, #0x13
ROM:0809D706 LDR R2, =0x1270
ROM:0809D708 ADD R1, R1, R2
ROM:0809D70A LDR R0, [R0]
ROM:0809D70C B loc_809D72C
ROM:0809D70C ; ---------------------------------------------------------------------------
ROM:0809D70E DCB 0
ROM:0809D70F DCB 0
ROM:0809D710 dword_809D710 DCD 0x3FFF ; DATA XREF: GetFlagAddress:loc_809D6FCr
ROM:0809D714 dword_809D714 DCD 0x3005D8C ; DATA XREF: GetFlagAddress+16r
ROM:0809D718 dword_809D718 DCD 0x1270 ; DATA XREF: GetFlagAddress+1Ar
ROM:0809D71C ; ---------------------------------------------------------------------------
ROM:0809D71C
ROM:0809D71C loc_809D71C ; CODE XREF: GetFlagAddress+14j
ROM:0809D71C LDR R1, =0xFFFFC000
ROM:0809D71E ADD R0, R3, R1
ROM:0809D720 CMP R0, #0
ROM:0809D722 BGE loc_809D728
ROM:0809D724 LDR R2, =0xFFFFC007
ROM:0809D726 ADD R0, R3, R2
ROM:0809D728
ROM:0809D728 loc_809D728 ; CODE XREF: GetFlagAddress+36j
ROM:0809D728 ASR R0, R0, #3
ROM:0809D72A LDR R1, =0x20375FC
ROM:0809D72C
ROM:0809D72C loc_809D72C ; CODE XREF: GetFlagAddress+20j
ROM:0809D72C ADD R0, R0, R1
ROM:0809D72E
ROM:0809D72E loc_809D72E ; CODE XREF: GetFlagAddress+Ej
ROM:0809D72E POP {R1}
ROM:0809D730 BX R1
ROM:0809D730 ; End of function GetFlagAddress
ROM:0809D730
ROM:0809D730 ; ---------------------------------------------------------------------------
ROM:0809D732 DCB 0
ROM:0809D733 DCB 0
ROM:0809D734 dword_809D734 DCD 0xFFFFC000 ; DATA XREF: GetFlagAddress:loc_809D71Cr
ROM:0809D738 dword_809D738 DCD 0xFFFFC007 ; DATA XREF: GetFlagAddress+38r
ROM:0809D73C dword_809D73C DCD 0x20375FC ; DATA XREF: GetFlagAddress+3Er


So, would not be viable (or even possible) to write an algorithm that checks the 'supposed' flags used in the game.

The best that could be done, is a tool that loads the save and check the flags. But it would not be very useful. :P

liuyanghejerry
December 31st, 2009, 02:04 PM
The flags are modified at run time.

So, would not be viable (or even possible) to write an algorithm that checks the 'supposed' flags used in the game.

The best that could be done, is a tool that loads the save and check the flags. But it would not be very useful. :P
That ASM code is amazing...
Except the ASM part,there's another way for about flags and vars.
Read all the scripts from the map and decomplie them and find the used flags or vars...
-v-But this is just thinking.Doing so is not really easy.



So many sentences...
Thank you for reminding~

Juan
December 31st, 2009, 03:24 PM
That ASM code is amazing...
Read all the scripts from the map and decomplie them and find the used flags or vars...


Firstly, how would it find every script? How would it know if the script it found is valid or not? What about scripts called from ASM? What about flags modified from ASM?

:D

Returning to the main subject of discussion, I hope to continue with their learning c + +.

And I also am learning C + +, and after you get used to the syntax, notice that is not as difficult as it seems.

Although I was almost giving up to create forms with wxWidgets using wsSizers. :(

helloNL
January 3rd, 2010, 01:09 AM
is this a programm that makes the rom bigger so you can put more on it?

liuyanghejerry
January 3rd, 2010, 05:13 AM
:D

Returning to the main subject of discussion, I hope to continue with their learning c + +.

And I also am learning C + +, and after you get used to the syntax, notice that is not as difficult as it seems.

Although I was almost giving up to create forms with wxWidgets using wsSizers. :(

Due to some reasons,I just give up wxWidgets and start learning Qt...

is this a programm that makes the rom bigger so you can put more on it?
Yes,it is^^

FinalZero
January 3rd, 2010, 03:13 PM
The flags are modified at run time.

The function to return the address of the flags is this:You weren't thinking of the same thing I was. By checking which flags are used, I thought it meant which flags are programmed to be used, whether they've been activated or not, while you thought it meant only flags that have been activated. To check the second, one'd have to check the individual save state.

C + +
Please, it's "C++".

Juan
January 3rd, 2010, 04:37 PM
You weren't thinking of the same thing I was. By checking which flags are used, I thought it meant which flags are programmed to be used, whether they've been activated or not, while you thought it meant only flags that have been activated. To check the second, one'd have to check the individual save state.


score_under quote [2]


Please, it's "C++".


Go to Google translator, select Portuguese in 1st option and English on the 2nd.
Type "C++", and see what the result will come out "C + +".

I check the spelling of important things, but we are in a Pokémon forum, no need to worry about "technically terms" nor the languages's names, because it makes no difference.



Can we go back to the subject of the topic, which is the program made by liuyanghejerry?

If you want to continue discussing a tool to search for flags, I think better to create a specific topic for this.
:D