Function at 0x10040e40
Capabilities:
Enumerate pe sections
Get system information on windows
Parse pe header

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x8c
cmp dword [esp + 0xa4], 0x3f
mov edi, dword [esp + 0xa0]
jbe 0x10041270
cmp word [edi], 0x5a4d
jne 0x10041250
mov eax, dword [edi + 0x3c]
lea edx, [eax + 0xf8]
cmp dword [esp + 0xa4], edx
jb 0x10041270
lea esi, [edi + eax]
cmp dword [esi], 0x4550
jne 0x10041250
cmp word [esi + 4], 0x14c
jne 0x10041250
mov ebp, dword [esi + 0x38]
test ebp, 1
jne 0x10041250
movzx ebx, word [esi + 6]
movzx eax, word [esi + 0x14]
lea edx, [esi + eax + 0x18]
mov eax, ebx
mov dword [esp + 0x24], ebx
xor ebx, ebx
test ax, ax
je 0x10040efd
mov dword [esp + 0x28], esi
xor ecx, ecx
mov dword [esp + 0xa0], edi
mov esi, dword [edx + 0x10]
mov eax, dword [edx + 0xc]
lea edi, [ebp + eax]
add eax, esi
test esi, esi
cmove eax, edi
cmp ebx, eax
cmovb ebx, eax
add ecx, 1
add edx, 0x28
cmp dword [esp + 0x24], ecx
jne 0x10040ed0
mov esi, dword [esp + 0x28]
mov edi, dword [esp + 0xa0]
lea eax, [esp + 0x5c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov edx, dword [esi + 0x50]
sub esp, 4
mov ecx, dword [esp + 0x60]
lea eax, [ecx - 1]
neg ecx
add edx, eax
add ebx, eax
and edx, ecx
and ebx, ecx
cmp ebx, edx
jne 0x10041250
mov eax, dword [esp + 0xbc]
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x3000
mov dword [esp + 0x10], eax
mov dword [esp + 4], ebx
mov eax, dword [esi + 0x34]
mov dword [esp], eax
call dword [esp + 0xa8]
mov dword [esp + 0x38], eax
test eax, eax
je 0x10041288
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov dword [esp + 8], 0x40
mov dword [esp + 4], 8
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x10041678
mov eax, dword [esp + 0x38]
mov dword [ebx + 4], eax
movzx eax, word [esi + 0x16]
shr ax, 0xd
and eax, 1
mov dword [ebx + 0x14], eax
mov eax, dword [esp + 0xa8]
mov dword [ebx + 0x1c], eax
mov eax, dword [esp + 0xac]
mov dword [ebx + 0x20], eax
mov eax, dword [esp + 0xb0]
mov dword [ebx + 0x24], eax
mov eax, dword [esp + 0xb4]
mov dword [ebx + 0x28], eax
mov eax, dword [esp + 0xb8]
mov dword [ebx + 0x2c], eax
mov eax, dword [esp + 0xbc]
mov dword [ebx + 0x34], eax
mov eax, dword [esp + 0x60]
mov dword [ebx + 0x3c], eax
mov eax, dword [esi + 0x54]
cmp dword [esp + 0xa4], eax
jb 0x100412d5
mov edx, dword [esp + 0xbc]
mov ecx, dword [esp + 0x38]
mov dword [esp + 4], eax
mov dword [esp + 0xc], 4
mov dword [esp + 0x10], edx
mov dword [esp], ecx
mov dword [esp + 8], 0x1000
call dword [esp + 0xa8]
mov ebp, eax
mov eax, dword [esi + 0x54]
mov dword [esp + 4], edi
mov dword [esp], ebp
mov dword [esp + 8], eax
call sub.msvcrt.dll_memcpy
mov ecx, dword [esp + 0x38]
add ebp, dword [edi + 0x3c]
mov dword [ebx], ebp
movzx edx, word [ebp + 0x14]
mov dword [ebp + 0x34], ecx
mov eax, ecx
mov ecx, dword [ebx + 4]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x24], ecx
mov ecx, ebp
lea ebp, [ebp + edx + 0x18]
cmp word [ecx + 6], 0
je 0x10041106
mov dword [esp + 0xa0], edi
xor eax, eax
mov edi, ebx
mov ebx, dword [esp + 0x24]
mov dword [esp + 0x28], esi
mov esi, eax
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x10041308
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 0x38]
test ecx, ecx
jle 0x100410e2
mov eax, dword [edi + 0x34]
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x1000
mov dword [esp + 0x10], eax
mov dword [esp + 4], ecx
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x24], ecx
add eax, ebx
mov dword [esp], eax
call dword [edi + 0x1c]
test eax, eax
je 0x10041378
mov eax, dword [ebp + 0xc]
mov ecx, dword [esp + 0x24]
add eax, ebx
mov dword [ebp + 8], eax
mov dword [esp + 8], ecx
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov eax, dword [edi]
add esi, 1
add ebp, 0x28
movzx ecx, word [eax + 6]
cmp esi, ecx
jl 0x1004107a
mov ebx, edi
mov edi, dword [edi + 4]
mov esi, dword [esp + 0x28]
mov dword [esp + 0x30], eax
mov eax, dword [eax + 0x34]
mov dword [esp + 0x24], edi
sub eax, dword [esi + 0x34]
mov edx, 1
mov dword [esp + 0x2c], eax
jne 0x1004159b
mov eax, dword [esp + 0x30]
mov dword [ebx + 0x18], edx
mov esi, dword [eax + 0x84]
test esi, esi
je 0x10041385
mov edi, dword [esp + 0x24]
add edi, dword [eax + 0x80]
mov dword [esp + 0x28], edi
lea esi, [esi]
nop
mov eax, dword [esp + 0x28]
mov dword [esp + 4], 0x14
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
sub esp, 8
test eax, eax
jne 0x1004137f
mov eax, dword [esp + 0x28]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x1004137f
mov edi, dword [esp + 0x24]
mov edx, dword [ebx + 0x34]
add eax, edi
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [ebx + 0x24]
mov edi, eax
test eax, eax
je 0x10041663
mov eax, dword [ebx + 0xc]
lea eax, [eax*4 + 4]
mov dword [esp + 4], eax
mov eax, dword [ebx + 8]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
test eax, eax
je 0x100416d0
mov edx, dword [ebx + 0xc]
mov dword [ebx + 8], eax
lea ecx, [edx + 1]
mov dword [ebx + 0xc], ecx
mov dword [eax + edx*4], edi
mov edx, dword [esp + 0x28]
mov esi, edx
mov eax, dword [edx]
mov edx, dword [esp + 0x24]
mov ebp, dword [esi + 0x10]
lea esi, [edx + eax]
add ebp, edx
test eax, eax
cmove esi, ebp
mov eax, dword [esi]
test eax, eax
jne 0x10041209
jmp 0x100412f8
mov ecx, dword [esp + 0x24]
mov dword [esp], edi
lea eax, [ecx + eax + 2]
mov dword [esp + 4], eax
call edx
mov dword [ebp], eax
test eax, eax
je 0x1004122a
mov eax, dword [esi + 4]
add esi, 4
add ebp, 4
test eax, eax
je 0x100412f8
mov ecx, dword [ebx + 0x34]
mov edx, dword [ebx + 0x28]
mov dword [esp + 8], ecx
test eax, eax
jns 0x100411e0
movzx eax, ax
mov dword [esp], edi
mov dword [esp + 4], eax
call edx
mov dword [ebp], eax
test eax, eax
jne 0x100411f8
mov eax, dword [ebx + 0x34]
mov dword [esp], edi
mov dword [esp + 4], eax
call dword [ebx + 0x2c]
mov dword [esp], 0x7f
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
jmp 0x100412e5
mov dword [esp], 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
xor ebx, ebx
add esp, 0x8c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
jmp 0x10041260
mov eax, dword [esp + 0xbc]
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x3000
mov dword [esp + 0x10], eax
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [esp + 0xa8]
mov dword [esp + 0x38], eax
test eax, eax
jne 0x10040f61
mov dword [esp], 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
jmp 0x10041260
mov ebx, edi
mov dword [esp], 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov dword [esp], ebx
call fcn.10040ba0
jmp 0x10041260
add dword [esp + 0x28], 0x14
jmp 0x10041140
mov ecx, dword [ebp + 0x14]
add ecx, eax
cmp dword [esp + 0xa4], ecx
jb 0x100412d3
mov ecx, dword [edi + 0x34]
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x1000
mov dword [esp + 0x10], ecx
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
add eax, ebx
mov dword [esp], eax
call dword [edi + 0x1c]
test eax, eax
je 0x10041378
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
mov eax, dword [esp + 0xa0]
add eax, dword [ebp + 0x14]
add ecx, ebx
mov dword [esp + 8], edx
mov dword [esp], ecx
mov dword [esp + 4], eax
mov dword [esp + 0x24], ecx
call sub.msvcrt.dll_memcpy
mov ecx, dword [esp + 0x24]
mov dword [ebp + 8], ecx
jmp 0x100410e2
mov ebx, edi
jmp 0x100412e5
mov eax, dword [ebx]
mov dword [esp + 0x30], eax
mov ecx, dword [esp + 0x30]
mov esi, dword [ebx + 0x3c]
movzx eax, word [ecx + 0x14]
lea edi, [ecx + eax + 0x18]
mov eax, esi
mov edx, dword [edi + 8]
neg eax
mov dword [esp + 0x48], edx
mov ebp, edx
and edx, eax
mov eax, dword [edi + 0x10]
mov dword [esp + 0x28], edx
mov dword [esp + 0x4c], edx
mov edx, dword [edi + 0x24]
test eax, eax
jne 0x100413d0
test dl, 0x40
jne 0x10041620
mov eax, edx
and eax, 0x80
je 0x100413d0
mov eax, dword [ecx + 0x24]
lea esi, [esi]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x30]
add edi, 0x28
mov dword [esp + 0x54], edx
movzx eax, word [eax + 6]
mov dword [esp + 0x58], 0
mov word [esp + 0x2c], ax
cmp ax, 1
jbe 0x100416ae
lea eax, [esp + 0x48]
mov dword [esp + 0x24], ebx
mov ecx, 1
mov edx, ebp
mov dword [esp + 0x3c], eax
mov ebx, esi
jmp 0x1004147b
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x24]
mov dword [esp + 0x34], ecx
call fcn.10041aa0
test eax, eax
je 0x1004165a
mov eax, dword [edi + 0x24]
mov dword [esp + 0x48], ebp
mov edx, ebp
mov dword [esp + 0x4c], ebx
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x50], esi
mov eax, dword [eax]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x30], eax
movzx eax, word [eax + 6]
mov word [esp + 0x2c], ax
movzx eax, word [esp + 0x2c]
add ecx, 1
add edi, 0x28
cmp ecx, eax
jge 0x100414f1
mov eax, dword [esp + 0x24]
mov ebx, dword [eax + 0x3c]
mov ebp, dword [edi + 8]
mov esi, dword [edi + 0x10]
neg ebx
and ebx, ebp
test esi, esi
jne 0x1004149b
mov esi, dword [edi + 0x24]
test esi, 0x40
je 0x100414e0
mov eax, dword [esp + 0x30]
mov esi, dword [eax + 0x20]
mov eax, dword [esp + 0x28]
cmp ebx, eax
je 0x100414b1
mov eax, dword [esp + 0x50]
add eax, edx
cmp ebx, eax
jae 0x10041418
mov ebx, dword [esp + 0x54]
mov eax, dword [edi + 0x24]
or eax, ebx
test dword [edi + 0x24], 0x2000000
je 0x100414cb
and ebx, 0x2000000
jne 0x100414d0
and eax, 0xfdffffff
sub ebp, edx
mov dword [esp + 0x54], eax
add ebp, esi
mov dword [esp + 0x50], ebp
jmp 0x10041461
and esi, 0x80
je 0x1004149b
mov eax, dword [esp + 0x30]
mov esi, dword [eax + 0x24]
jmp 0x1004149b
mov ebx, dword [esp + 0x24]
mov edx, dword [esp + 0x3c]
mov eax, ebx
mov dword [esp + 0x58], 1
call fcn.10041aa0
test eax, eax
je 0x100412e5
mov edx, dword [ebx]
mov eax, dword [edx + 0xc0]
test eax, eax
je 0x10041553
mov edi, dword [ebx + 4]
mov esi, dword [edi + eax + 0xc]
test esi, esi
je 0x10041553
mov eax, dword [esi]
test eax, eax
je 0x10041553
lea esi, [esi]
add esi, 4
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], edi
call eax
mov eax, dword [esi]
sub esp, 0xc
test eax, eax
jne 0x10041530
mov edx, dword [ebx]
mov eax, dword [edx + 0x28]
test eax, eax
je 0x10041614
mov edi, dword [esp + 0x38]
mov edx, dword [ebx + 0x14]
add eax, edi
test edx, edx
je 0x100416a6
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], edi
call eax
sub esp, 0xc
test eax, eax
je 0x100416bb
mov dword [ebx + 0x10], 1
jmp 0x10041262
mov eax, dword [esp + 0x30]
xor edx, edx
mov edi, dword [eax + 0xa4]
test edi, edi
je 0x10041118
mov esi, dword [esp + 0x24]
add esi, dword [eax + 0xa0]
mov edx, ebx
mov eax, dword [esi]
mov dword [esp + 0x28], eax
test eax, eax
je 0x1004160a
lea esi, [esi]
mov edi, dword [esi + 4]
lea ebx, [edi - 8]
mov eax, ebx
shr eax, 1
je 0x100415fc
xor eax, eax
lea esi, [esi]
lea esi, [esi]
movzx ecx, word [esi + eax*2 + 8]
mov ebp, ecx
shr bp, 0xc
cmp bp, 3
je 0x10041630
mov ecx, ebx
add eax, 1
shr ecx, 1
cmp eax, ecx
jb 0x100415e0
add esi, edi
mov eax, dword [esi]
mov dword [esp + 0x28], eax
test eax, eax
jne 0x100415c8
mov ebx, edx
mov edx, 1
jmp 0x10041118
mov dword [ebx + 0x38], 0
jmp 0x10041262
mov eax, dword [ecx + 0x20]
jmp 0x100413d0
mov edi, dword [esp + 0x28]
and ecx, 0xfff
mov ebx, dword [esp + 0x2c]
add eax, 1
add ecx, edi
mov edi, dword [esp + 0x24]
add dword [edi + ecx], ebx
mov edi, dword [esi + 4]
lea ebx, [edi - 8]
mov ecx, ebx
shr ecx, 1
cmp eax, ecx
jb 0x100415e0
jmp 0x100415fc
mov ebx, dword [esp + 0x24]
jmp 0x100412e5
mov dword [esp], 0x7e
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
jmp 0x100412e5
mov eax, dword [esp + 0xbc]
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call dword [esp + 0xac]
jmp 0x100412c1
mov dword [ebx + 0x38], eax
jmp 0x10041262
lea eax, [esp + 0x48]
mov dword [esp + 0x3c], eax
jmp 0x100414f5
mov dword [esp], 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
jmp 0x100412e5
mov eax, dword [ebx + 0x34]
mov dword [esp], edi
mov dword [esp + 4], eax
call dword [ebx + 0x2c]
mov dword [esp], 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
push ecx
jmp 0x100412e5