Function at 0x411557
Capabilities:
Extract resource via kernel32 functions
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
push esi
push edi
push ecx
lea edi, [ebp - 0x54]
mov ecx, 0x15
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
pop ecx
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x24], 0
cmp dword [0x434cf4], 0
je 0x41176a
mov esi, esp
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push 0x434bf4
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0xffffffff
jne 0x4115bb
jmp 0x411a7e
mov esi, esp
push 0
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x4115f1
mov esi, esp
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, esp
call fcn.004143c6
jmp 0x411a79
mov esi, esp
mov edx, dword [ebp - 0x1c]
push edx
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x18], eax
mov esi, esp
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x18], 0
je 0x411634
cmp dword [ebp - 0x10], 0
je 0x411634
mov dword [ebp - 0x54], 1
jmp 0x41163b
mov dword [ebp - 0x54], 0
cmp dword [ebp - 0x54], 0
je 0x411649
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], ecx
jmp 0x4116ba
mov esi, esp
push 0x10
push 0x41f49c
push str.Could_not_allocate_memory
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp esi, esp
call fcn.004143c6
mov esi, esp
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalHandle]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x18], eax
mov esi, esp
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
cmp esi, esp
call fcn.004143c6
mov esi, esp
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp esi, esp
call fcn.004143c6
mov esi, esp
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, esp
call fcn.004143c6
jmp 0x411a74
mov esi, esp
push 0
lea eax, [ebp - 8]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 1
je 0x411755
mov esi, esp
push 0x10
push 0x41f4c8
push str.Could_not_read_file
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp esi, esp
call fcn.004143c6
mov esi, esp
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalHandle]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x18], eax
mov esi, esp
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
cmp esi, esp
call fcn.004143c6
mov esi, esp
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp esi, esp
call fcn.004143c6
mov esi, esp
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, esp
call fcn.004143c6
jmp 0x411a6f
mov esi, esp
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, esp
call fcn.004143c6
jmp 0x4117dc
mov esi, esp
push 0x41f4e4
push str.earth.tga
mov eax, dword [0x434bf0]
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x48], eax
mov esi, esp
mov ecx, dword [ebp - 0x48]
push ecx
mov edx, dword [0x434bf0]
push edx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x14], eax
mov esi, esp
mov eax, dword [ebp - 0x48]
push eax
mov ecx, dword [0x434bf0]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x18], eax
mov esi, esp
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LockResource]
cmp esi, esp
call fcn.004143c6
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov cl, byte [eax]
mov byte [ebp - 0x28], cl
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
mov cl, byte [eax]
mov byte [ebp - 0x27], cl
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
mov cl, byte [eax]
mov byte [ebp - 0x26], cl
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
add eax, 9
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dl, byte [ecx]
mov byte [ebp - 0x44], dl
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dl, byte [ecx]
mov byte [ebp - 0x43], dl
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dl, byte [ecx]
mov byte [ebp - 0x42], dl
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dl, byte [ecx]
mov byte [ebp - 0x41], dl
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dl, byte [ecx]
mov byte [ebp - 0x40], dl
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dl, byte [ecx]
mov byte [ebp - 0x3f], dl
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x44]
and ecx, 0xff
mov edx, dword [ebp - 0x43]
and edx, 0xff
shl edx, 8
add ecx, edx
mov dword [ebp - 0x20], ecx
mov eax, dword [ebp - 0x42]
and eax, 0xff
mov ecx, dword [ebp - 0x41]
and ecx, 0xff
shl ecx, 8
add eax, ecx
mov dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x40]
and edx, 0xff
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x20]
imul eax, dword [ebp - 0x2c]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 4], 0x18
je 0x4118d4
xor al, al
jmp 0x411a83
mov ecx, dword [ebp - 0xc]
imul ecx, ecx, 3
push ecx
call fcn.00414947
add esp, 4
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
jne 0x4118f3
xor al, al
jmp 0x411a83
mov dword [ebp - 0x3c], 0
jmp 0x411905
mov edx, dword [ebp - 0x3c]
add edx, 3
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0xc]
imul eax, eax, 3
cmp dword [ebp - 0x3c], eax
jge 0x411968
mov ecx, dword [ebp - 0x10]
mov dl, byte [ecx]
mov byte [ebp - 0x34], dl
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x4c]
add ecx, dword [ebp - 0x3c]
mov dl, byte [ebp - 0x34]
mov byte [ecx + 2], dl
mov eax, dword [ebp - 0x10]
mov cl, byte [eax]
mov byte [ebp - 0x34], cl
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x4c]
add eax, dword [ebp - 0x3c]
mov cl, byte [ebp - 0x34]
mov byte [eax + 1], cl
mov edx, dword [ebp - 0x10]
mov al, byte [edx]
mov byte [ebp - 0x34], al
mov ecx, dword [ebp - 0x10]
add ecx, 1
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x4c]
add edx, dword [ebp - 0x3c]
mov al, byte [ebp - 0x34]
mov byte [edx], al
jmp 0x4118fc
mov ecx, dword [ebp - 0x50]
mov dword [ecx + 0xc], 0x1907
mov esi, esp
mov edx, dword [ebp + 0xc]
push edx
push 0xde1
call dword [sym.imp.OPENGL32.dll_glBindTexture]
cmp esi, esp
call fcn.004143c6
mov esi, esp
push 1
push 0xcf5
call dword [sym.imp.OPENGL32.dll_glPixelStorei]
cmp esi, esp
call fcn.004143c6
mov esi, esp
push 0x2901
push 0x2802
push 0xde1
call dword [sym.imp.OPENGL32.dll_glTexParameteri]
cmp esi, esp
call fcn.004143c6
mov esi, esp
push 0x2901
push 0x2803
push 0xde1
call dword [sym.imp.OPENGL32.dll_glTexParameteri]
cmp esi, esp
call fcn.004143c6
mov esi, esp
push 0x2601
push 0x2800
push 0xde1
call dword [sym.imp.OPENGL32.dll_glTexParameteri]
cmp esi, esp
call fcn.004143c6
mov esi, esp
push 0x2601
push 0x2801
push 0xde1
call dword [sym.imp.OPENGL32.dll_glTexParameteri]
cmp esi, esp
call fcn.004143c6
mov esi, esp
push 0x46040000
push 0x2200
push 0x2300
call dword [sym.imp.OPENGL32.dll_glTexEnvf]
cmp esi, esp
call fcn.004143c6
mov eax, dword [ebp - 0x4c]
push eax
push 0x1401
mov ecx, dword [ebp - 0x50]
mov edx, dword [ecx + 0xc]
push edx
mov eax, dword [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
mov edx, dword [ebp - 0x50]
mov eax, dword [edx + 0xc]
push eax
push 0xde1
call sub.GLU32.dll_gluBuild2DMipmaps
mov ecx, dword [ebp - 0x4c]
push ecx
call fcn.004148ff
add esp, 4
mov al, 1
jmp 0x411a83
jmp 0x41176a
jmp 0x41176a
jmp 0x41176a
jmp 0x41176a
pop edi
pop esi
add esp, 0x54
cmp ebp, esp
call fcn.004143c6
mov esp, ebp
pop ebp
ret 8