Function at 0x40f2ca
Capabilities:
Terminate process

Disassembly:
push esi
push edi
sub esp, 0x114
and eax, 1
mov esi, section..data
mov edi, 0xffffffff
xchg dword [esi + 0x20], edi
test edi, edi
jne 0x40f2da
mov word [esi + 0x3fc], ax
mov dword [esi + 0x402], ebx
mov dword [esi + 0x408], ecx
mov word [esi + 0x406], dx
mov dword [esi + 0x3fe], 0
mov dword [esi + 0x40c], esp
mov edx, esp
push ebx
call fcn.00411d81
pop ebx
or ebx, ebx
jne 0x40f325
or al, al
je 0x40f536
or ah, ah
jne 0x40f536
mov ax, word [esi + 0x406]
mov ebx, dword [esi + 0x408]
test ah, 4
jne 0x40f349
test ah, 0x2a
je 0x40f349
mov ebx, 1
mov ax, word [ebp - 0x46]
test ax, ax
js 0x40f542
mov dword [esi + 0x408], ebx
cmp ebx, 1
jl 0x40f53a
add ebx, 0x44
push esi
call fcn.00412db6
pop esi
jae 0x40f53e
mov ecx, ebx
call fcn.00412ce2
jb 0x40f548
mov dword [esi + 0x3fe], edx
call fcn.00412e32
jb 0x40f548
cld
xor eax, eax
mov ecx, 0x20
push edi
add edi, 4
rep stosw word es:[edi], ax
pop edi
mov bx, word [esi + 0x406]
mov eax, dword [esi + 0x402]
test eax, eax
jne 0x40f3db
call fcn.0040f576
jae 0x40f3db
test bh, 0x10
jne 0x40f546
test bl, 0x20
jne 0x40f52e
test bl, 0x40
je 0x40f52e
xor bl, 0x40
jmp 0x40f3aa
mov edx, eax
mov ax, 1
test dword [esi + 0x402], 0xffffffff
je 0x40f3f1
or ax, 4
mov dword [edi + 6], edx
mov word [edi + 0xa], 1
mov word [edi + 0x2c], ax
mov byte [edi + 0xc], bh
mov byte [edi + 0xe], bl
mov byte [edi + 0x20], 0xff
mov ax, word [ebp - 0x46]
mov word [edi + 4], ax
mov eax, dword [esi + 0x408]
mov dword [edi + 0x1c], eax
mov ax, word [esi + 0x3fc]
mov word [edi + 0x2e], ax
push edx
mov edx, dword [sym.imp.KERNEL32.DLL_GetFileType]
call fcn.004185d3
cmp eax, 1
je 0x40f43b
mov word [edi + 0xa], 2
cmp bh, 2
jne 0x40f46f
cmp word [edi + 0xa], 2
je 0x40f4fe
call fcn.0040f5c5
jb 0x40f52e
push dword [edi + 6]
mov edx, dword [sym.imp.KERNEL32.DLL_SetEndOfFile]
call fcn.004185d3
jae 0x40f4fe
jmp 0x40f52e
test bh, 8
jne 0x40f4b7
test bh, 4
jne 0x40f4e0
test bh, 1
jne 0x40f485
test bh, 0x10
jne 0x40f4cd
jmp 0x40f4f7
cmp word [edi + 0xa], 2
je 0x40f4b5
call fcn.0040f5c5
jb 0x40f52e
push 0
lea eax, [edi + 0x28]
push eax
mov eax, dword [edi + 0x1c]
push eax
lea eax, [edi + 0x44]
push eax
push dword [edi + 6]
mov edx, dword [sym.imp.KERNEL32.DLL_ReadFile]
call fcn.004185d3
jb 0x40f52e
jmp 0x40f4fe
call fcn.0040f5c9
jb 0x40f52e
cmp word [edi + 0xa], 1
jne 0x40f532
mov dword [edi + 0x14], eax
mov dword [edi + 0x18], ecx
jmp 0x40f4fe
cmp word [edi + 0xa], 2
je 0x40f4fe
mov eax, dword [edi + 6]
xor ecx, ecx
call fcn.00418168
jmp 0x40f546
cmp dword [edi + 0x1c], 0x8000
ja 0x40f53a
test word [edi + 0x2e], 0xffff
jne 0x40f4f7
dec dword [edi + 0x14]
dec dword [edi + 0x18]
call fcn.0040f5c5
jb 0x40f52e
mov ebx, edi
mov ecx, dword [esp]
call fcn.00412ce2
jb 0x40f548
mov dword [ebx + 0x10], edx
mov dword [esi + 0x20], 0
cld
lea esi, [esp + 4]
push ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
pop ecx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add esp, 0x114
pop edi
pop esi
ret
mov al, dl
mov dx, 0x36b0
mov al, 0x36
mov dx, 0x40b0
mov al, 0x40
mov dx, 0x5b0
mov al, 5
mov dx, 0x37b0
mov al, 0x37
mov dx, 0x34b0
mov al, 0x34
mov dx, 0x45b0
mov al, 0x45
mov edx, dword [esi + 0x3fe]
test edx, edx
je 0x40f562
push esi
mov esi, edx
push eax
call fcn.00412e7d
call fcn.00412d16
pop eax
pop esi
mov dword [esi + 0x20], 0
add esp, 0x114
pop edi
pop esi
jmp fcn.0040dccf