Function at 0x40cfc8
Capabilities:
Get system information on windows
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb0
mov eax, dword [0x45b050]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
xor ebx, ebx
mov dword [ebp - 0x64], edx
mov dword [ebp - 0x9c], ecx
push edi
mov edi, ebx
cmp edx, 0x40
jae 0x40cffc
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40d9b4
mov eax, 0x5a4d
cmp word [ecx], ax
je 0x40d00d
push 0xc1
jmp 0x40cff1
push esi
mov esi, dword [ecx + 0x3c]
mov dword [ebp - 0x60], esi
lea eax, [esi + 0xf8]
cmp edx, eax
jae 0x40d025
push 0xd
jmp 0x40d123
add esi, ecx
cmp dword [esi], 0x4550
jne 0x40d0a4
mov eax, 0x14c
cmp word [esi + 4], ax
jne 0x40d0a4
test byte [esi + 0x38], 1
jne 0x40d0a4
movzx edx, word [esi + 6]
movzx eax, word [esi + 0x14]
test edx, edx
je 0x40d06d
lea ecx, [esi + 0x24]
add ecx, eax
mov eax, dword [ecx]
cmp dword [ecx + 4], ebx
jne 0x40d05d
add eax, dword [esi + 0x38]
jmp 0x40d060
add eax, dword [ecx + 4]
cmp eax, edi
cmova edi, eax
add ecx, 0x28
sub edx, 1
jne 0x40d051
lea eax, [ebp - 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov ecx, dword [ebp - 0x8c]
mov eax, dword [esi + 0x50]
dec eax
add eax, ecx
lea edx, [ecx - 1]
not edx
and eax, edx
mov dword [ebp - 0xa8], eax
lea eax, [ecx - 1]
add eax, edi
mov edi, dword [ebp - 0xa8]
and eax, edx
cmp edi, eax
je 0x40d0ab
push 0xc1
jmp 0x40d123
mov esi, dword [esi + 0x34]
mov eax, 0x3000
push ecx
push eax
push edi
mov dword [ebp - 0x68], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edx, esi
mov ecx, eax
call fcn.0040ced8
mov esi, eax
mov dword [ebp - 0xac], esi
test esi, esi
jne 0x40d0f7
push ecx
mov eax, 0x3000
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
xor edx, edx
mov ecx, eax
call fcn.0040ced8
mov esi, eax
mov dword [ebp - 0xac], eax
test esi, esi
je 0x40d121
push 0x34
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [ebp - 0xb0], edi
test edi, edi
jne 0x40d12e
push 0x8000
push ebx
push esi
call dword [0x4477e8]
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40d9b3
mov ecx, dword [ebp - 0x9c]
mov edx, dword [ebp - 0x60]
mov dword [edi + 4], esi
mov esi, dword [ebp - 0xac]
movzx eax, word [edx + ecx + 0x16]
shr eax, 0xd
and eax, 1
mov dword [edi + 0x1c], 0x40cf9b
mov dword [edi + 0x14], eax
mov dword [edi + 0x20], 0x40cfa9
mov dword [edi + 0x24], 0x40cfba
mov dword [edi + 0x28], ebx
mov eax, dword [ebp - 0x8c]
mov dword [edi + 0x30], eax
mov eax, dword [edx + ecx + 0x54]
cmp dword [ebp - 0x64], eax
jae 0x40d17f
push 0xd
jmp 0x40d92f
push ecx
push 0x1000
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edx, esi
mov ecx, eax
call fcn.0040ced8
mov ecx, dword [ebp - 0x60]
mov esi, eax
mov eax, dword [ebp - 0x9c]
push dword [ecx + eax + 0x54]
push eax
push esi
call fcn.00423e00
mov ecx, dword [ebp - 0x9c]
add esp, 0xc
mov edx, dword [ebp - 0xac]
mov dword [ebp - 0x94], ebx
mov eax, dword [ecx + 0x3c]
add eax, esi
xor esi, esi
mov dword [edi], eax
mov dword [eax + 0x34], edx
mov eax, dword [edi + 4]
mov dword [ebp - 0xa4], eax
mov eax, dword [edi]
movzx edx, word [eax + 0x14]
cmp si, word [eax + 6]
jae 0x40d2e1
lea esi, [edx + 0x28]
add esi, eax
mov dword [ebp - 0xa0], esi
mov edx, dword [esi]
test edx, edx
jne 0x40d253
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + ecx + 0x38]
mov dword [ebp - 0xa8], eax
test eax, eax
jle 0x40d2bd
mov esi, dword [esi - 4]
add esi, dword [ebp - 0xa4]
push ecx
push 0x1000
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edx, esi
mov ecx, eax
call fcn.0040ced8
test eax, eax
je 0x40d935
mov esi, dword [ebp - 0xa0]
push dword [ebp - 0xa8]
push ebx
mov eax, dword [esi - 4]
add eax, dword [ebp - 0xa4]
push eax
mov dword [esi - 8], eax
call fcn.00424380
jmp 0x40d2b4
mov eax, dword [esi + 4]
add eax, edx
cmp dword [ebp - 0x64], eax
jb 0x40d178
mov esi, dword [esi - 4]
add esi, dword [ebp - 0xa4]
push ecx
push 0x1000
push edx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edx, esi
mov ecx, eax
call fcn.0040ced8
test eax, eax
je 0x40d935
mov eax, dword [ebp - 0xa0]
push dword [eax]
mov esi, dword [eax - 4]
mov eax, dword [eax + 4]
add eax, dword [ebp - 0x9c]
add esi, dword [ebp - 0xa4]
push eax
push esi
call fcn.00423e00
mov eax, dword [ebp - 0xa0]
mov dword [eax - 8], esi
mov esi, eax
mov ecx, dword [ebp - 0x9c]
add esp, 0xc
mov eax, dword [edi]
add esi, 0x28
mov edx, dword [ebp - 0x94]
inc edx
mov dword [ebp - 0xa0], esi
mov dword [ebp - 0x94], edx
movzx eax, word [eax + 6]
cmp edx, eax
jl 0x40d1f0
mov edx, dword [edi]
mov eax, dword [ebp - 0x60]
mov esi, dword [edx + 0x34]
sub esi, dword [eax + ecx + 0x34]
mov dword [ebp - 0xa8], esi
je 0x40d3a6
mov esi, dword [edi + 4]
mov dword [ebp - 0xa4], esi
cmp dword [edx + 0xa4], ebx
jne 0x40d314
xor edx, edx
mov eax, ebx
inc edx
jmp 0x40d3a1
mov ecx, dword [edx + 0xa0]
add ecx, esi
mov dword [ebp - 0x94], ecx
mov eax, dword [ecx]
test eax, eax
je 0x40d39c
add eax, esi
mov edi, ebx
mov dword [ebp - 0x60], eax
lea esi, [ecx + 8]
lea eax, [ecx + 4]
mov dword [ebp - 0x64], eax
mov eax, dword [eax]
sub eax, 8
test eax, 0xfffffffe
jbe 0x40d37f
mov ebx, dword [ebp - 0x64]
mov ecx, dword [ebp - 0xa8]
movzx edx, word [esi]
mov eax, edx
and eax, 0xf000
cmp ax, word [ebp - 0x68]
jne 0x40d368
and edx, 0xfff
add edx, dword [ebp - 0x60]
add dword [edx], ecx
mov eax, dword [ebx]
inc edi
sub eax, 8
add esi, 2
shr eax, 1
cmp edi, eax
jb 0x40d34d
mov ecx, dword [ebp - 0x94]
xor ebx, ebx
mov eax, dword [ebp - 0x64]
mov esi, dword [ebp - 0xa4]
add ecx, dword [eax]
mov dword [ebp - 0x94], ecx
mov eax, dword [ecx]
test eax, eax
jne 0x40d328
mov edi, dword [ebp - 0xb0]
xor edx, edx
inc edx
mov eax, edx
mov dword [edi + 0x18], eax
jmp 0x40d3ac
xor edx, edx
inc edx
mov dword [edi + 0x18], edx
mov eax, dword [edi]
mov ecx, dword [edi + 4]
mov dword [ebp - 0xa4], ecx
mov dword [ebp - 0xa0], edx
cmp dword [eax + 0x84], ebx
je 0x40d4f5
mov esi, dword [eax + 0x80]
add esi, ecx
push 0x14
push esi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x40d4f5
add esi, 0x10
mov ecx, dword [esi - 4]
test ecx, ecx
je 0x40d4e8
push dword [edi + 0x28]
mov eax, dword [ebp - 0xa4]
add eax, ecx
push eax
call dword [edi + 0x1c]
mov dword [ebp - 0x9c], eax
pop ecx
pop ecx
test eax, eax
je 0x40d54b
mov eax, dword [edi + 0xc]
xor ecx, ecx
push 4
pop edx
inc eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
push dword [edi + 8]
call fcn.004318c9
mov edx, eax
pop ecx
pop ecx
test edx, edx
je 0x40d536
mov eax, dword [edi + 0xc]
mov ecx, dword [ebp - 0x9c]
mov dword [edi + 8], edx
mov dword [edx + eax*4], ecx
inc dword [edi + 0xc]
mov eax, dword [esi - 0x10]
mov dword [ebp - 0x64], eax
test eax, eax
jne 0x40d457
mov eax, dword [esi]
mov dword [ebp - 0x64], eax
mov eax, dword [esi]
add eax, dword [ebp - 0xa4]
mov edx, dword [ebp - 0x64]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0xa4]
add edx, eax
mov dword [ebp - 0x64], edx
cmp dword [edx], ebx
je 0x40d4c8
mov edx, dword [edx]
push dword [edi + 0x28]
test edx, edx
jns 0x40d482
movzx eax, dx
jmp 0x40d487
add edx, 2
add eax, edx
push eax
push ecx
call dword [edi + 0x20]
mov ecx, dword [ebp - 0x60]
add esp, 0xc
mov dword [ecx], eax
mov eax, ecx
cmp dword [eax], ebx
je 0x40d4bc
mov edx, dword [ebp - 0x64]
push 4
pop ecx
add edx, ecx
add eax, ecx
mov ecx, dword [ebp - 0x9c]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0xa4]
mov dword [ebp - 0x64], edx
cmp dword [edx], ebx
jne 0x40d474
jmp 0x40d4c2
mov dword [ebp - 0xa0], ebx
mov ecx, dword [ebp - 0x9c]
cmp dword [ebp - 0xa0], 0
je 0x40d523
add esi, 0x14
push 0x14
lea eax, [esi - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
je 0x40d3e5
cmp dword [ebp - 0xa0], 0
je 0x40d935
mov edx, dword [edi]
mov ecx, dword [edi + 0x30]
movzx eax, word [edx + 0x14]
add eax, edx
dec ecx
not ecx
mov esi, dword [eax + 0x20]
and ecx, esi
mov dword [ebp - 0x9c], esi
mov esi, dword [eax + 0x28]
mov dword [ebp - 0x68], ecx
test esi, esi
jne 0x40d55b
test byte [eax + 0x3c], 0x40
je 0x40d552
mov esi, dword [edx + 0x20]
jmp 0x40d55b
push dword [edi + 0x28]
push ecx
call dword [edi + 0x24]
pop ecx
pop ecx
push 0x7f
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40d4e8
push dword [edi + 0x28]
push dword [ebp - 0x9c]
call dword [edi + 0x24]
pop ecx
pop ecx
push 0xe
jmp 0x40d92f
push 0x7e
jmp 0x40d92f
test byte [eax + 0x3c], 0x80
je 0x40d55b
mov esi, dword [edx + 0x24]
mov edx, dword [eax + 0x3c]
xor ebx, ebx
inc ebx
xor ecx, ecx
mov dword [ebp - 0x64], ebx
inc ecx
mov ebx, dword [edi]
push 0
cmp cx, word [ebx + 6]
mov ecx, dword [ebp - 0x68]
pop ebx
jae 0x40d7ab
add eax, 0x64
mov dword [ebp - 0xa0], eax
mov eax, dword [eax - 0x1c]
mov dword [ebp - 0x94], eax
mov eax, dword [edi + 0x30]
mov edi, dword [ebp - 0xa0]
dec eax
not eax
and eax, dword [ebp - 0x94]
mov dword [ebp - 0xa4], eax
mov edi, dword [edi - 0x14]
test edi, edi
mov dword [ebp - 0x60], edi
mov edi, dword [ebp - 0xb0]
jne 0x40d5ea
mov eax, dword [ebp - 0xa0]
test byte [eax], 0x40
mov eax, dword [ebp - 0xa4]
je 0x40d5cb
mov eax, dword [edi]
mov eax, dword [eax + 0x20]
jmp 0x40d5e1
mov edi, dword [ebp - 0xa0]
test byte [edi], 0x80
mov edi, dword [ebp - 0xb0]
je 0x40d5ea
mov eax, dword [edi]
mov eax, dword [eax + 0x24]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0xa4]
cmp ecx, eax
je 0x40d75b
mov eax, dword [ebp - 0x9c]
add eax, esi
cmp eax, dword [ebp - 0xa4]
ja 0x40d75b
test esi, esi
je 0x40d73c
test edx, 0x2000000
je 0x40d651
cmp dword [ebp - 0x9c], ecx
jne 0x40d73c
mov eax, dword [edi]
mov ecx, dword [edi + 0x30]
cmp dword [eax + 0x38], ecx
je 0x40d63a
xor edx, edx
mov eax, esi
div ecx
test edx, edx
jne 0x40d73c
push 0x4000
push esi
push dword [ebp - 0x9c]
call dword [0x4477e8]
jmp 0x40d73c
xor eax, eax
mov ecx, edx
inc eax
shr ecx, 0x1d
and ecx, eax
mov eax, edx
shr eax, 0x1e
and eax, 1
lea ecx, [eax + ecx*2]
mov eax, edx
shr eax, 0x1f
lea eax, [eax + ecx*2]
mov eax, dword [eax*4 + 0x454360]
mov dword [ebp - 0xa8], eax
test edx, 0x4000000
je 0x40d68e
or eax, 0x200
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0x68], esi
mov dword [ebp - 0x98], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
movaps xmm0, xmmword [0x455c60]
mov esi, eax
push 0x4e
pop eax
push 0x54
mov word [ebp - 0x18], ax
pop eax
push 0x44
pop ecx
push 0x4c
mov word [ebp - 0x16], ax
pop eax
mov word [ebp - 0x12], ax
mov word [ebp - 0x10], ax
mov word [ebp - 0xa], ax
mov word [ebp - 8], ax
xor eax, eax
push 0x2e
mov word [ebp - 6], ax
mov eax, dword [0x45e6f8]
mov word [ebp - 0x14], cx
mov word [ebp - 0xc], cx
mov dword [ebp - 0x34], 0x6f6d654d
mov word [ebp - 0x30], 0x7972
mov byte [ebp - 0x2e], bl
pop edx
mov word [ebp - 0xe], dx
movups xmmword [ebp - 0x44], xmm0
test eax, eax
jne 0x40d71c
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x45e6f8], eax
lea ecx, [ebp - 0x6c]
push ecx
push dword [ebp - 0xa8]
lea ecx, [ebp - 0x68]
push ecx
lea ecx, [ebp - 0x98]
push ecx
push esi
call eax
test eax, eax
jne 0x40d935
mov eax, dword [ebp - 0x94]
mov ecx, dword [ebp - 0xa4]
mov esi, dword [ebp - 0x60]
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp - 0xa0]
mov edx, dword [eax]
jmp 0x40d78a
mov eax, dword [ebp - 0xa0]
mov esi, dword [eax]
mov eax, esi
and eax, edx
or edx, esi
bt eax, 0x19
jb 0x40d775
and edx, 0xfdffffff
mov esi, dword [ebp - 0x60]
sub esi, dword [ebp - 0x9c]
add esi, dword [ebp - 0x94]
mov eax, dword [ebp - 0xa0]
inc dword [ebp - 0x64]
add eax, 0x28
mov dword [ebp - 0xa0], eax
mov eax, dword [edi]
movzx eax, word [eax + 6]
cmp dword [ebp - 0x64], eax
mov eax, dword [ebp - 0xa0]
jl 0x40d582
test esi, esi
je 0x40d8c2
test edx, 0x2000000
je 0x40d7db
mov eax, dword [ebp - 0x9c]
cmp eax, ecx
jne 0x40d8c2
push 0x4000
push esi
push eax
call dword [0x4477e8]
jmp 0x40d8c2
xor eax, eax
mov ecx, edx
inc eax
shr ecx, 0x1d
and ecx, eax
mov eax, edx
shr eax, 0x1e
and eax, 1
lea ecx, [eax + ecx*2]
mov eax, edx
shr eax, 0x1f
lea eax, [eax + ecx*2]
mov eax, dword [eax*4 + 0x454360]
mov dword [ebp - 0xa8], eax
test edx, 0x4000000
je 0x40d818
or eax, 0x200
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0x64], esi
mov dword [ebp - 0x94], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
movaps xmm0, xmmword [0x455c60]
mov esi, eax
push 0x4e
pop eax
push 0x54
mov word [ebp - 0x2c], ax
pop eax
push 0x44
pop ecx
push 0x4c
mov word [ebp - 0x2a], ax
pop eax
mov word [ebp - 0x26], ax
mov word [ebp - 0x24], ax
mov word [ebp - 0x1e], ax
mov word [ebp - 0x1c], ax
xor eax, eax
push 0x2e
mov word [ebp - 0x1a], ax
mov eax, dword [0x45e6f8]
mov word [ebp - 0x28], cx
mov word [ebp - 0x20], cx
mov dword [ebp - 0x4c], 0x6f6d654d
mov word [ebp - 0x48], 0x7972
mov byte [ebp - 0x46], bl
pop edx
mov word [ebp - 0x22], dx
movups xmmword [ebp - 0x5c], xmm0
test eax, eax
jne 0x40d8a6
lea eax, [ebp - 0x5c]
push eax
lea eax, [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x45e6f8], eax
lea ecx, [ebp - 0x60]
push ecx
push dword [ebp - 0xa8]
lea ecx, [ebp - 0x64]
push ecx
lea ecx, [ebp - 0x94]
push ecx
push esi
call eax
test eax, eax
jne 0x40d935
mov eax, dword [edi]
mov ecx, dword [edi + 4]
mov dword [ebp - 0xa8], ecx
mov esi, dword [eax + 0xc0]
test esi, esi
je 0x40d900
mov esi, dword [esi + ecx + 0xc]
test esi, esi
je 0x40d900
mov eax, dword [esi]
test eax, eax
je 0x40d900
mov edi, ecx
xor ecx, ecx
push ebx
inc ecx
push ecx
push edi
call eax
push 4
pop eax
add esi, eax
mov eax, dword [esi]
test eax, eax
jne 0x40d8e7
mov edi, dword [ebp - 0xb0]
mov eax, dword [edi]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x40d9ae
cmp dword [edi + 0x14], ebx
je 0x40d9a3
mov ecx, dword [ebp - 0xac]
xor esi, esi
push ebx
inc esi
add eax, ecx
push esi
push ecx
call eax
test eax, eax
jne 0x40d99e
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [edi + 0x10], ebx
je 0x40d949
mov eax, dword [edi]
push ebx
push ebx
push dword [edi + 4]
mov eax, dword [eax + 0x28]
add eax, dword [edi + 4]
call eax
cmp dword [edi + 8], ebx
je 0x40d978
mov esi, ebx
cmp dword [edi + 0xc], ebx
jle 0x40d96f
mov eax, dword [edi + 8]
cmp dword [eax + esi*4], 0
je 0x40d969
push dword [edi + 0x28]
push dword [eax + esi*4]
call dword [edi + 0x24]
pop ecx
pop ecx
inc esi
cmp esi, dword [edi + 0xc]
jl 0x40d955
push dword [edi + 8]
call fcn.00425c1c
pop ecx
cmp dword [edi + 4], 0
je 0x40d98d
push 0x8000
push ebx
push dword [edi + 4]
call dword [0x4477e8]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x40d9b3
mov dword [edi + 0x10], esi
jmp 0x40d9b1
add eax, dword [ebp - 0xac]
mov dword [edi + 0x2c], eax
jmp 0x40d9b1
mov dword [edi + 0x2c], ebx
mov ebx, edi
pop esi
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
xor ecx, ebp
pop ebx
call fcn.004204ef
mov esp, ebp
pop ebp
ret