Function at 0x407310
Capabilities:
Get common file path
Set current directory
Terminate process

Disassembly:
sub esp, 0x34c
push ebx
push ebp
push esi
push edi
mov byte [esp + 0x140], 0
mov eax, dword [0x46eecc]
test eax, eax
mov ebp, dword [esp + 0x364]
jne 0x407d1c
mov al, byte [0x46edc0]
test al, al
je 0x40765d
or ecx, 0xffffffff
xor eax, eax
mov edi, 0x46edc0
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
shr ecx, 2
mov esi, edi
lea edx, [esp + 0x140]
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x360]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
or ecx, 0xffffffff
mov esi, edi
lea edx, [esp + 0x140]
mov edi, edx
repne scasb al, byte es:[edi]
dec edi
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, str..arc
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
or ecx, 0xffffffff
mov esi, edi
lea edx, [esp + 0x140]
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
shr ecx, 2
dec edi
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x140]
and ecx, 3
push 0x41787c
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.0040a355
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x40765d
push ebx
push 1
lea eax, [ebp + 0x204]
push 0x1c
push eax
call fcn.0040b3c5
add esp, 0x10
cmp eax, 1
jne 0x4079a7
lea eax, [ebp + 0x204]
mov ecx, 4
mov edi, str.MajiroArcV1.000
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x40750e
mov eax, dword [ebp + 0x214]
lea ecx, [eax*8 + 0x108]
push ecx
call fcn.00409960
mov edx, dword [ebp + 0x214]
mov esi, eax
push ebx
push 1
lea eax, [edx*8 + 8]
push eax
push esi
mov dword [esp + 0x24], esi
call fcn.0040b3c5
add esp, 0x14
cmp eax, 1
jne 0x4079a7
mov eax, dword [ebp + 0x214]
lea ecx, [eax + eax*2]
lea edx, [ecx*4 + 0x10c]
push edx
call fcn.00409960
mov dword [ebp + 0x220], eax
mov eax, dword [ebp + 0x214]
add esp, 4
xor edx, edx
test eax, eax
jle 0x4074d0
xor ecx, ecx
lea eax, [esi + 4]
mov edi, dword [eax - 4]
mov esi, dword [ebp + 0x220]
mov dword [ecx + esi], edi
mov edi, dword [eax]
mov esi, dword [ebp + 0x220]
mov dword [ecx + esi + 4], edi
mov edi, dword [eax]
mov esi, dword [eax + 8]
sub esi, edi
mov edi, dword [ebp + 0x220]
mov dword [ecx + edi + 8], esi
mov esi, dword [ebp + 0x214]
inc edx
add eax, 8
add ecx, 0xc
cmp edx, esi
jl 0x407492
mov esi, dword [esp + 0x10]
push esi
call fcn.0040a368
mov eax, dword [ebp + 0x214]
mov ecx, dword [ebp + 0x220]
lea eax, [eax + eax*2]
mov edx, dword [ecx + eax*4 - 8]
lea eax, [ecx + eax*4]
mov eax, dword [eax - 4]
push 0
lea ecx, [edx + eax - 1]
push ecx
push ebx
call fcn.0040b30c
add esp, 0x10
mov dword [ebp + 0x238], 1
jmp 0x407636
mov ecx, 4
mov edi, str.MajiroArcV2.000
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x4075a8
mov eax, dword [ebp + 0x214]
lea eax, [eax + eax*2]
lea ecx, [eax*4 + 0x100]
push ecx
call fcn.00409960
mov ecx, dword [ebp + 0x214]
push ebx
lea edx, [ecx + ecx*2]
push 1
shl edx, 2
push edx
push eax
mov dword [ebp + 0x220], eax
call fcn.0040b3c5
add esp, 0x14
cmp eax, 1
jne 0x4079a7
mov ecx, dword [ebp + 0x214]
xor edx, edx
test ecx, ecx
jle 0x40758c
mov eax, dword [ebp + 0x220]
add eax, 4
mov esi, ecx
mov ecx, dword [eax + 4]
mov edi, dword [eax]
add ecx, edi
cmp edx, ecx
jg 0x407586
mov edx, ecx
add eax, 0xc
dec esi
jne 0x407579
push 0
dec edx
push edx
push ebx
call fcn.0040b30c
add esp, 0xc
mov dword [ebp + 0x238], 1
jmp 0x407636
mov ecx, 4
mov edi, str.MajiroArcV3.000
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x4079a7
mov eax, dword [ebp + 0x214]
add eax, 0x10
shl eax, 4
push eax
call fcn.00409960
mov ecx, dword [ebp + 0x214]
push ebx
push 1
shl ecx, 4
push ecx
push eax
mov dword [ebp + 0x224], eax
call fcn.0040b3c5
add esp, 0x14
cmp eax, 1
jne 0x4079a7
mov ecx, dword [ebp + 0x214]
xor edx, edx
test ecx, ecx
jle 0x40761f
mov eax, dword [ebp + 0x224]
add eax, 8
mov esi, ecx
mov ecx, dword [eax + 4]
mov edi, dword [eax]
add ecx, edi
cmp edx, ecx
jg 0x407619
mov edx, ecx
add eax, 0x10
dec esi
jne 0x40760c
push 0
dec edx
push edx
push ebx
call fcn.0040b30c
add esp, 0xc
mov dword [ebp + 0x238], 2
push ebx
push 1
lea edx, [esp + 0x1c]
push 1
push edx
call fcn.0040b3c5
add esp, 0x10
cmp eax, 1
jne 0x4079a7
push ebx
push eax
push eax
lea eax, [esp + 0x20]
jmp 0x40793f
mov edi, dword [esp + 0x360]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
shr ecx, 2
mov esi, edi
lea edx, [esp + 0x140]
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
xor eax, eax
mov edi, str..arc
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
or ecx, 0xffffffff
mov esi, edi
lea edx, [esp + 0x140]
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
shr ecx, 2
dec edi
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x140]
and ecx, 3
push 0x41787c
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.0040a355
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4079c9
push ebx
push 1
lea eax, [ebp + 0x204]
push 0x1c
push eax
call fcn.0040b3c5
add esp, 0x10
cmp eax, 1
jne 0x4079a7
lea eax, [ebp + 0x204]
mov ecx, 4
mov edi, str.MajiroArcV1.000
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x4077f9
mov eax, dword [ebp + 0x214]
lea ecx, [eax*8 + 0x108]
push ecx
call fcn.00409960
mov edx, dword [ebp + 0x214]
mov esi, eax
push ebx
push 1
lea eax, [edx*8 + 8]
push eax
push esi
mov dword [esp + 0x28], esi
call fcn.0040b3c5
add esp, 0x14
cmp eax, 1
jne 0x4079a7
mov eax, dword [ebp + 0x214]
lea ecx, [eax + eax*2]
lea edx, [ecx*4 + 0x10c]
push edx
call fcn.00409960
mov dword [ebp + 0x220], eax
mov eax, dword [ebp + 0x214]
add esp, 4
xor edx, edx
test eax, eax
jle 0x4077bb
xor ecx, ecx
lea eax, [esi + 4]
mov edi, dword [eax - 4]
mov esi, dword [ebp + 0x220]
mov dword [ecx + esi], edi
mov edi, dword [eax]
mov esi, dword [ebp + 0x220]
mov dword [ecx + esi + 4], edi
mov edi, dword [eax]
mov esi, dword [eax + 8]
sub esi, edi
mov edi, dword [ebp + 0x220]
mov dword [ecx + edi + 8], esi
mov esi, dword [ebp + 0x214]
inc edx
add eax, 8
add ecx, 0xc
cmp edx, esi
jl 0x40777d
mov esi, dword [esp + 0x14]
push esi
call fcn.0040a368
mov eax, dword [ebp + 0x214]
mov ecx, dword [ebp + 0x220]
lea eax, [eax + eax*2]
mov edx, dword [ecx + eax*4 - 8]
lea eax, [ecx + eax*4]
mov eax, dword [eax - 4]
push 0
lea ecx, [edx + eax - 1]
push ecx
push ebx
call fcn.0040b30c
add esp, 0x10
mov dword [ebp + 0x238], 1
jmp 0x407921
mov ecx, 4
mov edi, str.MajiroArcV2.000
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x407893
mov eax, dword [ebp + 0x214]
lea eax, [eax + eax*2]
lea ecx, [eax*4 + 0x100]
push ecx
call fcn.00409960
mov ecx, dword [ebp + 0x214]
push ebx
lea edx, [ecx + ecx*2]
push 1
shl edx, 2
push edx
push eax
mov dword [ebp + 0x220], eax
call fcn.0040b3c5
add esp, 0x14
cmp eax, 1
jne 0x4079a7
mov ecx, dword [ebp + 0x214]
xor edx, edx
test ecx, ecx
jle 0x407877
mov eax, dword [ebp + 0x220]
add eax, 4
mov esi, ecx
mov ecx, dword [eax + 4]
mov edi, dword [eax]
add ecx, edi
cmp edx, ecx
jg 0x407871
mov edx, ecx
add eax, 0xc
dec esi
jne 0x407864
push 0
dec edx
push edx
push ebx
call fcn.0040b30c
add esp, 0xc
mov dword [ebp + 0x238], 1
jmp 0x407921
mov ecx, 4
mov edi, str.MajiroArcV3.000
mov esi, eax
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x4079a7
mov eax, dword [ebp + 0x214]
add eax, 0x10
shl eax, 4
push eax
call fcn.00409960
mov ecx, dword [ebp + 0x214]
push ebx
push 1
shl ecx, 4
push ecx
push eax
mov dword [ebp + 0x224], eax
call fcn.0040b3c5
add esp, 0x14
cmp eax, 1
jne 0x4079a7
mov ecx, dword [ebp + 0x214]
xor edx, edx
test ecx, ecx
jle 0x40790a
mov eax, dword [ebp + 0x224]
add eax, 8
mov esi, ecx
mov ecx, dword [eax + 4]
mov edi, dword [eax]
add ecx, edi
cmp edx, ecx
jg 0x407904
mov edx, ecx
add eax, 0x10
dec esi
jne 0x4078f7
push 0
dec edx
push edx
push ebx
call fcn.0040b30c
add esp, 0xc
mov dword [ebp + 0x238], 2
push ebx
push 1
lea edx, [esp + 0x18]
push 1
push edx
call fcn.0040b3c5
add esp, 0x10
cmp eax, 1
jne 0x4079a7
push ebx
push eax
push eax
lea eax, [esp + 0x1c]
push eax
call fcn.0040b3c5
add esp, 0x10
cmp eax, 1
je 0x4079a7
push ebx
call fcn.0040a21d
or ecx, 0xffffffff
xor eax, eax
add esp, 4
lea edi, [esp + 0x140]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
shr ecx, 2
mov esi, edi
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x360]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
shr ecx, 2
lea edx, [ebp + 0x104]
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x407d1c
mov ecx, dword [esp + 0x360]
push ecx
push 0x419580
call fcn.00406700
push ebx
call fcn.0040a21d
add esp, 0xc
push 0xffffffffffffffff
call fcn.00409fbc
xor eax, eax
mov ecx, 7
lea edi, [ebp + 0x204]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0x220]
xor esi, esi
cmp eax, esi
je 0x4079f3
push eax
call fcn.0040a368
add esp, 4
mov dword [ebp + 0x220], esi
mov eax, dword [ebp + 0x224]
cmp eax, esi
je 0x407a0c
push eax
call fcn.0040a368
add esp, 4
mov dword [ebp + 0x224], esi
mov al, byte [0x46edc0]
test al, al
je 0x407bcb
or ecx, 0xffffffff
xor eax, eax
mov edi, 0x46edc0
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
shr ecx, 2
mov esi, edi
mov ebx, dword [esp + 0x360]
lea edx, [esp + 0x140]
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
xor eax, eax
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
lea edx, [esp + 0x140]
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
shr ecx, 2
dec edi
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
lea eax, [esp + 0x18]
rep movsb byte es:[edi], byte [esi]
push eax
lea ecx, [esp + 0x144]
push ecx
call fcn.00413c8e
add esp, 8
test eax, eax
jne 0x407bd2
mov eax, dword [esp + 0x1e]
test ah, 0x40
je 0x407bd2
or ecx, 0xffffffff
xor eax, eax
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
shr ecx, 2
mov esi, edi
lea edx, [ebp + 0x104]
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
xor eax, eax
lea edi, [esp + 0x140]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
shr ecx, 2
mov esi, edi
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, ebp
repne scasb al, byte es:[edi]
not ecx
mov al, byte [ecx + ebp - 2]
dec ecx
mov bl, 0x5c
cmp al, bl
je 0x407b28
or ecx, 0xffffffff
xor eax, eax
mov edi, 0x4170dc
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
or ecx, 0xffffffff
mov esi, edi
mov edi, ebp
repne scasb al, byte es:[edi]
mov ecx, edx
shr ecx, 2
dec edi
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x140]
push eax
push 0x104
mov dword [ebp + 0x238], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x40]
push edx
push 0x103
push ebp
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
push 0
push 0
lea eax, [esp + 0x24c]
push eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x4c]
push edx
call fcn.0040a4e2
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x54]
push ecx
call fcn.0040a6f0
lea edx, [esp + 0x260]
push edx
lea eax, [esp + 0x5c]
push eax
call fcn.0040a700
or ecx, 0xffffffff
xor eax, eax
add esp, 0x24
lea edi, [esp + 0x3c]
repne scasb al, byte es:[edi]
not ecx
mov al, byte [esp + ecx + 0x3a]
dec ecx
cmp al, bl
jne 0x407bc2
or ecx, 0xffffffff
xor eax, eax
lea edi, [esp + 0x3c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov byte [esp + ecx + 0x3b], al
lea ecx, [esp + 0x3c]
jmp 0x407d15
mov ebx, dword [esp + 0x360]
lea edx, [esp + 0x18]
push edx
push ebx
call fcn.00413c8e
add esp, 8
test eax, eax
jne 0x407e37
mov eax, dword [esp + 0x1e]
test ah, 0x40
je 0x407e37
or ecx, 0xffffffff
xor eax, eax
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
shr ecx, 2
mov esi, edi
lea edx, [ebp + 0x104]
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
xor eax, eax
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
shr ecx, 2
mov esi, edi
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, ebp
repne scasb al, byte es:[edi]
not ecx
mov al, byte [ecx + ebp - 2]
dec ecx
mov bl, 0x5c
cmp al, bl
je 0x407c77
or ecx, 0xffffffff
xor eax, eax
mov edi, 0x4170dc
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
or ecx, 0xffffffff
mov esi, edi
mov edi, ebp
repne scasb al, byte es:[edi]
mov ecx, edx
shr ecx, 2
dec edi
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x140]
push eax
push 0x104
mov dword [ebp + 0x238], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x40]
push edx
push 0x103
push ebp
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
push 0
push 0
lea eax, [esp + 0x24c]
push eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x4c]
push edx
call fcn.0040a4e2
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x54]
push ecx
call fcn.0040a6f0
lea edx, [esp + 0x260]
push edx
lea eax, [esp + 0x5c]
push eax
call fcn.0040a700
or ecx, 0xffffffff
xor eax, eax
add esp, 0x24
lea edi, [esp + 0x3c]
repne scasb al, byte es:[edi]
not ecx
mov al, byte [esp + ecx + 0x3a]
dec ecx
cmp al, bl
jne 0x407d11
or ecx, 0xffffffff
xor eax, eax
lea edi, [esp + 0x3c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov byte [esp + ecx + 0x3b], al
lea ecx, [esp + 0x3c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov edx, dword [0x46eecc]
inc edx
mov dword [0x46eecc], edx
mov eax, dword [ebp + 0x238]
test eax, eax
jne 0x407dfd
lea eax, [esp + 0x3c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
or ecx, 0xffffffff
xor eax, eax
lea edi, [esp + 0x3c]
repne scasb al, byte es:[edi]
not ecx
push ecx
call fcn.00409960
or ecx, 0xffffffff
mov ebx, eax
xor eax, eax
lea edi, [esp + 0x40]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
shr ecx, 2
mov esi, edi
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
lea eax, [esp + 0x248]
mov ecx, edx
push eax
and ecx, 3
push 0x41957c
rep movsb byte es:[edi], byte [esi]
call fcn.0040b0f3
mov esi, eax
add esp, 0xc
cmp esi, 0xffffffff
je 0x407dea
push ebx
lea ecx, [esp + 0x248]
push ecx
push ebp
call fcn.00407e50
lea edx, [esp + 0x250]
push edx
push esi
call fcn.0040b1c0
add esp, 0x14
test eax, eax
jne 0x407de1
push ebx
lea eax, [esp + 0x248]
push eax
push ebp
call fcn.00407e50
lea ecx, [esp + 0x250]
push ecx
push esi
call fcn.0040b1c0
add esp, 0x14
test eax, eax
je 0x407dbd
push esi
call fcn.0040b288
add esp, 4
mov eax, dword [ebp + 0x22c]
test eax, eax
jne 0x407dfd
push ebx
call fcn.0040a368
add esp, 4
mov edx, dword [0x46eecc]
dec edx
mov dword [0x46eecc], edx
mov al, byte [esp + 0x140]
test al, al
je 0x407e23
lea eax, [esp + 0x140]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [ebp + 0x238]
test eax, eax
jne 0x407e3a
mov ecx, dword [ebp + 0x22c]
test ecx, ecx
jne 0x407e3a
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34c
ret