Function at 0x4965c0
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1bc
mov dword [ebp - 0xc], edi
mov dword [ebp - 8], esi
mov dword [ebp - 4], ebx
mov esi, ecx
mov ebx, edx
mov edi, eax
mov edx, dword [0x5113e0]
mov eax, dword [0x52492c]
dec eax
cmp edx, eax
jg 0x49667f
mov eax, dword [0x524930]
mov ecx, dword [eax + edx*4]
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x49660b
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x4965f6
dec eax
push eax
push ecx
push dword [ebx]
mov dword [esi], eax
call fcn.004e26a0
add esp, 0xc
mov edx, dword [ebx]
mov eax, dword [esi]
mov byte [eax + edx], 0
mov ecx, dword [0x5113e0]
inc ecx
mov dword [0x5113e0], ecx
push ecx
push 0x5113e0
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov edx, dword [ebx]
movsx eax, byte [edx]
cmp eax, 0x20
je 0x496648
mov eax, dword [esi]
jmp 0x49665c
mov eax, dword [esi]
test eax, eax
jle 0x496679
inc edx
movsx ecx, byte [edx]
mov dword [ebx], edx
dec eax
mov dword [esi], eax
cmp ecx, 0x20
je 0x49664a
test eax, eax
jle 0x496679
movsx ecx, byte [eax + edx - 1]
cmp ecx, 0x20
je 0x496672
test ecx, ecx
jne 0x496f2d
dec eax
mov dword [esi], eax
test eax, eax
jg 0x496660
jne 0x496f2d
mov eax, dword [0x5212e8]
test eax, eax
je 0x49670f
push dword [edi + 0xf0]
push str.Open:_Select_File_for_Unit
lea eax, [ebp - 0x1b4]
push str._s_d
push eax
call fcn.004d2c54
add esp, 0x10
mov eax, dword [ebx]
lea edx, [ebp - 0x1b4]
push edx
push 0x100
push eax
call fcn.004eb810
add esp, 0xc
test eax, eax
je 0x4966ed
mov ecx, dword [ebx]
movzx eax, byte [ecx]
test eax, eax
je 0x4966ed
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4966e6
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x4966d1
dec eax
mov dword [esi], eax
jmp 0x496f2d
push 0x2134
push str.File_Open_Error
push str.A_File_Must_be_Selected_r_rTerminate_Program_
call fcn.004eb810
add esp, 0xc
cmp eax, 6
je 0x496f3c
jmp 0x4966ab
push 0
push 0x20b
call fcn.00490950
lea edx, [ebp - 0xe0]
push eax
push str._s_r_n
push edx
call fcn.004d2c54
push dword [edi + 0xf0]
push 1
push 0x20c
call fcn.00490950
lea edx, [ebp - 0xe0]
push eax
push 0x4f86e0
push edx
call fcn.004d2c54
add esp, 0x2c
lea ecx, [ebp - 0xe0]
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x496771
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x49675c
dec eax
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 0xf0]
cmp eax, 6
je 0x4967a2
lea edx, [ebp - 0x18]
lea eax, [ebp - 0x60]
push 4
push eax
push edx
push 6
call fcn.0048ebf0
add esp, 0x10
test eax, eax
jne 0x496804
mov eax, dword [edi + 0xf0]
cmp eax, 5
je 0x4967ed
lea edx, [ebp - 0x14]
lea eax, [ebp - 0x40]
push 1
push eax
push edx
push 5
call fcn.0048ebf0
mov dword [ebp - 0x1b4], eax
add esp, 0x10
test eax, eax
je 0x4967ed
mov eax, dword [edi + 0xf0]
cmp eax, 6
je 0x4967da
mov eax, dword [ebp - 0x18]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov eax, dword [ebp - 0x1b4]
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x1c]
push eax
push 1
push 0x170
call fcn.00484a50
add esp, 0xc
test eax, eax
je 0x496811
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x20]
push eax
push 1
push 0x170
call fcn.00484a50
add esp, 0xc
test eax, eax
je 0x496835
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
push 0x170
push 0
push dword [ebp - 0x1c]
call fcn.004e2770
push 0x170
push 0
push dword [ebp - 0x20]
call fcn.004e2770
lea eax, [ebp - 0x1b4]
push 0xc4
push 0
push eax
call fcn.004e2770
add esp, 0x24
mov eax, dword [ebp - 0x1c]
mov dword [eax + 0xf0], 6
movzx ecx, byte [edi + 0x158]
and ecx, 1
mov eax, dword [ebp - 0x1c]
movzx edx, byte [eax + 0x158]
and edx, 0xfffffffe
or edx, ecx
mov byte [eax + 0x158], dl
movzx edx, byte [edi + 0x158]
mov ecx, dword [ebp - 0x1c]
movzx eax, byte [ecx + 0x158]
and eax, 0xfffffffd
and edx, 2
or eax, edx
mov byte [ecx + 0x158], al
mov edx, dword [ebp - 0x1c]
movzx ecx, byte [edx + 0x158]
movzx eax, byte [edi + 0x158]
and ecx, 0xfffffffb
and eax, 4
or ecx, eax
mov byte [edx + 0x158], cl
mov edx, dword [ebp - 0x1c]
movzx eax, byte [edx + 0x158]
movzx ecx, byte [edi + 0x158]
and eax, 0xfffffff7
and ecx, 8
or eax, ecx
mov byte [edx + 0x158], al
mov ecx, dword [ebp - 0x1c]
movzx edx, byte [ecx + 0x158]
movzx eax, byte [edi + 0x158]
and edx, 0xffffffdf
and eax, 0x20
or edx, eax
mov byte [ecx + 0x158], dl
mov ecx, dword [ebp - 0x1c]
movzx eax, byte [ecx + 0x161]
movzx edx, byte [edi + 0x161]
and eax, 0xfffffffb
and edx, 4
or eax, edx
mov byte [ecx + 0x161], al
movzx eax, byte [edi + 0x161]
and eax, 8
mov edx, dword [ebp - 0x1c]
movzx ecx, byte [edx + 0x161]
and ecx, 0xfffffff7
or ecx, eax
mov byte [edx + 0x161], cl
movzx ecx, byte [edi + 0x158]
mov edx, dword [ebp - 0x1c]
movzx eax, byte [edx + 0x158]
and eax, 0xffffffbf
and ecx, 0x40
or eax, ecx
mov byte [edx + 0x158], al
mov ecx, dword [ebp - 0x1c]
movzx edx, byte [ecx + 0x158]
movzx eax, byte [edi + 0x158]
and edx, 0x7f
and eax, 0xffffff80
or edx, eax
mov byte [ecx + 0x158], dl
mov ecx, dword [ebp - 0x1c]
movzx eax, byte [ecx + 0x158]
movzx edx, byte [edi + 0x158]
and eax, 0xffffffef
and edx, 0x10
or eax, edx
mov byte [ecx + 0x158], al
mov dword [ebp - 0x15c], 4
mov eax, 1
mov dword [ebp - 0x1b4], eax
mov dword [ebp - 0x180], eax
mov ecx, 0x4f5f6c
mov dword [ebp - 0x188], ecx
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4969e9
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x4969d4
dec eax
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x184], eax
lea eax, [ebp - 0x1b4]
call fcn.00497158
mov dword [ebp - 0xf0], eax
test eax, eax
je 0x496a61
push dword [ebp - 0x1c]
call fcn.004849b0
push dword [ebp - 0x20]
call fcn.004849b0
add esp, 8
mov eax, dword [edi + 0xf0]
cmp eax, 6
je 0x496a3f
mov eax, dword [ebp - 0x18]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov eax, dword [edi + 0xf0]
cmp eax, 5
je 0x496a4e
mov eax, dword [ebp - 0x14]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov eax, dword [ebp - 0xf0]
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x20]
mov dword [eax + 0xf0], 5
movzx ecx, byte [edi + 0x158]
and ecx, 1
mov eax, dword [ebp - 0x20]
movzx edx, byte [eax + 0x158]
and edx, 0xfffffffe
or edx, ecx
mov byte [eax + 0x158], dl
movzx edx, byte [edi + 0x158]
mov ecx, dword [ebp - 0x20]
movzx eax, byte [ecx + 0x158]
and eax, 0xfffffffd
and edx, 2
or eax, edx
mov byte [ecx + 0x158], al
mov edx, dword [ebp - 0x20]
movzx ecx, byte [edx + 0x158]
movzx eax, byte [edi + 0x158]
and ecx, 0xfffffffb
and eax, 4
or ecx, eax
mov byte [edx + 0x158], cl
mov edx, dword [ebp - 0x20]
movzx eax, byte [edx + 0x158]
movzx ecx, byte [edi + 0x158]
and eax, 0xfffffff7
and ecx, 8
or eax, ecx
mov byte [edx + 0x158], al
mov ecx, dword [ebp - 0x20]
movzx edx, byte [ecx + 0x158]
movzx eax, byte [edi + 0x158]
and edx, 0xffffffdf
and eax, 0x20
or edx, eax
mov byte [ecx + 0x158], dl
mov ecx, dword [ebp - 0x20]
movzx eax, byte [ecx + 0x161]
movzx edx, byte [edi + 0x161]
and eax, 0xfffffffb
and edx, 4
or eax, edx
mov byte [ecx + 0x161], al
movzx eax, byte [edi + 0x161]
and eax, 8
mov edx, dword [ebp - 0x20]
movzx ecx, byte [edx + 0x161]
and ecx, 0xfffffff7
or ecx, eax
mov byte [edx + 0x161], cl
movzx ecx, byte [edi + 0x158]
mov edx, dword [ebp - 0x20]
movzx eax, byte [edx + 0x158]
and eax, 0xffffffbf
and ecx, 0x40
or eax, ecx
mov byte [edx + 0x158], al
mov ecx, dword [ebp - 0x20]
movzx edx, byte [ecx + 0x158]
movzx eax, byte [edi + 0x158]
and edx, 0x7f
and eax, 0xffffff80
or edx, eax
mov byte [ecx + 0x158], dl
mov ecx, dword [ebp - 0x20]
movzx eax, byte [ecx + 0x158]
movzx edx, byte [edi + 0x158]
and eax, 0xffffffef
and edx, 0x10
or eax, edx
mov byte [ecx + 0x158], al
mov ecx, str.CONIN_
mov dword [ebp - 0x188], ecx
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x496bc6
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x496bb1
dec eax
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x184], eax
lea eax, [ebp - 0x1b4]
call fcn.00497158
mov dword [ebp - 0xf0], eax
test eax, eax
jne 0x4970e8
mov eax, dword [ebp - 0x1c]
mov ecx, dword [esi]
mov byte [eax + 0x146], 3
mov edx, dword [ebp - 0x1c]
or byte [edx + 0x15d], 0x40
test ecx, ecx
jne 0x496ed2
mov dword [ebp - 0xe8], edi
mov dword [ebp - 0xe4], esi
mov esi, dword [ebp - 0x1c]
push 0
push esi
call fcn.004a0de0
add esp, 8
test eax, eax
jne 0x497061
movsx eax, byte [esi + 0x144]
lea edx, [eax - 1]
cmp edx, 7
ja case.default.0x496c42
mov edx, dword [edx*4 + 0x4fb284]
jmp edx
mov edx, dword [esi + 0x40]
test edx, edx
je 0x496c50
mov dword [esi + 0x3c], edx
jmp 0x496c56
mov edx, dword [esi + 0x38]
mov dword [esi + 0x3c], edx
mov eax, dword [esi + 0xe8]
lea ecx, [edx + eax - 1]
mov dword [esi + 0x44], ecx
movzx ecx, byte [esi + 0x158]
jmp 0x496da0
mov edx, dword [esi + 0x18]
test edx, edx
je 0x496f4d
movzx eax, byte [edx + 0x44]
test al, 2
je 0x496cb1
mov eax, 0x2c
mov dword [edx + 0x38], eax
mov edx, dword [esi + 0x18]
mov dword [edx + 0x3c], eax
mov eax, dword [esi + 0x64]
test eax, eax
je 0x496c9f
xor edx, edx
mov dword [eax + 4], edx
mov dword [esi + 0x64], edx
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov eax, 0x2c
mov esp, ebp
pop ebp
ret
movzx edx, byte [esi + 0x15c]
and edx, 7
mov eax, 0x2c
push eax
push eax
push edx
push 0xffffffffffffffff
push esi
call fcn.00495320
add esp, 0x14
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
mov edx, dword [esi + 0x40]
test edx, edx
je 0x496ce7
add edx, 4
jmp 0x496ced
mov edx, dword [esi + 0x38]
add edx, 4
mov eax, dword [esi + 0xe8]
mov dword [esi + 0x3c], edx
lea ecx, [edx + eax - 8]
mov dword [esi + 0x44], ecx
movzx ecx, byte [esi + 0x158]
jmp 0x496da0
mov edx, dword [esi + 0x40]
test edx, edx
je 0x496d15
mov dword [esi + 0x3c], edx
jmp 0x496d1b
mov edx, dword [esi + 0x38]
mov dword [esi + 0x3c], edx
mov ecx, dword [esi + 0xe8]
mov dword [ebp - 0xf0], ecx
lea edi, [edx + ecx]
movzx ecx, byte [esi + 0x158]
test cl, 4
mov dword [ebp - 0xec], edi
je 0x496d79
movzx edi, byte [esi + 0x15a]
test edi, 0x40
je 0x496d5f
movzx edi, byte [esi + 0x15b]
test edi, 8
je 0x496d5f
cmp eax, 1
je 0x496d6a
mov eax, dword [ebp - 0xec]
mov dword [esi + 0x44], eax
jmp 0x496da0
mov eax, dword [ebp - 0xf0]
lea edi, [edx + eax - 2]
mov dword [esi + 0x44], edi
jmp 0x496da0
mov eax, edi
mov dword [esi + 0x44], eax
jmp 0x496da0
push 0x1603
push str.for_nt_open_proc.c
push 2
push 8
call fcn.00492dd0
add esp, 0x10
movzx ecx, byte [esi + 0x158]
mov edx, dword [esi + 0x3c]
test cl, 4
je 0x496dc7
movzx eax, byte [esi + 0x15a]
test al, 0x40
je 0x496dc7
movzx eax, byte [esi + 0x15b]
test al, 8
je 0x496dc7
movsx eax, byte [esi + 0x144]
cmp eax, 1
je 0x496e12
movsx eax, byte [esi + 0x146]
cmp eax, 2
jne 0x496dee
movsx eax, byte [esi + 0x144]
cmp eax, 7
je 0x496e12
cmp eax, 6
je 0x496e12
cmp eax, 8
je 0x496e12
dec dword [esi + 0x44]
jmp 0x496e12
cmp eax, 1
jne 0x496e12
movsx eax, byte [esi + 0x144]
cmp eax, 7
je 0x496e0c
cmp eax, 6
je 0x496e0c
cmp eax, 8
je 0x496e0c
dec dword [esi + 0x44]
add edx, 5
mov dword [esi + 0x3c], edx
push dword [ebp - 0x10]
mov dword [esi + 0x4c], 0
lea eax, [ebp - 0xe0]
push eax
mov dword [esi + 0x48], edx
mov edx, dword [ebp - 0x1c]
push dword [edx + 0x3c]
call fcn.004e26a0
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x10]
add dword [edx + 0x3c], eax
push dword [ebp - 0x1c]
call fcn.004a0ef0
add esp, 0x10
mov esi, eax
test esi, esi
jne 0x496ff1
xor eax, eax
push eax
push eax
push dword [ebp - 0x20]
call fcn.0049c9c0
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x496f81
mov esi, dword [ebp - 0x20]
mov edx, dword [esi + 0x3c]
mov esi, dword [esi + 0x44]
sub esi, edx
push esi
push edx
push dword [ebx]
call fcn.004e26a0
add esp, 0xc
mov edx, dword [ebx]
mov byte [edx + esi], 0
movsx ecx, byte [edx]
cmp ecx, 0x20
jne 0x496e9d
test esi, esi
jle 0x496eb8
inc edx
movsx ecx, byte [edx]
mov dword [ebx], edx
dec esi
cmp ecx, 0x20
je 0x496e8d
test esi, esi
jle 0x496eb8
movsx ecx, byte [esi + edx - 1]
cmp ecx, 0x20
je 0x496eb3
test ecx, ecx
jne 0x496f6c
dec esi
test esi, esi
jg 0x496ea1
lea esi, [esi]
mov edx, dword [ebp - 0xe4]
mov dword [edx], esi
je 0x496c12
mov edi, dword [ebp - 0xe8]
push 0
push dword [ebp - 0x1c]
call fcn.0048b660
push 0
push dword [ebp - 0x20]
call fcn.0048b660
push dword [ebp - 0x1c]
call fcn.004849b0
push dword [ebp - 0x20]
call fcn.004849b0
add esp, 0x18
mov eax, dword [edi + 0xf0]
cmp eax, 6
je 0x496f1e
mov eax, dword [ebp - 0x18]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov eax, dword [edi + 0xf0]
cmp eax, 5
je 0x496f2d
mov eax, dword [ebp - 0x14]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
xor eax, eax
mov esp, ebp
pop ebp
ret
push 1
call fcn.004eb810
push 1
call fcn.004d1a02
add esp, 8
push esi
mov eax, 0x2c
push eax
push eax
push 1
call fcn.00490ca0
add esp, 0x10
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0xe8]
mov eax, esi
mov esi, dword [ebp - 0xe4]
mov dword [esi], eax
jmp 0x496ed2
mov edi, dword [ebp - 0xe8]
push 0
push dword [ebp - 0x1c]
call fcn.0048b660
push 0
push dword [ebp - 0x20]
call fcn.0048b660
push dword [ebp - 0x1c]
call fcn.004849b0
push dword [ebp - 0x20]
call fcn.004849b0
add esp, 0x18
mov eax, dword [edi + 0xf0]
cmp eax, 6
je 0x496fd3
mov eax, dword [ebp - 0x18]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov eax, dword [edi + 0xf0]
cmp eax, 5
je 0x496fe2
mov eax, dword [ebp - 0x14]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov ebx, dword [ebp - 4]
mov edi, dword [ebp - 0xc]
mov eax, esi
mov esi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0xe8]
push 0
push dword [ebp - 0x1c]
call fcn.0048b660
push 0
push dword [ebp - 0x20]
call fcn.0048b660
push dword [ebp - 0x1c]
call fcn.004849b0
push dword [ebp - 0x20]
call fcn.004849b0
add esp, 0x18
mov eax, dword [edi + 0xf0]
cmp eax, 6
je 0x497043
mov eax, dword [ebp - 0x18]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov eax, dword [edi + 0xf0]
cmp eax, 5
je 0x497052
mov eax, dword [ebp - 0x14]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov ebx, dword [ebp - 4]
mov edi, dword [ebp - 0xc]
mov eax, esi
mov esi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
mov edx, dword [esi + 0x18]
test edx, edx
je 0x4970c9
movzx eax, byte [edx + 0x44]
test al, 2
je 0x49709f
mov eax, 0x26
mov dword [edx + 0x38], eax
mov edx, dword [esi + 0x18]
mov dword [edx + 0x3c], eax
mov eax, dword [esi + 0x64]
test eax, eax
je 0x49708d
xor edx, edx
mov dword [eax + 4], edx
mov dword [esi + 0x64], edx
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov eax, 0x26
mov esp, ebp
pop ebp
ret
movzx edx, byte [esi + 0x15c]
and edx, 7
mov eax, 0x26
push eax
push eax
push edx
push 0xffffffffffffffff
push esi
call fcn.00495320
add esp, 0x14
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
push esi
mov eax, 0x26
push eax
push eax
push 1
call fcn.00490ca0
add esp, 0x10
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
push 0
push dword [ebp - 0x1c]
call fcn.0048b660
push dword [ebp - 0x1c]
call fcn.004849b0
push dword [ebp - 0x20]
call fcn.004849b0
add esp, 0x10
mov eax, dword [edi + 0xf0]
cmp eax, 6
je 0x49712a
mov eax, dword [ebp - 0x18]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov eax, dword [edi + 0xf0]
cmp eax, 5
je 0x497139
mov eax, dword [ebp - 0x14]
push dword [eax + 0xf0]
call fcn.0048ffe0
pop ecx
mov eax, dword [ebp - 0xf0]
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret