Function at 0x10045350
Capabilities:
Enumerate pe sections
Parse pe header
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push str.gta_sa.exe
mov dword [ebp - 4], edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x1004539d
mov edx, str.Failed_to_open_file
mov ecx, 0x100a6f18
call fcn.1002c580
push eax
call fcn.1004aec0
add esp, 4
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret
push esi
push 0
push 0
push 0
push 2
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov esi, eax
mov dword [ebp - 0xc], esi
test esi, esi
jne 0x100453df
mov edx, str.Failed_to_create_file_mapping
mov ecx, 0x100a6f18
call fcn.1002c580
push eax
call fcn.1004aec0
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push 0
push 0
push 0
push 4
push esi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
test edi, edi
jne 0x10045422
mov edx, str.Failed_to_map_view_of_file
mov ecx, 0x100a6f18
call fcn.1002c580
push eax
call fcn.1004aec0
add esp, 4
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push ebx
call esi
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 0x5a4d
cmp word [edi], ax
je 0x10045460
mov edx, str.Invalid_DOS_signature
mov ecx, 0x100a6f18
call fcn.1002c580
push eax
call fcn.1004aec0
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push ebx
call esi
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [edi + 0x3c]
add edx, edi
cmp dword [edx], 0x4550
je 0x100454a1
mov edx, str.Invalid_NT_signature
mov ecx, 0x100a6f18
call fcn.1002c580
push eax
call fcn.1004aec0
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push ebx
call esi
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret
movzx esi, word [edx + 0x14]
xor eax, eax
add esi, 0x18
xor ecx, ecx
add esi, edx
movzx edx, word [edx + 6]
cmp ax, dx
jae 0x10045541
nop dword [eax + eax]
movzx eax, cx
cmp eax, dword [ebp - 4]
je 0x100454d3
inc ecx
add esi, 0x28
cmp cx, dx
jb 0x100454c0
jmp 0x10045541
mov ecx, dword [ebp + 0xc]
mov eax, dword [esi + 0x10]
mov dword [ecx], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 4]
mov edx, dword [eax]
mov dword [ebp - 8], edx
mov edx, ecx
sub edx, dword [eax]
mov dword [ebp - 4], ecx
mov ecx, dword [esi + 0x10]
cmp edx, ecx
jae 0x10045529
mov eax, dword [eax + 8]
sub eax, dword [ebp - 8]
cmp ecx, eax
jbe 0x1004550a
push ecx
push ecx
mov ecx, dword [ebp + 8]
call fcn.1004fa50
jmp 0x10045529
sub ecx, edx
push ecx
push 0
push dword [ebp - 4]
mov dword [ebp - 8], ecx
call fcn.10059300
mov ecx, dword [ebp + 8]
add esp, 0xc
mov eax, dword [ebp - 8]
add eax, dword [ebp - 4]
mov dword [ecx + 4], eax
mov eax, dword [ebp + 0xc]
push dword [eax]
mov eax, dword [esi + 0x14]
add eax, edi
push eax
mov eax, dword [ebp + 8]
push dword [eax]
call fcn.10058d80
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [ebp - 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push ebx
call esi
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret