Function at 0x100299a
Capabilities:
Accept command line arguments
Check if file exists
Copy file
Create process on windows
Get common file path
Get file attributes
Read .ini file
Terminate process

Disassembly:
push ebp
lea ebp, [esp - 0xb6c]
sub esp, 0xbec
mov eax, dword [0x1005048]
push ebx
push esi
push edi
mov dword [ebp + 0xb68], eax
xor ebx, ebx
push 0x40
mov byte [ebp + 0xa64], bl
xor eax, eax
pop ecx
lea edi, [ebp + 0xa65]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [ebp - 4], ebx
mov dword [ebp + 4], ebx
mov dword [ebp - 8], ebx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov ecx, eax
and ecx, 0xff
cmp ecx, 4
jae 0x1002a4a
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push 0x10f
lea eax, [ebp + 0x850]
push eax
push 3
push ebx
call esi
mov edi, dword [sym.imp.USER32.dll_LoadStringA]
push eax
call edi
test eax, eax
je 0x1002a40
push 0x208
lea eax, [ebp + 0x648]
push eax
push 1
push ebx
call esi
push eax
call edi
test eax, eax
je 0x1002a40
push 0x1010
lea eax, [ebp + 0x648]
push eax
lea eax, [ebp + 0x850]
push eax
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0x47e
jmp 0x1003312
shr eax, 0x1f
mov dword [ebp - 0x1c], eax
mov edi, 0x104
push edi
lea eax, [ebp + 0x960]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x1002a74
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
jmp 0x1003312
lea eax, [ebp + 0x960]
push eax
call fcn.010019f2
cmp eax, ebx
mov dword [ebp + 8], eax
jne 0x1002a91
push 0xa1
jmp 0x1003312
cmp dword [ebp - 0x1c], ebx
mov dword [ebp - 0xc], 0x1001228
jne 0x1002aa4
mov dword [ebp - 0xc], 0x10013e4
mov byte [ebp + 0x1c], bl
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
lea eax, [eax + eax + 1]
push eax
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, ebx
mov dword [ebp + 0xc], eax
je 0x1002a68
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp + 0x10]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp + 0x18]
push eax
lea eax, [ebp + 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push eax
call main
cmp dword [ebp - 0x34], ebx
je 0x1002b11
call fcn.0100249d
push ebx
jmp 0x1003312
cmp dword [ebp - 0x1c], ebx
je 0x1002d7a
push 0x10013d4
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventA]
cmp eax, ebx
mov dword [ebp + 4], eax
je 0x1002a68
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x10], ebx
jne 0x1002d6e
cmp dword [ebp + 0x10], ebx
jne 0x1002d6e
lea eax, [ebp + 0x960]
push eax
call fcn.01001c2e
test eax, eax
je 0x1002d6e
push ebx
push 0x1001d58
push ebx
push 0x65
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.USER32.dll_CreateDialogParamA]
mov dword [ebp - 4], eax
push edi
lea eax, [ebp + 0xa64]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push 0x10012f8
push edi
lea eax, [ebp + 0xa64]
push eax
call fcn.0100173d
cmp dword [ebp + 0x18], ebx
mov eax, dword [ebp + 8]
mov byte [eax], bl
je 0x1002bde
lea eax, [ebp]
push eax
lea eax, [ebp + 0x328]
push eax
push edi
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
je 0x1002bde
lea eax, [ebp + 0x328]
push eax
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x1002bde
lea eax, [ebp + 0x328]
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], ebx
jmp 0x1002be7
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x3c], ebx
mov dword [ebp], eax
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp + 0xa64]
push eax
lea eax, [ebp + 0x960]
push eax
call fcn.010018ac
cmp eax, ebx
mov ecx, dword [ebp + 8]
mov byte [ecx], 0x5c
je 0x1002d69
lea eax, [ebp + 0x960]
push eax
lea eax, [ebp + 0x544]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp + 0x544]
push eax
call fcn.010019f2
mov byte [eax], bl
lea eax, [ebp + 0x544]
push eax
call fcn.010019f2
mov edi, eax
cmp edi, ebx
je 0x1002c52
push 0x10012f8
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x1002c52
mov byte [edi], bl
cmp dword [ebp], ebx
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
je 0x1002ce6
push dword [ebp + 0xc]
call edi
cmp eax, ebx
mov dword [ebp + 0x18], eax
jbe 0x1002c70
inc dword [ebp + 0x18]
push dword [ebp + 0x14]
call edi
push dword [ebp]
add dword [ebp + 0x18], eax
call edi
mov ecx, dword [ebp + 0x18]
add ecx, eax
inc ecx
push ecx
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, ebx
mov dword [ebp + 0x18], eax
je 0x1002ce6
mov eax, dword [ebp + 0xc]
cmp byte [eax], bl
je 0x1002cb6
push eax
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x1001254
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcatA]
jmp 0x1002cbb
mov eax, dword [ebp + 0x18]
mov byte [eax], bl
push dword [ebp + 0x14]
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push dword [ebp]
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push dword [ebp + 0xc]
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [ebp + 0x18]
mov dword [ebp + 0xc], eax
push dword [ebp + 0xc]
call edi
add eax, 0xa
push eax
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
cmp esi, ebx
je 0x1002d61
push 0x10012b8
push dword [ebp + 0xc]
push 0x10013cc
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp + 0x544]
push eax
push esi
push dword [ebp + 8]
lea eax, [ebp + 0xa64]
push eax
call fcn.01001b48
test eax, eax
je 0x1002a68
push 0x2710
push dword [ebp + 4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 4], ebx
je 0x1002d5a
push dword [ebp - 4]
call dword [sym.imp.USER32.dll_DestroyWindow]
xor eax, eax
jmp 0x1002a6e
push 8
pop eax
jmp 0x1002a6e
cmp dword [ebp - 4], ebx
jne 0x1002d7a
push dword [ebp + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp + 4], ebx
push dword [ebp + 0xc]
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [ebp + 0x14], ebx
je 0x1002d99
push dword [ebp + 0x14]
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [ebp - 0x18]
cmp esi, ebx
jne 0x1002e4f
cmp dword [ebp + 0x10], ebx
jne 0x1002e4f
mov eax, dword [ebp - 0x14]
cmp eax, ebx
jne 0x1002ddc
cmp dword [ebp + 0x18], ebx
je 0x1002e65
lea eax, [ebp]
push eax
lea eax, [ebp + 0x328]
push eax
push edi
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
je 0x1002e4f
lea eax, [ebp + 0x328]
cmp eax, ebx
mov dword [ebp + 0x14], eax
je 0x1002e4f
push eax
push edi
lea eax, [ebp + 0x648]
push eax
push 0x100131e
push 0x100126c
push 0x10013c0
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
push 0x10013bc
lea eax, [ebp + 0x648]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
mov esi, eax
neg esi
sbb esi, esi
inc esi
jne 0x1002e4f
push dword [ebp + 0x14]
lea eax, [ebp + 0x648]
push edi
push eax
push 0x100131e
push 0x1001264
push 0x10013c0
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
test eax, eax
je 0x1002e4f
lea eax, [ebp + 0x648]
push eax
call fcn.01001a15
mov dword [ebp + 0x10], eax
cmp dword [ebp + 0x18], ebx
je 0x1002e65
push dword [ebp + 0x18]
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [ebp - 0x24], ebx
mov dword [ebp + 0x14], ebx
jne 0x1002e8e
cmp esi, ebx
jne 0x1002e8e
cmp dword [ebp + 0x10], ebx
jne 0x1002e8e
push 0x708
call fcn.010026f9
cmp eax, ebx
mov dword [ebp + 0x10], eax
je 0x1002e8e
mov dword [ebp + 0x14], 1
cmp esi, ebx
mov dword [ebp + 0x18], ebx
jne 0x1003069
cmp dword [ebp + 0x10], ebx
je 0x1003069
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x1002f41
cmp dword [ebp + 0x14], ebx
jne 0x100304f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov dword [ebp + 0x18], eax
lea eax, [ebp + 0x224]
push eax
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, dword [sym.imp.USER32.dll_LoadStringA]
push eax
call esi
test eax, eax
je 0x100304f
push 0x10f
lea eax, [ebp + 0x850]
push eax
push 4
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call esi
test eax, eax
je 0x100304f
push dword [ebp + 0x10]
lea eax, [ebp + 0x850]
push eax
lea eax, [ebp + 0x648]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x1010
lea eax, [ebp + 0x224]
push eax
lea eax, [ebp + 0x648]
push eax
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x100304f
push dword [ebp + 0x10]
mov esi, 0x208
push esi
lea eax, [ebp + 0x648]
push eax
call fcn.010014a0
push 0x10013b0
push esi
lea eax, [ebp + 0x648]
push eax
call fcn.0100173d
push dword [ebp - 0xc]
lea eax, [ebp + 0x648]
push esi
push eax
call fcn.0100173d
cmp eax, ebx
jge 0x1002f83
push 0x6f
jmp 0x1003312
lea eax, [ebp + 0x648]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x100304f
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp + 0x648]
push eax
call fcn.01001aba
test eax, eax
je 0x100304f
mov eax, dword [ebp + 8]
lea ecx, [ebp + 0x960]
sub eax, ecx
add eax, 2
cmp eax, edi
jle 0x1002fcb
mov eax, edi
jmp 0x1002fd2
cmp eax, 0x7fffffff
ja 0x1002fe6
lea ecx, [ebp + 0x960]
push ecx
push eax
lea eax, [ebp + 0x42c]
push eax
call fcn.010014a0
push dword [ebp - 0xc]
lea eax, [ebp + 0x42c]
push edi
push eax
call fcn.0100173d
test eax, eax
jl 0x1002f7c
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp + 0x42c]
push eax
call fcn.01001aba
test eax, eax
je 0x100304f
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x14]
xor ecx, ecx
xor esi, esi
or ecx, edx
mov edx, dword [ebp - 0x10]
or eax, esi
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x28], ecx
xor ecx, ecx
or eax, esi
or ecx, edx
cmp eax, dword [ebp - 0x24]
jb 0x100304f
ja 0x100303e
cmp ecx, dword [ebp - 0x28]
jbe 0x100304f
lea eax, [ebp + 0x648]
push eax
lea eax, [ebp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp + 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [ebp + 0x18], ebx
jne 0x10031f8
push edi
lea eax, [ebp + 0x850]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x1002a68
push 0x10013a4
lea eax, [ebp + 0x850]
push eax
call fcn.01001a79
lea eax, [ebp + 0x850]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
mov dword [ebp + 0x18], eax
jne 0x1003318
mov eax, dword [ebp + 8]
lea ecx, [ebp + 0x960]
sub eax, ecx
add eax, 2
cmp eax, edi
jle 0x10030bf
mov eax, edi
jmp 0x10030c6
cmp eax, 0x7fffffff
ja 0x10030da
lea ecx, [ebp + 0x960]
push ecx
push eax
lea eax, [ebp + 0x42c]
push eax
call fcn.010014a0
push 0x1001390
lea eax, [ebp + 0x42c]
push eax
call fcn.01001a79
push 1
lea eax, [ebp + 0x850]
push eax
lea eax, [ebp + 0x42c]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x1002a68
mov eax, dword [ebp + 8]
mov byte [eax], bl
cmp byte [ebp + 0x1c], bl
jne 0x1003130
lea eax, [ebp + 0x960]
push eax
lea eax, [ebp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 0xc]
lea eax, [ebp + 0x1c]
push eax
call fcn.01001a79
lea eax, [ebp + 0x1c]
push eax
xor esi, esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
cmp eax, ebx
mov dword [ebp - 0x24], eax
je 0x1003180
push 0x1001388
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x1003173
lea ecx, [ebp - 8]
push ecx
push dword [ebp + 4]
mov ecx, dword [ebp - 0x20]
push dword [ebp - 4]
neg ecx
sbb ecx, ecx
lea edx, [ebp + 0x960]
and ecx, edx
push ecx
call eax
mov dword [ebp + 0x18], eax
inc esi
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp esi, ebx
jne 0x10031f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov dword [ebp + 0x18], eax
lea eax, [ebp + 0x224]
push eax
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, dword [sym.imp.USER32.dll_LoadStringA]
push eax
call esi
test eax, eax
je 0x10031f8
push 0x10f
lea eax, [ebp + 0x850]
push eax
push 2
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call esi
test eax, eax
je 0x10031f8
lea eax, [ebp + 0x1c]
push eax
lea eax, [ebp + 0x850]
push eax
lea eax, [ebp + 0x648]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x1010
lea eax, [ebp + 0x224]
push eax
lea eax, [ebp + 0x648]
push eax
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp dword [ebp - 0x1c], ebx
je 0x10032bd
cmp dword [ebp - 0x20], ebx
je 0x10032bd
lea eax, [ebp + 0x960]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x10032bd
lea eax, [ebp + 0x960]
push eax
lea eax, [ebp + 0x544]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp + 0xa64]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x1003254
push edi
lea eax, [ebp + 0xa64]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea eax, [ebp + 0xa64]
push eax
call fcn.010019f2
cmp eax, ebx
je 0x100326b
cmp byte [eax + 1], bl
jne 0x100326b
mov byte [eax], bl
mov esi, dword [ebp + 8]
push 1
push ebx
push esi
lea eax, [ebp + 0xa64]
push eax
lea eax, [ebp + 0x544]
push eax
mov byte [esi], 0x5c
call fcn.01001534
test eax, eax
je 0x10032bd
push ebx
push 0x100137c
push esi
lea eax, [ebp + 0xa64]
push eax
call fcn.01001b48
test eax, eax
jne 0x10032bd
push esi
push edi
lea eax, [ebp + 0xa64]
push eax
call fcn.0100173d
lea eax, [ebp + 0xa64]
push eax
call fcn.0100176e
cmp dword [ebp + 0x18], ebx
jne 0x100330f
cmp dword [ebp - 8], ebx
je 0x100330f
push 0x11
pop ecx
xor eax, eax
lea edi, [ebp - 0x80]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x80]
push eax
push ebx
push ebx
push 0x20
push ebx
push ebx
push ebx
push dword [ebp - 8]
mov dword [ebp - 0x80], 0x44
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x10032fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0x18], eax
push dword [ebp - 8]
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_ExitProcess]
test al, 0x10
je 0x1003109
push 0x10b
jmp 0x1003312