Function at 0x478d00
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0x110]
test eax, eax
push edi
je 0x478d3d
xor eax, eax
mov ax, word [esi + 0xfe]
shl eax, 4
push eax
push 0x40
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
jmp 0x478d41
mov ebx, dword [esp + 0x18]
mov eax, dword [esi + 0x1a4]
test eax, eax
mov dword [esp + 0x10], 0
jle 0x478f7c
mov eax, dword [esi + 0x110]
test eax, eax
je 0x478d93
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x20]
push ecx
push edx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x478d8d
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esi + 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0x118], ebx
mov ecx, dword [esi + 0x118]
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [esi + 0x118], ecx
cmp eax, 0x80
jne 0x478e69
mov eax, dword [esi + 0x110]
test eax, eax
je 0x478ded
push 1
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, eax
cmp edi, 0xffffffff
jne 0x478de1
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esi + 0x110]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub edi, dword [esp + 0x18]
mov dword [esi + 0x11c], edi
jmp 0x478df4
dec ecx
mov dword [esi + 0x11c], ecx
mov edi, dword [esi + 0x114]
mov eax, dword [esi + 0x11c]
xor ecx, ecx
mov cx, word [esi + 0xfe]
sub eax, edi
cdq
mov edi, ecx
shl edi, 4
idiv edi
imul eax, ecx
lea edx, [eax*8]
sub edx, eax
shl edx, 3
mov dword [esi + 0x4b4], edx
lea ecx, [esi + 0x144]
lea eax, [esi + 0x178]
mov edx, 2
mov edi, dword [eax - 0x20]
mov dword [eax], edi
mov edi, dword [eax - 0x1c]
mov dword [eax + 4], edi
mov edi, dword [eax - 0x10]
mov dword [eax + 0x10], edi
mov edi, dword [eax - 0xc]
mov dword [eax + 0x14], edi
mov edi, dword [ecx - 0x10]
mov dword [ecx], edi
mov edi, dword [ecx - 8]
mov dword [ecx + 8], edi
add eax, 8
add ecx, 4
dec edx
jne 0x478e39
jmp 0x478f2c
cmp eax, 0xff
je 0x478e7b
cmp eax, 0x81
jne 0x478f2c
mov eax, dword [esi + 0x1c0]
test eax, eax
je 0x478f7c
mov edi, dword [esi + 0x1b4]
mov eax, dword [esi + 0x1b8]
inc edi
test eax, eax
mov dword [esi + 0x1b4], edi
mov ecx, edi
je 0x478eaa
cmp ecx, eax
je 0x478f6b
lea ecx, [esi + 0x144]
lea eax, [esi + 0x178]
mov edx, 2
mov edi, dword [eax]
mov dword [eax - 0x20], edi
mov edi, dword [eax + 4]
mov dword [eax - 0x1c], edi
mov edi, dword [eax]
mov dword [eax - 0x10], edi
mov edi, dword [eax + 4]
mov dword [eax - 0xc], edi
mov edi, dword [ecx]
mov dword [ecx - 0x10], edi
mov edi, dword [ecx]
mov dword [ecx - 8], edi
add eax, 8
add ecx, 4
dec edx
jne 0x478ebb
mov eax, dword [esi + 0x110]
test eax, eax
je 0x478f1f
mov ecx, dword [esi + 0x11c]
push 0
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x478f19
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edx, dword [esi + 0x110]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
dec dword [esp + 0x10]
jmp 0x478f53
mov eax, dword [esi + 0x11c]
inc eax
mov dword [esi + 0x118], eax
mov eax, dword [esi + 0x130]
test eax, eax
push 0x1c
je 0x478f45
lea ecx, [esp + 0x18]
push ecx
push esi
call fcn.004784f0
jmp 0x478f50
lea edx, [esp + 0x18]
push edx
push esi
call fcn.00478880
add esp, 0xc
mov eax, dword [esp + 0x10]
mov ecx, dword [esi + 0x1a4]
inc eax
cmp eax, ecx
mov dword [esp + 0x10], eax
jge 0x478f7c
jmp 0x478d57
dec ecx
mov dword [esi + 0x1c0], 0
mov dword [esi + 0x1b4], ecx
mov eax, dword [esi + 0x1a4]
mov ecx, dword [esp + 0x10]
cmp ecx, eax
jge 0x478fc2
sub eax, ecx
xor ecx, ecx
mov cx, word [esi + 0xfe]
mov edi, dword [esp + 0x14]
imul eax, ecx
lea ecx, [eax*8]
sub ecx, eax
shl ecx, 3
mov edx, ecx
shr ecx, 2
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov dword [esi + 0xf0], 1
mov eax, dword [esi + 0x110]
test eax, eax
je 0x478fd3
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret